0% found this document useful (0 votes)
33 views2 pages

Q LR

Good Notes

Uploaded by

myworkmyangel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
33 views2 pages

Q LR

Good Notes

Uploaded by

myworkmyangel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 2
Question 1 1. A university has many departments. Each department has multiple instructors (one person is HOD). Here the HOD refers to the head of the department. The University is identified by name and location and the department is identified by name, deptid, and location. An instructor belongs to only one department. Instructors are identified by name, ID, roomNo, and telephone. Each department offers multiple courses, which are determined by course title, courseID, and course unit. A single instructor teaches each course. A. student may enroll in many courses offered by different departments. The student is identified by name, student ID, and address. a, Draw an E/R model for the above scenario[S Marks]. b. Write an SQL command to create the tables Department and Instructors[5 Marks] c. Write an SQL command to insert to record each into the Department[5 Marks] d. Write an SQL command to establish a relationship between the Department and the Instructor[S Marks}. €. Modify the instructor Table by adding another attribute called Place of birth{S Marks], Question 2 Explain the following within the context of Database Management: a. The differences between the notions of Database (DB) and Database Management System (DBMS) [5 Marks} b. Write an SQL statement to create a database named school [5 Marks] c. Consider the school database, where the primary keys are underlined. Write an SQL statement to create each of the relations 1. Student (student_id, name, address,gender) [5 Marks] 2. Course (code, course_name, year) [5 Marks] 3. Department (dept_number, date, department_name) [5 Marks] Question 3 Kampala International University is recently voted the Runner-up University in East Africa. The University registrar requested you help pull out some information from the University database. Perform the following task on the University database: a) Write an SQL statement to display all records in the staff table.[5 Marks} b) Give an SQL statement to add a new record into the department table.[5 Marks] ©) Write an SQL statement to delete all the records from the course table. [5 Marks] d) Write an SQL statement to insert a new column/tuple in the student table called ‘Hobby’. [5 Marks] e) Write an SQL statement that displays all records that are captured in the year 2020 in the course table. [5 Marks] Page 2 of 4 Question 4 Define the following terms as used in Database Systems a) Data Definition Language[5 Marks}. b) Data Manipulation Language [5 Marks]. ©) Outline three advantages of a Relation database over a flat file.{5 Marks]. 4) Outline at least three drawbacks of the flat file system. [5 Marks]. e) Define the term model with the contest of Database Management System.[5 Marks}. Question 5 Consider the schema Employee (r_no, name, dept, dob, percentage, specialty,salary) and solve thefollowing queries using SQL statements. a) Display the name of the students having r_no is 13345[5 Marks]. ) Display the list of employees having dob > 1975[5 Marks}. ©) Display all information of employees whose specialty is cyber security[S Marks]. d) Display names and departments of employees whose monthly rating is greater than 80% [5 Marks}. ©) Display the sum of all employee salaries. [3 Marks}. Question 6 Answer the following questions in terms of Normalization in the database: istomer Name NOMS ECCT al NCU Aol ELL 4 Joe Bloggs Baked Beans Bread Jeff Smith Milk Baked Beans Stephen Jones Bread Milk a) What is Normalization in Relational Database?[5 Marks]. b) Explain the importance of Normalization in Database Management System[5 Marks] c) What are the forms of anomalies that exist in an UN-normalized table?[5 Marks]. Page 3 0f 4

You might also like