0% found this document useful (0 votes)
15 views12 pages

Print

Uploaded by

skilzababy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views12 pages

Print

Uploaded by

skilzababy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

A teacher keeps a record of books loaned to students.

1.
The teacher uses a relational database containing three tables, BookCopy, Student and Loan.
The figure below shows some data from the tables.

BookCopy Student

CopyID BookTitle StudentID FirstName LastName YearGroup

HT001 HTML 4 Fun TUC004 Barry Tucker 8

PB002 Python Basics WAY002 Shania Wayneton 10

GC001 GCSE Computing KOW001 Bartek Kowalski 11

GC002 GCSE Computing AZE001 Faisal Azeez 9

GC003 GCSE Computing BAK007 Jolene Baker 11

GC004 GCSE Computing ANA002 Aisha Anand 11

RG001 GCSE Revision Guide OKA003 Sani Okafor 10

Loan

LoanID StudentID CopyID DepositPaid

L0001 TUC004 HT001 0.50

L0002 WAY002 GC004 2.00

L0003 KOW001 GC001 2.00

L0004 TUC004 PB002 0.75

L0005 BAK007 RG001 2.50

L0006 BAK007 GC002 2.00

L0007 OKA003 GC003 2.00

Dubai College Page 1 of 12


Shade two lozenges to show which of the following statements are benefits of relational
databases.

A All the information can be stored in one table.

B Redundant data is less likely to be stored.

C Tables don’t need primary keys.

D There are less likely to be data inconsistencies.

(Total 2 marks)

Dubai College Page 2 of 12


A teacher keeps a record of books loaned to students.
2.
The teacher uses a relational database containing three tables, BookCopy, Student and Loan.
The figure below shows some data from the tables.

BookCopy Student

CopyID BookTitle StudentID FirstName LastName YearGroup

HT001 HTML 4 Fun TUC004 Barry Tucker 8

PB002 Python Basics WAY002 Shania Wayneton 10

GC001 GCSE Computing KOW001 Bartek Kowalski 11

GC002 GCSE Computing AZE001 Faisal Azeez 9

GC003 GCSE Computing BAK007 Jolene Baker 11

GC004 GCSE Computing ANA002 Aisha Anand 11

RG001 GCSE Revision Guide OKA003 Sani Okafor 10

Loan

LoanID StudentID CopyID DepositPaid

L0001 TUC004 HT001 0.50

L0002 WAY002 GC004 2.00

L0003 KOW001 GC001 2.00

L0004 TUC004 PB002 0.75

L0005 BAK007 RG001 2.50

L0006 BAK007 GC002 2.00

L0007 OKA003 GC003 2.00

State one field in the Loan table that is a foreign key.

_______________________________________________________________________
(Total 1 mark)

Dubai College Page 3 of 12


A teacher keeps a record of books loaned to students.
3.
The teacher uses a relational database containing three tables, BookCopy, Student and Loan.
The figure below shows some data from the tables.

BookCopy Student

CopyID BookTitle StudentID FirstName LastName YearGroup

HT001 HTML 4 Fun TUC004 Barry Tucker 8

PB002 Python Basics WAY002 Shania Wayneton 10

GC001 GCSE Computing KOW001 Bartek Kowalski 11

GC002 GCSE Computing AZE001 Faisal Azeez 9

GC003 GCSE Computing BAK007 Jolene Baker 11

GC004 GCSE Computing ANA002 Aisha Anand 11

RG001 GCSE Revision Guide OKA003 Sani Okafor 10

Loan

LoanID StudentID CopyID DepositPaid

L0001 TUC004 HT001 0.50

L0002 WAY002 GC004 2.00

L0003 KOW001 GC001 2.00

L0004 TUC004 PB002 0.75

L0005 BAK007 RG001 2.50

L0006 BAK007 GC002 2.00

L0007 OKA003 GC003 2.00

State the most suitable data type for the DepositPaid field in the Loan table.

_______________________________________________________________________

_______________________________________________________________________
(Total 1 mark)

Dubai College Page 4 of 12


A teacher keeps a record of books loaned to students.
4.
The teacher uses a relational database containing three tables, BookCopy, Student and Loan.
The figure below shows some data from the tables.

BookCopy Student

CopyID BookTitle StudentID FirstName LastName YearGroup

HT001 HTML 4 Fun TUC004 Barry Tucker 8

PB002 Python Basics WAY002 Shania Wayneton 10

GC001 GCSE Computing KOW001 Bartek Kowalski 11

GC002 GCSE Computing AZE001 Faisal Azeez 9

GC003 GCSE Computing BAK007 Jolene Baker 11

GC004 GCSE Computing ANA002 Aisha Anand 11

RG001 GCSE Revision Guide OKA003 Sani Okafor 10

Loan

LoanID StudentID CopyID DepositPaid

L0001 TUC004 HT001 0.50

L0002 WAY002 GC004 2.00

L0003 KOW001 GC001 2.00

L0004 TUC004 PB002 0.75

L0005 BAK007 RG001 2.50

L0006 BAK007 GC002 2.00

L0007 OKA003 GC003 2.00

Dubai College Page 5 of 12


Year 11 students must return their books after they have finished their GCSE exams.

Using the database shown in the figure above, write an SQL query that lists all the loans for
students who are in Year 11.

The query must only return:


• both names of the student
• the ID of the book borrowed
• the deposit paid.

The results must be in ascending order of the students’ last names.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 6 marks)

