Mit802 2015 2016
Mit802 2015 2016
c Data modeling is the most important part of the systems development process.
Discuss. (5 Marks)
d Explain how a view can be used to reinforce data security. (5 Marks)
a Draw a relational schema and diagram the functional dependencies in the relation.
(10 Marks)
b In what normal form is this relation? (5 Marks)
3 a Draw ER Diagram(s) for the following situation: (If you believe you need to make
additional assumptions, clearly state them)
Stillwater Antiques buys and sells one-of-a-kind antiques of all kinds (e.g., furniture,
jewelry, china, and clothing). Each item is uniquely identified by an item number
and is also characterized by a description, asking price, condition, and open-ended
comments. Stillwater works with many different individuals, called clients, who sell
items to and buy items from the store. Some clients only sell items to Stillwater,
some only buy items, and some others both sell and buy. A client is identified by a
client number and is also described by a client name and client address. When
Stillwater sells an item in stock to a client, the owners want to record the
commission paid, the actual selling price, sales tax (tax of zero indicates a tax
exempt sale), and date sold. When Stillwater buys an item from a client, the owners
want to record the purchase cost, date purchased, and condition at time of
purchase. (20 Marks)
b Convert the ER diagram(s) in Question 3a to relations. (5 Marks)
b List three conditions that you can apply to determine whether a relation that is in
first normal form is also in second normal form. (6 Marks)
c Consider the following two relations for Tonia International College:
STUDENT(StudentID, StudentName, CampusAddress, GPA)
REGISTRATION(StudentID, CourseID, Grade)
Following is a typical query against these relations:
SELECT Student_T.StudentID, StudentName, CourseID, Grade
FROM Student_T, Registration_T
WHERE Student_T.StudentID = Registration_T.StudentID AND GPA > 3.0
ORDER BY StudentName
i On what attributes should indexes be defined to speed up this query? Give the
reasons for each attribute selected. (6 Marks)
ii Write SQL commands to create the tables for the relations taking cognizance
the associated indexes identified in (i) above. (10 Marks)
a Count the number of courses taken per student. The result should include Matric No
and number of courses. (4 Marks)
b List the Matric No, Last name and First name of students that offered CSC100. (3
Marks)
c Insert a female Muslim student with matric number 020805023, named Ahmed
Aminat and born on September 13th 1985 in the STUDENT table. (3 Marks)
d Create a view for female students that offered compulsory courses. The view should
include all the fields in the STUDENT table (3 Marks)
e Delete all female students with last name ending with EYE in the STUDENT table. (3
Marks)
f Change the CSC205 to a compulsory course. (3 Marks)
2|Page
a Write SQL command to:
ii Find the average score per student. The output should also include MATRIC
_NO, LAST_NAME, FIRST_NAME and average score. (3 Marks)
iii List the students with no result. (3 Marks)
3|Page
Figure 1: Student Records Relations
LECTURER_ID LECTURER_NAME
S0001 Prof. O. Olatunde
S0002 Dr. A. Haruna
S0003 Mrs. Glory Ekpe
S0004 Dr. A. Ajao
S0005 Dr A. Chukwu
4|Page