Exam Dbms
Exam Dbms
v3 (latest)
Question 7
Not answered
v5 (latest)
Write an SQL query that lists the firstname and lastname of all persons who have directed a movie in the 'crime' genre but never directed a movie
in the 'comedy' genre. The query result should have two columns, which are the firstname and lastname.
Your query must be runnable. You can use psql to test your SQL query for syntactic correctness and correctness wrt the database schema.
(Max 6 marks.)
Question 8
Not answered
v3 (latest)
Write an SQL query that lists the firstname and lastname of all persons who have written a movie, but only together with other writers (i.e., have
never been the only writer on any movie) together with the number of movies that they have written. The query result should have three columns:
firstname, lastname, and the number of movies written.
Your query must be runnable. You can use psql to test your SQL query for syntactic correctness and correctness wrt the database schema.
(Max 4 marks.)
Question 9
Not answered
v3 (latest)
Correctly complete each of the following statements about the ER model described by the diagram:
• The correct way of translating the "depart" relationship into a relational schema using the foreign key approach is:
• The correct translation of the "depart" relationship into a relational schema using the cross-reference approach is:
.
• Each city that has at least one arriving flight must also have at least one departing flight: .
• Each city that has at least one departing flight must also have at least one arriving flight: .
Note: Selecting an incorrect alternative for one of the statements may result in a lower total mark than not selecting any alternative for that
statement. (Max 8 marks.)
Question 10
Not answered
v2 (latest)
A group of sports fans are designing a database to record their teams' matches. It includes the following table:
LINEUP(Team, Opponent, Day, Player, Number, Position)
Each row in the table records the position of a player in the starting lineup of the team in one match.
The following rules apply to the relation:
Based on these rules, select among the following functional dependencies all that should apply to the LINEUP relation. (Max 6 marks.)
{Team} → Opponent
{Team} → Day
{Player} → Number
{Team,Player} → Number
{Number} → Player
{Day,Team,Player} → Number
{Day,Team,Number} → Player
Not answered
v3 (latest)
Let R = { A, B, C, D, E } be a relation schema with the set of FDs Σ = { {B, D, E} → A, {B, D, A} → E, {B, C, D} → A, {C, D} → E }.
Select from the following relations a set that constitutes a BCNF decomposition of the relation. The decomposition should be lossless, but it
does not need to be dependency-preserving. There can be more than one correct answer, in the sense that the relation can have more than one
BCNF decomposition: You should select all relations included in one decomposition, and no more. Note that the order in which attributes are
listed in a relation does not matter. (Max 6 marks.)
R1 = {A, B, E}
R2 = {A, B, C, D}
R3 = {A, B, D, E}
R4 = {A, C, D, E}
R5 = {A, D, E}
R6 = {B, C, D}
R7 = {B, C, D, E}
R8 = {B, D, E}
R9 = {C, D, E}
Question 12
Not answered
v7 (latest)
• The relational algebra expression that is equivalent to the SQL query and will be the most efficient to evaluate is .
(Max 6 marks.)
Question 13
Not answered
v2 (latest)
T1 T2
read(B) read(A)
write(B) write(A)
read(A) read(B)
write(A) write(B)
In the list below, order the operations into an interleaved execution of both transactions such that a dirty read problem occurs in T1. (Max 6
marks.)
1 Choose...
2 Choose...
3 Choose...
4 Choose...
5 Choose...
6 Choose...
7 Choose...
8 Choose...
9 Choose...
10 Choose...
Question 14
Not answered
v12 (latest)
Jane
Squid
Jane
Squid
(Max 6 marks.)