Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume the following three are true. (1) The above two tables already exist in a database with data inserted as shown above. (2) EmpID and

image text in transcribed

Assume the following three are true.

(1) The above two tables already exist in a database with data inserted as shown above.

(2) EmpID and Dname are the primary key of Employee and Department tables, respectively.

(3) There is no foreign key constraint defined to relate these two table. That's why employee E012 can have a dept value 'HR', which does not exist in Department.

Leaving current data alone (i.e., without adding or modifying or removing them out of these two tables), how would you relate Employee with Department by enforcing a foreign key constraint such that referencing a non-existing department will never happen again to any new employees? Write an ALTER TABLE statement to answer this question.

Employee Department EmpID Dept Gender Dname Office R&D K-71 Sales M-22 Sales F E012 HR E354

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions

Question

Consider the following string: w = 1 0 1 1 0 0 1 1 1 What is wR ?

Answered: 1 week ago

Question

LO3 Define the difference between job satisfaction and engagement.

Answered: 1 week ago