Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose the following tables are part of a project management database of a company, where keys are underlined: E(ssn, name, salary) stores the information of

Suppose the following tables are part of a project management database of a company, where keys are underlined: E(ssn, name, salary) stores the information of employees, P(pid, title, budget) stores the information of projects, and M(ssn, pid, start, end) stores the information of management of projects by employees.

1.) Define an SQL view PNum (pid, num) that gives the number of employees that manages project pid.

2.) Write an SQL query to return the ssn of employees that manage each project in P.

3.) Write an SQL CREATE ASSERTION statement to force the constraint An employee needs to manage at least one project

4.) Write an SQL CREATE ASSERTION statement to enforce the constraint that an employee never manages two projects that overlap in time.

5.) Define an SQL view Budget(ssn, totalbudget) that summarizes the total budget of projects that an employee manages.

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

Principles Of Multimedia Database Systems

Authors: V.S. Subrahmanian

1st Edition

1558604669, 978-1558604667

More Books

Students also viewed these Databases questions

Question

Question How are VEBA assets allocated when a plan terminates?

Answered: 1 week ago

Question

Question May a taxpayer roll over money from an IRA to an HSA?

Answered: 1 week ago

Question

Question What is the doughnut hole in HSA coverage?

Answered: 1 week ago