Name ________________________________________________________________
INSY 483
Summer 2001
Test 1
Use the tables at the end of this test as the basis for answering any queries requested. As was the case with homework, I will give full credit for any reasonably optimized query but will deduct points for queries that are clearly more complicated than necessary.
Make sure that your test is not missing any pages. You should have seven pages total as follows:
Cover page 1
page
Questions 5 pages
Sample Tables 1
page
----------
Total 7 pages
The
â receive no aid from other students, books, or notes.
â give no aid to other students.
â report any suspected cheating to the instructor or proctor.
1. In a file oriented system, application programs directly access data files. How do Database Management Systems differ?
Data is passed from the server to a client running SQLplus where the SELECT query against that data can be executed. The results of the query are then displayed on the screen.
Data is selected from the client but passed to the server for processing of the SELECT command. The results are then sent back to the client machine where they are displayed on the screen.
The server SELECTS the rows indicated by any WHERE clause and passes them to the client where any search conditions based on the HAVING clause are then executed. The results are then displayed on the screen.
The SELECT command is sent from the client to the server. The command is executed on the server and the results are sent back to the client. The client than displays the results on the screen.
Use the tables at the end of this test to answer the following questions:
q Students.sid
q Faculty.sid
q DeclaredMajors.sid
q Students.fid
q Faculty.fid
q DeclaredMajors.advisorfid
SQL: Bonus question: Use SQL to create a list of the lastname, firstname, and phone number of all students who are currently being advised by the faculty who has the last name “Jones” and the first name “Fred”.
Students {sid, lastname, firstname, phone, gpa}
Faculty{fid, lastname, firstname, phone, salary, dept}
DeclaredMajors {sid, major, advisorfid }
The first few rows of each table is shown below
Students
Sid
|
Lastname |
Firstname |
Phone |
GPA |
|
123456 |
Doe |
Jane |
555-1111 |
3.6 |
|
111111 |
Smith |
Steve |
555-5432 |
3.1 |
|
222222 |
|
Sarah |
555-7676 |
2.7 |
|
Etc… |
|
|
|
|
Faculty
Fid
|
Lastname |
Firstname |
Phone |
Salary |
Dept |
|
987654 |
Parker |
Peter |
555-8181 |
49000 |
INSY |
|
777777 |
Date |
CJ |
555-4444 |
81000 |
INSY |
|
654321 |
Jones |
Fred |
555-9999 |
56000 |
CPSC |
|
222222 |
Bures |
Allen |
555-4554 |
71000 |
MGMK |
|
Etc… |
|
|
|
|
|
DeclaredMajors
|
Sid |
Major |
AdvisorFid |
|
123456 |
INSY |
987654 |
|
111111 |
INSY |
777777 |
|
111111 |
MGNT |
222222 |
|
237654 |
CPSC |
654321 |
|
877665 |
DBMS |
987654 |
|
Etc |
|
|