WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Store similar types of records all in one table or separat..

 
   Home -> Office other -> Table Design RSS
Next:  Publish as PDF - lose mouse-over text  
Author Message
tryit

External


Since: Nov 06, 2009
Posts: 2



(Msg. 1) Posted: Fri Nov 06, 2009 9:13 am
Post subject: Store similar types of records all in one table or separate tables?
Archived from groups: microsoft>public>access>tablesdbdesign (more info?)

Suppose you want to have four different types of records.

Each of these records have numerous fields in common, and a few fields
that are unique to each type of record.

Most of the fields are related to other tables, but a few are simply
text fields or Booleans.

Which is better?:

Keeping track of all 3 types of records in a single table.

Or

Creating separate tables for each type of record.

Is one solution clearly better or is it just a matter of opinion?


Thanks in advance,
Tom
Back to top
Login to vote
John W. Vinson

External


Since: Jan 29, 2004
Posts: 4627



(Msg. 2) Posted: Fri Nov 06, 2009 11:55 am
Post subject: Re: Store similar types of records all in one table or separate tables? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 6 Nov 2009 09:13:14 -0800 (PST), tryit <tryit.ca.TakeThisOut@gmail.com> wrote:

>Suppose you want to have four different types of records.
>
>Each of these records have numerous fields in common, and a few fields
>that are unique to each type of record.
>
>Most of the fields are related to other tables, but a few are simply
>text fields or Booleans.
>
>Which is better?:
>
> Keeping track of all 3 types of records in a single table.
>
>Or
>
> Creating separate tables for each type of record.
>
>Is one solution clearly better or is it just a matter of opinion?
>
>
>Thanks in advance,
>Tom

You can get into some fine old quasi-religious arguments over this issue. The
"purists" would say that this is a case of Subclassing, one of the few
instances where one-to-one relationships are appropriate. Let's say you have a
table of ComputerComponents; Monitors have width, height, resolution, etc.,
disk drives have diameter, capacity, speed, cabletype, etc. - but these
attributes only apply to the particular category.

Using subclassing you would have one master table of ComputerParts, with the
common fields; it would be related one-to-one to a table of Monitors (with the
monitor-specific fields), and to a table of Diskdrives (with those fields),
etc. You would need some programmatic (not referential integrity) constraint
to ensure that you don't put a record in the Monitors table when the part in
question is a disk drive!

Alternatively you can use a wider table and leave the irrelevant fields NULL.

Both methods do work, and do have their place; which is better depends both on
the application (how MANY subclasses? how many fields each? how will the data
be used?) and on the biases and preferences of the developer.
--

John W. Vinson [MVP]
Back to top
Login to vote
tryit

External


Since: Nov 06, 2009
Posts: 2



(Msg. 3) Posted: Fri Nov 06, 2009 1:07 pm
Post subject: Re: Store similar types of records all in one table or separate [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Nov 6, 10:55 am, John W. Vinson
<jvinson.TakeThisOut@STOP_SPAM.WysardOfInfo.com> wrote:
> On Fri, 6 Nov 2009 09:13:14 -0800 (PST), tryit <tryit....TakeThisOut@gmail.com> wrote:
> >Suppose you want to have four different types of records.
>
> >Each of these records have numerous fields in common, and a few fields
> >that are unique to each type of record.
>
> >Most of the fields are related to other tables, but a few are simply
> >text fields or Booleans.
>
> >Which is better?:
>
> >     Keeping track of all 3 types of records in a single table.
>
> >Or
>
> >     Creating separate tables for each type of record.
>
> >Is one solution clearly better or is it just a matter of opinion?
>
> >Thanks in advance,
> >Tom
>
> You can get into some fine old quasi-religious arguments over this issue. The
> "purists" would say that this is a case of Subclassing, one of the few
> instances where one-to-one relationships are appropriate. Let's say you have a
> table of ComputerComponents; Monitors have width, height, resolution, etc..,
> disk drives have diameter, capacity, speed, cabletype, etc. - but these
> attributes only apply to the particular category.
>
> Using subclassing you would have one master table of ComputerParts, with the
> common fields; it would be related one-to-one to a table of Monitors (with the
> monitor-specific fields), and to a table of Diskdrives (with those fields),
> etc. You would need some programmatic (not referential integrity) constraint
> to ensure that you don't put a record in the Monitors table when the part in
> question is a disk drive!
>
> Alternatively you can use a wider table and leave the irrelevant fields NULL.
>
> Both methods do work, and do have their place; which is better depends both on
> the application (how MANY subclasses? how many fields each? how will the data
> be used?) and on the biases and preferences of the developer.
> --
>
>              John W. Vinson [MVP]

Thank you, John. You've given me food for thought.


Best,
Tom
Back to top
Login to vote
Display posts from previous:   
       Home -> Office other -> Table Design All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
 Office
  Office Other
 Security
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET |
  • IT Support