Question: 5 - Based on the below relational schema, answer the following questions. ( 2 0 pts ) Emp ( empid: integer, empname: string, age: integer,
Based on the below relational schema, answer the following questions. pts
Empempid: integer, empname: string, age: integer, salary: real
Worksempid: integer, deptid: integer, pcttime: integer
Deptdeptid: integer, deptname: string, budget: real, managerid: integer
a Identify a foreign key involving the Dept relation. Discuss how this constraint can be
enforced when trying to delete a Dept tuple.
b Provide the SQL statements to create the relations mentioned above, ensuring to
include necessary primary and foreign key constraints.
c How would you define the Dept relation in SQL to ensure each department always
has a manager?
d Write an SQL statement to add an employee named your name with empid as your
student ID and age as your own or a random! age and salary of $important
to user your real name and student id
e Write an SQL statement that applies a salary increase to every employee. with
UPDATE TABLE query
f Write an SQL statement for removing a department named IT Discuss the
consequences of this action given your schema's referential integrity constraints.
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
