Question: Given the tables have been created without foreign keys added, which of the following ALTER TABLE statements would create a foreign key on the department

Given the tables have been created without foreign keys added, which of the following ALTER TABLE statements would create a foreign key on the department_id in the employee table to reference the department_id in the department table?
a.)
ALTER TABLE employee
ADD CONSTRAINT fk_employee
FOREIGN KEY (department_id)
REFERENCES department (department_id);
b.)
ALTER TABLE employee
ADD CONSTRAINT
FOREIGN KEY (department_id)
REFERENCES department (department_id);
c.)
ALTER TABLE department
ADD CONSTRAINT fk_employee
FOREIGN KEY (department_id)
REFERENCES employee (department_id);
d.)
ALTER TABLE employee
ADD CONSTRAINT fk_employee
FOREIGN KEY department (department_id)
REFERENCES department_id;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!