IMIS HIGHER DIPLOMA QUALIFICATIONS DATABASE DEVELOPMENT (H4) Friday 3 rd June 2016 10:00hrs 13:00hrs DURATION: 3 HOURS Candidates should answer ALL the questions in Part A and THREE of the five questions in Part B. Part A carries 40% of the marks available and Part B carries 60%. Candidates should allocate their time accordingly. No reference material of any kind may be taken into the examination. [Turn over] Page 1 of 9
PART A. Answer ALL questions in this section Question A1 Describe two reasons why an attribute would have an index associated with it. - The main reason is to achieve performance. - Used to quickly locate data without having to search all rows in a table - Include examples of use up to 3 examples For example: o include to index a primary key field o Index attributes used most for join operations o Non-key attributes that are searched on frequently Question A2 Describe, with examples, what is meant by entity and referential integrity. Entity integrity applies to primary keys Referential integrity applies to foreign keys Entity integrity means no attribute of the primary key can be null Referential integrity means any values must either match a value in the related primary key value, or must be null Question A3 List five disadvantages of a distributed database system. Any 5 of the following, or equivalent ( each): - Complexity - Cost - Security - Integrity control more difficult - Lack of standards - Database design more complex Page 2 of 9
Question A4 Explain the term location transparency in the context of a distributed database management system. - Location is the middle level of distribution transparency - User knows data has been distributed, but does not know location of data - E.g., SELECT name FROM E1 UNION SELECT name FROM E2 - Database can be physically reorganised without impacting on programs that access them Question A5 Describe, with examples, two limitations of the file based approach. Two of the following, with examples: - Separation and isolation of data - Duplication of data - Data dependence - Incompatible file formats - Fixed queries for each limitation, up to for the examples. Question A6 Explain briefly what data mining means. An answer along the lines of the definition found in T1 is acceptable, which explains that data mining is the process of extracting previously unknown, comprehensible and actionable information for a large database and use it to make business decisions. Question A7 By means of a diagram, describe the three levels of the ANSI-SPARC Architecture. (5marks) The candidate should use a diagram to show the three levels: External, Conceptual and Internal levels. External should represent the way users view the data. Internal is how the DBMS and Operating System perceive the data. The conceptual level represents the mapping and independence between the external and internal levels.the levels separate the users view from the physical representation. Question A8 Show how the following relational heading can be created in SQL: Page 3 of 9
STAFF(staff_No, name, date_of_birth, salary) CREATE TABLE STAFF (staff_no NUMBER(6) PRIMARY KEY, Name VARCHAR(20), Date_of_birth DATE, Salary NUMBER(7,2)); for CREATE TABLE, for PRIMARY KEY, for attributes with appropriate data types and syntax. Question B9 PART B. Answer any THREE of the following FIVE questions. Use the following tables to answer the questions below: Employee Table Department Table Emp_No Emp_Name Start_Date Dept Dept_No Dept_Name 1234 John Smith 01-Jul-1983 10 10 Sales 2345 Julie Brown 15-May-2001 10 20 Research 3456 Tom Jones 01-Mar-2010 20 30 Human Resources 2245 Susan Sharp 01-Feb-2015 30 40 Manufacturing 1498 Peter Thomas 15-Sept-1999 20 3214 Vera Jones 25-Jun-1995 30 4512 Ali Patel 15-Oct-2005 10 a. Write a SQL statement to produce a list of all the records in the Employee Table. SELECT * FROM EMPLOYEE; 1 for SELECT 1 for * 1 for correct table name (3 marks) b. Write a SQL statement to produce the Emp_No, Emp_Name, Start_Date of all employees who work in department 20. (4 marks) SELECT Emp_No, Emp_name, Start_Date FROM Employee WHERE Dept_No = 20 for SELECT Page 4 of 9
for correct column list for correct table name for correct WHERE modifier c. Write a SQL statement to produce a list of employee names (Emp_Name) who started on or after the 1 st January 2000. SELECT Emp_Name FROM Employee WHERE Start_Date >= 01-Jan-2000 ; for SELECT for correct column list for correct table name for correct WHERE modifier (4 marks) d. Write a SQL statement that produces a list of department names that have no employees. Can be written using an OUTER JOIN or subquery, for example: SELECT Dept_Name from Department WHERE Dept_No NOT IN (SELECT Dept_No FROM Employee) for SELECT for correct column list for correct table names for correct WHERE modifier e. It has been decided that the budget for the department needs to be stored, for example: Dept_No Dept_Name Budget 10 Sales 10,000 20 Research 500,000 30 Human Resources 15,000 40 Manufacturing 25,000 Write a SQL statement to make this change to the table structure. (4 marks) ALTER TABLE DEPT ADD (Budget NUMBER(6)); for ALTER TABLE Page 5 of 9
for ADD for BUDGET for suitable type (e.g. number or currency type) (Total 20 marks) Question B10 Bill Inmon provides a definition of a data warehouse that they are: a) Subject-oriented; The data warehouse is organised round subject areas, such as customers, or sales, rather than application areas, such as stock control. This is due to storing decision support data rather than application oriented data. b) Integrated; A data warehouse will bring together data from various sources.the source data may be in different formats that are inconsistent. For example, metric and imperial measurements. The integrated data needs to be made consistent to give a unified view. c) Time-variant; Historical data is kept in a data warehouse. Data in the warehouse is only accurate at a given time or time period, such as 3 months. The data represents a series of snap-shots. In an OLTP system only the most recent data is usually kept. For example, an OLTP system may hold the most recent address of a customer, where a data warehouse holds all addresses associated with a customer. d) Non-volatile Data in a data warehouse is not updated in real-time, instead data is refreshed from operational systems on a regular basis. Once in the data warehouse the data will not change, unlike OLTP systems, where updates will replace existing data. The data warehouse continually absorbs new data, incrementally integrating it with the previous data. Describe, with examples, what each of these mean and explain how they contrast to an online transaction processing system (OLTP). (Total 20 marks) Question B11 A College maintains information about departments, courses, modules, students and staff. Page 6 of 9
A course has a course code (unique), title and start date A module has a module number (unique), name and number of credits A department has a department name (unique) and location A student has a number (unique), name and address A member of staff has a staff number (unique), name and salary A course consists of a number of modules. A module is associated with one course only Each student can take a number of modules. Each module can be taken by a number of students. Some new modules may not have any students yet Each student obtains an overall grade for each module they take Each module is led by a member of staff who belongs to a department A department employs a number of staff Each department runs a number of courses. A course is run by only one department Draw a conceptual module for the above requirements, showing the entities, relationships and attributes. State any assumptions made Sample ER diagram below. UML class diagrams may also be produced, or any other appropriate conceptual diagram per entity per relationship ( for correct cardinality and for correct particiaption constraints) for correct placement of attributes. (Total 20 marks) Page 7 of 9
Question B12 In the context of an international bank, describe what each of the following roles would involve in a database environment: Data administrator (DA) - Responsible for management of the data - Includes planning, development, policies and procedures - Responsible for the conceptual and logical design - Liaises with senior managers - Ensures database system would fulfil requirements of the bank, ensures legal requirements covered, such as the UK DPA Database administrator (DBA) - Responsible for the physical requirements of the database - Includes physical design and implementation, security - Maintenance of the database - More technically oriented than data administrator, DBA would be more concerned with keeping the banking systems up and running efficiently Database designer - Can be two types: logical and physical designers - Logical concerned with identifying the data requirements, defining the entities, relationships, business rules - Will produce conceptual and logical designs, such an ER diagram and the mapping to relational tables - Physical designer concerned with how logical design is physically realised, such as creating the tables and any constraints - Would include any security and performance features, such as indexes - In a banking environment logical designer may liaise with DA and maybe others to produce the design End users - These are the users of the database systems developed - Can be two types: naïve and sophisticated - Naïve would be the customers of the bank, most banks would now have an online presence, so system has to be usable by users with little technical skills - Sophisticated could be non-database staff working for the bank, who may have some knowledge of the database structure and could want access via a database tool, or high level language such as SQL 5 marks each per point, up to 5 for each role. Should include a bank specific example for full marks. (Total 20 marks) Page 8 of 9
Question B13 a) Garbage in Garbage out (GIGO) is a term that could be applied to a poorly maintained database system. Describe, with examples, 4 techniques that could be used to control the integrity of a database system. The following can be discussed: - Required data and the use of NULL - Domain constraints - Entity integrity - Referential integrity - General constraints 16 marks 4 marks each Other appropriate techniques will be accepted. for technique, for description for example, up to 4 per technique. b) Describe a tool that can be used to monitor the performance of a database management system (DBMS) and explain how the tool helps a Database Administrator (DBA). 4 marks This question is open to a number of answers, different tools provided by Oracle, DB2, SQL Server, etc. can be included. E.g., Oracle s SQL Tuning Advisor, Automatic Database Diagnostic Monitor. For full marks, the candidate should say why the tool helps a DBA. END OF EXAMINATION (Total 20 marks) Page 9 of 9