Review Questions 1 1. Explain the following terms using examples: a) Database b) Database system c) Database application d) Database Management System (DBMS) e) Data Model f) Metadata g) Data Independence (logical and physical) 2. Explain the difference between a file-based system and database system. 3. Explain the main components of a DBMS. 4. Discuss the importance of data modeling. 5. Discuss the basic differences between external schema, conceptual schema, and internal schema. 6. What is an entity set? Explain the difference between an entity and an entity set. 7. What is a relationship set? Explain the difference between a relationship instance and a relationship set. 8. What is a participation role? When is it necessary to use role names in the description of relationship types? 9. Under what conditions can an attribute of a binary relationship type be migrated to become an attribute of one of the participating entity types? 10. Can an identifying relationship of a weak entity type be of degree greater than two? Give examples to illustrate your answer. 11. Construct an ER diagram for a hospital with a set of patients and a set of medical doctors. Associate with each patient a log of the various tests and examinations conducted. 12. Consider the following set of requirements for a university database that is used to keep track of students’ transcripts. a) The university keeps track of each student’s name, IDNO, address, birthdate, sex, classs (1st year, 2nd year, etc), department, degree program (BSC, BIS, etc) b) Each department is described by a name, department code, building number, phone, and Faculty. Both name and department code have unique values for each department. 1 c) Each course has course code, title, credit hours, level (level 200, 300, etc), and offering department. The value of the course code is unique for each course. d) Each instructor has IDNO, name, department, and title (lecturer, senior lecturer, etc). The value of IDNO is unique for each instructor. Draw an ER diagram for this application and indicate key attributes, cardinality constraints. Note any unspecified requirements, and make appropriate assumptions to make the ER diagram complete. Modify the above ER diagram so that you can be able to keep track of students’ result sheet. 13. You are given a relational database instance containing the following relations: PART SUPPLIER Pno p1 p2 p3 p4 p5 Sno s1 s2 s3 s4 s5 Pname nut screw washer screw hinge Sname John Saul Patel Saul John City Lobatse Phikwe Lobatse Kanye Hukuntsi SUPPLY Sno s2 s1 s1 s2 s1 Pno p4 p1 p3 p2 P2 Quantity 40 50 30 20 20 a. Give an example each of the relational concepts: Superkey, Candidate Key, Primary Key and Foreign key. Briefly explain how these concepts are related. [5] b. Express the request: “get the name of supplier, name of part, and quantity supplied for supply involving supplier named John who supplied part named nut in quantity greater than 40” as a sequence of Relational Algebra operations. [5] 14. Explain the main distinction between an operational and non-operational (declarative) query language. 2 15. Suppose you have gathered the following database application requirements in respect of Micro Lending Organization: The Micro Lending Organization is organized into branches. Each branch has a branch name, a city it is located in and assets of the branch. The customers of the Micro Lending Organization have names, ids and an address. Customers also have accounts and may take loans. The Micro Lending Organization offers two types of accounts (savings and current accounts). Accounts can be held by more than one customer and a customer can have many accounts. Each account has a balance and an account number. Each savings account has an interest rate and each current account has an overdraft. Employees of the Micro Lending Organization have ids, names and telephone numbers. A loan originates at a particular branch and can be held by one or more customers. A loan has a loan number and loan amount. For each loan the Micro Lending Organization keeps track of the loan payment number uniquely identifies a particular payment for a specific loan. You are required to specify these requirements by means of suitable ER diagram. [15] OR Represent the following E-R schema as tables. State any assumptions you make. 16. Consider the following relational schema: STUDENT (stud-id, stud-name, age, address) COURSE (c-code, c-name) TAKING (stud-id, c-code, grade) Write the following queries as relational algebra statements: a) Get the names of students who are doing a course called CSI471 AND a course called CSI481. [5] b) Get the names of students who are doing a course called CSI471 OR a course called CSI481. [5] 3