Database Assignment: ER Model and Normalization
I) Garage Database
We want to design a database for a local garage. For each customer, we want to record the (unique) name, the customer address, and the contact phone number. For each vehicle, we want to record the unique vehicle's identification number (VIN), and the vehicle's make, model and year. For each repair job we want to record the description of the job done (maximum 200 chars), the date, and the total dollar cost. A repair job may involve zero or more parts (like, e.g., "windshield wipers", "battery", etc.) For each part we want to record its (unique) part number, the part name and its cost. In addition, note that:
i. Each vehicle may have 1 or more repair jobs.
ii. Each customer may be the primary owner of 1 or more vehicles.
iii. Every vehicle has only one primary owner (we ignore co-owners).
iv. No vehicle can have more than one repair job in any given day.
Answer the following questions:
i. Draw an ER diagram for this database. Make sure to indicate primary keys, cardinality constraints, weak entities (if any), and participation constraints. List any assumptions you make in the process.
ii. Translate the ER diagram in (i) into relational database tables (i.e. give the SQL DDL statements). Make sure that the translation captures key constraints (primary keys and foreign keys if applicable) and participation constraints in the ER diagram. Identify constraints, if any, that you are not able to capture.
iii. Identify the functional dependencies that you expect should hold for the Garage Database domain. Use the dependencies to find keys and BCNF normal forms.
II) Restaurant Database
The student administrator of the Mini University wants to design a database for profiling students' preferences for the nearby restaurants and the dishes. For example, the student Jack Smith likes the "rib eye steak" at the "TGI Fridays", not the "rib eye steak" at the "Olive Garden", while the student Nancy Graham likes the Italian spaghetti at "Zeppoli's".
i. Each student has his/her SSN, the name, and the department.
ii. Each restaurant has its name, and the mailing address.
iii. The name of a restaurant may not be unique, but the mailing address is unique.
iv. Each dish has the name and the price.
v. The price of a dish might differ on different restaurants. For example, "rib eye steak" is $15 at "TGI Fridays", but $20 at the "Olive Garden".
vi. The name of a dish is unique within a restaurant. Two restaurants may have the same dish name.
vii. A dish is offered by at least one restaurant, and a restaurant offers at least a dish.
Answer the following questions:
i. Draw an ER diagram for this database. Make sure to indicate primary keys, cardinality constraints, weak entities (if any), and participation constraints. List any assumptions you make in the process.
ii. Translate the ER diagram in (i) into relational database tables (i.e. give the SQL DDL statements). Make sure that the translation captures key constraints (primary keys and foreign keys if applicable) and participation constraints in the ER diagram. Identify constraints, if any, that you are not able to capture.
iii. Identify the functional dependencies that you expect should hold for the Restaurant Database domain. Use the dependencies to find keys and BCNF normal forms.
III) Reverse Engineering
This question tests how well you understand the algorithm for converting E/R diagrams to relational schemas. An E/R diagram when converted to relations (using the mechanical construction that we know and love) gives rise to the following relations:
i. R(a, b, c)
ii. S(a, d)
iii. T(a, d, f, g)
You may assume that the same symbols refer to the same attribute and different symbols refer to different attributes (e.g., the attributes a in the relations R, S and T are the same) i.e. it ultimately comes from a single entity set or relationship in the E/R diagram.
Your task is to reverse-engineer the E/R diagram from these relations; in other words, what E/R diagram could have produced these relations. For full credit, give two different E/R diagrams that could have produced these (and only these) relations (i.e. 10 points for each correct E/R diagram).
Format your homework according to the following formatting requirements:
i) The answer should be typed, using Times New Roman font (size 12), double spaced, with one-inch margins on all sides.
ii) The response also includes a cover page containing the title of the homework, the student's name, the course title, and the date. The cover page is not included in the required page length.
iii) Also include a reference page. The Citations and references must follow APA format. The reference page is not included in the required page length.