Question
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 bold
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 bold 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. Write the following queries in SQL. Consider the following SQL queries:
Select * From Emp, Works Where 1< Emp.eid < 200 and salary < 20000 and Emp.eid = Works.eid
Select * From Emp, Works, Dept Where Emp.eid = Works.eid and Works.did = Dept.did and budget= 800000
List the attributes of the relations Emp, Works, Dept that if one indexes them, the running time of these queries will improve. Which ones are clustered and which ones are not? You must also write the type of index (B+ tree or hash) for each indexed attribute(s)
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