Assignment 2
Assignment 2
Assignment 2
Answer all of the following questions, and upload your completed work here.
• There are 1 000 patients and 500 items yielding a total of 10 000 usage records in the database.
• There are 50 physicians and a total of 4 000 prescriptions in the database.
• There are 200 treatments in the database.
• There are 50 accesses per day for patient records; of these, 30 request access to both prescription and
usage records.
• There are 20 accesses per day for physician records; of these, 20 request access to prescriptions.
a. What are the typical integrity controls performed in both data integrity and referential integrity?
b. Using an example for each situation, illustrate the three common situations that suggest relations should be
denormalized.
c. What are the advantages and disadvantages of horizontal and vertical partitioning?
a. Write one SELECT SQL query to list the numbers and names of all employees with a salary greater than 66
000 who are assigned to projects, the projects they are assigned to, and the corresponding hours worked.
Your list should be sorted by employee name.
b. Define indexes on selected attributes to speed up your query, and justify your selections.
c. Write SQL queries to create the indexes you defined above.