Dubai College Page 6 of 12


A teacher keeps a record of books loaned to students.
5.
The teacher uses a relational database containing three tables, BookCopy, Student and Loan.
The figure below shows some data from the tables.

BookCopy Student

CopyID BookTitle StudentID FirstName LastName YearGroup

HT001 HTML 4 Fun TUC004 Barry Tucker 8

PB002 Python Basics WAY002 Shania Wayneton 10

GC001 GCSE Computing KOW001 Bartek Kowalski 11

GC002 GCSE Computing AZE001 Faisal Azeez 9

GC003 GCSE Computing BAK007 Jolene Baker 11

GC004 GCSE Computing ANA002 Aisha Anand 11

RG001 GCSE Revision Guide OKA003 Sani Okafor 10

Loan

LoanID StudentID CopyID DepositPaid

L0001 TUC004 HT001 0.50

L0002 WAY002 GC004 2.00

L0003 KOW001 GC001 2.00

L0004 TUC004 PB002 0.75

L0005 BAK007 RG001 2.50

L0006 BAK007 GC002 2.00

L0007 OKA003 GC003 2.00

Barry Tucker has returned their copy of the book Python Basics.

Complete the SQL to delete the loan record for the book PB002.

DELETE FROM ___________________________________________________________

WHERE _________________________________________________________________
(Total 2 marks)

Dubai College Page 7 of 12


A relational database has been developed for a youth club to store information about their
6. members and the awards they are given.

The database contains two tables: Member and Award

The figure below shows some data from the tables.

Member

MemberID FirstName LastName DateJoined

1 Zarah Tariq 2020-01-05

2 Penny Hill 2020-01-05

3 Peter Boyes 2020-02-14

4 Reuben Bailey 2020-10-20

Award

AwardID MemberID DatePresented AwardName

1 1 2020-09-10 Teamwork

2 1 2020-10-13 Outdoors

3 3 2020-06-19 Challenge

4 2 2020-11-11 Leader

(a) Define the term relational database.

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________
(2)

(b) State one benefit of using relational databases.

___________________________________________________________________

___________________________________________________________________
(1)

Dubai College Page 8 of 12


(c) State the name of the field from the Member table that is the most suitable to use as the
primary key.

___________________________________________________________________

___________________________________________________________________
(1)

(d) State the name of the field from the Award table that is a foreign key.

___________________________________________________________________

___________________________________________________________________
(1)

The figure above has been included again below.

Member

MemberID FirstName LastName DateJoined

1 Zarah Tariq 2020-01-05

2 Penny Hill 2020-01-05

3 Peter Boyes 2020-02-14

4 Reuben Bailey 2020-10-20

Award

AwardID MemberID DatePresented AwardName

1 1 2020-09-10 Teamwork

2 1 2020-10-13 Outdoors

3 3 2020-06-19 Challenge

4 2 2020-11-11 Leader

Dubai College Page 9 of 12


(e) The youth club needs to produce a report listing the members who have been given the
Leader award. The report must include both names of each member and the date the
award was presented.

Write an SQL query that could be used to find this information. The results must be in order
of the date the awards were presented, starting with the earliest.

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________
(6)

(f) A new member joins the youth club. The following SQL is run to add their details to the
database:

INSERT INTO
(5, 'Alina', 'Ahmed', '2020-11-30')

Some of the SQL has been replaced by labels.

State the SQL that should have been written in place of the labels and .

_______________________________________________________________

_______________________________________________________________
(2)
(Total 13 marks)

A relational database is being developed to store information about the games that are available
7. to play at a games café and the advance bookings that have been made for those games. Each
game has a unique name.

The database contains two tables: Game and Booking.

The database is currently being tested by the person who has developed it so the database
tables only contain a small amount of data that is being used for testing.

The contents of the tables are shown below.


Dubai College Page 10 of 12
Game

Name MinPlayers MaxPlayers LengthOfGame Complexity

Friday 1 1 25 2.12

Scythe 1 5 90 3.37

Terra Mystica 2 5 100 3.95

Agricola 1 4 90 3.31

Pandemic 2 4 45 2.42

Booking

GameTableID Name Date StartTime Customer Hours

1 Friday 28/05/19 11 Hawkins 1

2 Scythe 28/05/19 11 Jemisin 1

3 Pandemic 28/05/19 15 Gormally 1

1 Pandemic 28/05/19 13 Van Perlo 2

1 Terra Mystica 29/05/19 15 Hawkins 2

(a) State the field in the Booking table that is a foreign key.

___________________________________________________________________

___________________________________________________________________
(1)

(b) State the most suitable data type to use for the Complexity field.

___________________________________________________________________

___________________________________________________________________
(1)
(Total 2 marks)

Dubai College Page 11 of 12


Due to a change in layout at a games café, the game table with an ID of 2 is no longer suitable
8. for games that can have more than four players. The manager needs to find out the customer,
date and time of all bookings made for the game table with an ID of 2 that are for a game that
can have more than four players.

Write an SQL query that could be used to find this information for the manager. The results
should be shown in date order.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 6 marks)

The LengthOfGame field shows the average amount of time it takes to play a game in minutes.
9.
A query to add 10 minutes to the length of time taken for all games that have a Complexity of
more than three is shown below.

UPDATE Game

SET LengthOfGame = LengthOfGame + 9

WHERE Complexity <= 3

The query contains two errors. Refine the query to correct the errors.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)
Dubai College Page 12 of 12

You might also like