Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2 Type in 3 rows of data for EMPLOYEE and STORE tables and 2 rows data for REGION table. Please use exactly the same
2 Type in 3 rows of data for EMPLOYEE and STORE tables and 2 rows data for REGION table. Please use exactly the same data as shown in the picture in the picture above. Paste the screenshots of those tables with data in your submission. (10 points for undergraduate students, 5 points for graduate students) When typing in data in 1.2, you may find you have to start with the REGION table, and then the STORE table, and finally the EMPL YEE table. Can you explain why you have to follow this order? (10 points for undergraduate students, 5 points for graduate students) (Graduate students only) Suppose you have one manager for each store and you want to have data about store managers. Then you can add a column of Emp_Code to the store table (as shown in the following picture). How do you revise your SQL code in 1.1 to create the table? Please note Emp_Code in the STORE table should be a foreign key because Emp_Code is the primary key of EMPLOYEE table. Paste the SQL code in your submission. (10 points for graduate students) (Hint for 1.4: In order to satisfy the rule of referential integrity, we have to create tables without FKs first. In his case, both EMPLOYEE and STORE have FKs. Which one do you create first? To solve this problem, you can first create the tables without FK constraints. Then use "Alter Table" command to add FK constraints. There is an example of "SQL FOREIGN KEY on ALTER TABLE" here ttps://www.w3schools.com/sql/sql foreignkey.asp)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started