Question: 1 . Write a query in sql to create a table employee and department Employce ( empno , cnamc, deptno, job, hiredate salary, mgrno, commission
Write a query in sql to create a table employee
and department
Employceempno cnamc, 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 columr
with constraint greater than zero
Include the following constraints on column of
dept
table.
deptno as primary
a to make
key.
b to ensure dname,loc coloumns does not
contain
values
NULL
Also enforce REFERENTIAL INTEGRITY
leclare 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
