Databases (OCR A Level Computer Science): Exam Questions

47 mins19 questions
11 mark

The database supports ACID transactions. ACID stands for Atomicity, Consistency, Isolation and Durability.

Give one way that durability can be achieved for a completed transaction.

Did this page help you?

21 mark

Give one disadvantage of using record locking.

Did this page help you?

32 marks

OCR Insurance uses a computer system to calculate the price that customers pay for car insurance.

Customers’ details are stored in the flat file database table Customer

Describe one problem that would arise with the flat file database structure if a customer wanted to insure more than one car at the same time.

Did this page help you?

42 marks

Details of all users that have accessed the robot are stored in a database table called TblAccessLog. This table stores the username and user type of each user. When a user accesses the robot, the current date is added to the DateAccessed field for that user.

A selection of the data from this table is shown here. Username is the key field.

Username

UserType

DateAccessed

Mrphy003

User

08/05/21, 07/06/21, 08/06/21

Lwis076

Admin

17/04/21, 19/07/21

Bbby412

NotNeeded

01/06/21, 02/07/21, 14/07/21

Write an SQL statement to delete all records from the table TblAccessLog for users who have a UserType of "NotNeeded".

Did this page help you?

51 mark

State what is meant by the term ‘primary key’.

Did this page help you?

62 marks

Customers’ details are stored in the flat file database table Customer. An extract of the table is shown below.

Table showing user data includes username, first name, start date, package type, and package details like cost per month and adverts for each type.

Identify the foreign key used in the database and the table name where this is a foreign key.

Did this page help you?

72 marks

OCR Insurance uses a computer system to calculate the price that customers pay for car insurance.

Customers’ details are stored in the flat file database table Customer. An extract of the table is shown below.

CustomerID

Surname

Title

Phone

CarReg

JJ178

James

Mr

(0121) 343223

DY51 KKY

HG876

Habbick

Miss

(01782) 659234

PG62 CRG

EV343

Elise

Mrs

(07834) 123998

HN59 GFR

PG127

Pleston

Mr

(07432) 234543

JB67 DSF

State what is meant by the term ‘primary key’, identifying the primary key in the table above.

Did this page help you?

83 marks

A hotel stores data about rooms, customers and bookings in a database. Each customer can book multiple rooms and each room can be booked multiple times

Define what is meant by the term ‘foreign key’, giving one example of where a foreign key would be used in the hotel booking database.

Did this page help you?

13 marks

Explain how record locking can be used to ensure that the ACID principle of isolation is achieved when carrying out multiple transactions.

Did this page help you?

22 marks

State two requirements for a database to be in First Normal Form (1NF).

Did this page help you?

32 marks

Details of all users that have accessed the robot are stored in a database table called TblAccessLog. This table stores the username and user type of each user. When a user accesses the robot, the current date is added to the DateAccessed field for that user.

A selection of the data from this table is shown here. Username is the key field.

Username

UserType

DateAccessed

Mrphy003

User

08/05/21, 07/06/21, 08/06/21

Lwis076

Admin

17/04/21, 19/07/21

Bbby412

NotNeeded

01/06/21, 02/07/21, 14/07/21

Explain why the structure of TblAccessLog means that this database is not in First Normal Form (1NF).

Did this page help you?

45 marks

Customers’ details are stored in the flat file database table Customer. An extract of the table is shown below.

Table showing user data includes username, first name, start date, package type, and package details like cost per month and adverts for each type.

The Adverts field indicates if customers will be shown adverts. true indicates that customers will be shown adverts, and false indicates that adverts are not shown.

Write Structured Query Language (SQL) to return the Username and FirstName fields for all customers who see adverts.

Did this page help you?

53 marks

When new customers join the streaming service, their name, email address and contact details are captured so that they can be entered into the database.

Identify one method of capturing a new customer’s personal data, describing why this method is suitable.

Did this page help you?

62 marks

Sometimes a company may need to move or backup its data they hold about customers.

Identify two methods of exchanging data with other computer systems

Did this page help you?

72 marks

A database supports ACID transactions. ACID stands for Atomicity, Consistency, Isolation and Durability

Describe what is meant by a transaction being durable.

Did this page help you?

84 marks

OCR Insurance uses a computer system to calculate the price that customers pay for car insurance.

Customers’ details are stored in the flat file database table Customer. An extract of the table is shown below.

CustomerID

Surname

Title

Phone

CarReg

JJ178

James

Mr

(0121) 343223

DY51 KKY

HG876

Habbick

Miss

(01782) 659234

PG62 CRG

EV343

Elise

Mrs

(07834) 123998

HN59 GFR

PG127

Pleston

Mr

(07432) 234543

JB67 DSF

Write the SQL statement that would show only the CustomerID and Surname fields for customers with the Title “Miss” or “Mrs”.

Did this page help you?

95 marks

OCR Insurance uses a computer system to calculate the price that customers pay for car insurance.

Customers’ details are stored in the flat file database table Customer. An extract of the table is shown below.

CustomerID

Surname

Title

Phone

CarReg

JJ178

James

Mr

(0121) 343223

DY51 KKY

HG876

Habbick

Miss

(01782) 659234

PG62 CRG

EV343

Elise

Mrs

(07834) 123998

HN59 GFR

PG127

Pleston

Mr

(07432) 234543

JB67 DSF

Describe how the flat file database structure could be altered to efficiently allow each customer to insure multiple cars at the same time. (You may assume each car is insured to only one customer.)

Did this page help you?

104 marks

A hotel uses a computer system to keep track of room bookings. The hotel staff are able to query a database to discover which rooms are booked or which rooms are free.

The hotel stores data about rooms, customers and bookings in a database. Each customer can book multiple rooms and each room can be booked multiple times.

Draw an Entity Relationship Diagram for this database.

Did this page help you?

111 mark

Explain what is meant by the term ‘referential integrity’ and how this could potentially be broken.

Did this page help you?