Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Question: Entities With Common Attributes
So those are not all that diffferent (the phone number is common to both too, and of course the name)
This is an example of so-called 'sub-types' within one entity.
You have the choice of
- designing two separate tables.
This is a decision you will regret as you will constantly have to UNION
them both
- have one table with 2 appropiate views on top of them.
The last one is the best solution
Hth,
Sybrand Bakker, Oracle DBA
"SQL-er" <SQL-er_at_noemail.com> wrote in message
news:9ae7he$pli$1_at_newsg1.svr.pol.co.uk...
> Thanks in advance for any suggestions offered:
>
> All right, I *thought* I understood database modelling and SQL, until the
> following arose:
>
> What is the "accepted way" of handling something like this ?
>
> A database model for a company sales obviously contains an entity
"customer"
>
> But, in this case, there are 2 types of customer - "businesses" and
> "individuals"
> Different attributes are recorded for each type
>
> eg: something like:
>
> Individual-Customer
> Customer-number
> Name
> Phone-no
> Driving-Licence-number
>
> Business-Customer
> Customer-number
> Business-name
> Business-type
> phone-no
> fax-no
>
> So, the customer-number is the only attribute common to both types of
> customer
> But, I don't see how that ought to be handled
>
> I'm probably missing something very obvious here...
> Could someone give me a hint as to what it is ?
>
>
> novice SQL-er ( still learning )
>
>
Received on Tue Apr 03 2001 - 23:40:48 CDT
![]() |
![]() |