0% found this document useful (0 votes)
54 views4 pages

Number of Questions: 25 Section Marks: 30: Database Test 3

This document provides a 25 question multiple choice test on database concepts. The questions cover topics such as: - Cardinality ratios for entity relationship diagrams - Relational algebra operators - Normal forms (1NF, 2NF, 3NF, BCNF) - Functional dependencies - Keys - Joins and subqueries

Uploaded by

AKASH PAL
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)
54 views4 pages

Number of Questions: 25 Section Marks: 30: Database Test 3

This document provides a 25 question multiple choice test on database concepts. The questions cover topics such as: - Cardinality ratios for entity relationship diagrams - Relational algebra operators - Normal forms (1NF, 2NF, 3NF, BCNF) - Functional dependencies - Keys - Joins and subqueries

Uploaded by

AKASH PAL
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/ 4

Database Test 3

Number of Questions: 25 Section Marks: 30

Directions for questions 1 to 25: Select the correct alterna- (A) Key constraint
tive from the given choices. (B) Referential Integrity constraint
1. A studio can have at most one president and a president (C) UNIQUE Constraint
can preside at most one studio. (D) None of the above
6. Student (RNo, Name, Marks, Subject)
(,) (,) For each Subject, Retrieve the Subject, maximum
President is - president studio
- of
marks in that subject.
In the SQL query which clause will not appear?
(A) SELECT
Which of the following is correct cardinality ratio, for
(B) GROUPBY
the above description?
(C) FROM
(A) (0, 1), (1, n) (B) (0, 1), (0, 1)
(D) WHERE
(C) (1, n), (0, 1) (D) (1, n), (1, n)
7. Which of the following is NOT a Relational algebra
2. A movie award goes exactly to one movie. A movie
operator used in basic queries?
may be awarded multiple awards (but may be none at
(A) JOIN (B) PROJECT
all). Which of the following is correct cardinality ratio,
(C) SELECT (D) LOCATE
for the above description?
8. What does the asterisk (*) in SQL mean?
(,) (,) (A) It is a standard symbol used to start a query.
Award award - to movie (B) It is a wild card symbol that requests inclusion of
all attributes.
(C) It is an interruption symbol used to abort a query
(A) (0, 1), (1, n) (B) (1, 1), (1, n) if it takes longer to process than a prescribed time
(C) (1, 1), (0, *) (D) (1, 1), (1, *) length.
3. Match the following: (D) None of the above
I. Conceptual Database design 9. Consider the given functional dependencies
II. Logical Database design R(A, B, C, D):
III. Physical Database design FD = {A → B
P. Transforms the conceptual schema into the data
C→B
model supported by the DBMS.
D → B}
Q. Design indexes, table distribution, buffer size etc.
The given Relation is in which Normal Form?
R. Produces the initial model.
(A) 1 NF (B) 2 NF
(A) I–R, II–P, III–Q (B) I–P, II–Q, III–R
(C) 3 NF (D) BCNF
(C) I–Q, II–P, III–R (D) I–Q, II–R, III–P
10. For a Relation scheme R(ABC), Assume that all attrib-
Common Data for Questions 4 and 5:
utes are prime attributes, Then minimum ‘R’ is in which
CREATE TABLE Emp (EId INT
Normal Form?
Name CHAR(50)
(A) 1 NF (B) 2 NF
mgr-Id : INT
SSNo: INT UNIQUE (C) 3 NF (D) BCNF
DNo: INT 11. Which of the following model, describes the fact that a
Salary: INT role is stored for every pair of actor ‘X’ and movie ‘Y’
Primary key (EId) such that ‘X’ starred in ‘Y’.
Foreign key DNo References Dept (DNo))
Actor Stars - in Movie
4. If a tuple is inserted into the table Emp, which violation
would never occur? (A)
(A) Key constraint Role
(B) Entity Integrity constraint
(C) Referential Integrity constraint
Role
(D) Unique constraint
(B)
5. If a tuple value is updated in Emp table, which viola-
Actor Stars - in Movie
tions would never occur?
3.124 | Database Test 3

