Professional Documents
Culture Documents
Database Lab3 Final
Database Lab3 Final
Database Lab3 Final
Please work in groups to complete this lab. This lab is worth 2% of the total course grade and
will be evaluated through your written submission, as well as the lab demo. During the lab
demo, group members are randomly selected to explain the submitted solution. Group
members who are not present during the lab demo will lose the demo mark.
Please submit the submission file(s) through Blackboard. Only one person must submit for the
group and only the last submission will be marked.
Part I: Keys
[Adapted from Coronel and Russel- Chapter 3 Problems] Use the database shown in Figure P3.1 (copied
to the end of this document) to answer the following questions:
EMP_CODE
EMP_CODE, LAST_NAME
EMP_CODE, FIRST_NAME
LAST_NAME, FIRST_NAME
EMP_CODE, EMP_DOB
EMP_DOB, FIRST_NAME
EMP_DOB, LAST_NAME
STORE_CODE
STORE_CODE, REGION_CODE
STORE_NAME
EMP_FIRST_NAME,
EMP_FIRST_NAME
4- Do the tables exhibit entity integrity? Answer yes or no, and explain your answer.
5- Do the tables exhibit referential integrity? Answer yes or no, and explain your answer. Write N/A if
the table does not have a foreign key.
6- What type of relationship (1:1, 1:M, M:N, or none) exists between the following pairs of entities?
8- From table J, SELECT only STARCH = Potatoes (Let’s call the resulting table B)
Table name: B
Recipe Starch Stock Meat Vegetable
Lamb Stew Potatoes Water Lamb Peas
Irish Stew Potatoes Beef Stock Beef Cabbage
9- From table M, SELECT only STOCK = not Water (Let’s call the resulting table
C)
Table name: C
Recipe Starch Stock Meat Vegetable
Turkey Stew Rice Chicken Stock Turkey Carrots
Vegetable
Veggie Stew Pasta Tofu Snap Peas
Stock
Irish Stew Potatoes Beef Stock Beef Cabbage
11- From table M, PROJECT RECIPE and VEGETABLE (Let’s call the resulting table
E)
Table name: E
Recipe Vegetable
Lamb Stew Peas
Turkey Stew Carrots
Veggie Stew Snap Peas
Irish Stew Cabbage
Pork Stew Onions
12- J UNION M
Table name: J ∪ M
Recipe Starch Stock Meat Vegetable
Lamb Stew Potatoes Water Lamb Peas
Chicken Stew Rice Chicken Stock Chicken Carrots
Veggie Stew Pasta Water Tofu Snap Peas
Irish Stew Potatoes Beef Stock Beef Cabbage
Pork Stew Pasta Water Pork Onions
Turkey Stew Rice Chicken Stock Turkey Carrots
14-J DIFFERENCE M
Recipe Starch Stock Meat Vegetable
Chicken Stew Rice Chicken Stock Chicken Carrots
15- M DIFFERENCE J
Recipe Starch Stock Meat Vegetable
Turkey Stew Rice Chicken Stock Turkey Carrots
16- B UNION C
Table name: B U C
Recipe Starch Stock Meat Vegetable
Lamb Stew Potatoes Water Lamb Peas
Irish Stew Potatoes Beef Stock Beef Cabbage
Turkey Stew Rice Chicken Stock Turkey Carrots
Vegetable
Veggie Stew Pasta Tofu Snap Peas
Stock
18- B PRODUCT E
It would be combination of every row in B with every row in E.
19- E DIVIDE D
Vegetable
Peas
Carrots
Snap Peas
Cabbage
Onions
We, ------------ (mention your names), declare that the attached assignment is our own work
in accordance with the Seneca Academic Policy. We have not copied any part of this
assignment, manually or electronically, from any other source including web sites, unless
specified as references. We have not distributed our work to other students.
2- Specify what each member has done towards the completion of this work:
Name Task(s)
1 Druv Mann 7-12
2 Md Nazmun hasan Nafees 1,2,3
3 Deepak Prashad Khuswaha 4,5,6
4 Paschal Ibeh Answered question 13-19
- EMPLOYEE: Lists the employees working across several stores belonging to StoreCo company.
For each employee, the table contains information such as name, date of birth, and the code of
the store he/she works in.
- STORE: Lists the company’s stores across different regions. For each store, this table contains
information such as name, year-to-date sales, the code of the region it belongs to, and the code
of the employee who manages the store.
- REGION: Lists the regions.