20kB Size 5 Downloads 29 Views

DATABASE MANAGEMENT SYSTEMS. Class 5 Homework. Suppose we need to build a database to hold information about recipes for different food we have ...

Suppose we need to build a database to hold information about recipes for different food we have prepared. Here is the total list of attributes we need to have:

RECIPE(Recipe#, Recipe Name, Description, Directions, Ingredient name, Ingredient type, Ingredient description, Ingredient amount, Ingredient unit, Ingredient#, Source-ID, Book title, author, publisher, date of publication, friend’s name, relationship, address, phone#, date of attempt, result of attempt)

We are going to design a set of tables for this application by constructing an E-R Diagram and converting it into a set of tables. Perform each of the following steps in order:

1. I believe there are entities Recipe, Ingredient, and History (of attempts of the recipe). What are the attributes of these entities? Are any of these weak? Draw these entities on your E-R Diagram. 2. The Source of a recipe is either a book or a friend. This sounds like an ISA relationship. For now, list the attributes of these 3 entities and add them to your E-R Diagram. 3. Draw the ISA Relationship with Source as the generalization and Book & Friend as the specializations. 4. Add the Relationships Recipe/History and Recipe/Ingredient. Note that we must know the ingredient amount and unit for each ingredient in a recipe (a unit is something like “TSP” for teaspoon or “C” for Cup). Be sure to indicate the types of these relationships. 5. Now add the relationship between Recipe and Source. Be sure to label its type. 6. Now the E-R Diagram is complete; develop a set of tables from it using the algorithm presented in the lectures. Note, I did not have a table for Source…