Answered step by step
Verified Expert Solution
Link Copied!

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(8), ename: char(20), age: integer, salary: real)
did: char(8), dname: char(30), budget: real, manager: char(8) Work(eid:
char(8), did: char(8), 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 his/her 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 =101, age =32, and salary =15000.
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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions