UNIVERSITY OF LIMPOPO FACULTY OF SCIENCE AND AGRICULTURE SCHOOL OF MATHEMATICAL AND COMPUTER SCIENCES DEPARTMENT OF COMPUTER SCIENCE DEGREE AND DIPLOMA SUPPLEMENTARY/AEGROTAT EXAMINATION MAY/JUNE: 2019 MODULE: PAPER: P MARKS: 70 SCOA031 (INTRODUCTION TO DATABASE SYSTEMS) TIME: 2 HOURS INTERNAL EXAMINER: MR PS RAMALEPE SECOND EXAMINER: DR TI MODIPA EXTERNAL EXAMINER: PROF DB JORDAAN (NWU-Vaal) THIS PAPER CONSISTS OF SIX (06) PAGES INCLUDING COVER PAGE INSTRUCTIONS: 1. Answer all the questions 2. Write neatly and legibly SCOA031 MAY/JUNE SUPPLEMENTARY/AEGROTAT EXAMINATION 2019 Question 1 [20] 1.1. Define the following terms as applied in databases: [04] 1.1.1 Database management system 1.1.2 Data manipulation language 1.1.3 Subtype discriminator 1.1.4 Specialization hierarchy 1.2. What is the difference between partial completeness and total completeness? [02] 1.3. What is the most common design trap, and how does it occur? [02] 1.4. Briefly discuss the four potential costs of implementing a database system [08] 1.5. Briefly explain the concept of normalization as used in database system [02] 1.6. In a SELECT query, what is the difference between a WHERE clause and a HAVING clause? [02] ________________________________________________________________________________ Question 2 [25] 2.1 Use the descriptions of the attributes shown in Figure P6.2 to answer Questions 2.1.1 – 2.1.3 2|Page SCOA031 MAY/JUNE SUPPLEMENTARY/AEGROTAT EXAMINATION 2019 2.1.1 Draw the dependency diagram that is 1NF, and show all dependencies, including all partial and transitive dependencies. 2.1.2 [05] Remove the partial dependency and draw a new dependency diagram to achieve 2NF. [02] 2.1.3 Remove all transitive dependencies and draw a new dependency diagram to achieve the 3NF. [02] 2.2 The FlyRight Aircraft Maintenance (FRAM) division of the FlyRight Company (FRC) performs all maintenance for FRC’s aircraft. Produce a data model segment that reflects the following business rules: [16] All mechanics are FRC employees. Not all employees are mechanics. Some mechanics are specialized in engine (EN) maintenance. Some mechanics are specialized in airframe (AF) maintenance. Some mechanics are specialized in avionics (AV) maintenance. (Avionics are the electronic components of an aircraft that are used in communication and navigation.) All mechanics take periodic refresher courses to stay current in their areas of expertise. FRC tracks all courses taken by each mechanic—date, course type, certification (Y/N), and performance. FRC keeps a history of the employment of all mechanics. The history includes the date hired, date promoted, date terminated, and so on. (Note: The “and so on” component is, of course, not a real-world requirement. Instead, it has been used here to limit the number of attributes you will show in your design.) Given those requirements, create the Crow’s Foot ERD segment. Question 3 [25] 3.1 Use the database shown in Figure 3.3 to answer questions 3.1.1 - 3.1.3. 3|Page 2019 SCOA031 MAY/JUNE SUPPLEMENTARY/AEGROTAT EXAMINATION FIGURE 3.3 The Ch03_TransCo Database Tables 3.1.1 For each table, identify the primary key and the foreign key(s). If a table does not have a foreign key, write None. [03] 3.1.2 Do the tables exhibit entity integrity? For each table answer yes or no and then explain your answer. [03] 3.1.3 Do the tables exhibit referential integrity? For each table answer yes or no and then explain your answer. [03] 3.2 Consider the Employee table (EMP_1) Figure P3.4 to answer questions 3.2.1 -3.2.5 4|Page SCOA031 MAY/JUNE SUPPLEMENTARY/AEGROTAT EXAMINATION 2019 Figure P3.4 The contents of the EMP_1 table 3.2.1 Write the SQL code to enter the first two rows for the table shown in Figure P3.4 [02] 3.2.2 Assuming that the data shown in the EMP_1 table have been entered, write the SQL code that will list all attributes for job code 502. 3.2.3 Write the SQL code that will save the changes made to the EMP_1 table. [01] [01] 3.2.4 Write the SQL code to change the job code to 501 for the person whose employee number (EMP_NUM) is 107. After you have completed the task, examine the results, and then reset the job code to its original value. [03] 3.2.5 Write the SQL code to delete the row for the person named William Smithfield, who was hired on June 22, 2004, and whose job code classification is 500. (Hint: Use logical operators to include all of the information given in this problem. Remember, if you are using MySQL, will have to first disable “safe mode.”) 3.3 Study Figure 3.5 and answer questions 3.3.1 -3.3.2 5|Page [03] SCOA031 MAY/JUNE SUPPLEMENTARY/AEGROTAT EXAMINATION 2019 Figure 3.5 SimpleCo database table 3.3.1. Write a query that will generate a combined list of customers to include the duplicate customer records and show the resulting table. [03] 3.3.2. Modify the CUSTOMER table to include two new attributes: CUST_DOB and CUST_AGE. Customer 1000 was born on March 15, 1979, and customer 1001 was born on December 22, 1988. 6|Page [03]