You are on page 1of 43

Databases

JUNE 2012
1

A database is designed to store data about students at a college and the subjects that they
study.

All students are based in a tutor group


A tutor supervises all the students in their tutor group
Each subject has one subject teacher only
Students study a number of subjects

The following table StudentSubjects was a first attempt at the database design.
Table: StudentSubjects
StudentName
Tom

TutorGroup
6

Tutor
SAN

Joe

MEB

Samir

SAN

Subject
Physics
Chemistry
Gen. Studies
Geography
French
Computing
Chemistry
Maths
Gen. Studies

Level SubjectTeacher
A
SAN
A
MEB
AS
DIL
AS
ROG
AS
HEN
A
VAR
A
MEB
A
COR
A
DIL

(a) (i) Explain why the table is not in First Normal Form (1NF).

[1]
(ii) Explain your answer by referring to the above data.

[1]

(b) The design is changed to the following:


Student (StudentName, TutorGroup, Tutor)
StudentSubjectChoices (StudentName, Subject, Level, SubjectTeacher)

Using the data given in the original table, show how this data is now stored in the
revised table designs.
Table: Student
StudentName

TutorGroup

Tutor

Table: StudentSubjectChoices
StudentName

Subject

Level

SubjectTeacher

[3]

(c) (i) Explain what is meant by a primary key.

[2]
(ii) A student is not allowed to choose the same subject at A Level and AS.
What is the primary key of table StudentSubjectChoices?
[1]

(iii) There is a relationship between tables Student and StudentSubjectChoices.


Explain how the relationship is established using a primary key and foreign key.

[2]

(d) The design of table StudentSubjectChoices is:


StudentSubjectChoices (StudentName, Subject, Level, SubjectTeacher)
Explain why this table is not in Second Normal Form (2NF).

[2]

(e) The design of table Student is:


Student (StudentName, TutorGroup, Tutor)
Explain why this table is not in Third Normal Form (3NF).

[2]

JUNE 2012

A database is designed to store data about all aircraft owned by an airline and the flight
schedules.
The following table AircraftSchedule was a first attempt at part of the database design.
Table: AircraftSchedule
AircraftID
1

Type
747

YearBought
1998

747-400

2007

747-400

2007

FlightCode
2032
1187
1326
1556
1426
1427
5564
7865
1090
1165

Departure
Delhi
Singapore
Melbourne
Tokyo
Bristol
Amsterdam
Bristol
Rome
London
New York

Arrival
Singapore
Melbourne
Tokyo
Delhi
Amsterdam
Bristol
Rome
Istanbul
New York
Boston

(a) (i) Explain why the table is not in First Normal Form (1NF).

[1]
(ii) Explain your answer in terms of the data above.

[1]

(b) The design is changed to the following:


Aircraft (AircraftID, Type, YearBought)
Schedules (FlightCode, Departure, Arrival)
Using the data given in the original table:
(i) Show what data is now stored in the table Aircraft.
Table: Aircraft
AircraftID

Type

YearBought

[1]
(ii) How many records are now stored in table Schedules?
[1]

(c) (i) Explain what is meant by a primary key.

[2]
(ii) What is the primary key of table Aircraft?
[1]

(d) (i) Explain what is meant by a foreign key.

[2]
(ii) State what foreign key needs to be added to the Schedules table design.
[1]

(e) An additional table Airport is designed as shown:


Airport (AirportName, Country, NoOfRunways)
Explain why this table is in Third Normal Form (3NF).

[2]

(f) The normalisation process is designed to eliminate data inconsistency.


Explain what is meant by data inconsistency.

[1]

NOVEMBER 2012

(a) In database design:


(i) Describe what is meant by a foreign key.

[2]
(ii) Explain how keys are used to implement a one-to-many relationship between the
two entities X and Y shown below:
Entity X

Entity Y

[3]

(b) A company has a number of products for sale and receives orders from customers.

Customers are given a CustomerID and other customer data are recorded
Each product has a ProductID and other product data are recorded
Over a period of time a customer will place many orders, and each product can
appear on many customer orders
You should assume:
o all orders are for one product only,
o on any given day a customer will place at most one order.

A table description can be expressed as:


TableName(Attribute1, Attribute2, Attribute3, ...)
The primary key is indicated by underlining one or more attributes.
(i) Describe the given data model by adding two attributes to the Customer table
and two attributes to the Product table.
,

