Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Databases > Re: Designing a...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 25 of 29 Topic 3734 of 3876
Post > Topic >>

Re: Designing a structure for a personal database

by Lew <lew@[EMAIL PROTECTED] > May 5, 2008 at 08:14 PM

Arved Sandstrom wrote:
> "Stefan Ram" <ram@[EMAIL PROTECTED]
> wrote in message 
> news:join-20080505155910@[EMAIL PROTECTED]
>> "Arved Sandstrom" <asandstrom@[EMAIL PROTECTED]
> writes:
>>> named relation****ps [...] so the join tables will
>>> often have at least one extra attribute.
>>  Which is the same as keeping a single join table
>>  per named relation****p without an extra attribute.
> 
> This is true. But you'd want to ask whether or not you want one join
table 
> for for work phone numbers, one for personal phone numbers, and possibly

> others for other phone numbers. Easier to have one join table for 
> PersonInfo - PhoneNum, and keep an attribute in there that describes the

> nature of the phone number.

In dimensional databases, a fact table is pretty much just what you
desribe - 
a many-to-many join table that has foreign key references to multiple 
dimension tables, along with facts that pertain to that combination of 
intersecting keys.

Returning to the phone number table -- well, phone isn't so good as an 
independent entity IMHO, so let's use address instead.  An address entity 
stands alone pretty well, and it has a network of relation****ps to person 
entities, as Arved has described already.  That join table, what I call a 
"many-to-many" table, might want other attributes that pertain to the 
relation****p key.  Time of day for primary association, e.g., evenings and

weekends for a home address.  Descriptive information, like, "Office
building 
with guard at desk".  Ranking, e.g., primary, alternate, third choice - 
orthogonal to the name.  Once you have a table, with rows identified by a 
primary key, it's legitimate and frequently useful to attach dependent 
columns.  There's no rule that says relation****p tables can't have
attributive 
columns; /au contraire/ it's a very useful and oft-used idiom.

In any join table (or whatever you want to call them) diligently avoid use
of 
an autogenerated surrogate key (i.e., sequence).  The natural key of the
table 
already comprises key columns that reference other tables' PKs; adding
another 
layer of indirection is harmful to your schema structure.  This becomes 
especially dire if you snowflake your schema - multilayer joins are a real

PITA when they involve superfluous key columns.

-- 
Lew
 




 29 Posts in Topic:
Designing a structure for a personal database
David Segall <david@[E  2008-04-26 14:33:00 
Re: Designing a structure for a personal database
Ed Prochak <edprochak@  2008-04-28 05:46:06 
Re: Designing a structure for a personal database
David Segall <david@[E  2008-04-28 18:33:58 
Re: Designing a structure for a personal database
Martin Gregorie <marti  2008-04-28 21:01:13 
Re: Designing a structure for a personal database
David Segall <david@[E  2008-04-29 13:35:54 
Re: Designing a structure for a personal database
"Arved Sandstrom&quo  2008-04-30 19:25:17 
Re: Designing a structure for a personal database
Ed Prochak <edprochak@  2008-04-30 10:21:09 
Re: Designing a structure for a personal database
David Segall <david@[E  2008-05-02 15:06:55 
Re: Designing a structure for a personal database
Lew <lew@[EMAIL PROTEC  2008-05-02 20:45:39 
Re: Designing a structure for a personal database
David Segall <david@[E  2008-05-03 12:59:57 
Re: Designing a structure for a personal database
"David Cressey"  2008-05-03 13:42:09 
Re: Designing a structure for a personal database
David Segall <david@[E  2008-05-03 15:59:18 
Re: Designing a structure for a personal database
Lew <lew@[EMAIL PROTEC  2008-05-03 09:57:13 
Re: Designing a structure for a personal database
David Segall <david@[E  2008-05-07 15:53:35 
Re: Designing a structure for a personal database
Lew <lew@[EMAIL PROTEC  2008-05-07 19:54:49 
Re: Designing a structure for a personal database
David Segall <david@[E  2008-05-09 08:36:55 
Re: Designing a structure for a personal database
Gene Wirchenko <genew@  2008-05-04 17:45:01 
Re: Designing a structure for a personal database
Roedy Green <see_websi  2008-05-08 19:25:07 
Re: Designing a structure for a personal database
Ed Prochak <edprochak@  2008-04-30 10:27:53 
Re: Designing a structure for a personal database
Ed Prochak <edprochak@  2008-05-07 11:06:18 
Re: Designing a structure for a personal database
ram@[EMAIL PROTECTED] (S  2008-05-03 16:09:12 
Re: Designing a structure for a personal database
"Arved Sandstrom&quo  2008-05-05 13:46:03 
Re: Designing a structure for a personal database
ram@[EMAIL PROTECTED] (S  2008-05-05 14:00:17 
Re: Designing a structure for a personal database
"Arved Sandstrom&quo  2008-05-05 15:50:20 
Re: Designing a structure for a personal database
Lew <lew@[EMAIL PROTEC  2008-05-05 20:14:54 
Re: Designing a structure for a personal database
David Segall <david@[E  2008-05-06 15:22:07 
Re: Designing a structure for a personal database
Marco <zakmck@[EMAIL P  2008-05-07 07:46:12 
Re: Designing a structure for a personal database
Arved Sandstrom <asand  2008-05-08 12:13:34 
Re: Designing a structure for a personal database
Marco <zakmck@[EMAIL P  2008-05-06 02:12:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 23:14:43 CST 2008.