Question: Write a query in sql to create a table employee and department Employee ( empno , ename, deptno, job, hiredate, salary, mgrno, commission ) Department
Write a query in sql to create a table
employee and department
Employeeempno ename, deptno, job, hiredate,
salary,
mgrno,
commission
Departmentdeptno dname, loc
Include the following constraints on column of
table.
emp
a to make the empno as primary key of the table
and
b to ensure that the ename column does not
contain NULL values and add salary column
with constraint greater than zero
Include the following constraints on column of
dept
table.
a to make
deptno as primary
key.
b to ensure dname,loc coloumns does not
contain
NULL
values
Also enforce REFERENTIAL INTEGRITY
declare deptno field of dept table as primary key
and deptno field of emp table as foreign key
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
