Problem

Exercise 3.8 Answer each of the following questions briefly. The questions are based on th...

Exercise 3.8 Answer each of the following questions briefly. The questions are based on the following relational schema:

Emp(eid: integer, ename: string, age: integer, salary: real)Works(eid: integer, did: integer, pcttime: integer)Dept(did: integer, dname: string, budget: real, managerid: integer)
  1. Give an example of a foreign key constraint that involves the Dept relation. What are the options for enforcing this constraint when a user attempts to delete a Dept tuple?
  2. Write the SQL statements required to create the preceding relations, including appropriate versions of all primary and foreign key integrity constraints.
  3. Define the Dept relation in SQL so that every department is guaranteed to have a manager.
  4. Write an SQL statement to add John Doe as an employee with eid = 101, age = 32 and salary = 15,000.
  5. Write an SQL statement to give every employee a 10 percent raise.
  6. Write an SQL statement to delete the Toy department. Given the referential integrity constraints you chose for this schema, explain what happens when this statement is executed.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 3