Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Answer each of the following questions briefly. The questions are based on the following relational schema: eid: char ( 8 ) , ename: char (
Answer each of the following questions briefly. The questions are based on the following relational
schema:
eid: char ename: char age: integer, salary: real
did: char dname: char budget: real, manager: char Workeid:
char did: char pct time: real
a Assume that an employee works in one or more departments. Write the SQL statement required to
create the Work relation, including appropriate versions of primary and foreign key integrity
constraints, such that when an employee is deleted all hisher work records are also removed, and
the deletion of a department is disallowed if there are one or more employees working in the
department.
b Write the SQL statement to create the Emp relation, and write an SQL statement to add John as an
employee with eid age and salary
c Write the SQL statement to create the Dept relation such that every department is guaranteed to
have a manager represented by manager and the manager must be an existing employee.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started