Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 2. (Based on Exercise 5.10) (35pts] Consider again the following relational schema. The meaning of each relation and attribute is straight- forward. Again, the

image text in transcribed

Problem 2. (Based on Exercise 5.10) (35pts] Consider again the following relational schema. The meaning of each relation and attribute is straight- forward. Again, the managerid refers to the employee (eid) that is the manager of this department. Emp(eid: integer, ename: string, age: integer, salary: real) Works(eid: integer, did: integer, since: date) Dept (did: integer, dname: string, budget: real, managerid: integer) Write SQL integrity constraints (domain, key, foreign key, or CHECK constraints; or assertions) or SQL triggers to ensure each of the following requirements, considered independently. You have to give the CREATE TABLE statements for each relation and you can modify it to add constraints if needed. 1. Employees must make a minimum salary of $1000. 2. Every manager must be also be an employee. 3. The budget of a department must be larger than the sum of the salaries of the employees that work in this department. 4. A manager must always have a higher salary than any employee that he or she manages. 5. Whenever an employee is given a raise, the manager's salary must be increased to be at least as much

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_2

Step: 3

blur-text-image_3

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

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions

Question

=+ 4. Why should policymakers think about incentives?

Answered: 1 week ago

Question

=+ 2. What is the opportunity cost of seeing a movie?

Answered: 1 week ago