I would break it into smaller tables.

One issue is size - you don't want to store a lot of empty fields.  Create
each table, and use a primary key ID field to link them.  

Just remember that when you want a record set with all the data, you will
need to use LEFT JOIN in order for the result set to include the members who
don't have records in the optional tables.

-----Original Message-----
From: Jason Lotz [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 10:52 AM
To: CF-Talk
Subject: DB structure advice


This is more of a theory question than an actualy request for help.  Let's
say you are building a database of members with lots of information that
applies to every member (name, address, phone, etc.)  This could be about 40
seperate fields.  Then, on top of that, each member can have lots of
optional information that can easily be grouped together.  For example, if
they graduated from college, you want to store their degree information or
if they own a company, you want to store their company info.  Each of these
"optional groups" are one-to-one (each member can only have one chunk of
this data but doesn't have to have it at all.) Now here's the question -

When you are building this database, you could easily put it into one huge
table because all the information is one-to-one.  However, it's a pain when
you only want to get the "degree" information or the "company" information.
>From a programming standpoint, is it best to break these into smaller tables
for ease of use or to keep it into one table?

Thanks,
Jason
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to