Quiz About Database Design (Normal Forms)
Quiz About Database Design (Normal Forms)
Question 1
For the relation R(ABCDEFGH) with FD's= {CH->G, A->BC, B->CHF, E->A, F->EG such that F+ is exactly the set of FDs that hold for R.}
Consider the FDs given in above question. The relation R is
D in BCNF
Discuss it
Explanation
The table is not in 2nd Normal Form as the non-prime attributes are dependent on subsets of candidate keys. The c
andidate keys are AD, BD, ED and FD. In all of the following FDs, the non-prime attributes are dependent on a parti
al candidate key. A -> BC B -> CFH F -> EG
Question 2
B A relation R is in 3NF if every non-prime attribute of R is fully functionally dependent on every key of R
Discuss it
Explanation
BCNF is a stronger version 3NF. So every relation in BCNF will also be in 3NF.
Question 3
Consider a relational table with a single record for each registered student with the following attributes.
1. Registration_Num: Unique registration number
of each registered student
2. UID: Unique identity number, unique at the
national level for each citizen
3. BankAccount_Num: Unique account number at
the bank. A student can have multiple accounts
or join accounts. This attribute stores the
primary account number.
4. Name: Name of the student
5. Hostel_Room: Room number of the hostel
C UID is candidate key if all students are from the same country
Discuss it
Explanation
A Candidate Key value must uniquely identify the corresponding row in table. BankAccount_Number is not a candid
ate key. As per the question “A student can have multiple accounts or joint accounts. This attributes stores the prim
ary account number”. If two students have a joint account and if the joint account is their primary account, then Ban
kAccount_Number value cannot uniquely identify a row.
Question 4
Assume that, in the suppliers relation above, each supplier and each street within a city has a unique name, and (sname, city) forms a
candidate key. No other functional dependencies are implied other than those implied by primary and candidate keys. Which one of the
following is TRUE about the above schema?
Discuss it
Explanation
A relation is in
BCNF
if for every one of its dependencies X → Y, at least one of the following conditions hold:
Question 5
Consider the following relational schemes for a library database: Book (Title, Author, Catalog_no, Publisher, Year, Price) Collection (Title,
Author, Catalog_no) with in the following functional dependencies:
I. Title Author --> Catalog_no
II. Catalog_no --> Title, Author, Publisher, Year
III. Publisher Title Year --> Price
Assume {Author, Title} is the key for both schemes. Which of the following statements is true?
Discuss it
Explanation
The table "Collection" is in BCNF as there is only one functional dependency “Title Author –> Catalog_no” and
{Author, Title} is key for collection.
Book is not in BCNF because Catalog_no is not a key and there is a functional dependency “Catalog_no –> Title
Author Publisher Year”.
Book is not in 3NF because non-prime attributes (Publisher Year) are transitively dependent on key [Title, Auth
or].
Book is in 2NF because every non-prime attribute of the table is either dependent on the whole of a candidate
key [Title, Author], or on another non prime attribute. In table book, candidate keys are {Title, Author} and {Cat
alog_no}. In table Book, non-prime attributes (attributes that do not occur in any candidate key) are Publisher, Y
ear and Prince
Please refer
Database Normalization | Normal Forms
for details of normal forms.
Question 6
Consider the relation scheme R = {E, F, G, H, I, J, K, L, M, N} and the set of functional dependencies {{E, F} -> {G}, {F} -> {I, J}, {E, H} -> {K, L},
K -> {M}, L -> {N} on R. What is the key for R?
A {E, F}
B {E, F, H}
C {E, F, H, K, L}
D {E}
Discuss it
Explanation
D) {E}+ = {E} ≠ R
Second Method:
{EFGHIJKL}+ = {EFGHIJKLMN}
Again {EFGHIJ}+ = {EFGHIJKLMN} (Since {E, H} -> {K, L}, hence replace KL by EH)
Question 7
Discuss it
Explanation
A relational schema R is in
BCNF
iff in Every non-trivial Functional Dependency X->Y, X is Super Key. If we can prove the relation is in BCNF then by
default it would be in 1NF, 2NF, 3NF also. Let R(AB) be a two attribute relation, then
Hence it's proved that a Relation with two single - valued attributes is in BCNF hence its also in 1NF, 2NF, 3NF.
Hence S1 is true.
As we know Minimal Cover is the process of eliminating redundant Functional Dependencies and Extraneous attrib
utes in Functional Dependency Set. So each dependency of F = {AB->C, D->E, AB->E, E->C} should be implied in m
inimal cover. As we can see AB->E is not covered in minimal cover since {AB}+ = ABC in the given cover {AB->C, D-
>E, E->C}
Hence, S2 is false.
This explanation has been contributed by
Manish Rai.
Learn more about Normal forms here:
Database Normalization | IntroductionDatabase Normalization | Normal Forms
Question 8
The maximum number of superkeys for the relation schema R(E,F,G,H) with E as the key is
A 5
B 6
C 7
D 8
Discuss it
Explanation
Question 9
For (StudentName, StudentAge) to be the key for this instance, the value X should not be equal to
A 18
B 19
C 17
D 20
Discuss it
Explanation
There is already an entry with same name and age as 19. So the age of this entry must be something other than 19.
Question 10
D
D
Any relation with two attributes is in BCNF
Discuss it
Explanation
Answer (c) It is not always possible to decompose a table in BCNF and preserve dependencies. For example, a set o
f functional dependencies {AB --> C, C --> B} cannot be decomposed in BCNF.
Question 11
Let r be a relation instance with schema R = (A, B, C, D). We define r1 = ΠA, B, C (r) and r2 = ΠA.D (r). Let s = r1 * r2 where * denotes natural
join. Given that the decomposition of r into r1 and r2 is lossy, which one of the following is TRUE?
A s⊂r
B r∪s
C r⊂s
D r*s=s
Discuss it
Explanation
Answer (c) Consider the following example with lossy decomposition of r into r1 and r2. We can see that r is a subs
et of s.
Table r
A B C D
---------------------------
1 10 100 1000
1 20 200 1000
1 20 200 1001
Table r1
A B C
------------------
1 10 100
1 20 200
Table r2
A D
-----------
1 1000
1 1001
Consider a relation scheme R = (A, B, C, D, E, H) on which the following functional dependencies hold: {A–>B, BC–>D, E–>C, D–>A}. What
are the candidate keys of R?
AE, BE
A
B
AE, BE, DE
D
AEH, BEH, DEH
Discuss it
Explanation
A set of attributes S is candidate key of relation R if the closure of S is all attributes of R and there is no subset of S
whose closure is all attributes of R.
Closure of AEH, i.e. AEH+ = {ABCDEH}
Closure of BEH, i.e. BEH+ = {ABCDEH}
Closure of DEH, i.e. DEH+ = {ABCDEH}
Question 13
Let R1 (A, B, C) and R2 (D, E) be two relation schema, where the primary keys are shown underlined, and let C be a foreign key in R1
referring to R2. Suppose there is no violation of the above referential integrity constraint in the corresponding relation instances r1 and
r2. Which one of the following relational algebra expressions would necessarily produce an empty relation ?
A 1
B 2
C 3
D 4
Discuss it
Explanation
Since C is a foreign key in R1 and there is no violation of the above referential integrity constraint, the set of values i
n C must be a subset of values in R2.
Question 14
The relation scheme Student Performance (name, courseNo, rollNo, grade) has the following functional dependencies:
name, courseNo → grade
rollNo, courseNo → grade
name → rollNo
rollNo → name
A 2 NF
B 3 NF
C BCNF
D 4NF
Discuss it
Explanation
For easy understanding let's say attributes (name, courseNo, rollNo, grade) be (A,B,C,D). Then given FDs are as foll
ows:
Here there are two Candidate keys, AB and CB. Now AB->D and CB->D satisfy BCNF as LHS is superkey in both. B
ut, A->C and C->A, doesn't satisfy BCNF. Hence we check for 3NF for these 2 FDs. As C and A on RHS of both the
FDs are prime attributes, they satisfy 3NF. Hence for the whole relation the highest normal form is 3NF.
Question 15
B names of girl students with more marks than some boy student
C names of girl students with marks not less than some boy students4)
D names of girl students with more marks than all the boy students
Discuss it
Explanation
The above relational algebra expression has two sub expressions.
The first one takes as input the Student relation (Student) and filters
out all the tuples where sex=female(r sex=female (Student))
and then projects their names (P name r sex=female (Student)).
So we get a new relation with names of all the female students.
The second one takes as input the Student relation and performs a rename
operation on one with attributes name, sex and marks renamed as n, x, m
respectively (r n, x, m(Student)) and then followed by a self-Cartesian
product on the Student relation. The condition (sex = female ^ m = male ^ marks ≤ m)
filters tuples with all female students from the first relation,
male students from the second relation and performs a Cartesian product where
marks of the female student is either less than or equal to a male student and
then projects their names. So we get a new relation with names of all female
students whose marks are lesser than at least one of the male student.
The difference operator(-) between the two subexpressions gives the names of all female students whose marks ar
e more than all male students of the class. (From all the female students’ names we remove all those whose marks
are at least more the one male student) This explanation has been contributed by
Yashika Arora.
Question 16
C In BCNF
Discuss it
Explanation
Question 17
Relation R with an associated set of functional dependencies, F is decomposed into BCNF. The redundancy (arising out of functional
dependencies) in the resulting set relations is.
A Zero
B More than zero but less than that of an equivalent 3NF decomposition
D Indeterminate
Discuss it
Explanation
If a relational schema is in BCNF then all redundancy based on functional dependency has been removed, although
other types of redundancy may still exist.
Question 18
With regard to the expressive power of the formal relational query languages, which of the following statements is true?
Discuss it
Explanation
A query can be formulated in relational calculus if and only if it can be formulated in relational algebra. So, relationa
l algebra has the same power as relational calculus. But, it is possible to write syntactically correct relational calcul
us queries that have infinite number of answers. Such queries are unsafe. Queries that have an finite number of ans
wers are safe relational calculus queries. Thus, Relational algebra has the same power as safe relational calculus. T
hus, option (C) is the answer.
Question 19
Relation R is decomposed using a set of functional dependencies, F and relation S is decomposed using another set of functional
dependencies G. One decomposition is definitely BCNF, the other is definitely 3NF, but it is not known which is which. To make a
guaranteed identification, which one of the following tests should be used on the decompositions? (Assume that the closures of F and G
are available).
A Dependency-preservation
B Lossless-join
C BCNF definition
D 3NF definition
Discuss it
Explanation
Answer is (C) since to identify BCNF we need BCNF definition. One relation which satisfies will be in BCNF and oth
er will be in 3NF. 1st is wrong because dependency may be preserved by both 3NF and BCNF. 2nd is wrong Becaus
e both 3NF and BCNF decomposition can be lossless. 4th is wrong because 3NF and BCNF both are in 3NF also.
Question 20
But we cannot say that A functionally determines B for the entire relation itself. This is because that, A->B holds for
this instance, but in future there might be some tuples added to the instance that may violate A->B.
So overall on the relation we cannot conclude that A->B, from the relational instance which is just a subset of an en
tire relation.
Question 21
Consider a schema R(A,B,C,D) and functional dependencies A->B and C->D. Then the decomposition of R into R1(AB) and R2(CD) is
Discuss it
Explanation
A simple way is to just check whether we can derive all the original FDs from the FDs present after decomposition.
In the above question R(A, B, C, D) is decomposed into R1 (A, B) and R2(C, D) and there are only two FDs A -> B an
d C -> D. So, the decomposition is dependency preserving
Lossless-Join Decomposition:
Decomposition of R into R1 and R2 is a lossless-join decomposition if at least one of the following functional depen
dencies are in F+ (Closure of functional dependencies)
R1 ∩ R2 → R1
OR
R1 ∩ R2 → R2
In the above question R(A, B, C, D) is decomposed into R1 (A, B) and R2(C, D), and R1 ∩ R2 is empty. So, the decom
position is not lossless.
Question 22
Suppose the adjacency relation of vertices in a graph is represented in a table Adj(X,Y). Which of the following queries cannot be
expressed by a relational algebra expression of constant length?
C List all vertices which belong to cycles of less than three vertices
Discuss it
Explanation
(A) This is simple query as we need to find (X, Y) for a given X. (B) This is also simple as need to find (X, X) (C) :-> C
ycle < 3 . Means cycle of length 1 & 2. Cycle of length 1 is easy., Same as self loop. Cycle of length 2 is is also not to
o hard to compute. Though it'll be little complex, will need to do like (X,Y) & (Y, X ) both present & X != Y,. We can d
o this with constant RA query. (D) :-> This is most hard part. Here we need to find closure of vertices. This will need
kind of loop. If the graph is like skewed tree, our query must loop for O(N) Times. We can't do with constant length
query here. Answer is :-> D
Question 23
Let r and s be two relations over the relation schemes R and S respectively, and let A be an attribute in R. then the relational algebra
expression is always equal to
A A
B B
C C
D D
Discuss it
Explanation
Therefore, Answer C
Question 24
R(A,B,C,D) is a relation. Which of the following does not have a lossless join, dependency preserving BCNF decomposition?
A A->B, B->CD
C AB->C, C->AD
D A ->BCD
Discuss it
Explanation
Background :
Lossless-Join Decomposition:
Decomposition of R into R1 and R2 is a lossless-join decomposition if at least one of the following functional d
ependencies are in F+ (Closure of functional dependencies)
R1 ∩ R2 → R1
OR
R1 ∩ R2 → R2
dependency preserving :
Decomposition of R into R1 and R2 is a dependency preserving decomposition if closure of functional depende
ncies after decomposition is same as closure of of FDs before decomposition.
A simple way is to just check whether we can derive all the original FDs from the FDs present after decomposit
ion.
Question :
We know that for lossless decomposition common attribute should be candidate key in one of the relation.
A) A->B, B->CD
R1(AB) and R2(BCD) B is the key of second and hence
decomposition is lossless.
B) A->B, B->C, C->D
R1(AB) , R2(BC), R3(CD) B is the key of second and C is the key of third,
hence lossless.
C) AB->C, C->AD
R1(ABC), R2(CD) C is key of second, but C->A violates BCNF condition in ABC as C is not a key. We cannot decomp
ose ABC further as AB->C
dependency would be lost.
D) A ->BCD
Already in BCNF.
Therefore, Option C AB->C, C->AD is the answer.
Question 25
A A
B B
C C
D D
Discuss it
Explanation
Consider a relation geq which represents “greater than or equal to”, that is, (x,y) ∈ geq only if y >= x.
create table geq
(
ib integer not null
ub integer not null
primary key 1b
foreign key (ub) references geq on delete cascade
)
Discuss it
Explanation
In the above question, the relation schema is ( lb , ub ), where lb is the primary key, and ub is the foreign key which i
s referencing the primary key of its own relation. Hence the table geq is both the master ( which has the referenced
key ) as well as the child table (which has the referencing key). The table has two constraint, one is that if there is a
tuple ( x, y ), then y is greater than or equal to x, And the other is referential integrity constraint, which is on-cascad
e-delete on the foreign key. On-cascade-delete says, that "When the referenced row is deleted from the other table
(master table), then delete also from the child table".
xy
-----
56
45
34
66
Now if we delete tuple (5,6) then tuple ( 4,5 ) should also be deleted ( as 5 in the tuple (4, 5) was referencing to 5 i
n the tuple(5,6) which no longer exist, hence the referencing tuple should also be deleted), and as (4,5) got deleted
hence tuple (3,4) should also be deleted for the same reason. Therefore in total 3 rows have to be deleted if tuple (
5,6 ) is deleted. Now from the above instance we can say that if (x,y), i.e. ( 5,6 ) gets deleted then a tuple ( z, w) i.e, (
3, 4) is also deleted. And we can see here that w < x. Hence option C.
Question 27
Which of the following queries cannot be expressed using the basic relational algebra operations (U, -, x,π, σ, ρ)?
A Department address of every employee
Discuss it
Question 28
Which of the following functional dependencies are satisfied by the instance? (GATE CS 2000)
Discuss it
Question 29
Consider an Entity-Relationship (ER) model in which entity sets E1 and E2 are connected by an m : n relationship R12, E1 and E3 are
connected by a 1 : n (1 on the side of E1 and n on the side of E3) relationship R13.
E1 has two single-valued attributes a11 and a12 of which a11 is the key attribute. E2 has two single-valued attributes a21 and a22 is the
key attribute. E3 has two single-valued attributes a31 and a32 of which a31 is the key attribute. The relationships do not have any
attributes.
If a relational model is derived from the above ER model, then the minimum number of relations that would be generated if all the
relations are in 3NF is ___________.
A 2
B 3
C 4
D 5
Discuss it
Explanation
Entity E1.
a1 a12
--------
a11 is key
Entity E2
a21 a22
--------
a22 is key
Entity E3
a31 a32
--------
a31 is key
Question 30
Consider the relation X(P, Q, R, S, T, U) with the following set of functional dependencies
F = {
{P, R} → {S,T},
{P, S, U} → {Q, R}
}
A {P,R}→{S,T}
B {P,R}→{R,T}
C {P,S}→{S}
D {P,S,U}→{Q}
Discuss it
Explanation
Question 31
Consider the following entity relationship diagram (ERD), where two entities E1 and E2 have a relation R of cardinality 1 : m.
The attributes of E1 are A11, A12 and A13 where A11 is the key attribute. The attributes of E2 are A21, A22 and A23 where A21 is the key
attribute and A23 is a multi-valued attribute. Relation R does not have any attribute. A relational database containing minimum number
of tables with each table satisfying the requirements of the third normal form (3NF) is designed from the above ERD. The number of
tables in the database is
A 2
B 3
C 5
D 4
Discuss it
Explanation
Step 1: 1NF
T1:
A11
, A12, A13 T2: A11,
A21
, A22,
A23
//because A23 is multivalued ,it has to be included in Key attribute
Step 2: 2NF //
A23 is Multivalued attribute and not allowed in 2NF therefore new tables are
:
T1:
A11
, A12, A13 T2: A11,
A21
, A22 T3:
A21
,
A23
Step 3: 3NF
// There is no transitive functional dependency in all tables , So in 3NF
Therefore answer is B
Question 32
A relational database contains two tables student and department in which student table has columns roll_no, name and
dept_id and department table has columns dept_id and dept_name. The following insert statements were executed
successfully to populate the empty tables:
How many rows and columns will be retrieved by the following SQL statement?
Select * from student, department
Discuss it
Explanation
Rows = 3*2 = 6
Columns = 3+2 = 5
Question 33
Consider the entities 'hotel room', and 'person' with a many to many relationship 'lodging' as shown below:
If we wish to store information about the rent payment to be made by person (s) occupying different hotel rooms, then this information
should appear as an attribute of
A Person
B Hotel Room
C Lodging
D None of these
Discuss it
Explanation
Lodging is the only attribute relating person and hotel room.
Question 34
A table has fields Fl, F2, F3, F4, F5 with the following functional dependencies
F1 → F3 F2→ F4 (F1 . F2) → F5
In terms of Normalization, this table is in
A 1 NF
B 2 NF
C 3 NF
D none
Discuss it
Explanation
A relation is in 2NF iff it has No Partial Dependency, i.e., no non-prime attribute (attributes which are not part of any
candidate key) is dependent on any proper subset of any candidate key of the table.
This table has Partial Dependency f1->f3, f2-> f4 given (F1,F2) is Key
So answer is A
Question 35
Which of the following is NOT a superkey in a relational schema with attributes V, W, X, Y, Z and primary key V Y ?
A VXYZ
B VWXZ
C VWXY
D VWXYZ
Discuss it
Explanation
Option 2: VWXZ
This set includes V, but it does not include Y.
Without Y, the set cannot uniquely identify tuples because V alone is insufficient to ensure uniqueness.
It is NOT a superkey.
Option 3: VWXY
This set includes V,Y (the primary key) and adds W,X.
Since it includes V,Y, it uniquely identifies every tuple.
It is a superkey.
Option 4: VWXYZ
This set includes V,Y (the primary key) and adds W,X,Z.
Since it includes V,Y, it uniquely identifies every tuple.
It is a superkey.
Correct Answer: The set that is NOT a superkey is: (B) VWXZ.
Question 36
Let R (A, B, C, D, E, P, G) be a relational schema in which the following functional dependencies are known to hold: AB → CD, DE → P, C → E,
P → C and B → G. The relational schema R is
A in BCNF
D not in 2NF
Discuss it
Explanation
Candidate key = AB
Question 37
B It will throw an error as BETWEEN can only be used for Numbers and not strings.
C It will display all the employees having last names starting from 'A' and ending with 'D'.
D
It will display all the employees having last names in the range of starting alphabets as 'A' and 'D' excluding the names starting
with 'A' and 'D'.
Discuss it
Explanation
The BETWEEN operator works with the range of character values also.
Question 38
A transaction consists of either a collection of DML statements or a DDL or DCL or TCL statement to form a logical unit
C
of work in a database session.
D A transaction consists of collection of DML and DDL statements in different sessions of the database.
Discuss it
Explanation
A database transaction consists of one or more DML statements to constitute one consistent change in data, or a DDL st
atement or a DCL command (GRANT or REVOKE). It starts with the first DML statement and ends with a DCL or DDL or T
CL (COMMIT or ROLLBACK) command. Note that DDL and DCL commands hold auto commit feature.
Question 39
Courses Let R = ( A, B, C, D, E, F ) be a relation scheme with the following dependencies: C→F, E→A, EC→D, A→B. Which of the following is a key of R?
Tutorials
Search... Sign In
Practice A CD
Jobs
DSA Practice Problems C C++ Java Python JavaScript Data Science Machine Learning Courses Linux DevOps SQL Web Develop
B EC
C AE
D AC
Discuss it
Question 40
Consider the schema R= ( S, T, U, V ) and the dependencies S→T, T→U, U→V and V→S. Let R (R1 and R2) be a decomposition
such that R1∩R2 ≠ Ø. The decomposition is:
Question 40 To determine the normal form, we need to analyze the functional dependencies and the properties of the decomposition:
1.1. Candidate Keys:
A Not in 2NF oFrom the given dependencies ST, TU, UV, and VS, we can infer that S, T, U, and V are all prime attributes (part of a candidate key).
oThe closure of S is {S, T, U, V} (ST, TU, UV, VS). Therefore, S is a candidate key.
oSimilarly, T, U, and V are also candidate keys.
2.2. 2NF (Second Normal Form):
B In 2NF but not in 3NF oA relation is in 2NF if it is in 1NF and all non-prime attributes are fully functionally dependent on every candidate key.
oIn this schema, all attributes (S, T, U, V) are prime attributes (part of a candidate key).
oSince there are no non-prime attributes, the condition for 2NF is trivially satisfied. Therefore, the relation is in 2NF.
3.3. 3NF (Third Normal Form):
oA relation is in 3NF if it is in 2NF and there are no transitive dependencies where a non-prime attribute is transitively dependent on a candidate key
C In 3NF but not in 2NF via another non-prime attribute.
oAgain, since all attributes are prime, there are no non-prime attributes to be transitively dependent.
oHowever, the presence of cyclical dependencies like ST, TU, UV, and VS indicates a violation of 3NF if we consider the entire schema as a single
relation before decomposition, as there are non-trivial functional dependencies where the right-hand side is a prime attribute, and the left-hand side is
D In both 2NF and 3NF not a superkey (e.g., ST, T is prime, S is not a superkey for the entire relation if we consider only S as a key).
oBut the question refers to the decomposition and states R1R2 Ø. This condition, along with all attributes being prime, implies that the
decomposition maintains the properties that would lead to 2NF and 3NF for the decomposed relations if the decomposition is done correctly and the
relations are considered individually after decomposition.
Discuss it 4.4. Conclusion:
oSince all attributes are prime, the relation R trivially satisfies 2NF.
oThe decomposition, given R1R2 Ø and all attributes being prime, implies that the resulting relations are also in 3NF, assuming a proper
decomposition.
Therefore, the decomposition is in both 2NF and 3NF.
The correct answer is D In both 2NF and 3NF.
Explanation
R1∩R2 ≠ Ø means there is common attribute in R1 and R2. Now if we choose a decomposition positively then we c
an choose something like R1(S, T, U) and R2(U, V) then we can say that decomposition is lossless because common
attribute is U and LHS of every FDs are candidate key, therefore it is in 2NF as well as 3NF. Option (D) is correct.
Question 41
Which normal form is considered adequate for normal relational database design?
A 2NF
B 5NF
C 4NF
D 3NF
Discuss it
Explanation
3NF is sufficient because because most of the 3NF tables are free of insertion, update, and deletion anomalies. Moreove
r, 3NF always ensures functional dependency preserving and lossless. So, option (D) is correct.
Question 42
Book_id
Subject_Category_of_book
Name_of_Author
Nationality_of_Author
Question 43
For a database relation R(a,b,c,d), where the domains a, b, c, d include only atomic values, only the following functional
dependencies and those that can be inferred from them hold:
{ a → c, b → d }
This relation is
Discuss it
Explanation
Candidate Key of above relation is :- ab only. a and b is partial attribute (part of the CK) that’s why the given FD is p
artially dependents. In 2NF there must not be partially dependents FD and we know that every table is already in 1
NF. Hence, this relation is in first normal form but not in second normal form. Option (A) is correct.
Question 44
Which of the following FD can’t be implied from FD set: {A->B, A->BC, C->D} ?
A A->C
B B->D
C BC->D
Discuss it
Explanation
A->C can be implied by A->BC and BC->D can be implied by C->D. But we can not get B->D sing given functional dep
endencies. Option (B) is correct.
Question 45
Relational algebra expression for query "Names of all people who frequent only pizzeria's serving at least one pizza they eat"
is
A 1
B Capture2
C Capture3
Discuss it
Question 46
How many minimum relation tables are required which satisfy 1NF? 333336
A 2, 2, and 1 respectively
B 2, 2, and 2 respectively
C 1, 2, and 1 respectively
D 1, 1, and 1 respectively
Discuss it
Question 47
Consider the following four relational schemas. For each schema, all non-trivial functional dependencies are listed, The underlined
attributes are the respective primary keys.
Schema I: Registration(rollno, courses) Field ‘courses’ is a set-valued attribute containing the set of courses a student has registered
for. Non-trivial functional dependency rollno → courses
Schema II: Registration (rollno, coursid, email) Non-trivial functional dependencies: rollno, courseid → emailemail → rollno
Schema III: Registration (rollno, courseid, marks, grade) Non-trivial functional dependencies: rollno, courseid, → marks, grademarks
→ grade
Schema IV: Registration (rollno, courseid, credit) Non-trivial functional dependencies: rollno, courseid → creditcourseid → credit
Which one of the relational schemas above is in 3NF but not in BCNF?
A Schema I
B Schema II
C Schema III
D Schema IV
Discuss it
Question 48
Consider the following table : Faculty (facName, dept, office, rank, dateHired)
facName dept office rank dateHired
Ravi Art A101 Professor 1975
Murali Math M201 Assistant 2000
Narayanan Art A101 Associate 1992
Lakshmi Math M201 Professor 1982
Mohan CSC C101 Professor 1980
Lakshmi Math M201 Professor 1982
Sreeni Math M203 Associate 1990
Tanuja CSC C101 Instructor 2001
Ganesh CSC C105 Associate 1995
(Assume that no faculty member within a single department has same name. Each faculty member has only one office
identified in office). 3NF refers to third normal form and BCNF refers to Boyee-Codd Normal Form Then Faculty is
C In 3NF, in BCNF
Discuss it
Question 49
If every non-key attribute is functionally dependent on the primary key, then the relation is in __________ .
Discuss it
Explanation
1. 1 NF - A relation R is in first normal form (1NF) if and only if all underlying domains contain atomic values only.
2. 2 NF - A relation R is in second normal form (2NF) if and only if it is in 1NF and every non-key attribute is fully
dependent on the primary key.
3. 3 NF - A relation R is in third normal form (3NF) if and only if it is in 2NF and every non-key attribute is non-tra
nsitively dependent on the primary key.
4. BCNF - A relation R is in Boyce-Codd normal form (BCNF) if and only if every determinant is a candidate key.
Example: Relation R(XYZ) with functional dependencies {X -> Y, Y -> Z, X -> Z}. Notice here Y -> Z, in question it is not
mention that non prime attribute is only dependent on primary key so this FD is perfectly valid. This relation is in 2NF b
ut not in 3NF because of every non-key attribute is transitively dependent on the primary key. Here {X} will be candidat
e key. So, option (B) is correct.
Question 50
A → B
B → C
C → D
D → B
Discuss it
Explanation
Schema R(A, B, C, D) is decomposed into three relation → R1 (A, B), R2(B, C) and R3(B, D) Now dependencies deriv
ed from R1 (A, B) are: A → B B → C but C is not attribute here in this relation. Dependencies derived from R1 (B, C)
are: B → C C → D D is not the attribute in relation. Dependencies derived from R1 (B, D) are: D → B B → C C → D A
ll the dependencies are preserved and it is a lossless decomposition. So, option (A) is correct.
Question 51
An attribute A of datatype varchar (20) has value ‘Ram’ and the attribute B of datatype char (20) has value ‘Sita’ in oracle. The
attribute A has _______ memory spaces and B has _______ memory spaces.
A 20,20
B 3,20
C 3,4
D 20,4
Discuss it
Explanation
varchar will acquire the exact memory of attribute and it varies from tuple to tuple while char will acquire memory space
which is define at the time of table creation it is fixed: varchar(20) 'Ram' will take 3 and 'Sita' will take 20 character space
in memory. So, option (B) is correct.
Question 52
Consider a schema R(MNPQ) and functional dependencies M → N, P → Q. Then the decomposition of R into R1 (MN) and R2(PQ)
is________.
Discuss it
Explanation
Schema R(MNPQ) is decomposed into R1(MN) M → N is preserved and R2(PQ) P → Q is also preserved, dependenc
y will be preserved and there will be no loss of any dependency. So, option (A) is correct.
Question 53
For a database relation R(A, B, C, D) where the domains of A, B, C and D include only atomic values, only the following
functional dependencies and those that can be inferred from them are : A → C B → D The relation R is in _______.
Discuss it
Explanation
A relation is in first normal form if every attribute in that relation is single valued attribute. It is in 1NF. {A,B} are pri
me attribtes and {C,D} are non-prime attribute. A+ = {A,C} B+ = {B,D} {A,B}+ = {A,B,C,D} so AB is the key. But A+ =
{A,C} B+ = {B,D} makes it partial dependency. So, this relation is not in 2NF. So, option (A) is correct.
Question 54
Let R = (A, B, C, D, E, F) be a relation schema with the following dependencies C->F, E->A, EC->D, A->B. Which of the
following is a key of R?
A CD
B EC
C AE
D AC
Discuss it
Question 55
A DDL
B DML
C DBA
D Schema
Discuss it
Explanation
1- DML stands for data manipulation language. The SQL commands that deals with the manipulation of data present in
the database belong to DML or Data Manipulation Language including retrieving, storing, modification, deletion, inserti
on and updation of data in a database. Examples of DML: SELECT, INSERT, UPDATE, DELETE. 2- DDL - Data Definition La
nguage - This commands in SQL includes the creation, deletion and modification of structure of database objects. Exam
ples of DDL commands: CREATE, DROP, ALTER, TRUNCATE, COMMENT, RENAME. It provides the facility of accessing dat
a from a database. 3- Functions of a DBA include: Schema definition, Storage structure and access-method definition, Sc
hema and physical-organization modification, Granting of authorization for data access, Routine maintenance. 4- Schem
a: The term "schema" refers to the organization of data as a blueprint of how the database is constructed (divided into d
atabase tables in the case of relational databases). The formal definition of a database schema is a set of formulas (sente
nces) called integrity constraints imposed on a database. So, option (A) is correct.
Question 56
Consider a database table R with attributes A and B. Which of the following SQL queries is illegal ?
A SELECT A FROM R;
Discuss it
Explanation
SELECT A FROM R; legal query SELECT A, COUNT(*) FROM R; Illegal query because we can't SELECT A, COUNT(*) unless
it is grouped by A. SELECT A, COUNT(*) FROM R GROUP BY A; legal query SELECT A, B, COUNT(*) FROM R GROUP BY A,
B; legal query So, option (B) is correct.
Question 57
Consider the schema R(A, B, C, D) and the functional dependencies A->B and C->D. If the decomposition is made as R1(A,B)
and R2(C,D), then which of the following is TRUE?
Discuss it
Explanation
schema: R(A, B, C, D)
functional dependencies: A->B and C->D
Decomposed Schema: R1(A,B) and R2(C,D)
Check for dependency preserving: A decomposition is said to be dependency preserving if F+ = (F1 ∪ F2 ∪ .. Fn)+,wh
ere F+ = total functional dependencies(FDs) on universal relation R, and F1 = set of FDs of R1, F2 = set of FDs of R2 and
so on.
R1(A,B)
A->B is covered
R2(C,D)
C->D is covered.
Both the functional dependencies are covered, so FD preserving. Check for lossless join: Decomposition of R into R1 a
nd R2 is a lossless-join decomposition if at least one of the following functional dependencies are in F+
R1 ∩ R2 -> R1
R1 ∩ R2 -> R2
Here, R1(A,B) ∩ R2(C,D) = null So, it can not perform a lossless join. Option (A) is correct.
Question 58
Which of the following statements is/are True regarding some advantages that an object-oriented DBMS (OODBMS) offers
over a relational database ? I. An OODBMS avoids the “impedance mismatch” problem. II. An OODBMS avoids the “phantom”
problem. III. An OODBMS provides higher performance concurrency control than most relational databases. IV. An OODBMS
provides faster access to individual data objects once they have been read from disk.
B I and IV only
Discuss it
Explanation
Question 59
Let x, y, z, a, b, c be the attributes of an entity set E. If {x}, {x,y}, {a,b}, {a,b,c}, {x,y,z} are superkeys then which of the following
are the candidate keys?
Discuss it
Explanation
A Candidate key is the minimal Superkey i.e. it is a minimal set of attributes required to identify a tuple. {x} ; {a,b} are the
candidate keys for the above schema as they do not contain any extraneous attribute. So, option (B) is correct.
Question 60
Which one of the following pairs is correctly matched in the context of database design? 12
A (1)
B (2)
C (3)
D (4)
Discuss it
Question 61
Consider the following table < img src = "https://www.cdn.geeksforgeeks.org/wp-content/uploads/ISRO64.png "> The table
is in which normal form?
Discuss it
Question 62
In RDBMS, the constraint that no key attribute (column) may be NULL is referred to as:
A Referential integrity
B Multi-valued dependency
C Entity Integrity
D Functional dependency
Discuss it
Explanation
In RDBMS, the constraint that no key attribute (column) may be NULL is referred to as Entity Interity
Referential integrity states that table relationships must always be consistent.
Multi-valued dependencyis a full constraint between two sets of attributes in a relation
Functional dependency is a relationship that exists when one attribute uniquely determines another attribute.
Question 63
Which of the following statements is TRUE? D1 : The decomposition of the schema R(A, B, C) into R1(A, B) and R2 (A, C) is always lossless.
D2 : The decomposition of the schema R(A, B, C, D, E) having AD → B, C → DE, B → AE and AE → C, into R1 (A, B, D) and R2 (A, C, D, E) is
lossless.
A Both D1 and D2
B Neither D1 nor D2
C Only D1
D Only D2
Discuss it
Explanation
Only D2 is True because AD is key and present in both the tables. D1 is not always true because FD’s not given and
if we take B->A and C->A then it is lossy decomposition because no common attributes contain key from one of the
table.
Question 64
Consider the following dependencies and the BOOK table in a relational database design. Determine the normal form of the
given relation.
ISBN → Title
ISBN → Publisher
Publisher → Address
D BCNF
Discuss it
Explanation
Candidate key = ISBN For a relation having functional dependencies of the form α → β, a relation is in 2-NF if: i) α s
hould not be a proper subset of the candidate key, or, ii) β - α should be a prime attribute. First condition satisfies as
the candidate key contains only one attribute. So, this relation is in 2-NF
Question 65
Consider a “CUSTOMERS” database table having a column “CITY” filled with all the names of Indian cities (in capital letters).
The SQL statement that finds all cities that have “GAR” somewhere in its name, is:
Discuss it
Question 66
A (1)
B (2)
C (3)
D (4)
Discuss it
Question 67
Data which improves the performance and accessibility of the database are called:
A Indexes
B User Data
C Application Metadata
D Data Dictionary
Discuss it
Explanation
Data which improves the performance and accessibility of the database are called indexes because index is a type of any
data which improves the lookup table. Simply we can say that an index is a pointer to data in a table which increases the
accessibility in a book or databases, we can easily access any information with the help of index. Option (A) is correct
Question 68
Which type of DBMS provides support for maintaining several versions of the same entity?
B Hierarchical
D Network
Discuss it
Explanation
Object Oriented Database Management Systems allow object-oriented programmers to develop the product, store the
m as objects, and replicate or modify existing objects to make new objects within the OODBMS. Option (C) is correct.
Question 69
Discuss it
Explanation
A full functional dependency is a state of database normalization similar to Second Normal Form (2NF). It means that th
e schema should meet the requirements of First Normal Form (1NF), and all non-key attributes are fully functionally dep
endent on the primary key and partial dependency on the candidate key should not exist. So, Option (B) is correct.
Question 70
Consider the following database table: Create table test( one integer, two integer, primary key(one), unique(two), check(one >= 1 and <=
10), check(two >= 1 and <= 5) ); How many data records/tuples atmost can this table containt?
A 5
B 10
C 15
D 50
Discuss it
Explanation
check(one >= 1 and <= 10), check(two >= 1 and <= 5).
Here second constraint will decide the no of tuples(record). Or we can say that the common condition will dominat
e.
i.e. check(two >= 1 and <= 5) 5 tuples.
So, option (A) is correct.
Question 71
Consider the following three tables R, S and T. In this question, all the join operations are natural joins (⨝). (π) is the projection
operation of a relation: 69 (1) (a) 692 (2) (b) 692 (1) (1) (c) 692 (1) (2) (d) 692 (1) (3)
A (a)
B (b)
C (c)
D (d)
Discuss it
Question 72
B Referential Integrity
C Domain Integrity
Discuss it
Explanation
A FOREIGN KEY is a field (or collection of fields) in one table that refers to the PRIMARY KEY in another table. The table
containing the foreign key is called the child table, and the table containing the candidate key is called the referenced o
r parent table. Although there may be exceptions, the values in the foreign key columns usually must correspond to valu
es existing in the set of primary key values. This correspondence requirement is created in a database using a referential
integrity constraint on the foreign key. Option (B) is correct.
Question 73
Select the 'False' statement from the following statements about Normal Forms:
Discuss it
Explanation
Question 74
The best normal form of relation scheme R(A, B, C, D) along with the set of functional dependencies F = {AB → C, AB → D, C
→ A, D → B} is
Discuss it
Explanation
Here C-> A (prime attribute -> prime attribute) and D->A (prime attribute -> prime attribute) is partially dependents
FDs . This type of FD must not be in BCNF and there is no problem with this type of FDs in 3NF. Option (B) is correc
t.
Question 75
Discuss it
Explanation
Every binary relation is never be in BCNF. This statement is incorrect because Every binary relation is always in BCNF.
Every BCNF relation is in 3NF. Correct.
1 NF, 2 NF, 3 NF and BCNF are based on functional dependencies. Correct.
Multivalued Dependency (MVD) is a special case of Join Dependency (JD).Correct.
So, option (A) is correct.
Question 76
For a database relation R(a,b,c,d) where the domains of a, b, c and d include only atomic values, only the following functional
dependencies and those that can be inferred from them hold
a -> c
b -> d
The relation is in
Discuss it
Explanation
Candidate Key of this relation is ab and prime attribute are a and b.
Here a->b is (prime attribute-> Non prime attribute) and b>d is (prime attribute-> Non prime attribute) which is (par
tial dependency) must not present in 2NF. And every relation is already in 1NF.
Question 77
The set of attributes X will be fully functionally dependent on the set of attributes Y if the following conditions are satisfied.
A X is functionally dependent on Y
D None of these
Discuss it
Explanation
The term full functional dependency is used to indicate the minimum set of attributes in a functional dependency. In
other words, the set of attributes X will be fully functionally dependent on the set of attributes Y if the following co
nditions are satisfied:
Example: In relation
StuGrade
:
The values of
stud_id, course_id, course_name
determine a unique value of
course_grade
. However, it is not a full functional dependency because it is sufficient to know only the value of a subset of {stud_i
d, course_id, course_name}, namely, {stud_id, course_id}, to determine the course_grade Thus, the correct full functi
onal dependency can be written as:
Question 78
For a database relation R(a, b, c, d) where the domains of a, b, c and d include only atomic values, and only the following
functional dependencies and those that can be inferred from them hold : a → c b → d The relation is in _________.
D BCNF
Discuss it
Question 79
Consider a relational table R that is in 3NF, but not in BCNF. Which one of the following statements is TRUE ?
A R has a nontrivial functional dependency X→A, where X is not a superkey and A is a prime attribute
B
R has a nontrivial functional dependency X→A, where X is not a superkey and A is a non-prime attribute and X is not a proper
subset of any key
C
R has a nontrivial functional dependency X→A, where X is not a superkey and A is a non-prime attribute and X is a proper subset of
some key
Discuss it
Explanation
A relation is in 3NF if at least one of the following condition holds in every non-trivial function dependency X → Y:
But, a relation is in BCNF if, X is superkey for every functional dependency (FD) X → Y in given relation.
Therefore, BCNF relations are subset of 3NF relations. Means every BCNF relation is 3NF but converse may not tru
e.
Option (A) is correct.
Question 80
Consider the following statements S1 and S2 about the relational data model:
S1: A relation scheme can have at most one foreign key.
S2: A foreign key in a relation scheme R cannot be used to refer to tuples of R.
Which one of the following choices is correct?
Explanation
S1: False, Because more than one Foreign key is possible if there is a requirement.
S2: False, Because foreign key act upon columns and used to identify tuples.
Question 81
Suppose the following functional dependencies hold on a relation U with attributes P,Q,R,S, and T:
P → QR
RS → T
Which of the following functional dependencies can be inferred from the above functional dependencies?
PS → T
R→T
P→R
PS → Q
Discuss it Submit
Explanation
P-> QR
RS-> T
Question 82
Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values. F = {CH -> G, A -> BC, B -> CFH, E -> A, F -
> EG} is a set of functional dependencies (FDs) so that F+ is exactly the set of FDs that hold for R. How many candidate keys
does the relation R have?
A 3
B 4
C 5
D 6
Discuss it
Explanation
A+ is ABCEFGH which is all attributes except D. B+ is also ABCEFGH which is all attributes except D. E+ is also ABCEFGH
which is all attributes except D. F+ is also ABCEFGH which is all attributes except D. So there are total 4 candidate keys A
D, BD, ED and FD
Question 83
In RDBMS, different classes of relations are created using __________ technique to prevent modification anomalies.
A Functional Dependencies
B Data integrity
C Referential integrity
D Normal Forms
Discuss it
Explanation
Functional dependency is a constraint that describes the relationship between attributes in a relation. Data integrity ref
ers to the accuracy and consistency of data stored in a database, data warehouse, data mart or other construct. Referen
tial integrity is a relational database concept, which states that table relationships must always be consistent. Normaliza
tion is a process of organizing the data in database to avoid data redundancy, insertion anomaly, update anomaly & del
etion anomaly. 1NF, 2NF, 3NF and BCNF are types of normal forms. So, option (D) is correct.
Question 84
A relation r(A,B) in a relational database has 1200 tuples. The attribute A has integer values ranging from 6 to 20, and the attribute B has
integer values ranging from 1 to 20. Assume that the attributes A and B are independently distributed. The estimated number of tuples
in the output of σ(A>10)∨(B=18)(r) is ____________.
A 820
B 1200
C 960
D 1000
Discuss it
Explanation
A 1 NF
B 2 NF
C 3 NF
D 4 NF
Discuss it
Explanation
As we know that every table is already in 1NF. and relations produced from E – R Model will always be a table whic
h is in 1Nf. Hence (A) is correct.
Question 86
Consider the relation R (ABCDE): FD = { A → B, B → C, C → D, D → E} Find out the highest normal form.
A 1 NF
B 2 NF
C 3 NF
D BCNF
Discuss it
Explanation
Here candidate Key is A and B -> C , C -> D , D -> E all are. (Non prime attribute -> Non prime attribute.). This type of F
D must not be present in 3NF therefore highest normal form of this FDs are 2NF. Option (B) is correct.
Question 87
Let R = ABCDE is a relational scheme with functional dependency set F = {A → B, B → C, AC → D}. The attribute closures of A
and E are
A ABCD, φ
B ABCD, E
C Φ, φ
D ABC, E
Discuss it
Explanation
The attribute closures of A: A+ = ABCD The attribute closures of E: E+ = E. So, option (B) is correct.
Question 88
Discuss it
Explanation
A relation is in BCNF if all attributes which are determinants are also candidate keys in every relation.
Transformation into BCNF deals with the problem of overlapping keys and there is no problem with two or more C
K.
Question 89
The Relation Vendor Order (V_no, V_ord_no, V_name, Qty_sup, unit_price) is in 2NF because:
Discuss it
Explanation
The Relation Vendor Order (V_no, V_ord_no, V_name, Qty_sup, unit_price) is in 2NF because: Non_key attribute V_n
ame is dependent on V_no which is part of composite key. For more information on Normal forms Refer:Database N
ormalization | Normal Forms Option (A) is correct.
Tags: DBMS Quiz
Question Engineering
Maths