Question: 7. Write a SQL statement to create a table employees including columns employee id, first name, last name, email, phone number hire date, job_id, salary,

7. Write a SQL statement to create a table employees including columns employee id, first name, last name, email, phone number hire date, job_id, salary, commission, manager id and department_id and make sure that, the employee id column does not contain any duplicate value at the time of insertion and the foreign key column department_id contain only those unique combination values, which combinations are exists in the departments table. 1. 2 Automatic context help the toolbar to manual the current caret positi automatich 3 7 8 use countries; create table embloyees embloyee_id decinal (6,0) not null primary key, first_name varchar (30), last_name varchar (3e), email varchar (30) not null, phone_number varchar (10), hire_date date not null, job_id varchar (5) not null, salary decimal (6,2), commission decimal (6,2), manager_id varchar (5) not null, department_id decimal (4,0), foreign key (department_id)references department (department_id)); 9 le 11 13 14 15 16 > Context Help Snippets Output Action Output Time Action Message 1 19:20:01 use countries Orow(s) affected 2 1920:01 create table embloyees (enbloyee_jd decimal (6.0) not nul primary key... Error Code: 1824. Failed to open the referenced table 'department 3 19.24 30 use countries Orow(s) affected 4 19.24 30 create table embloyees (embloyeed decimal (60) not nul primary key, fi Enor Code: 1824. Failed to open the referenced table department
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
