0% found this document useful (1 vote)
227 views3 pages

Lecture Questions Lecture 7 - Design Physical File

The document discusses indexes that could help speed up queries on various database schemas. It includes sample queries and reports on relations such as STUDENT, REGISTRATION, EMPLOYEE, DEPARTMENT, WORKS, SUPPLIERS, PARTS, and CATALOG. It asks what indexes would help the queries and reports run faster, and provides the SQL commands to create those indexes. It also distinguishes between clustered and nonclustered indexes.

Uploaded by

Võ Thị Tú
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
227 views3 pages

Lecture Questions Lecture 7 - Design Physical File

The document discusses indexes that could help speed up queries on various database schemas. It includes sample queries and reports on relations such as STUDENT, REGISTRATION, EMPLOYEE, DEPARTMENT, WORKS, SUPPLIERS, PARTS, and CATALOG. It asks what indexes would help the queries and reports run faster, and provides the SQL commands to create those indexes. It also distinguishes between clustered and nonclustered indexes.

Uploaded by

Võ Thị Tú
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Lecture Questions

Lecture 7 – Design Physical File

1. Consider the following tw relations for Millennium College:


STUDENT (Student_ID, Student_Name, Campus_Address, GRA)
REGISTRATION (Student_ID, Course_ID, Grade)

SELECT STUDENT.STUDENT_ID, STUDENT_NAME, COUSE_ID, GRADE


FROM STUDENT, REGISTRATION
WHERE (STUDENT.STUDENT_ID=REGISTRATION.STUDENT_ID) AND (GRA>3)
ORDER BY STUDENT_NAME;

a. On what attributes should indexes be defined to speed up this query? Give the reasons for
each attribute selected?
b. Write SQL commands to create indexes for each attribute you identified in part a.
2. Consider the following schema:

EMPLOYEE(EmployeeID, EmployeeName, Age, Salary)

DEPARTMENT(DepartmentID, DepartmentName, Budget, ManagerID)

WORKS(EmployeeID, DepartmentID, time)

a. For each of the following reports, indicate any indexes that you feel would help
the report run faster as well as the type of index. Write SQL commands to create
indexes for each attribute you identified

Did Dname Total _of_Salary

b. What is the role of the buffer manager in a DBMS? What is the role of the disk
space manager?

3. Consider the following schema:

SUPPLIERS(SupplierID, SupplierName, Address)

PARTS(PartID, PartName, Color)

CATALOG(SupplierId, PartID, Cost)


a. For each of the following reports, indicate any indexes that you feel would help
the report run faster as well as the type of index. Write SQL commands to create
indexes for each attribute you identified

sid sname Total _of_Pid

b. What is the difference between a clustered index and an unclustered index

4. Refer to Figure 1. For each of the following reports, indicate any indexes that you feel would
help the report run faster as well as the type of index:

a. State by products (use – specified period)

State By Products Report January 1, 2013 To March 31, 2013


State Product Description Total Quantity Ordered
CO 8- Drawer Dresser 1
CO Entertainment Center 0
CO Oak Computer Desk 1
CO Write’s Desk 2
NY Write’s Desk 1
VA Write’s Desk 5

b. Most fequently sold product finish in a user – specified month

Most Frequently Sold Product Finish Report March 1, 2013


to March 31, 2013
Product Finish Units Sold
Cherry 13

c. All orders placed last month

Monthly Order Report March 1, 2013 To March 31, 2013


Order_I Order_Date Customer_ID Customer_Name
D
19 3/5/2013 4 Eastern Furniture
Order Details:

Product Description Quantity Price Exteded Price


Ordered
Cherry End Table 10 75 750
High Back Leather Chair 5 362 1810

Order_I Order_Date Customer_ID Customer_Name


D
24 3/10/2013 1 Comtemporaty Casuals
Order Details:

Product Description Quantity Price Exteded Price


Ordered
Bookcase 4 69 276

d. Total products sold by product line (use-specified period)

Products sold by Product Line March 1, 2013 To March 31,


2013
Product_Line Quantity Sold
Basic 200
Antique 15
Modern 10
Classical 75

You might also like