Role 17. To find the EId of the Employees that are managed by
people who are managed by the employee with EId
(C)
456.
Actor Stars - in Movie
Consider the following Queries:
I. SELECT E.EId
Role Role FROM Emp E, Emp F
WHERE E.MgrId = F.EId AND F.MgrId = 456
(D)
II. SELECT EId
Actor Stars - in Movie
FROM Emp
WHERE MgrId IN (SELECT EId
12. Consider the given ER-Diagram: FROM Emp
(0, ∗) (1, 1) WHERE MgrId = 456)
Instructor teaches course
Which query will correctly get the desired set of Em-
ployee IDs?
Which of the following is TRUE? (A) I only (B) II only
(A) one instructor teaches many courses, but each (C) Both I and II (D) Neither I nor II
course is run by exactly one instructor.
18. Consider the following functional dependencies
(B) One instructor teaches atmost one course.
AB → C
(C) An instructor may not take even a single course.
C→D
(D) One instructor teaches one course, but each course
AB → D
is run by many instructors.
Which of the following is CORRECT minimal set?
13. Consider the given Functional dependencies. (A) A → C C→D
For a Relation R(ABCDE): (B) AB → C C→D
A→B (C) B → C C→D
B→C (D) AB → C AB → D
BC → A
19. Consider the following functional dependencies:
A→D
R(ABCD)
E→A
AB → C
D→E
C→A
Which of the following is not a key?
D→B
(A) B (B) C
AB → D
(C) D (D) E
What are the keys possible for Relation R?
14. Consider a Relation R(ABCDE) with following func- (A) AC, BD, CD (B) AB, BC, CD
tional dependencies: (C) AB, AD, BC, CD (D) AC, BC, BD
ABC → DE
20. Sailor (Sid, Sname, Rating, age)
D → AB
Reserves (Sid, bid)
What is the number of candidate keys for the Relation
Boats (bid, bname, color)
R?
To select the names of sailors who have reserved all
(A) 0 (B) 1
the boats, which Relational algebra operation is used
(C) 2 (D) 3
specifically, to do the under lined part?
15. Suppose relation R(A, B) currently has tuples {(2, 3), (A) OUTER JOIN (B) UNION
(2, 4), (4, 5)} and Relation S(B, C) currently has {(3, 6), (C) DIVISION (D) EXCEPT
(5, 7), (8, 9)}. What is the number of tuples in the result
21. Student1 (RNo, Name, CNo, CName)
of the SQL query
Student2 (RNo, Name, CNo, CName)
SELECT * FROM R NATURAL OUTER JOIN S ?
I. πName (σCNO = ‘C2’ (student1 – student2))
(A) 2 (B) 3
II. πName (σCNO = ‘C2’ (student2 – student1))
(C) 4 (D) 5
Which of the following is TRUE in most of the cases
16. Consider the following ER-Diagram: about Number of tuples appear in the result of I and II?
A R B S C (A) I ≠ II (B) I < II
(C) I > II (D) I = II
What is the minimum number of tables required to rep- 22. Consider the following:
resent given ER-Diagram? I. {P/∃ S ∈ student ∃ D ∈ Department
(A) 1 (B) 2 (S.RNo = D.RNo. ∧ D. DNo. = 5 ∧ P.Sname
(C) 3 (D) 4 = S.Sname)
Database Test 3 | 3.125

II.{< SN > /∃ SR, SN (< SR, SN > ∈ student ∧∃ DR, (C) INNER JOIN
DN (< DR, DN > ∈ Department ∧ SR = DR DN = 5))} (D) FULL OUTER JOIN
Which of the following is TRUE about given expres-
sions? 24. Assume that table A has 5 columns, table B has
(A) I – Tuple Relational Calculus 4 columns, one column is common in both the tables.
II – Relational algebra What is the number of columns appear in the result
(B) I – Tuple Relational Calculus of NATURAL JOIN, LEFT OUTER JOIN, FULL
II – Domain Relational Calculus OUTER JOIN respectively?
(C) I – Domain Relational Calculus (A) 8, 9, 9 (B) 8, 8, 9
II – Tuple Relational Calculus (C) 8, 8, 8 (D) 8, 9, 8
(D) I – Relational Algebra
25. Consider the following Query in English:
II – Domain Relational Calculus
“Retrieve the names of students who scored more than
23. Consider 2 Relations R and S, If we want to Retrieve all 90% but whose age is not more than 15?”
the tuples from both R and S without losing any tuple,
which Relational Algebra operator is used? Which Relational operator is compulsory in SQL?
(A) NATURAL JOIN (A) INTERSECTION (B) NATURAL JOIN
(B) LEFT OUTER JOIN (C) OUTER JOIN (D) SET-DIFFERENCE

Answer Keys
1. B 2. C 3. A 4. C 5. D 6. D 7. D 8. B 9. A 10. C
11. A 12. A 13. B 14. B 15. C 16. C 17. C 18. B 19. C 20. C
21. A 22. B 23. D 24. C 25. D

Hints and Explanations


1. 7. LOCATE is NOT a Relational algebra operator.
Choice (D)
(0, 1) (0, 1)
President is – president - of studio 8. It is a wild card symbol that requests inclusion of all
attributes. Choice (B)
Choice (B) 9. A → B
2. “*” may be used as maximum if there is no limit (0, *) C→B
means no restriction at all (general relationship) D→B
– “A movie award goes exactly to one movie” (1, 1) L M R
– A movie may be awarded multiple awards but may ACD B
be none at all (0, *). Choice (C)
3. The correct match is I – R, II – P, III – Q.
Choice (A) (ACD)+ = {ACDB} Prime Attributes = ACD
Non prime Attributes = B
4. – If we insert some value which already exists, under
A→ B
primary key column, key constraint is violated.
– If we insert NULL value under primary key col- ↓ Non prime Attribute
umn Entity Integrity constraint is violated. Partial Key
– If we insert some value which already exists under It violates 2NF.
the column ‘SSNO’ which is declared as UNIQUE ∴ The Relation is in 1 NF. Choice (A)
in the schema, UNIQUE constraint is violated. 10. If All attributes are prime attributes, then a Relation R
Choice (C) is in minimum 3 NF. Choice (C)
5. All violations are possible with updation operation. 11.
Refer above solution. Choice (D)
6. The query will be Actor Stars - in Movie
SELECT Subject, MAX(Marks)
FROM Student Role
GROUPBY Subject Choice (D)
3.126 | Database Test 3

Describes the fact that a Role is stored for every pair of 17. Both queries will correctly give the desired set of
actor ‘X’ and ‘Y’ such that X starred in Y. Choice (A) Employee Ids. Choice (C)
12. One instructor teaches many courses (0, *). Each 18. AB → C
course is run by exactly one Instructor (1, 1). C→D
Choice (A) AB → D
13. A → B Minimal cover:
B→C AB → C
BC → A C→D Choice (B)
A→D 19. AB → C
E→A C→A
D→E D→B
AB → D
L M R
L M R
ABCD
E ABCD

A+ = {ABCDE} A+ = {A}
B+ = {BCADE} B+ = {B}
C+ = {C} C+ = {CA}
D+ = {DEABC} D+ = {DB}
E+ = {EABCD} AB+ = {ABCD}
∴ ‘C’ is not the key. Choice (B) AC+ = {AC}
14. AD+ = {ADBC}
BC+ = {BCAD}
L M R BD+ = {BD}
C ABD E CD+ = {CDAB}
Keys are AB, AD, BC, CD. Choice (C)
C+ = {C} x 20. If an SQL query contains “Select – all” term, DIVISION
CA+ = {CA} operation is used. Choice (C)
CB+ = {CB} 21. (Student1 – Student2) ≠ (Student2 – Student1) option (B)
CD+ = {CDABE} and option (C) depends on the number of tuples in first
Candidate key = CD Choice (B) specified Relation. Choice (A)
15. 22. Both Queries return the names of students Whose
RS department number is 5.
I – Tuple Relational Calculus
A B B C II – Domain Relational Calculus Choice (B)
2 3 3 6
23. FULL OUER JOIN returns all the tuples of Both the
2 4 5 7 tables. Choice (D)
4 5 8 9 24. Table A has 5 columns
Table B has 4 columns
R NATURAL OUTER JOIN S One column is common to both the tables. In the Re-
A B C
sult of NATURAL JOIN, LEFT OUTER JOIN, FULL
OUTER JOIN, duplicate columns are not allowed,
2 3 6
(5 columns + 3 columns) = 8 columns. Choice (C)
2 4 NULL
25. The query will be as follows
4 5 7
SELECT name
NULL 8 9 FROM student
WHERE marks > 90
∴ 4-Tuples appear in the Result. Choice (C) SET DIFFERENCE
16. Minimum, for every entity one table is required. Since SELECT name
there are 3 entities A, B, C, we need minimum 3 tables. FROM student
Choice (C) WHERE age > 15. Choice (D)

You might also like