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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!