Please keep track of the total time you spend on this assignment, and make a note of that on what you turn in. This way we can tune the assignments for future classes.
This week's assignment involves visual representations of database schemas using the Entity-Relationship model. For questions that involve drawing diagrams, you can use a program such as Visio, Powerpoint, xfig, dia, etc. Or, you can turn in hand-drawn diagrams. However you must follow these guidelines:
Some of the problems include translating diagrams into SQL DDL commands; in those cases, feel free to type the SQL into a text file (or some other file), as a separate document.
This week's assignment draws from the majority of Chapter 6. The reading sections for Lectures 14 through 18 indicate the most relevant sections: 6 - 6.7.5, 6.8.1, and 6.9. Of course, reading the entire chapter is recommended.
Do these problems from the "Exercises" section of Chapter 6.
General Hints:
When you are designing these database schemas, you should think hard about what constraints should be specified. Always try to design schemas so that it is not possible to represent invalid states.
Also, think about what types to use for the various columns when translating relation schemas into SQL DDL:
You will lose points if your designs specify bad column types or size/precision limits. If you provide rationale for your choices in SQL comments then you will be less likely to lose points. Also, you will lose points for leaving out constraints; these are essential in any good database design.
Problem 6.15
After you have created this E-R diagram, convert it into the corresponding relational model schemas. If you apply any schema combinations or other optimizations, note this and explain why this is a good idea.
Finally, translate the relational model schemas into SQL DDL commands that can successfully be loaded into MySQL. (You should actually try that, of course.) Make sure that your SQL DDL commands include all primary key, foreign key, and candidate key constraints indicated or implied by the E-R diagram!
Scoring: The E-R diagram is one part, the relational model schema is another, and the SQL DDL is a third part. Each part is worth 6 points, for 18 in total.
Problem 6.21, parts b and c. Although not obvious in the problem statement, make sure your updated diagram also allows warehouses to supply the new kinds of items as well.
Once you have completed both parts b and c, take your final E-R diagram and convert it into the corresponding relational model schemas. If you apply any schema combinations or other optimizations, note this and explain why this is a good idea.
Finally, translate therelational model schemas into SQL DDL commands that can successfully be loaded into MySQL. (You should actually try that, of course.) Make sure that your SQL DDL commands include all primary key, foreign key, and candidate key constraints indicated or implied by the E-R diagram!
Scoring: The final E-R diagram is one part, the relational model schema is another, and the SQL DDL is a third part. Each part is worth 10 points, for 30 points in total.
Problem 6.22. Make sure your discussion touches on at least these particular topics:
Scoring: 20 points total.
Problem 6.23. Don't specify the foreign key constraints in English; rather, write SQL DDL commands to create every table in the schema, and specify all constraints for primary keys, foreign keys, and candidate keys. Make sure your SQL DDL actually loads into MySQL.
Scoring: 20 points total.