Answered step by step
Verified Expert Solution
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:
empeid:integer, ename:string, age:integer, salary:real
workseid:integer, did:integer, pc time:integer
deptdid: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 dbsql 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started