Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following relational schema: emp ( eid:integer, ename:string, age:integer, salary:real ) works ( eid:integer, did:integer, pc time:integer ) dept ( did:integer, dname:string, budget:real, managerid:integer

Consider the following relational schema:
emp(eid:integer, ename:string, age:integer, salary:real)
works(eid:integer, did:integer, pc time:integer)
dept(did:integer, dname:string, budget:real, managerid:integer)
The underlined attributes are keys for their relations. Note that a manager is an employee as well
and their manager id and employee id are the same. An employee can work in more than one
department. The pct time field of the works relation shows the percentage of time that a given
employee works in a given department and is always greater than zero.
A sample database (sample db.sql) is provided with this assignment and the output of the correct
queries over this sample database is given in each part of this question. You may use this sample
database to test or debug your queries. We have created an account for each student on the
MySQL server of our department. The access guide to the MySQL server
(database access guide.txt) is also posted with this assignment. You can import the sample
database to your account on the MySQL server and use it to ensure that your queries are correct.
Notice that your SQL queries must return the correct result over every possible database instance
of the aforementioned schema for the questions and not only over the sample database.
You should not submit any .sql file in your assignment submission and must write your final SQL
queries in a single PDF file that you submit for all questions in this assignment.
Write the queries in parts (a) and (b) using relational algebra, nonrecursive Datalog, relational
calculus, and SQL. Write the rest of queries only in SQL.

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

Finding and scheduling appointments with new prospective clients.

Answered: 1 week ago