Re: standard and easy way to do schema design
Date: Thu, 16 Aug 2007 01:22:44 -0700
Message-ID: <1187252564.591070.177990_at_q4g2000prc.googlegroups.com>
> and for any ">>>>>>>>" line, we will need to create a separate table,
> if that table doesn't already exist.
>
> and for those ">>>>>>>>" lines, we will simply remove them from the
> original table.
I think one correction is this:
When there are plurals, then that means yes, there needs to be a separate table for those items, but if it is actually one-to-many relationship, then those items would most likely already be in another existing table.
Example:
Suppliers
id
name
products it supply >>>>>>>
address
phone
etc
So we need another table for "Products"
Assuming 1 product can only come from 1 supplier (cannot come from 2 or more suppliers), so we don't need an additional table besides "Suppliers" and "Products" tables.
The only situation where we need an additional table is that when the 2 entities are related by the many-to-many relation, such as one movie can show in many theaters, and one theater can show many movies. In that case, we need this additional table in the middle, so that the "Movies" table is connected to it in a "one-to-many" relation, and the "Theaters" table is also connect to it in a "one-to-many" relation.
Thus, it seems like any "line" draw between two tables can only be 1- to-1 or 1-to-many, but not many-to-many, because the many-to-many relation becomes a table itself. Received on Thu Aug 16 2007 - 10:22:44 CEST