Databases Homework 4
Databases Homework 4
(b) Identify a foreign key in the tables above. What is the purpose of the foreign key? [2]
(c) Write an SQL statement to extract the passport numbers, surnames and firstnames of
all passengers on Flight BA401 on 12/11/2016. [5]
2
Homework 4 Updating tables using SQL
Unit 11 Databases and software development
(f) Write an SQL statement to add two new columns for Telephone,
16 characters (variable length) and email, 20 characters (variable length) to the
Passenger table. [2]
(g) Write an SQL statement to delete the column email from the Passenger table. [2]
(h) Write an SQL statement to insert a record for passenger Jo Harris, passport number
12345678. [2]
2. Name and briefly describe a serialisation technique which ensures that transactions do not
overlap in time and ensures that updates are not lost. [3]
Two-phase locking (2PL) is a technique that ensures transactions do not interfere with each
other. It has a growing phase, where locks are acquired but not released, and a
shrinking phase, where locks are released and no new locks can be acquired. This
ensures serializability and prevents lost updates.
TOTAL 28 marks