Re: test
Posted by:
Rick James
Date: April 16, 2010 10:04PM
Let's take one piece:
"Every employee works for one and only one department."
That is a "many to one" relationship. Many employees work for one department. The reasonable way to represent that is (assuming you have Employee and Department tables) to have the dept_id in the Employee table.
See how far you can get with that principle.
It will fall apart when you have a "many to many" relationship. In that case, you need an extra table that has effectively 2 columns -- the ids into each of the other tables.
Generally, have an "id" in each table. (That will call for a third column in the relation table I just mentioned.)
Now see how far you can get into writing CREATE TABLE statements. Once you have done that, you may be satisfied, or you may wish a more detail review than I have given you.
Subject
Written By
Posted
Re: test
April 16, 2010 10:04PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.