Mock Test Flashcards

1
Q

Which of the following SQL statements removes from a BRANCH table the row for the branch with branchNo B002?

A

DELETE FROM branch WHERE branchNo = ’B002’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the definition of a database according to the Copyright, Designs and Patents Act 1988?

A

A shared collection of logically related data, and its description, designed to meet the information needs of an organisation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Consider the following UML diagram of a ER model representing people working on a movie. Which of the following sentences is NOT true.

A

“Role” is an attribute of a relation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Consider the following relation:
Staff (Name, Department, OfficeNumber, Telephone)
Suppose a table implementing the relation contains the following data:
Smith, Databases, 1.05, 1270
Jackson, Networks, 3.02, 3610
Brown, Networks, 2.06, 2214
Smith, Programming, 1.05,1270
Brown, Databases, 2.06, 2214
Assume that the dataset above is representative and that there are no dependencies between attributes besides the ones you can find in this dataset. Choose a Primary Key for this table among the options below.

A

Name and OfficeNumber.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In SQL, what is the most appropriate way to implement the following constraint:
the salary of a teacher must not be greater than the salary of the head-teacher of the school he/she works for.

A

This requirements is not supported by SQL.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which of the following statements about indexes is not true?

A

D. Values in an index are ordered.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
Suppose the following set of functional dependencies holds on the universal relation: R={A,B,C,D,E,F}
A → C
AC → D
E → AD
E → B
What is the closure of A, or A+?
A

The set {A,C,D}.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Consider the following table:
Movies (MovieID, Title, Country, RunningTime)
Which of the following SQL statements retrieves the cardinality of this table?

A

SELECT * FROM Movies;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which statement below is true about modelling ER diagrams as tables ?

A

A binary many-to-many relation will be implemented as a set of 2 tables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which of the following statements about weak entities is not true?

A

Weak entities represent virtual data, and are not actually stored in the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A set of relations in a database such that no spurious tuples are generated after normalisation is said to have which property:

A

A. Non additive join property.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Suppose you have two Relation schemas
R1 = {A, B, C} and
R2 = {A, D, E, F }.
Select the most appropriate SQL version of the RA statement below.

A

C. SELECT B,D FROM R1 JOIN R2 ON R1.A=R2.A WHERE D=2;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which of the following statements is not true about a functional dependence: A → B ?

A

C. A is a primary key.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Consider the constraint definition:
”Entity Lecturer has partial participation to relationship Teaching with entity Course, and entity Course has total participation to relationship Teaching with entity Lecturer”
Which combination of the following statements is correct?
Every lecturer must teach at least one course.
Every course must be taught by least one lecturer.
There can be lecturers who do not teach.
A lecturer can’t teach more than one course.
There can be courses which are not taught.

A

C. 1 and 5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which of the following SQL statements represents a correlated nested query?

A

C. SELECT * FROM EMPLOYEE E

WHERE E.deptno IN (SELECT D.deptno FROM DEPARTMENT D);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly