SCHOOL OF COMPUTER TECHNOLOGY EXAMINATION FOR: DPLOMA IN COMPUTER STUDIES, YEAR 1 DIPLOMA IN COMPUTER STUDIES (INTERACTIVE MULTIMEDIA), YEAR 1 DIPLOMA IN INFORMATION TECHNOLOGY, YEAR 1 DIPLOMA IN INFORMATION ENGINEERING, YEAR 1 ACADEMIC SESSION 2009, SEMESTER 3 & 4 CXD1206: DATABASES 2 JULY 2009 TIME: 2 HOURS Answer question from Section A, and any TWO questions from Section B. Section A question carries 50 marks, Section B questions carry equal marks. Candidates must write in blue or black INK when writing in the answer booklet. All answers must be written in the answer booklet provided. At the end of the examination, answer booklets and answer sheets must be fastened together. Only non – programmable calculators are allowed (if applicable). Question papers must NOT be removed from the exam hall. [ This paper contains FOUR questions printed on SIX pages ] Section A (50 marks) a) HENRY BOOK DATABASE – the data in each of the table listing is NOT complete Copy Table 1 to your answer booklet. PRIMARY KEY FOREIGN KEY AUTHOR BOOK BRANCH INVENTORY PUBLISHER WROTE Table 1 Identify primary key and foreign key (if exists) for the following tables. If there is no foreign key, write “NONE”. AUTHOR AuthorNum 1 2 3 4 AuthorLast Morrison Solotaroff Vintage Francis BOOK BookCode Title 0180 A Deep Sky 0189 Magic Terror 0200 The Stranger 0378 Venice AuthorFirst Toni Paul Vernor Dick PublisherCode TB FA VB SS BRANCH BranchNum BranchName 1 Henry Downtown 2 Henry On The Hill 3 Henry Brentwood 4 Henry Eastshore Type SFI HOR FIC ART BranchLocation 16 Riverview 1289 Bedford Brentwood Mall Eastshore Mall INVENTORY BookCode BranchNum OnHand 0180 1 2 0189 2 2 0200 1 1 0200 2 3 PUBLISHER PublisherCode PublisherName AH Arkham House AP Arcade Publishing BA Basic Books BP Berkley Publishing BY Back Bay Books CT Course Technology CXD1206: Databases 2 (July 2009) City Sauk City WI New York Boulder CO Boston New York Boston 1 Price 7.19 7.99 8.00 24.50 Paperback Yes Yes Yes No NumEmployees 10 6 15 9 (12 marks) WROTE BookCode AuthorNum 0180 3 0189 5 0200 18 0378 11 b) Sequence 1 1 1 1 i) What is functional dependency? (2 marks) ii) Based on Table 2, list THREE possible functional dependencies. (6 marks) Sid Sname Phone 100 John 487 2454 100 John 487 2454 200 Smith 671 8120 200 Smith 671 8120 200 300 Smith Russell 671 8120 871 2356 Course­ Course­ id description IS380 Database Concepts IS416 Unix Operating System IS380 Database Concepts IS416 Unix Operating System IS420 Data Net Work IS417 System Analysis Credit­ hours 3 Grade 3 B 3 B 3 B 3 3 C A A Table 2 iii) What is a superkey? List TWO superkeys from Table 2. (6 marks) iv) Table 2 suffers from anomalies. List the THREE anomalies and give an example of each of the anomaly based on the given table. (9 marks) c) Suppose that you have been given the table structure and data shown in Table 3, which was imported from an Excel spreadsheet. The data reflect that a professor can have multiple advisees, can serve on multiple committees, and can edit more than one journal. Attribute Name Sample Value Sample Value Sample Value EMP_NUM PROF_RANK 123 Professor EMP_NAME DEPT_CODE DEPT_NAME Ghee CIS Computer Info. Systems 104 Asst. Professor Rankin CHEM Chemistry PROF_OFFICE ADVISEE KDD­567 1215, 2312, 3233, 2218, 2098 118 Assoc. Professor Ortega CIS Computer Info. Systems KDD­562 2134, 2789, 3456, 2002, 2046, 2018, 2764 COMMITTEE_CODE PROMO, TRAF APPL, DEV JOURNAL_CODE JMIS, QED, JMGT BLF­119 3102, 2782, 3311, 2008, 2876, 2222, 3745, 1783, 2378 DEV JCIS, JMGT Table 3 Given the information in Table 3, CXD1206: Databases 2 (July 2009) SPR, TRAF 2 Sample Value 107 Assoc. Professor Smith ENG English PRT­345 2873, 2765, 2238, 2901, 2308 PROMO, SPR DEV i) ii) iii) Draw the dependency diagram indicating all the dependencies that you can observe. Identify the multivalued dependencies. Create the dependency diagrams to yield a set of table structures in 3NF. CXD1206: Databases 2 (July 2009) 3 (6 marks) (3 marks) (6 marks) Section B Answer any TWO questions from this section. Question 2 (25 marks) a) b) c) What is an object­oriented DBMS? (2 marks) In object oriented context explain: i) how do classes relate to objects ii) how do messages relate to methods (2 marks) (2 marks) With regards to database administration, explain what a recovery is? (3 marks) Assume that a DBMS is halfway through recording a transaction with several related updates, and someone trips over the computer’s power cord. Describe the steps the DBMS uses to protect and restore the database. (7 marks) Suppose that you have been hired as a consultant to choose a database system for your client’s application. For each of the following applications, state what type of database system (relational, object oriented, object relationalÍž do not specify a commercial product name) you would recommend. Justify your recommendation. i) a computer­aided design system for a manufacturer of airplanes ii) a system to track contributions made to candidates for public office iii) an information system to support the making of movies Question 3 (25 marks) Please refer to relational database schema in Diagram 1 where Fname – First name, Minit – Middle initial, Lname – Last name, Ssn – Social Security number, Bdate – birth date, Dno – Department number, Essn – Employee social security number, etc) . Suppose that all the relations were created by (and hence are owned by) user X, who wants to grant the following privileges to user accounts A, B, C, D, and E. CXD1206: Databases 2 (July 2009) 4 (3 marks) (3 marks) (3 marks) (2 marks) Diagram 1 (a) (8 marks) Account A can retrieve any relation except DEPENDENT and can grant any of these privileges to other users. (b) Account B can retrieve all the attributes of EMPLOYEE and DEPARTMENT except for SALARY, MGR_START_DATE and MGRSSN. (c) Account C can retrieve or modify WORKS_ON but can only retrieve the FNAME, MINIT, LNAME, SSN attributes of EMPLOYEE and the PNAME, PNUMBER attributes of PROJECT. (d) Account D can retrieve any attribute of EMPLOYEE or DEPENDENT and cannot modify DEPENDENT. (e) Account E can retrieve any attribute of EMPLOYEE but only for EMPLOYEE tuples that have DNO = 13. Write SQL statements to grant these privileges. Use views when appropriate. CXD1206: Databases 2 (July 2009) 5 (10 marks) (1 marks) (4 marks) Question 4 (25 marks) a) i) What is a deadlock? ii) How does it occur? iii) Draw a diagram to explain its situation. (3 marks) (2 marks) (7 marks) b) What are location transparency, replication and fragmentation transparencies? (9 marks) c) Explain the functions of shared and exclusive locks. (4 marks) ~ END OF PAPER ~ CXD1206: Databases 2 (July 2009) 6