1.8. Database and data modelling
A subsection of Computer Science, 9608, through 1. Theory Fundamentals
Listing 10 of 31 questions
A software development company has a relational database, SOFTWARE_MANAGEMENT. The database stores details of the customers who have purchased software, as well as the software and licences that customers have purchased. The SOFTWARE_MANAGEMENT database has the following tables: CUSTOMER_DETAILS(CustomerID, CompanyName, Address1, Address2, City) SOFTWARE_PURCHASED( SoftwareName, SoftwareDescription, CustomerID, LicenceType, LicenceCost, RenewalDate) Explain why this database is not in Third Normal Form (3NF). Refer to the tables in your answer. Do not attempt to normalise the tables. Give an example from the database SOFTWARE_MANAGEMENT for each of the following database terms. Term Example Entity Foreign key Attribute The company also develops computer games. They extend the relational database SOFTWARE_MANAGEMENT by adding a new table. The new table, GAME_DEVELOPMENT, stores details about the games and the software development teams creating them. The table shows example data in GAME_DEVELOPMENT. GameName Genre TeamNumber DevelopmentStage ManagerID Bunny Hop Platform Analysis 23KP Fried Eggs Retro Programming stage 1 9RTU Create‑a‑game Action Acceptance testing 11TF Complete the Data Definition Language (DDL) statement to create the table GAME_DEVELOPMENT. CREATE ………………………………………………………… ………………………………………………………… ( GameName VarChar, Genre VarChar, ………………………………………………………… ………………………………………………………… , DevelopmentStage VarChar, ManagerID VarChar, ………………………………………………………… (GameName) ); Another table, PRODUCT_MANAGER, is created. PRODUCT_MANAGER(ManagerID, FirstName, LastName) Complete the Data Manipulation Language (DML) statement to return the game name, genre and team number of all games managed by the product manager with the first name ‘James’ and the last name ‘Fitz’. ………………………………………………………… GameName, Genre, TeamNumber FROM GAME_DEVELOPMENT, PRODUCT_MANAGER WHERE PRODUCT_MANAGER.FirstName = "James" AND PRODUCT_MANAGER.LastName = "Fitz" AND ………………………………………………………………………………………………… = …………………………………………………………………………………………………… ;
9608_s20_qp_12
THEORY
2020
Paper 1, Variant 2
A company uses a relational database. The company stores data about its customers and their bank details. Explain the ways in which the database can be set up to only allow certain people to see the bank details. The database contains the following tables that store data about suppliers and stock. SUPPLIER(SupId, SupName, SupAddress, SupPhone, SupContactName) STOCK(StockId, SupId, StockName, StockImage, NumberInStock) Write Data Manipulation Language (DML) statements to return the supplier name, phone number and contact name, and the number of items in stock for the item with the stock ID of D930. The stock price needs to be included in the stock table. $10.55 and $299.99 are two examples of stock prices. Write Data Definition Language (DDL) statements to insert the attribute StockPrice into the table STOCK. Three examples of items stored in the data dictionary of a relational database are: Item Purpose Field name to store the names of fields so they cannot be repeated in a table Primary key to uniquely identify each record in a table Validation rule to ensure that data entered is sensible Identify three other examples of items stored in a data dictionary and give the purpose of each. Item 1 Purpose Item 2 Purpose Item 3 Purpose Draw one line from each database term to its matching description. Database term Description An attribute that could be a primary key but is not selected to be a primary key Logical schema An attribute in one table that is a primary key in another table Referential integrity The overview of a database structure Query processor An attribute or set of attributes that uniquely identifies each tuple Primary key Data between linked tables is consistent Secondary key Changing data to see what would happen in different scenarios The part of the DBMS that allows a user to search for data
9608_w21_qp_13
THEORY
2021
Paper 1, Variant 3
A company uses a relational database, EMPLOYEES, to store data about its employees and departments. The company uses a Database Management System (DBMS). The DBMS has a data dictionary. Describe what the data dictionary stores. The DBMS has a query processor. Describe the purpose of a query processor. Relationships are created between tables using primary and foreign keys. Describe the role of a primary and a foreign key in database relationships. In the company: • An employee can be a manager. • A department can have several managers and several employees. • An employee can only belong to one department. The EMPLOYEES database has three tables: EMPLOYEE_DATA( EmployeeID, FirstName, LastName, DateOfBirth, Gender, DepartmentNumber) DEPARTMENT(DepartmentNumber, DepartmentName) DEPARTMENT_MANAGER(DepartmentNumber, EmployeeID, role) Complete the entity-relationship (E-R) diagram for the EMPLOYEES database. EMPLOYEE_DATA DEPARTMENT DEPARTMENT_MANAGER Give three reasons why the EMPLOYEES database is fully normalised. Part of the EMPLOYEE_DATA table is shown. EmployeeID FirstName LastName DateOfBirth Gender DepartmentNumber 156FJEK Harvey Kim 12/05/1984 Male S1 558RRKL Catriona Moore 03/03/1978 Female F2 388LMDV Oscar Ciao 01/01/1987 Male F2 Write a Data Definition Language (DDL) statement to create the EMPLOYEES database. Write a DDL statement to define the table EMPLOYEE_DATA, and declare EmployeeID as the primary key. Write a Data Manipulation Language (DML) statement to return the first name and last name of all female employees in the department named Finance.
9608_s19_qp_13
THEORY
2019
Paper 1, Variant 3
9608_s20_qp_13
THEORY
2020
Paper 1, Variant 3
A clinic is staffed by several doctors. The clinic serves thousands of patients. Each day and at any one time, there is only one doctor in the clinic available for appointments. The clinic stores patient, doctor and appointment data in a relational database. Underline the primary key for each table in the following suggested table designs. PATIENT(PatientID, PatientName, Address, Gender) DOCTOR(DoctorID, Gender, Qualification) APPOINTMENT(AppointmentDate, AppointmentTime, DoctorID, PatientID) Complete the following entity-relationship (E-R) diagram for this design. The doctors are concerned that many patients make appointments but do not attend them. Describe the changes to the table designs that could be made to store this information. The doctors are about to set up a new clinic in the neighbouring village, SITE-B. The original location is identified as SITE-A. A new table is designed to store the ID of the doctor who is able to work at each site. DOCTOR-AVAILABILITY(DoctorID, Site) Five entries stored in the table are: DoctorID Site SITE-A SITE-A SITE-B SITE-B SITE-B State what this data shows about the availability of the doctor with the ID of 098. Opening a new clinic in the neighbouring village will not require any additional table for storing appointments. It will need a change to the existing appointment table design. Show the revised APPOINTMENT table. APPOINTMENT( ) The doctor with the ID of 117 has recently been allocated a new DoctorID of 017. Write an SQL script to update this doctor’s record in the database. UPDATE SET WHERE Describe why this update could cause problems with the existing data stored. Write an SQL script to display the date and time of all appointments made by the patient with the PatientID of 556.
9608_w17_qp_11
THEORY
2017
Paper 1, Variant 1
Questions Discovered
31