


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!



1.1 Introduction In this lesson, we shall utilize some simple databases to illustrate the concepts of query processing. Class Exercise 1: Test your proficiency in designing, implementing, and using a database by recalling the skills gained during the previous course. The following are the steps involved in designing and implementing a database, given some requirement. i. Requirements Analysis ii. Conceptual Model iii. Normalization iv. ERD v. Database Schema Objective: Create a database based on a brief set of requirements provided. “In Meru University of Science and Technology, there are various schools (eg. SBE, SAFS etc.). Each school has one or more departments (eg. CS, IT, Nursing etc). Each department has its programs (eg. BCT, BIT, BCS, BEd. Etc). When a student is admitted into the University, he/she is enrolled into a program.” Use the above information to; a) Requirements analysis - Summarize the above case into (entities, relationships, cardinalities, and attributes) b) Translate the above requirements into a conceptual model c) Normalize the conceptual model in b (above) d) Translate the conceptual model into an ERD e) Translate the ERD to a physical model (Create a database) While making reference to the database schema generated after completing the above exercise, test your basic SQL proficiency by attempting to write SQL query commands to; i) List the names and email of all students ii) List the names and email of all students whose names begin with ‘MA’ iii) List the names and email of all students registered for ‘BBIT’
iv) List the names and email of all students from IT department v) List the names and email of all students taking programs from IT and Nursing departments. vi) List the names, email of all students who have not enrolled to any program. vii) List the names of programs with no students enrolled. Class Exercise 2: Library database. The purpose of the database is to facilitate staff members to issue books to the library patrons. The three major entities (table) are: Staff – staff members of the library patrons – registered users of the library. Books – Library inventory or items How are these entities related? In this problem we need to know which books are issued to which patrons and by whom (staff). Thus, the relationship “issues/issued” becomes an obvious and an important relationship in this simple problem. Normalizing the design, the relationship is represented using a new entity, “issues”. Finally, the resulting Entity- Relationship Diagram is as follows; While making reference to the ERD above, test your basic SQL proficiency by attempting to write commands to; i. List the names and email of all patrons who have ever been issued with a book authored by ‘Stephen Mutua’;
A number of search algorithms are possible for selecting the records from a file. The selection of records from a file is known as file scan, as the algorithm scans the records of a file to search for and retrieve records that satisfy the selection condition. Index Scan If the search algorithm uses an index to perform the search, then it is referred as Index Scan.