Customer(CustomerID,
Product(ProductID,

[2]

[2]

(ii) Give the attributes for the Order table, showing the primary key.
You should not create an OrderID for this table.
Order(

(c) In database design, unnecessary data duplication should be avoided.


Explain, using an example, what is meant by data duplication.

[2]

NOVEMBER 2012

(a) In database design:


(i) Explain what is meant by a foreign key.

[2]
(ii) Explain how keys are used to implement the one-to-many relationship between the
two entities X and Y shown below.
Entity X

Entity Y

[3]

(b) A company offers training courses to its employees.

Each employee is given a unique EmployeeID


Each course has a unique CourseCode
Over a period of time an employee will enrol on many courses
Each course will be attended by many employees
An employee never enrols on a particular course more than once.

A table description can be expressed as:


TableName(Attribute1, Attribute2, Attribute3, ...)
The primary key is indicated by underlining one or more attributes.
(i) Add two attributes to each of the Employee and Course tables.
Employee(EmployeeID,
Course(

,
,

)
)

[3]

(ii) A third table, CourseEnrolment, will record which employee enrolled on which
courses.
State two essential attributes for this table. Show the primary key.
You should not create a CourseEnrolmentID for the table.
CourseEnrolment(

[2]

(c) Storing data in flat files has been replaced by storing data in relational database tables.
Explain how the use of a relational database reduces data redundancy.

[2]

NOVEMBER 2012

(a) In database design:


(i) Describe what is meant by a primary key.

[2]
(ii) Explain how keys are used to implement a one-to-many relationship between the
two entities X and Y shown below:
Entity X

Entity Y

[3]

(b) A College library has a stock of books which are loaned to students.

Each book has a BookID and other data about each book are recorded
Each student has a StudentID starting with the year of entry e.g. 2010jamesd
Other data about each student are also recorded

When a loan is made data are recorded. Any book may be loaned by a particular
student more than once.
However, you can assume that the same book is never loaned out to the same student
on the same day.
A table description can be expressed as:
TableName(Attribute1, Attribute2, Attribute3, ...)
The primary key is indicated by underlining one or more attributes.
(i) Describe the given data model by adding two attributes to the Student table and
two attributes to the Book table.
,

Student(StudentID,
Book(BookID,

[2]

[2]

(ii) Give the attributes for the Loan table below, showing the primary key.
You should not create a LoanID for this table.
Loan (

(c) In database design, data inconsistency must be avoided.


Explain, using an example, what is meant by data inconsistency.

[2]

JUNE 2013

A hospital has a number of doctors and a number of wards. A ward has a number of
patients. A patient may be treated by more than one doctor and a doctor treats many
patients.
Data is to be recorded in a relational database and the tables include DOCTOR and
PATIENT.
(a) (i) What is the relationship between DOCTOR and PATIENT?
[1]
(ii) Show this relationship with an entity-relationship (E-R) diagram.

[1]
(iii) Draw an E-R diagram showing a database design which can be produced so that
the doctor and patient data are fully normalised.

Explain how the relationships are implemented.

[4]

(b) (i) What is the relationship between WARD and PATIENT?


[1]
(ii) Show this relationship with an E-R diagram.

[1]

(c) Two of the incomplete table designs are:


PATIENT(PatientID, PatientName, Address, NextOfKin)
WARD(WardName, NurseInCharge, NumberOfBeds,
NumberOfOccupiedBeds, Specialism)
Explain how the relationship between PATIENT and WARD is implemented.

[2]

(d) The following Data Manipulation Language query is run.


SELECT WardName
FROM WARD
WHERE NumberOfOccupiedBeds < NumberOfBeds
What useful information is produced for the Hospital Administrator?

[2]

JUNE 2013

A database is created to store data about all the football clubs who play in a number of
different leagues.

Each club runs a number of different teams (Men, Women, Boys, Girls).
Each club has a number of players.
A player can only be registered with one club.
Each club team plays in a league.

Data is to be recorded in a relational database and the tables include CLUB and LEAGUE.
(a) (i) What is the relationship between CLUB and LEAGUE?
[1]
(ii) Show this relationship with an entity-relationship (E-R) diagram.

[1]
(iii) Draw an E-R diagram showing a database design which can be produced so that
the club and league data are fully normalised.

Explain how the relationships are implemented.

[4]

(b) (i) What is the relationship between CLUB and PLAYER?


[1]
(ii) Show this relationship with an E-R diagram.

[1]

(c) Two of the incomplete table designs are:


CLUB(ClubName, GroundName, Address, ClubSecretaryName)
PLAYER(PlayerRegistrationNo, PlayerName, Gender, DateOfBirth,
PreferredPosition)
Explain how the relationship between CLUB and PLAYER is implemented.

[2]

(d) The following Data Manipulation Language query is run.


SELECT PlayerRegistrationNo, PlayerName
FROM PLAYER
WHERE Gender=F AND PreferredPosition=Defender
What useful information is produced from this query?

[2]

NOVEMBER 2013
8

Cross country runners take part in races.

A runner must be registered with one club only and club names are unique.
A club has runners; each runner has a unique national MemberID.
Each race is organised by a club and the Club Secretary records which runners are
entered for each race.
Runners may enter any race.
There is only one race on any one day.

At present each club records the data for the competition races it organises. The data is
stored in flat files.
(a) Describe three advantages that a relational database would have over the use of flat
files.
1

3
[3]

(b) (i) What is the relationship between runner and race?


[1]
(ii) What is the relationship between club and race?
[1]

(c) A database solution is to be developed.


Two of the tables are RUNNER and RACE.
(i) Draw an entity-relationship (E-R) diagram showing a database design which can
be produced so that the runner and race data are fully normalised.

(ii) Explain how the relationships are implemented.

[2]

(d) The following table design is suggested for RUNNER.


RUNNER(MemberID, RunnerName, RunnerDOB, ClubName, ClubAddress)
This is poorly designed.
(i) Is this table in First Normal Form (1NF)?
Explain.

[1]
(ii) Is this table in Second Normal form (2NF)?
Explain.

[1]
(iii) The table is not in Third Normal Form (3NF).
Explain.

[1]
(iv) Using only the attributes given in the RUNNER table above, produce a new design
which is fully normalised.
The table descriptions should be expressed as:
TableName(Attribute1, Attribute2, Attribute3, ...)

[2]

(e) Explain why all tables in the final design should be fully normalised.

[2]

(f) The table to store the race data has the following design:
RACE(RaceDate, RaceStartTime, StartVenue, Distance,
OrganisingClubName)
Write a Data Manipulation Language (DML) query to report all races after the 1st
January 2013 which are less than 10 km. Display the race date and organising club
name only.
Use the keywords SELECT, FROM, WHERE.

[3]

NOVEMBER 2013
9

Customers order products from a website.

An order contains one or more products.


Over time, a customer places many orders.
A product will appear on many customer orders.
Each product is sourced from a single supplier and a number of suppliers are used.
A supplier can supply more than one product.

At present the company stores and manages all the data using flat files.
(a) Describe three advantages that a relational database would have over the use of flat
files.
1

3
[3]

(b) (i) What is the relationship between product and supplier?


[1]
(ii) What is the relationship between product and order?
[1]

(c) A database solution is to be developed.


Two of the tables are PRODUCT and ORDER.
(i) Draw an entity-relationship (E-R) diagram showing a database design which can
be produced so that the product and order data are fully normalised.

[2]

(ii) Explain how the relationships are implemented.

[2]

(d) The following table design is suggested for PRODUCT.


PRODUCT(ProductID, ProductDescription, RetailPrice, SupplierID,
SupplierName, SupplierTelNumber)
This is poorly designed.
(i) Is this table in First Norm Form (1NF)?
Explain.

[1]
(ii) Is this table in Second Normal form (2NF)?
Explain.

[1]
(iii) The table is not in Third Normal Form (3NF).
Explain.

[1]
(iv) Using only the attributes given in the PRODUCT table above, produce a new design
which is fully normalised.
The table descriptions should be expressed as:
TableName(Attribute1, Attribute2, Attribute3, ...)

[2]

(e) Explain why all tables in the final design should be fully normalised.

[2]

(f) The table to store the order data has the following design:
ORDER(OrderNo, OrderDate, OrderTime, IsPaid, OrderAmountPaid,
PaymentMethod, CustomerID)

IsPaid has data type Boolean


PaymentMethod has data type Char with possible values: C - credit card,
D - debit card, A - account customer

Write a Data Manipulation Language (DML) query to report orders which were placed
on the 15 January 2013 and paid for using a debit card. Show the customer ID and
order number only.
Use the keywords SELECT, FROM, WHERE.

[3]

NOVEMBER 2013

10 A car hire company in a large town hires out cars to customers.

There are five depots.


A number of cars are based at each depot.
Each car registration number is unique.
Each customer hire is for a single car only.
Customers may return for future car hires.
A customers future hire may involve a different car.

At present the company records all car, customer and hire data in flat files.
(a) Describe three advantages that a relational database would have over the use of flat
files.
1

3
[3]

(b) (i) What is the relationship between car and customer?


[1]
(ii) What is the relationship between depot and car?
[1]

(c) A database solution is to be developed.


Two of the tables are CAR and CUSTOMER.
(i) Draw an entity-relationship (E-R) diagram showing a database design which can
be produced so that the car and customer data are fully normalised.

[2]

(ii) Explain how the relationships are implemented.

[2]

(d) The following table design is suggested for CAR.


CAR(CarRegistrationNo, CarMake, CarModel, HirePriceCode, Dep
DepotAddress, DepotManager)
This is poorly designed.
(i) Is this table in First Norm Form (1NF)?
Explain.

[1]
(ii) Is this table in Second Normal form (2NF)?
Explain.

[1]
(iii) The table is not in Third Normal Form (3NF).
Explain.

[1]
(iv) Using only the attributes given in the CAR table above, produce a new design
which is fully normalised.
The table descriptions should be expressed as:
TableName(Attribute1, Attribute2, Attribute3, ...)

[2]

(e) Explain why all tables in the final design should be fully normalised.

[2]

(f) The table to store the hire data has the following design:
HIRE(HireID, CarRegistrationNo, HireBookingDate, HireStartDate,
NoOfDays, HireRate, CustomerID)
Write a Data Manipulation Language (DML) query to report all hire bookings made for
car registration 456431 with customer C674. Display the customer ID and hire ID only.
Use the keywords SELECT, FROM, WHERE.

[3]

JUNE 2014

11 A company hires vehicles to customers. A database is to be created to record data for all hire
transactions.
The company has a number of depots in different towns. Each town has one depot only. A
number of vehicles are available for hire. Each vehicle is based at one of the depots. Every
vehicle starts and ends a hire from its base depot.
Depot data consist of:
Depot town name
Depot address
Vehicle data consist of:
A unique registration number
A vehicle type code. Vehicles are coded as SC Small Car, LC Large Car or V Van.
Vehicle mileage
Customer data consist of:
Unique Customer ID
Customer address
Data for each hire transaction consist of:
Customer ID
Vehicle registration number
Date the booking was made
Start date of the hire
Return date
Driving licence check. A check is carried out to confirm that customers have a valid driving
licence and this is recorded. This check is done when the customer shows their driving
licence when they collect the vehicle.
Hire charge
(a) At first, the company used a single table named DepotVehicle. A sample of the tables
data is shown below.
DepotTown

RegistrationNo

VehicleType

0987

SC

0988

SC

0991

0945

1431

SC

1476

LC

Dhaka

Kumba

Explain why the table is not in normal form.

[2]

The final design uses these four entities:

Depot
Vehicle
Customer
Hire.

(b) Consider the relationship between Depot and Vehicle.


(i) Draw the entity-relationship (E-R) diagram.

[1]
(ii) Complete the description for the Vehicle and Depot tables using the notation:
TableName(Attribute1, Attribute2, )
where the underlined attribute indicates the primary key.
Vehicle(

Depot(

[4]

(c) The Customer and Hire tables (with the primary keys not shown) are as follows:
Customer(CustomerID, CustomerAddress)
Hire(CustomerID, DateBooked, RegistrationNo,
StartDate, ReturnDate, LicenceChecked, HireCharge)
Consider the relationship between Customer and Hire.
(i) Draw the E-R diagram.

[1]
(ii) Explain how this relationship between Customer and Hire is modelled using the given
attributes.

[2]

(d) The following Data Manipulation Language (DML) query is run:


SELECT RegistrationNo
FROM Hire
WHERE (StartDate < Now() ) AND (ReturnDate > Now() );
Note: Now() is a function which returns the current date and time.
Describe what useful information is produced by the query.

[2]

(e) A query is needed to list the depot and registration number for all small car vehicles.
Write the query in Data Manipulation Language (DML).

[3]

(f) On 05/04/2014, customer 085 booked a vehicle hire. This hire will start on 13/04/2014.
When the customer arrives, the receptionist will check their driving licence. If the licence is
valid, the value of the licence check attribute, of the correct Hire record, must be updated.
Complete the Data Manipulation Language (DML) command to make the change.

UPDATE Hire
SET
WHERE CustomerID = '085' AND

[2]

JUNE 2014
12 Paintings by various artists are on display in art galleries all over the world. When a gallery holds
an exhibition, it may display paintings:

from its own stock,


or borrowed from other galleries,
or both.

A database is to be created. It will store data about artists, paintings, galleries and exhibitions.
Artist data consist of:
artist name (unique).
Painting data consist of:

a unique reference number (recognised by all galleries)


painting title
artist name
date (year only)
name of the gallery owning the painting.

Gallery data consist of:


gallery name (unique)
country.
An exhibition only takes place once at one gallery and shows either:
paintings for a single artist only, e.g. the Da Vinci exhibition at the National Gallery in London
in 2011, or
paintings by a number of artists.
Exhibition data consist of:

exhibition title (unique)


gallery name
exhibition artist (if a single artist only, otherwise contains an empty string)
start date
closing date
all paintings which are included in the exhibition.

Painting-in-exhibition data consist of:

exhibition title (unique)


painting reference number
loan fee.

When a gallery lends a painting to another gallery, it may charge a loan fee.

The database design consists of five entities. These are shown in the entity-relationship
(E-R) diagram.
Gallery

Exhibition
Features

ExhibitionPainting

Owns

Painting

Artist

Paints

(a) Consider the relationship between Gallery and Exhibition.


(i) Draw this relationship on the E-R diagram above.

[1]

(ii) Complete the description for the Gallery and Exhibition tables. Use the notation:
TableName(Attribute1, Attribute2, ...)
where the underlined attribute indicates the primary key.
Gallery (

Exhibition (

)[4]

(b) The Painting and ExhibitionPainting entities (with the primary keys not shown) are
as follows:
Painting(PaintingRefNo, PaintingTitle, ArtistName, PaintingDate,
GalleryName)
ExhibitionPainting(ExhibitionTitle, PaintingRefNo, LoanFee)
(i) What is the primary key of table ExhibitionPainting?
[1]
Consider the relationship between Painting and ExhibitionPainting.
(ii) Draw this relationship on the E-R diagram.

[1]

(iii) Explain how this relationship is modelled using the given attributes.

[2]

(c) Additional data are to be stored about each artist as follows:


Artist(ArtistName, Nationality, YearBorn, YearDied)
The following Data Manipulation Language (DML) query is run.
SELECT PaintingRefNo
FROM Painting, Artist
WHERE (Artist.ArtistName = Painting.ArtistName) AND
(YearBorn >= 1900) AND (YearDied <= 2000);
Identify what useful information is produced by the query.

[2]

(d) Write a DML query to display the painting reference number and painting title for all paintings
by Da Vinci.

[3]

(e) The painting The Guitar Player was in the Secrets and Silence exhibition. The
ExhibitionPainting table has a record for this. In the record:

The painting is referred to by its reference number, 9065.


The loan fee is recorded as $10000. This is an error there was no charge made for
the loan by the loaning gallery.

Complete the DML command to amend this record.


UPDATE
SET
WHERE (ExhibitionTitle = 'Secrets and Silence')
AND (

);

[3]

(a) (i) The table/each student has a repeated group of attributes // each student has a number
of subjects
[1]
(ii) StudentName, TutorGroup and Tutor would need to be repeated for each record

(b)
Table: Student
StudentName TutorGroup
Tom
Joe
Samir

6
7
6

Table: StudentSubjectChoices
Tutor
Student
Subject
Name
SAN
Tom
Physics
MEB
Tom
Chemistry
SAN
Tom
Gen Studies
Joe
Geography
Joe
French
Samir
Computing
Samir
Chemistry
Samir
Maths
Samir
Gen. Studies

Level
A
A
AS
AS
AS
A
A
A
A

Mark as follows ....


Complete Student table
Repetition of StudentName in StudentSubjectchoices table
Complete columns 2, 3, and 4

[1]

Subject
Teacher
SAN
MEB
DIL
ROG
HEN
VAR
MEB
COR
DIL
[1]
[1]
[1]

(c) (i) primary key...


- an attribute/combination of attributes
- chosen to ensure that the records in a table are unique // used to identify a record/tuple
[2]
(ii) StudentName + Subject Correct Answer Only

[1]

(iii) - there is a one-to-many relationship // Student is the one side table


StudentSubjectChoices is the many side table.
- The primary key (attribute StudentName) in Student
- Links to StudentName in the StudentSubjectChoices table
- (StudentName in the) StudentSubjectChoices table is the foreign key // StudentName
is the foreign key that links the two tables
[MAX 2]
(d) - There are non-key attributes ...
- SubjectTeacher ...
- dependent only on part of the primary key (i.e. Subject) // partial dependency
(e) - There are dependent non-key attributes // there are non-key dependencies
- TutorGroup is dependant on Tutor // Tutor is dependent on TutorGroup

[MAX 2]

[2]
[Total: 14]

(a) (i)

The table has a repeated group of attributes // each aircraft has a repeated group of
attributes
[1]

(ii) AircraftID, Type and YearBought would have to be repeated for all records // FlightCode,
Departure and Arrival are the repeated group
[1]
(b) (i) The Aircraft table would contain:
AircraftID

Type

YearBought

747

1998

747400

2007

747400

2007
[1]

(ii) 10 records

[1]

(c) (i) primary key


- an attribute/combination of attributes
- chosen to ensure that the records in a table are unique // used to identify a record/tuple
[2]
(ii) AircraftID
(d) (i) foreign key
An attribute/field in one table
Which links to the primary key in another table
(ii) AircraftID
(e) - the two non-key attributes // Country & NumberOFRunways
- are not dependant on each other

[1]

[2]
[1]

[2]

(f) data inconsistency ...


The data value in one table does not match up with what should be the same data value in a
second table.
[1]
[Total: 13]

(a) (i)

-An attribute/or combination of attributes A field


-Which (links to/is) the primary key in a second / another table

[2]

(ii) -the primary key from Entity X


-Matches to the foreign key
-The same key in table Y

[3]

(b) (i) -Two sensible attributes for Customer (but none which relate to the Product or Order tables)
-Two sensible attributes for Product (but none which relate to the Customer or Order
tables)
[2]
(ii) -Order attributes include CustomerID + ProductID
-Primary key of CustomerID + OrderDate

[2]

(c) Data duplication


-the same data is (unnecessarily) repeated in a second table
-Duplication means that data will be redundant in one of the tables
-A consequence of duplication is that data can become inconsistent

[2]
[Total: 11]

(a) (i)

An attribute/or combination of attributes


Which (links to/is) the primary key in another table

(ii) the primary key


Matches/links/connects to a foreign key
Primary in X foreign key in Y

[2]

[MAX 3]

(b) (i) Two sensible attributes for Employee (and do not relate to the Course or
CourseEnrolment tables)
CourseCode shown as the primary key
One sensible non-key attribute for Course (and does not relate to the Employee or
CourseEnrolment tables)
(ii) EmployeeID, CourseCode
Primary key of EmployeeID + CourseCode

(c) unnecessary/avoids data duplication/repetition


in normalised relational database tables (addresses the issue)

[3]

[2]

[2]
[Total: 12]

(a) (i)

-An attribute/or combination of attributes


-Which ensures the records in the table are unique

[2]

(ii) -the primary key from Entity X


- Matches to the foreign key
-Many records from entity Y will have a matching record in entity X

[3]

(b) (i) -Two sensible attributes for Student (but none which relate to the Book or Loan tables)
- Two sensible attributes for Book (but none which relate to the Student or Loan tables)
[2]
(ii) Loan table
-Loan attributes include StudentID and BookID
-Primary key StudentID_+ BookID + IssueDate

[2]

(ii) Data inconsistency


-Copies of a data item appear in a table and are not consistent with a copy in a second
table
-For example - a person who changes address - address changed in one table but
original address still appears in some other table
[2]
[Total: 11]

(a) (i)

Many-to-many

[1]

(ii) E-R diagram

[1]
(iii)

Link table drawn

[1]

2 one-to-many relationships

[1]

primary key in DOCTOR links to foreign key in link table

[1]

primary key in PATIENT links to foreign key in link table

[1]

No mention of foreign key scores max 1 for final two points


(b) (i) One to many

[1]

(ii) E-R diagram

[1]
(c) The primary key of table WARD - WardName

[1]

Matches to WardName in the PATIENT table

[1]

(d) Displays a list of the wards (names)


R. Number of wards
Which has unoccupied beds available
R. the condition explained using the attribute identifiers

[1]
[1]
[Total: 12]

(a) (i)

Many CLUBs play in many LEAGUEs.

(ii) E-R diagram

[1]
[1]

(iii)

Link table drawn


2 x one-to-many relationships

[1]
[1]

primary key in CLUB links to foreign key in link table


primary key in LEAGUE links to foreign key in link table

[1]
[1]

No mention of foreign keys scores max 1 for final mark points


(b) (i) One CLUB has many PLAYERs
(ii) E-R diagram

[1]

[1]

(c) The primary key of table CLUB ClubName


Matches to ClubName in the PLAYER table

[1]

(d) Displays a list of the player names and registration numbers


Who are female defenders

[1]
[1]

[1]

[Total: 12]

(a) Security is improved/better managed


[1]
Different users can have different views of/access to data
[1]
Program-data independence // Changing a field does not require an applications
program re-write
[1]
Queries and reports quickly produced
[1]
Reduced data duplication/redundancy
[1]
Reduced data inconsistencies
[1]
Better managed data integrity/data validation // Validation code does not need to be present
in all applications programs
[1]
If implemented with a DBMS it will allow concurrent access to the database
[1]
MAX 3
(b) (i) many runners compete in many races // many-to-many // M:m
(ii)

[1]

one club organises many races // one-to-many // 1:M

[1]

Intermediate table (not labelled RUNNER, RACE, CLUB, etc.)


2 X one-to-many relationship

[1]
[1]

(c) (i)

(ii) Primary key of RACE/Primary key RaceDate


// Primary key of RUNNER/Primary key MemberID
Is used as a foreign key in the link table
(d) (i) (Yes) since there is a not a repeated group of attributes
(ii) (Yes) Since there is only a single attribute primary key
// there are no partial dependencies
// all non-key attr. are dependent on the primary key

[1]
[1]
[1]

[1]

(iii) There are dependent non-key attributes // ClubAddress is dependant on ClubName [1]
(iv) RUNNER(MemberID, RunnerName, RunnerDOB, ClubName)
CLUB(ClubName, ClubAddress)

[1]
[1]

If primary key not indicated penalise once only


(e) Avoids data duplication/repeated data
Avoids data inconsistencies
Ensures data integrity

[1]
[1]
[1]

(f) SELECT RaceDate, OrganisingClubName


FROM RACE
WHERE RaceDate > #01/01/2013# AND Distance < 10

[1]
[1]
[1]

Do not penalise imprecise syntax in the WHERE line


[Total: 19]

(a) Security is improved/better managed


[1]
Different users can have different views of/access to data
[1]
Program-data independence
// Changing a field does not require an applications program re-write
[1]
Queries and reports quickly produced
[1]
Reduced data duplication/ repetition /redundancy
[1]
Reduced data inconsistencies
[1]
Better managed /or similar data integrity/data validation // Validation code does not need to
be present in all applications programs
[1]
If implemented with a DBMS it will allow concurrent access to the database
[1]
MAX 3
(b) (i) Many product can be supplied by one supplier // many-to-one // M:1

[1]

(ii) Many products appear on many orders // many-to-many // M:M

[1]

(c) (i)

Intermediate table (not labelled PRODUCT, ORDER, etc.)


2 X one-to-many relationship
(ii) Primary key of PRODUCT/Primary key ProductID // Primary key of ORDER
Is used as a foreign key in the link table
(d) (i) (Yes) since there is a not a repeated group of attributes

[1]
[1]
[1]
[1]
[1]

(ii) (Yes) since there is only a single attribute primary key


// there are no partial dependencies
// all non-key attr. are dependent on the primary key

[1]

(iii) There are dependent non-key attributes //


SupplierName and/or SupplierTelNo are dependent on SupplierID

[1]

(iv) PRODUCT(ProductID,

ProductDescription,

RetailPrice,

SupplierID)
[1]
SUPPLIER(SupplierID, SupplierName, SupplierTelNumber)
[1]

If primary key not-indicated penalise once only


(e) Avoids data duplication/avoids repeated data // reduces data redundancy
Avoids data inconsistencies
Ensures data integrity

(f) SELECT CustomerID, OrderNo


FROM ORDER
WHERE OrderDate = #15/01/2014# AND PaymentMethod = D
(AND ISPaid = TRUE)

[1]
[1]
[1]
MAX 2
[1]
[1]
[1]

Do not penalise imprecise syntax in the WHERE line


[Total: 19]

10 (a)

Security is better managed


[1]
Program-data independence // Changing a field does not require an applications
program re-write
[1]
Better managed data integrity/data validation // Validation code does not need to be present
in all applications programs
[1]
Queries and reports quickly produced
[1]
If implemented with a DBMS it will allow concurrent access to the database
[1]
Reduced data duplication // data inconsistencies
[1]
MAX 3

(b) (i) many cars are hired to many customers // many-to-many // M:m
(ii)

one depot has based there many cars // one-to-many // 1:M

[1]
[1]

(c)

Link table shown...


2 X one-to-many relationships
(d) (i) (Yes) since there is a not a repeated group of attributes

[1]
[1]
[1]

(ii) (Yes) Since there is only a single attribute primary key //


There are no partial dependencies //
All no-key attributes are dependant on the primary key

[1]

(iii) Two of the non-key attributes are dependant //


DepotManager and DepotAddress are dependant on DepotID

[1]

(iv) CAR(CarRegistrationNo, CarMake, CarModel, HirePriceCode, DepotID)


[1]
DEPOT(DepotID, DepotAddress, DepotManager )
[1]
If the primary key is no indicated, penalise once only
(e) avoids data duplication
avoids data inconsistencies

[1]
[1]

(f) SELECT HireID, CustomerID


FROM HIRE
WHERE CustomerID = C674 AND CarRegistration = 456431

[1]
[1]
[1]
[Total: 19]

11 (a)

The table is not in First Normal Form


The table has a repeated group of attributes / Registration and
VehicleType is repeated (for each depot)

(1)
(1)

[2]

(b) (i)
[1]

(ii)

Vehicle (RegistrationNo, VehicleType, Mileage,


DepotTown)
Mark as follows
Correct first three attributes
(1)
RegistrationNo PK
(1)
DepotTown present
(1)
Depot (DepotTown (or similar), DepotAddress)
All correct

(1)

[4]

(c) (i)
[1]
(ii)

(d)

(e)

(f)

Primary key CustomerID in the Customer table


links to foreign key (CustomerID or by implication) in the Hire table

(1)
(1)

[2]

Displays the registration number


For all vehicles currently on a hireout

(1)
(1)

[2]

SELECT DepotTown, RegistrationNo (/ or equivalent)


FROM Vehicle (R. DepotVehicle)
WHERE VehicleType (/ or equivalent) = 'SC'

(1)
(1)
(1)

[3]

UPDATE Hire
SET LicenceChecked = TRUE // YES // equivalent

(1)

A. Any sensible attribute name + value


WHERE CustomerID = '085' AND
StartDate = #13/07/2014#
// DateBooked = #05/04/2014#

(1)

[2]

12 (a) (i)

[1]

(ii) Gallery(GalleryName, Country)


2 attributes
Primary key GalleryName
Exhibition (ExhibitionTitle, GalleryName, ArtistName,
StartDate, CloseDate)
Correct five attributes (only)
Primary key ExhibitionTitle

(1)
(1)

(1)
(1)

(b) (i) ExhibitionTitle + PaintingReferenceNo

[4]
[1]

(ii)

[1]

(iii) Primary key PaintingReferenceNo in the Painting table


(1)
Links to foreign key PaintingReferenceNo in the Exhibition-Painting
table
(1)

[2]

(c) Displays the Painting reference number


For all paintings by artists born after 1899 and died before 2001

(1)
(1)

[2]

(d) SELECT PaintingReferenceNo, PaintingTitle


FROM Painting
WHERE ArtistName = 'Da Vinci';

(1)
(1)
(1)

[3]

(e) UPDATE ExhibitionPainting


SET LoanFee = 0
WHERE (ExhibitionTitle = 'Secrets and Silence')
AND PaintingRefNo = 9065;

(1)
(1)
(1)

[3]

You might also like