

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


W1-2-60-1-
JOMO KENYATTA UNIVERSITY
OF
AGRICULTURE AND TECHNOLOGY
UNIVERSITY EXAMINATIONS 2016/
DATE: JUNE 2017 TIME: 2 HOURS
INSTRUCTIONS: ANSWER QUESTION ONE AND ANY OTHER TWO QUESTIONS
QUESTION ONE (30 MARKS)
a. What is DBMS? [3 marks]
b. Give at least FIVE disadvantages of file processing system over DBMS. [5 marks]
c. Discuss TWO levels of data independence. [6 marks]
d. Write the SQL statements to create TWO relations student and course. Where; Student and course. Where Student (SID, FName, LName, age, C/D, RegDate) and Course (C/D, Name, Units) Make sure that your statement specifies the composite primary key on student table and foreign keys on any table. Additionally, we would like to enforce the constraint that student age be greater than zero. [8 marks]
e. Consider the following relational schema: Emp (SSN, Name, MGR-SSN, Salary, DNo) Dept (D no, Dname, Mgrssn)
Write the following queries in SQL i. Display the names of the employees in descending order of their salaries. ii. Retrieve the names of employees working in IT department. [8 marks]
QUESTION TWO
a. What is the difference between DDL and DML commands? Give example of three operations found in each command. [8 marks]
b. Consider the following schema; [12 marks]
STUDENTS (Student – code, first-name, last- name, email, phone no, date of birth, honors, subject, percentage of marks) i. Display the full name of students with a column heading “Name”. ii. Display the unique honors subject in the STUDENTS table iii. Display all students names with honor subject “Eng 01” iv. Display all student whose first name starts with the character ‘A’ v. Display all students whereby the second letter in the first name is “I” vi. Display names of all students in descending order of percentage of marks.
QUESTION THREE (20 MARKS)
a. What is an entity relationship model? [3 marks] b. Explain TWO types of participation constraint. [6 marks]
c. (^) Consider the following scenario; A University registrar’s office maintains data about the following entities; courses, including number, title, credits, syllabus and prerequisites; course offerings, including course number, year, semester section number, instructor(s), timings and classroom; students including studentId, name and program; instructors, including identification number, name, department and title.
The instructors is allowed to teach only courses that are offered by the University. Furthermore, the enrollment of students in courses and grades awarded to students in each course they are enrolled all must be appropriately modelled. Construct an ER diagram for the registrar’s office for the given scenario. Document all assumptions that you make about the mapping constraints. [11 marks]
a. What is key constraint? Discuss THREE types of key constraints in relational model. [8 marks] b. Design a relational database model corresponding to the following ER diagram. [12 marks]