0% found this document useful (0 votes)
42 views838 pages

Dbms MCQ

The document contains a series of questions and answers related to relational database systems, including concepts such as degree of relations, entity-relationship diagrams, superkeys, and referential integrity. Each question is followed by a correct answer and an explanation to clarify the reasoning behind it. Additionally, there are links to download an app for further resources and support.
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)
42 views838 pages

Dbms MCQ

The document contains a series of questions and answers related to relational database systems, including concepts such as degree of relations, entity-relationship diagrams, superkeys, and referential integrity. Each question is followed by a correct answer and an explanation to clarify the reasoning behind it. Additionally, there are links to download an app for further resources and support.
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/ 838

Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 1
Which one of the options given below refers to the degree (or arity) of a relation in relational
database systems?

A. Number of attributes of its relation schema.

B. Number of tuples stored in the relation.

C. Number of entries in the relation.

D. Number of distinct domains of its relation schema.


Solution A
The degree (or arity) of a relation in a relational database system refers to
the number of attributes (or fields) of its relation schema. Therefore,
Option A is the correct answer.

The degree is a fundamental property of the relation that does not change
with the number of tuples/rows stored in the relation, or with the number of
entries in the relation. Moreover, the degree does not directly depend on
the number of distinct domains of its relation schema.
Question 2
Which one of the following is used to represent the supporting many-one
relationships of a weak entity set in an entity-relationship diagram?

A. Rectangles with double/bold border


B. Diamonds with double/bold border
C. Ovals that contain underlined identifiers
D. Ovals with double/bold border
Answer is B
Question 3

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) V X Y Z
(B) V W X Z
(C) V W X Y
(D) V W X Y Z
Solution 3

Answer: (B)

Explanation: Super key = Candidate Key + other attributes. But option B


does not include Y which is a part of PK or candidate key.
Question 4
Given an instance of the STUDENTS relation as shown below:

For (StudentName, StudentAge) to be a key for this instance, the value X should NOT be equal
to ________.
Answer: 19
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 5
An index is clustered, if
(A) it is on a set of fields that form a candidate key.
(B) it is on a set of fields that include the primary key.
(C) the data records of the file are organized in the same order as the data
entries of the index.
(D) the data records of the file are organized not in the same order as the
data entries of the index.
Solution 5

Answer: (C)

Explanation: A database index is clustered if physical records on disk


follow the index order.
Question 6
Given the basic ER and relational models, which of the following is
INCORRECT?
(A) An attribute of an entity can have more than one value
(B) An attribute of an entity can be composite
(C) In a row of a relational table, an attribute can have more than one
value
(D) In a row of a relational table, an attribute can have exactly one value
or a NULL value
Answer: (C)

Explanation: The term ‘entity’ belongs to ER model and the term ‘relational
table’ belongs to relational model.
A and B both are true. ER model supports both multivalued and composite
attributes See this for more details.
(C) is false and (D) is true. In Relation model, an entry in relational table
can can have exactly one value or a NULL.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 7
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
Which one of the following option is INCORRECT?
(A) BankAccount_Num is candidate key
(B) Registration_Num can be a primary key
(C) UID is candidate key if all students are from the same country
(D) If S is a superkey such that S∩UID is NULL then S∪UID is also a superkey
Solution
Answer: (A)

Explanation: A Candidate Key value must uniquely identify the


corresponding row in table. BankAccount_Number is not a candidate key.
As per the question “A student can have multiple accounts or joint
accounts. This attributes stores the primary account number”. If two
students have a joint account and if the joint account is their primary
account, then BankAccount_Number value cannot uniquely identify a row.
Question 8
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
Answer: (C)

Explanation:
Lodging is the only attribute relating person and hotel room.
Question 9
In an Entity-Relationship (ER) model, suppose R is a many-to-one
relationship from entity set E1 to entity set E2. Assume that E1 and E2
participate totally in R and that the cardinality of E1 is greater that the
cardinality of E2.
Which one of the following is true about R?
(A) Every entity in E1 is associated with exactly one entity in E2.
(B) Some entity in E1 is associated with more than one entity in E2.
(C) Every entity in E2 is associated with exactly one entity in E1.
(D) Every entity in E2 is associated with at most one entity in E1.
Solution
Answer: (A)

Explanation: Since given relation is many to one :

Therefore, no entity in E1 can be related to more than one entity in E2 and an entity in E2 can be related
to more than one entity in E1.
Only option (A) is correct.
Question 10
Consider the following ER diagram.

The minimum number of tables needed to represent M, N, P, R1, R2 is


(A) 2
(B) 3
(C) 4
(D) 5
Solution
Answer: (B)

Explanation: Answer is B, i.e, 3 minimum tables.


M, P are strong entities hence they must be represented by separate tables.
Many-to-one and one-to-many relationship sets that are total on the many-side can be represented by adding an extra
attribute to the “many” side, containing the primary key of the “one” side. ( This way no extra table will be needed for
Relationship sets )
M table is modified to include primary key of P side(i.e. P1). N is weak entity, and is modified to include primary key of P
(i.e, P1).
Therefore there would be minimum of 3 tables with schema given below :
M ( M1, M2, M3, P1)
P ( P1, P2 )
N ( P1, N1, N2 )
Question 11
Consider the data given in above question. Which of the following is a correct attribute set for
one of the tables for the correct answer to the above question?

(A) {M1, M2, M3, P1}


(B) {M1, P1, N1, N2}
(C) {M1, P1, N1}
(D) {M1, P1}
Answer: (A)

Explanation: As given in the explanation We get 3 tables.


M: {M1, M2, M3, P1}
P: {P1, P2}
N: {P1, N1, N2}
The only attribute set that matches the given table sets is A. Therefore,
option A
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 12
Let E1 and E2 be two entities in an E/R diagram with simple single-valued
attributes. R1 and R2 are two relationships between E1 and E2, where R1
is one-to-many and R2 is many-to-many. R1 and R2 do not have any
attributes of their own. What is the minimum number of tables required to
represent this situation in the relational model?
(A) 2
(B) 3
(C) 4
(D) 5
Answer: (B)

Explanation:
The answer is B, i.e minimum 3 tables. Strong entities E1 and E2 are represented as separate tables. In addition to that many-to-many relationships(R2) must be
converted as separate table by having primary keys of E1 and E2 as foreign keys. One-to-many relationship (R1) must be transferred to \’many\’ side table(i.e. E2)
by having primary key of one side(E1) as foreign key( this way we need not to make a separate table for R1). Let relation schema be E1(a1,a2) and E2( b1,b2).
Relation E1( a1 is the key)
a1 a2
-------
13
24
34
Relation E2( b1 is the key, a1 is the foreign key, hence R1(one-many) relationship set satisfy here )
b1 b2 a1
-----------
742
872
973
Relation R2 ( {a1, b1} combined is the key here , representing many-many relationship R2 )
a1 b1
--------
17
18
29
39
Hence we will have minimum of 3 tables.
Question 13
The following table has two attributes A and C where A is the primary key and C is the foreign key referencing A with on-delete
cascade.
A C
-----
2 4
3 4
4 3
5 2
7 2
9 5
6 4
The set of all tuples that must be additionally deleted to preserve referential integrity when the tuple (2,4) is deleted is:
(A) (3,4) and (6,4)
(B) (5,2) and (7,2)
(C) (5,2), (7,2) and (9,5)
(D) (3,4), (4,3) and (6,4)
Answer (C)
When (2,4) is deleted. Since C is a foreign key referring A with delete on
cascade, all entries with value 2 in C must be deleted. So (5, 2) and (7, 2)
are deleted. As a result of this 5 and 7 are deleted from A which causes
(9, 5) to be deleted.
Question 14
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
Answer: (B)

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 15
Consider the following three relations in a relational database. Employee (eId, Name ), Brand
(bId, bName), Own (eId, bId ) Which of the following relational algebra expressions return the
set of eIds who own all the brands?
Answer: (A) (B)

Explanation:
Option A and Option B are the relational algebra expressions that results
eid’s which owns every brand of brand relation.
Question 16
Answer: (A)

Explanation: The Relational Algebra expression in the question above, does 4 operations, step by step ( innermost braces first ) .
1. Select those tuples from relation r which satisfies
expression/condition F1, say the result of this
operation is set A.

2. Select those tuples from set A which satisfies


expression/condition F2, say the result of this
operation is set B.

3. Select attributes set A2 from set B, say the


result of this operation is set C.

4. Select attributes set A1 from set C, say the


result is set D which is the final result.
Now to optimize this expression, we can combine operations/steps 1 and 2 by AND operator between F1 and F2 condition, like F1 ^ F2, and instead
of selecting first attribute set A2, we can directly select attribute set A1 from the result of the combined operation, which is represented by expression
in Option A .
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 17
Answer: (C)

Explanation: Some transformation rules for tuple relational calculus are :

Thus, using the above rules option (C) is correct.

Please comment below if you find anything wrong in the above post.
Question 18
Consider the relations r1(P, Q, R) and r2(R, S, T) with primary keys P and
R respectively. The relation r1 contains 2000 tuples and r2 contains 2500
tuples. The maximum size of the join r1⋈ r2 is :

(A) 2000
(B) 2500
(C) 4500
(D) 5000
Answer: (A)

Explanation:
r1⋈ r2 is a join operation done on the common attribute R. Further R is
the primary key of R2
When we take a , the value of common attribute( R2 in this case) should
match.The value of R in r2 is matched with corresponding R in r1 . So it
will have 2000 tuples. So correct option is (A).
Question 19
Which of the following relational query languages have the same expressive power?
1. Relational algebra

2. Tuple relational calculus restricted to safe expressions

3. Domain relational calculus restricted to safe expressions

(A) II and III only


(B) I and II only
(C) I and III only
(D) I, II and III
Answer: (D)

Explanation:
Relational algebra is a procedural query language where we input – relations and it yields
relations as output. It provides method to get the result. It is performed recursively on a relation
and the in between results are relations(output). Basic set of operations for the relational
model. Relational calculus is a non – procedural query language. It provides the query to get
result. Higher level declarative language for specifying relational queries. Tuple Relational
Calculus operates on each tuple.
Domain Relational Calculus operates on each column or attribute. Safe expression means
fixed no. of tuple or column or attribute as a result But all of them has same expressive power.
Just different ways to do so.
Question 20
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
Answer (c)
Consider the following example with lossy decomposition of r into r1 and r2. We can see that r is a subset 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

Table s (natural join of r1 and r2)


A B C D
---------------------------
1 10 100 1000
1 20 200 1000
1 10 100 1001
1 20 200 1001
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 21
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
Answer: (B)

Explanation: Since C is a foreign key in R1 and there is no violation of the


above referential integrity constraint, the set of values in C must be a
subset of values in R2.
Question 22
Consider the following SQL query
select distinct al, a2,........., an
from r1, r2,........, rm
where P
For an arbitrary predicate P, this query is equivalent to which of the following relational algebra expressions ?
Answer: (A)

Explanation:
Cross product (x) combines the tuples of one relation with all the tuples of the other relation. Thus, tuples
of relation r1, r2 …. rn are combined.

Select operator is used to select resultant tuples.

Projection operator is used to select a subset of attributes from the resultant tuples by specifying the
names of the attributes. So attributes a1, a2, an are projected from the resultant tuples.

Thus, option (A) is correct.


Question 23

With regard to the expressive power of the formal relational query


languages, which of the following statements is true?
(A) Relational algebra is more powerful than relational calculus
(B) Relational algebra has the same power as relational calculus
(C) Relational algebra has the same power as safe relational calculus
(D) None of the above
Answer: (C)

Explanation:
A query can be formulated in relational calculus if and only if it can be formulated in relational algebra. So, relational
algebra has the same power as relational calculus.

But, it is possible to write syntactically correct relational calculus queries that have infinite number of answers. Such
queries are unsafe.
Queries that have an finite number of answers are safe relational calculus queries.

Thus, Relational algebra has the same power as safe relational calculus.

Thus, option (C) is the answer.


Given the relations
Question 24
employee (name, salary, deptno) and
department (deptno, deptname, address)
Which of the following queries cannot be expressed using the basic
relational algebra operations (U, -, x, , , p)?
(A) Department address of every employee
(B) Employees whose name is the same as their department name
(C) The sum of all employees’ salaries
(D) All employees of a given department
Answer: (c)
Explanation:
The six basic operators of relational algebra are the selection(σ ), the
projection(π), the Cartesian product (x) (also called the cross product or cross
join), the set union (U), the set difference (-), and the rename (p). These six
operators are fundamental in the sense that none of them can be omitted without
losing expressive power. Many other operators have been defined in terms of
these six. Among the most important are set intersection, division, and the natural
join, but aggregation is not possible with these basic relational algebra operations.
So, we cannot run sum of all employees’ salaries with the six operations.
Question 25
Consider the join of a relation R , with a relation S . If R has m number of
tuples and S has n number of tuples then the maximum and minimum
sizes of the join respectively are:
(A) m + n & 0
(B) mn & 0
(C) m + n & | m – n |
(D) mn & m + n
Answer: (B)

Explanation:
Consider the following examples:
Case 1: Maximum tuples- When the common attribute contains identical values
Relation R Relation S R⋈S
a b a d a b d
1 2 1 10 1 2 10
1 3 1 11 1 2 11
1 4 1 3 10
1 3 11
1 4 10
1 4 11
Case 2: Minimum Tuples- When Both the relations have a common attribute but no tuple in both relations match.
Relation R Relation S R⋈S
a b a d a b d
1 2 2 10 No tuple
1 3 3 11
1 4
So, option (B) is correct.
Question 26
The relational algebra expression equivalent to the following tuple calculus expression

{ t | t ∈ r ∧ (t[A] = 10 ∧ t[B] = 20 }
is
Answer: (C)

Explanation: In Given relational algebra, Tuple t should have two attributes


A=10 and B=20
In A, we select tuples having A=10 or B=20 so, it is wrong choice.
In B, we select tuples having A=10 or we can select tuples having B=20,
so it is also wrong choice.
D is also wrong choice.
In C, we select tuples having A=10 and tuples having B=20, it is same as
above relational algebra. Hence, option (C) is Correct.
Data Base Management System
Functional Dependency
Question 27
In a relational data model, which one of the following statements is
TRUE?
A A relation with only two attributes is always in BCNF.
B If all attributes of a relation are prime attributes, then the relation is in
BCNF.
C Every relation has at least one non-prime attribute.
D BCNF decompositions preserve functional dependencies.
Answer: (A)

Explanation:
Option A: It is true to say that every binary relation is always in BCNF
Option B: This is false because it is not necessary to have a relation in BCNF if all the
attributes are prime attributes. For example, R(A, B, C) with FD A -> C, B -> C, C -> A
Here all the attributes are prime but it is not in BCNF.
Option C: No, it is not necessary to have at least one non-prime attribute in a relation
Option D: No, it is not necessary that every lossless BCNF decomposition is
dependency preserving
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 28

Consider a relation R(A, B, C, D, E) with the following three functional


dependencies.
AB → C ; BC → D ; C → E;
The number of superkeys in the relation R is _________.
AB+ = ABCDE

AB : Candidate key
Non prime attribute = C, D, E

Number of superkeys = 23 = 8. Those are AB, ABC, ABD, ABE, ABCD,
ABCE, ABDE, ABCDE. In super key candidate key should always present.
Question 29
A database of research articles in a journal uses the following schema.
(VOLUME, NUMBER, STARTPGE, ENDPAGE, TITLE, YEAR, PRICE)
The primary key is (VOLUME, NUMBER, STARTPAGE, ENDPAGE) and the following functional dependencies exist in the
schema.
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> TITLE
(VOLUME, NUMBER) -> YEAR
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> PRICE
The database is redesigned to use the following schemas.
(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, PRICE)
(VOLUME, NUMBER, YEAR)
Which is the weakest normal form that the new database satisfies, but the old one does not?
(A) 1NF
(B) 2NF
(C) 3NF
(D) BCNF
Solution
Answer: (B)

Explanation: Old relation has functional dependency : Volume, Number -> Year
as partial dependency. So it does not follow 2NF.
But, there is no partial dependency in the New relation and so it satisfies 2NF as
well as 3NF.
Therefore, 2NF is the weakest normal form that the new database satisfies, but
the old one does not.
Option (B) is true.
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}
}
Which of the following is the trivial functional dependency in F+ is closure of F?
(A) {P,R}→{S,T}
(B) {P,R}→{R,T}
(C) {P,S}→{S}
(D) {P,S,U}→{Q}
Answer: (C)

Explanation: A functional dependency X -> Y is trivial if Y is a subset of X.


Question 31
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}
Solution 32
Using the given options try to obtain closure of each options. The solution is the one that contains R and also minimal Super Key, i.e

Candidate Key.
A) {EF}+ = {EFGIJ} ≠ R(The given relation)

B) {EFH}+ = {EFGHIJKLMN} = R (Correct since each member of the


given relation is determined)

C) {EFHKL}+ = {EFGHIJKLMN} = R (Not correct although each member


of the given relation can be determined
but it is not minimal, since by the definition
of Candidate key it should be minimal Super Key)

D) {E}+ = {E} ≠ R

Solution B
Question 33

A prime attribute of a relation scheme R is an attribute that appears


(A) in all candidate keys of R.
(B) in some candidate key of R.
(C) in a foreign key of R.
(D) only in the primary key of R.
Answer: (B)

Explanation: The constituent attributes of a Candidate key or simply the


attributes of a candidate key are called the prime attributes.
Suppose ABC is one candidate key of a Relation R(ABCDEFGH). Then
the attributes A, B and C all are prime attributes. Similarly if ABD is also
another candidate key in the same relation R, then D is also the prime
attribute. And conversely, an attribute that does not occur in ANY
candidate key is called a non-prime attribute.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 34

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
Solution
Answer: (D)

Explanation: Maximum no. of possible superkeys for a table with n


attributes = 2^(n-1)
Here, n = 4.
So, the possible superkeys = 24-1 = 8
The possible superkeys are : E, EH, EG, EF, EGH, EFH, EFG, EFGH
Question 35
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
Answer: (A)

Explanation:
First Normal Form
A relation is in first normal form if every attribute in that relation is singled valued attribute.
Second Normal Form
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 36
1) Which one of the following statements about normal forms is FALSE?
(a) BCNF is stricter than 3NF
(b) Lossless, dependency-preserving decomposition into 3NF is always
possible
(c) Lossless, dependency-preserving decomposition into BCNF is always
possible
(d) Any relation with two attributes is in BCNF
Solution

Answer (c)
It is not always possible to decompose a table in BCNF and preserve
dependencies. For example, a set of functional dependencies
{AB –> C, C –> B} cannot be decomposed in BCNF.
Question 37
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
(C) Proportional to the size of F+
(D) Indeterminate
Solution

Answer: (A)

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 38
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
(A) dependency preserving and lossless join
(B) lossless join but not dependency preserving
(C) dependency preserving but not lossless join
(D) not dependency preserving and not lossless join
Answer: (C)

Explanation: Dependency Preserving Decomposition:


Decomposition of R into R1 and R2 is a dependency preserving decomposition if closure of functional dependencies 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 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 and 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 dependencies 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 decomposition is not
lossless.
Question 39
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?
(A) CD
(B) EC
(C) AE
(D) AC
Answer: (B)

Explanation: To check find the closure for all


{CD} = {CDF}
{EC} = {ECDAFB} Only this is the key because it drives all attributes.
{AE} = {AEB}
{AC} = {ACBF}
Hence, Option (B) is Correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 40
Which normal form is considered adequate for normal relational database
design?
(A) 2NF
(B) 5NF
(C) 4NF
(D) 3NF
Answer: (D)

Explanation: 3NF is sufficient because because most of the 3NF tables


are free of insertion, update, and deletion anomalies. Moreover, 3NF
always ensures functional dependency preserving and lossless.
So, option (D) is correct.
Question 41

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
(B) A->B, B->C, C->D
(C) AB->C, C->AD
(D) A ->BCD
Answer: (C)
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 dependencies 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
dependencies 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
decomposition.
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 decompose 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 42
Consider the relation R(P,Q,S,T,X,Y,Z,W) with the following functional dependencies.

Consider the decomposition of the relation R into the constituent relations according to the following two decomposition
schemes.

Which one of the following options is correct?


(A) D1 is a lossless decomposition, but D2 is a lossy decomposition
(B) D1 is a lossy decomposition, but D2 is a lossless decomposition
(C) Both D1 and D2 are lossless decompositions
(D) Both D1 and D2 are lossy decompositions
Answer: (A)

Explanation: Lossless-Join Decomposition:


Lossless-Join Decomposition:
Decomposition of R into R1, R2, R3, R4 is a lossless-join decomposition if at least one of the following functional
dependencies are in F+ (Closure of functional dependencies):
similarly,
R1 ∩ R2 → R1 OR R1 ∩ R2 → R2
R3 ∩ R4 =(Y)+ = YZW, it is a super key, so we can merge R3 and R4.
For decomposition D1:
another combined table T2 is QYZW.
R1(PQST)
now, Q is common in both T1 and T2.
R2(PTX) T1 ∩ T2 = Q+ = QYZW, it is a super key, so we can merge T1 and T2.
R3(QY) after combining, we get original table PQSTXYZW,
R4(YZW) Hence D1 is lossless join decomposition.
R1 ∩ R2 = (PT)+ = PTYXZW , it is a super key, For decomposition D2:
so we can merge R1 and R2. R1(PQS)

combined table T1 is PQSTX R2(TX)


R3(QY)
R4(YZW)
since R2 has no common attributes as the primary key, so R2 cannot be
merge with any other table,
Hence D2 is lossy decomposition.
Question 43
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

(D). A cell in R holds a set instead of an atomic value


Answer: (A)

Explanation:
A relation is in 3NF if at least one of the following condition holds in every non-trivial function dependency X → Y:
1.X is a super key. (This condition is must for BCNF relations.).

2.Y is a prime attribute (each element of Y is part of some candidate key).

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 true.
Option (A) is correct.
Question 44
Let the set of functional dependencies F = {QR → S, R → P, S → Q} hold on a relation schema X = (PQRS). X is
not in BCNF. Suppose X is decomposed into two schemas and Z where Y = (PR) and Z = (QRS). Consider the
two statements given below:
• I. Both Y and Z are in BCNF

• II. Decomposition of X into Y and Z is dependency preserving and a lossless.

Which of the above statements is/are correct?


(A). I only
(B). Neither I nor II
(C). Both I and II
(D). II only
Answer: (D)

Explanation:
X(PQRS) {QR → S, R → P, S → Q} decomposed into Y (PR) and Z (QRS). So,
Y (PR) Z (QRS)
{R → P} {QR → S, S → Q}
Candidate key : {R} Candidate key : {QR, RS}
So, relation Y in BCNF So, relation Z in 3NF but not BCNF
, becasuse of S is not superkey.

Since, this decomposition covers all functional dependencies of original relation (X), so decomposition of X into Y
and Z is dependency preserving. Also, this decomposition has common attribute (i.e., R) which is superkey of

relation Y(PR), so decomposition of X into Y and Z is also lossless join decomposition. Option (D) is correct.
Question 45
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 ___________.
Answer: (C)
(a11, a22) is key.
Explanation: R13 is 1:n Relationship between E1 and E3
Entity E1. R13
a1 a12 a11 a31
-------- -----------
a11 is key (a11, a31) is key.
Entity E2 We need minimum no. of tables.
a21 a22 Can we remove any of the above tables without
-------- loosing information and keeping the relations in 3NF?
a22 is key We can combine R13 and R12 into one.
Entity E3 a11 a31 a22
a31 a32 ------------------
-------- (a11, a31, a22) is key.
a31 is key The relation is still in 3NF as for every functional
R12 is m:n Relationship between E1 and E2 dependency X -> A, one of the following holds
R12
1) X is a superkey or
a11 a22
2) A-X is prime attribute
-------------
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 46
Given the following two statements:
S1: Every table with two single-valued
attributes is in 1NF, 2NF, 3NF and BCNF.

S2: AB->C, D->E, E->C is a minimal cover for


the set of functional dependencies
AB->C, D->E, AB->E, E->C.
Which one of the following is CORRECT?
(A) S1 is TRUE and S2 is FALSE.
(B) Both S1 and S2 are TRUE.
(C) S1 is FALSE and S2 is TRUE.
(D) Both S1 and S2 are FALSE.
Answer: (A)
Explanation:
S1: Every table with two single-valued
attributes is in 1NF, 2NF, 3NF and BCNF.

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
1.If {A->B} exists then BCNF since {A}+ = AB = R
2.If {B->A} exists then BCNF since {B}+ = AB = R
3.If {A->B,B->A} exists then BCNF since A and B both are Super Key now.
4.If {No non trivial Functional Dependency} then default BCNF.
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.
S2: AB->C, D->E, E->C is a minimal cover for
the set of functional dependencies
AB->C, D->E, AB->E, E->C.

As we know Minimal Cover is the process of eliminating redundant Functional Dependencies and Extraneous attributes in Functional
Dependency Set.
So each dependency of F = {AB->C, D->E, AB->E, E->C} should be implied in minimal 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.
Question 47
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
Answer: (B)

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 AD, BD, ED and FD
Question 48
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?
(A) Both Book and Collection are in BCNF
(B) Both Book and Collection are in 3NF only
(C) Book is in 2NF and Collection is in 3NF
(D) Both Book and Collection are in 2NF only
Answer: (C)

Explanation:
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


• 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, Author].

• 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 {Catalog_no}. In table Book, non-prime attributes (attributes that do not
occur in any candidate key) are Publisher, Year and Place
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 49
Let R (A, B, C, D) be a relational schema with the following functional dependencies:
A → B, B → C,
C → D and D → B.

The decomposition of R into


(A, B), (B, C), (B, D)

(A) gives a lossless join, and is dependency preserving


(B) gives a lossless join, but is not dependency preserving
(C) does not give a lossless join, but is dependency preserving
(D) does not give a lossless join and is not dependency preserving
Answer: (A)

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 dependencies are in F+ (Closure of functional
dependencies)
R1 ∩ R2 → R1
OR
R1 ∩ R2 → R2
• Dependency Preserving Decomposition:
Decomposition of R into R1 and R2 is a dependency preserving decomposition if closure of functional dependencies 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 decomposition.
Question :
Let R (A, B, C, D) be a relational schema with the following functional dependencies:
A -> B, B -> C,
C -> D and D -> B.

The decomposition of R into


(A, B), (B, C), (B, D)

Note that A, B, C and D are all key attributes. We can derive all attributes from every attribute.
Since Intersection of all relations is B and B derives all other attributes, relation is lossless.

The relation is dependency preserving as well as all functional dependencies are preserved directly or indirectly. Note that C -> D is also preserved
with following two C -> B and B -> D.
Question 50
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
(B) in 3NF, but not in BCNF
(C) in 2NF, but not in 3NF
(D) not in 2NF
Answer: (D)

Explanation: Candidate key = AB


B->G is partial dependency
So, not in 2NF
Question 51
Consider the relation enrolled(student, course) in which (student, course) is the primary key, and the relation paid(student, amount), where student is the
primary key. Assume no null values and no foreign keys or integrity constraints. Assume that amounts 6000, 7000, 8000, 9000 and 10000 were each
paid by 20% of the students. Consider these query plans (Plan 1 on left, Plan 2 on right) to “list all courses taken by students who have paid more than
x”.

A disk seek takes 4ms, disk data transfer bandwidth is 300 MB/s and checking a tuple to see if amount is greater than x takes 10 micro-seconds. Which
of the following statements is correct?
(A) Plan 1 and Plan 2 will not output identical row sets for all databases.
(B) A course may be listed more than once in the output of Plan 1 for some databases
(C) For x = 5000, Plan 1 executes faster than Plan 2 for all databases.
(D) For x = 9000, Plan I executes slower than Plan 2 for all databases.
Answer C
A disk seek takes 4ms, disk data transfer bandwidth is 300 MB/s and checking a tuple to see if
amount is greater than x takes 10 micro-seconds. Which of the following statements is correct?
(A) Plan 1 and Plan 2 will not output identical row sets for all databases. (B) A course may be
listed more than once in the output of Plan 1 for some databases (C) For x = 5000, Plan 1
executes faster than Plan 2 for all databases. (D) For x = 9000, Plan I executes slower than
Plan 2 for all databases. Answer (C) Assuming that large enough memory is available for all
data needed. Both plans need to load both tables courses and enrolled. So disk access time is
same for both plans. Plan 2 does lesser number of comparisons compared to plan 1. 1) Join
operation will require more comparisons as the second table will have more rows in plan 2
compared to plan 1. 2) The joined table of two tables will have more rows, so more
comparisons are needed to find amounts greater than x.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 52
The following functional dependencies are given:
AB -> CD, AF -> D, DE -> F, C -> G , F -> E, G -> A

Which one of the following options is false?


(A) CF+ = {ACDEFG}
(B) BG+ = {ABCDG}
(C) AF+ = {ACDEFG}
(D) AB+ = {ABCDG}
Which one of the following options is false? (A)CF+ = {ACDEFG} (B)BG+
= {ABCDG} (C)AF+ = {ACDEFG} (D)AB+ = {ABCDFG} Answer (C)
Closure of AF or AF+ = {ADEF}, closure of AF doesn’t contain C and G.
Option (D) also looks correct. AB+ = {ABCDG}, closure of AB doesn’t
contain
Question 53
In a schema with attributes A, B, C, D and E following set of functional dependencies are given
A→B
A→C
CD → E
B→D
E→A
Which of the following functional dependencies is NOT implied by the above set?
(A) CD → AC
(B) BD → CD
(C) BC → CD
(D) AC → BC
Question 54
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?

(A)AE, BE
(B) AE, BE, DE
(C) AEH, BEH, BCH
(D) AEH, BEH, DEH
Answer: (D)

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 55
A relation Empdtl is defined with attributes empcode (unique), name,
street, city, state and pincode. For any pincode, there is only one city and
state. Also, for any given street, city and state, there is just one pincode.
In normalization terms, Empdtl is a relation in
(A) 1NF only
(B) 2NF and hence also in 1NF
(C) 3NF and hence also in 2NF and 1NF
(D) BCNF and hence also in 3NF, 2NF an 1NF
Answer: (B)

Explanation:
Given:
Empdtl: empcode , name, street, city, state and pincode
• There is transitive dependency in Table ( pincode, there is only one city and state),so not in
3NF

• All attributes are fully dependant on key,so in 2NF

So answer is B
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 56
The relation scheme Student Performance (name, courseNo, rollNo, grade) has the following
functional dependencies:
name, courseNo → grade
rollNo, courseNo → grade
name → rollNo
rollNo → name
The highest normal form of this relation scheme is
(A) 2 NF
(B) 3 NF
(C) BCNF
(D) 4NF
Answer: (B)

Explanation: For easy understanding let’s say attributes (name, courseNo, rollNo,
grade) be (A,B,C,D). Then given FDs are as follows:
AB->D, CB->D, A->C, C->A
Here there are two Candidate keys, AB and CB.
Now AB->D and CB->D satisfy BCNF as LHS is superkey in both.
But, 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.
Data Base Management System
Functional Dependency
Question 57
In a relational data model, which one of the following statements is
TRUE?
A A relation with only two attributes is always in BCNF.
B If all attributes of a relation are prime attributes, then the relation is in
BCNF.
C Every relation has at least one non-prime attribute.
D BCNF decompositions preserve functional dependencies.
Answer: (A)

Explanation:
Option A: It is true to say that every binary relation is always in BCNF
Option B: This is false because it is not necessary to have a relation in BCNF if all the
attributes are prime attributes. For example, R(A, B, C) with FD A -> C, B -> C, C -> A
Here all the attributes are prime but it is not in BCNF.
Option C: No, it is not necessary to have at least one non-prime attribute in a relation
Option D: No, it is not necessary that every lossless BCNF decomposition is
dependency preserving
Question 58

Consider a relation R(A, B, C, D, E) with the following three functional


dependencies.
AB → C ; BC → D ; C → E;
The number of superkeys in the relation R is _________.
AB+ = ABCDE

AB : Candidate key
Non prime attribute = C, D, E

Number of superkeys = 23 = 8. Those are AB, ABC, ABD, ABE, ABCD,
ABCE, ABDE, ABCDE. In super key candidate key should always present.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 59
A database of research articles in a journal uses the following schema.
(VOLUME, NUMBER, STARTPGE, ENDPAGE, TITLE, YEAR, PRICE)
The primary key is (VOLUME, NUMBER, STARTPAGE, ENDPAGE) and the following functional dependencies exist in the
schema.
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> TITLE
(VOLUME, NUMBER) -> YEAR
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> PRICE
The database is redesigned to use the following schemas.
(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, PRICE)
(VOLUME, NUMBER, YEAR)
Which is the weakest normal form that the new database satisfies, but the old one does not?
(A) 1NF
(B) 2NF
(C) 3NF
(D) BCNF
Solution
Answer: (B)

Explanation: Old relation has functional dependency : Volume, Number -> Year
as partial dependency. So it does not follow 2NF.
But, there is no partial dependency in the New relation and so it satisfies 2NF as
well as 3NF.
Therefore, 2NF is the weakest normal form that the new database satisfies, but
the old one does not.
Option (B) is true.
Question 60
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}
}
Which of the following is the trivial functional dependency in F+ is closure of F?
(A) {P,R}→{S,T}
(B) {P,R}→{R,T}
(C) {P,S}→{S}
(D) {P,S,U}→{Q}
Answer: (C)

Explanation: A functional dependency X -> Y is trivial if Y is a subset of X.


Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 61
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}
Solution
Using the given options try to obtain closure of each options. The solution is the one that contains R and also minimal Super Key, i.e

Candidate Key.
A) {EF}+ = {EFGIJ} ≠ R(The given relation)

B) {EFH}+ = {EFGHIJKLMN} = R (Correct since each member of the


given relation is determined)

C) {EFHKL}+ = {EFGHIJKLMN} = R (Not correct although each member


of the given relation can be determined
but it is not minimal, since by the definition
of Candidate key it should be minimal Super Key)

D) {E}+ = {E} ≠ R

Solution B
Question 62

A prime attribute of a relation scheme R is an attribute that appears


(A) in all candidate keys of R.
(B) in some candidate key of R.
(C) in a foreign key of R.
(D) only in the primary key of R.
Answer: (B)

Explanation: The constituent attributes of a Candidate key or simply the


attributes of a candidate key are called the prime attributes.
Suppose ABC is one candidate key of a Relation R(ABCDEFGH). Then
the attributes A, B and C all are prime attributes. Similarly if ABD is also
another candidate key in the same relation R, then D is also the prime
attribute. And conversely, an attribute that does not occur in ANY
candidate key is called a non-prime attribute.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 63

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
Solution
Answer: (D)

Explanation: Maximum no. of possible superkeys for a table with n


attributes = 2^(n-1)
Here, n = 4.
So, the possible superkeys = 24-1 = 8
The possible superkeys are : E, EH, EG, EF, EGH, EFH, EFG, EFGH
Question 64
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
Answer: (A)

Explanation:
First Normal Form
A relation is in first normal form if every attribute in that relation is singled valued attribute.
Second Normal Form
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 65
1) Which one of the following statements about normal forms is FALSE?
(a) BCNF is stricter than 3NF
(b) Lossless, dependency-preserving decomposition into 3NF is always
possible
(c) Lossless, dependency-preserving decomposition into BCNF is always
possible
(d) Any relation with two attributes is in BCNF
Solution

Answer (c)
It is not always possible to decompose a table in BCNF and preserve
dependencies. For example, a set of functional dependencies
{AB –> C, C –> B} cannot be decomposed in BCNF.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 66
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
(C) Proportional to the size of F+
(D) Indeterminate
Solution

Answer: (A)

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 67
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
(A) dependency preserving and lossless join
(B) lossless join but not dependency preserving
(C) dependency preserving but not lossless join
(D) not dependency preserving and not lossless join
Answer: (C)

Explanation: Dependency Preserving Decomposition:


Decomposition of R into R1 and R2 is a dependency preserving decomposition if closure of functional dependencies 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 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 and 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 dependencies 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 decomposition is not
lossless.
Question 68
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?
(A) CD
(B) EC
(C) AE
(D) AC
Answer: (B)

Explanation: To check find the closure for all


{CD} = {CDF}
{EC} = {ECDAFB} Only this is the key because it drives all attributes.
{AE} = {AEB}
{AC} = {ACBF}
Hence, Option (B) is Correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 69
Which normal form is considered adequate for normal relational database
design?
(A) 2NF
(B) 5NF
(C) 4NF
(D) 3NF
Answer: (D)

Explanation: 3NF is sufficient because because most of the 3NF tables


are free of insertion, update, and deletion anomalies. Moreover, 3NF
always ensures functional dependency preserving and lossless.
So, option (D) is correct.
Question 70

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
(B) A->B, B->C, C->D
(C) AB->C, C->AD
(D) A ->BCD
Answer: (C)
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 dependencies 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
dependencies 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
decomposition.
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 decompose 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 71
Consider the relation R(P,Q,S,T,X,Y,Z,W) with the following functional dependencies.

Consider the decomposition of the relation R into the constituent relations according to the following two decomposition
schemes.

Which one of the following options is correct?


(A) D1 is a lossless decomposition, but D2 is a lossy decomposition
(B) D1 is a lossy decomposition, but D2 is a lossless decomposition
(C) Both D1 and D2 are lossless decompositions
(D) Both D1 and D2 are lossy decompositions
Answer: (A)

Explanation: Lossless-Join Decomposition:


Lossless-Join Decomposition:
Decomposition of R into R1, R2, R3, R4 is a lossless-join decomposition if at least one of the following functional
dependencies are in F+ (Closure of functional dependencies):
similarly,
R1 ∩ R2 → R1 OR R1 ∩ R2 → R2
R3 ∩ R4 =(Y)+ = YZW, it is a super key, so we can merge R3 and R4.
For decomposition D1:
another combined table T2 is QYZW.
R1(PQST)
now, Q is common in both T1 and T2.
R2(PTX) T1 ∩ T2 = Q+ = QYZW, it is a super key, so we can merge T1 and T2.
R3(QY) after combining, we get original table PQSTXYZW,
R4(YZW) Hence D1 is lossless join decomposition.
R1 ∩ R2 = (PT)+ = PTYXZW , it is a super key, For decomposition D2:
so we can merge R1 and R2. R1(PQS)

combined table T1 is PQSTX R2(TX)


R3(QY)
R4(YZW)
since R2 has no common attributes as the primary key, so R2 cannot be
merge with any other table,
Hence D2 is lossy decomposition.
Question 72
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

(D). A cell in R holds a set instead of an atomic value


Answer: (A)

Explanation:
A relation is in 3NF if at least one of the following condition holds in every non-trivial function dependency X → Y:
1.X is a super key. (This condition is must for BCNF relations.).

2.Y is a prime attribute (each element of Y is part of some candidate key).

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 true.
Option (A) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 73
Let the set of functional dependencies F = {QR → S, R → P, S → Q} hold on a relation schema X = (PQRS). X is
not in BCNF. Suppose X is decomposed into two schemas and Z where Y = (PR) and Z = (QRS). Consider the
two statements given below:
• I. Both Y and Z are in BCNF

• II. Decomposition of X into Y and Z is dependency preserving and a lossless.

Which of the above statements is/are correct?


(A). I only
(B). Neither I nor II
(C). Both I and II
(D). II only
Answer: (D)

Explanation:
X(PQRS) {QR → S, R → P, S → Q} decomposed into Y (PR) and Z (QRS). So,
Y (PR) Z (QRS)
{R → P} {QR → S, S → Q}
Candidate key : {R} Candidate key : {QR, RS}
So, relation Y in BCNF So, relation Z in 3NF but not BCNF
, becasuse of S is not superkey.

Since, this decomposition covers all functional dependencies of original relation (X), so decomposition of X into Y
and Z is dependency preserving. Also, this decomposition has common attribute (i.e., R) which is superkey of

relation Y(PR), so decomposition of X into Y and Z is also lossless join decomposition. Option (D) is correct.
Question 74
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 ___________.
Answer: (C)
(a11, a22) is key.
Explanation: R13 is 1:n Relationship between E1 and E3
Entity E1. R13
a1 a12 a11 a31
-------- -----------
a11 is key (a11, a31) is key.
Entity E2 We need minimum no. of tables.
a21 a22 Can we remove any of the above tables without
-------- loosing information and keeping the relations in 3NF?
a22 is key We can combine R13 and R12 into one.
Entity E3 a11 a31 a22
a31 a32 ------------------
-------- (a11, a31, a22) is key.
a31 is key The relation is still in 3NF as for every functional
R12 is m:n Relationship between E1 and E2 dependency X -> A, one of the following holds
R12
1) X is a superkey or
a11 a22
2) A-X is prime attribute
-------------
Question 75
Given the following two statements:
S1: Every table with two single-valued
attributes is in 1NF, 2NF, 3NF and BCNF.

S2: AB->C, D->E, E->C is a minimal cover for


the set of functional dependencies
AB->C, D->E, AB->E, E->C.
Which one of the following is CORRECT?
(A) S1 is TRUE and S2 is FALSE.
(B) Both S1 and S2 are TRUE.
(C) S1 is FALSE and S2 is TRUE.
(D) Both S1 and S2 are FALSE.
Answer: (A)
Explanation:
S1: Every table with two single-valued
attributes is in 1NF, 2NF, 3NF and BCNF.

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
1.If {A->B} exists then BCNF since {A}+ = AB = R
2.If {B->A} exists then BCNF since {B}+ = AB = R
3.If {A->B,B->A} exists then BCNF since A and B both are Super Key now.
4.If {No non trivial Functional Dependency} then default BCNF.
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.
S2: AB->C, D->E, E->C is a minimal cover for
the set of functional dependencies
AB->C, D->E, AB->E, E->C.

As we know Minimal Cover is the process of eliminating redundant Functional Dependencies and Extraneous attributes in Functional
Dependency Set.
So each dependency of F = {AB->C, D->E, AB->E, E->C} should be implied in minimal 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.
Question 76
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
Answer: (B)

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 AD, BD, ED and FD
Question 77
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?
(A) Both Book and Collection are in BCNF
(B) Both Book and Collection are in 3NF only
(C) Book is in 2NF and Collection is in 3NF
(D) Both Book and Collection are in 2NF only
Answer: (C)

Explanation:
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


• 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, Author].

• 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 {Catalog_no}. In table Book, non-prime attributes (attributes that do not
occur in any candidate key) are Publisher, Year and Place
Question 78
Let R (A, B, C, D) be a relational schema with the following functional dependencies:
A → B, B → C,
C → D and D → B.

The decomposition of R into


(A, B), (B, C), (B, D)

(A) gives a lossless join, and is dependency preserving


(B) gives a lossless join, but is not dependency preserving
(C) does not give a lossless join, but is dependency preserving
(D) does not give a lossless join and is not dependency preserving
Answer: (A)

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 dependencies are in F+ (Closure of functional
dependencies)
R1 ∩ R2 → R1
OR
R1 ∩ R2 → R2
• Dependency Preserving Decomposition:
Decomposition of R into R1 and R2 is a dependency preserving decomposition if closure of functional dependencies 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 decomposition.
Question :
Let R (A, B, C, D) be a relational schema with the following functional dependencies:
A -> B, B -> C,
C -> D and D -> B.

The decomposition of R into


(A, B), (B, C), (B, D)

Note that A, B, C and D are all key attributes. We can derive all attributes from every attribute.
Since Intersection of all relations is B and B derives all other attributes, relation is lossless.

The relation is dependency preserving as well as all functional dependencies are preserved directly or indirectly. Note that C -> D is also preserved
with following two C -> B and B -> D.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 79
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
(B) in 3NF, but not in BCNF
(C) in 2NF, but not in 3NF
(D) not in 2NF
Answer: (D)

Explanation: Candidate key = AB


B->G is partial dependency
So, not in 2NF
Question 80
Consider the relation enrolled(student, course) in which (student, course) is the primary key, and the relation paid(student, amount), where student is the
primary key. Assume no null values and no foreign keys or integrity constraints. Assume that amounts 6000, 7000, 8000, 9000 and 10000 were each
paid by 20% of the students. Consider these query plans (Plan 1 on left, Plan 2 on right) to “list all courses taken by students who have paid more than
x”.

A disk seek takes 4ms, disk data transfer bandwidth is 300 MB/s and checking a tuple to see if amount is greater than x takes 10 micro-seconds. Which
of the following statements is correct?
(A) Plan 1 and Plan 2 will not output identical row sets for all databases.
(B) A course may be listed more than once in the output of Plan 1 for some databases
(C) For x = 5000, Plan 1 executes faster than Plan 2 for all databases.
(D) For x = 9000, Plan I executes slower than Plan 2 for all databases.
Answer C
A disk seek takes 4ms, disk data transfer bandwidth is 300 MB/s and checking a tuple to see if
amount is greater than x takes 10 micro-seconds. Which of the following statements is correct?
(A) Plan 1 and Plan 2 will not output identical row sets for all databases. (B) A course may be
listed more than once in the output of Plan 1 for some databases (C) For x = 5000, Plan 1
executes faster than Plan 2 for all databases. (D) For x = 9000, Plan I executes slower than
Plan 2 for all databases. Answer (C) Assuming that large enough memory is available for all
data needed. Both plans need to load both tables courses and enrolled. So disk access time is
same for both plans. Plan 2 does lesser number of comparisons compared to plan 1. 1) Join
operation will require more comparisons as the second table will have more rows in plan 2
compared to plan 1. 2) The joined table of two tables will have more rows, so more
comparisons are needed to find amounts greater than x.
Question 81
The following functional dependencies are given:
AB -> CD, AF -> D, DE -> F, C -> G , F -> E, G -> A

Which one of the following options is false?


(A) CF+ = {ACDEFG}
(B) BG+ = {ABCDG}
(C) AF+ = {ACDEFG}
(D) AB+ = {ABCDG}
Which one of the following options is false? (A)CF+ = {ACDEFG} (B)BG+
= {ABCDG} (C)AF+ = {ACDEFG} (D)AB+ = {ABCDFG} Answer (C)
Closure of AF or AF+ = {ADEF}, closure of AF doesn’t contain C and G.
Option (D) also looks correct. AB+ = {ABCDG}, closure of AB doesn’t
contain
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 82
In a schema with attributes A, B, C, D and E following set of functional dependencies are given
A→B
A→C
CD → E
B→D
E→A
Which of the following functional dependencies is NOT implied by the above set?
(A) CD → AC
(B) BD → CD
(C) BC → CD
(D) AC → BC
Question 83
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?

(A)AE, BE
(B) AE, BE, DE
(C) AEH, BEH, BCH
(D) AEH, BEH, DEH
Answer: (D)

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}
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 84
A relation Empdtl is defined with attributes empcode (unique), name,
street, city, state and pincode. For any pincode, there is only one city and
state. Also, for any given street, city and state, there is just one pincode.
In normalization terms, Empdtl is a relation in
(A) 1NF only
(B) 2NF and hence also in 1NF
(C) 3NF and hence also in 2NF and 1NF
(D) BCNF and hence also in 3NF, 2NF an 1NF
Answer: (B)

Explanation:
Given:
Empdtl: empcode , name, street, city, state and pincode
• There is transitive dependency in Table ( pincode, there is only one city and state),so not in
3NF

• All attributes are fully dependant on key,so in 2NF

So answer is B
Question 85
The relation scheme Student Performance (name, courseNo, rollNo, grade) has the following
functional dependencies:
name, courseNo → grade
rollNo, courseNo → grade
name → rollNo
rollNo → name
The highest normal form of this relation scheme is
(A) 2 NF
(B) 3 NF
(C) BCNF
(D) 4NF
Answer: (B)

Explanation: For easy understanding let’s say attributes (name, courseNo, rollNo,
grade) be (A,B,C,D). Then given FDs are as follows:
AB->D, CB->D, A->C, C->A
Here there are two Candidate keys, AB and CB.
Now AB->D and CB->D satisfy BCNF as LHS is superkey in both.
But, 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.
Gate previous year questions
Database management system
Question 86

For the schedule given below, which of the following is Correct?


1 Read A
2 Read B
3 Write A
4 Read A
5 Write A
6 Write B
7 Read B
8 Write B

(A) This schedule is serialisable and can occur in a scheme using 2PL protocol.
(B) This schedule is serialisable but cannot occur in a scheme using 2PL protocol.
(C) This schedule is not serialisable but can occur in a scheme using 2PL protocol.
(D) This schedule is not serialisable and cannot occur in a scheme using 2PL protocol.
Answer: (D)

Explanation: Initial read of data item A is done by T1 whereas final write of


data item B os done by T1. therefore W1( A) , R2( A) and W2(B) , R1(B )
are conflicting pairs. The schedule is neither T1 –> T2 nor T2 –> T1
serializable. Since schedule is not serializable , it can not occur in scheme
using 2PL protocol .
Option (D) is correct.
Question 87

Consider two files systems A and B , that use contiguous allocation and
linked allocation, respectively. A file of size 100 blocks is already stored in A
and also in B. Now, consider inserting a new block in the middle of the file
(between 50th and 51st block), whose data is already available in the
memory. Assume that there are enough free blocks at the end of the file and
that the file control blocks are already in memory. Let the number of disk
accesses required to insert a block in the middle of the file in A and B are nA
and nB respectively, then the value of nA + nB is_________.
Explanation:
Contiguous Allocation can directly traverse to the 50th element as it is already given
the file control blocks is already present.
Now, we need 50 operations to read the rest of the 50 elements and another 50
operations to write those 50 blocks and 1 operation is needed to write the new block.
Therefore, total operations in this case = 50 + 50 + 1
Linked Allocation needs to traverse to the 50th element.
Now, simply change the pointers just like the Linked list where Adding element in the
middle of it.
So, here it takes 50 operations to read the first 50 elements and 2 operations to
change the pointer of the 50th block and a new block. So, 52 operations in this case.
Therefore, nA = 101, and nB = 52. nA + nB = 101+52 = 153
Question 88

Which one of the following statements is NOT correct about the B+ tree data
structure used for creating an index of a relational database table?
(A) B+ Tree is a height-balanced tree
(B) Non-leaf nodes have pointers to data records
(C) Key values in each node are kept in sorted order
(D) Each leaf node has a pointer to the next leaf node
Answer: (B)

Explanation: B+ tree is height balance search tree, where key values in each
node are kept in sorted order.
All leaf nodes are at same level and connected to next leaf node.
Each non-leaf (i.e., internal) node is of the form:
<P1, K1, P2, K2, ….., Pc-1, Kc-1, Pc>
where c <= a and each Pi is a tree pointer (i.e points to another node of the
tree) and, each Ki is a key value. That means each non-leaf (i.e., internal)
nodes has only block (i.e., node or tree pointers) and keys. These internal
(i.e., non-leaf) node do not contain data record pointers. So, option (B) is not
correct.
Question 89

B+ Trees are considered BALANCED because


(A) the lengths of the paths from the root to all leaf nodes are all equal.
(B) the lengths of the paths from the root to all leaf nodes differ from each
other by at most 1.
(C) the number of children of any two non-leaf sibling nodes differ by at most
1.
(D) the number of records in any two leaf nodes differ by at most 1.
Answer: (A)

Explanation: In both B Tree and B+ trees, depth (length of root to leaf paths)
of all leaf nodes is same. This is made sure by the insertion and deletion
operations.
In these trees, we do insertions in a way that if we have increase height of
tree after insertion, we increase height from root. This is different from BST
where height increases from leaf nodes.
Similarly, if we have to decrease height after deletion, we move the root one
level down. This is also different from BST which shrinks from bottom.
The above ways of insertion and deletion make sure that depth of every leaf
node is same.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 90

With reference to the B+ tree index of order 1 shown below, the minimum
number of nodes (including the root node) that must be fetched in order to
satisfy the following query: “Get all records with a search key greater than or
equal to 7 and less than 15” is ________
Answer: (B)

Explanation:
We can get all values in range from 7 to 59 by accessing 5 nodes.
1) First search 7 in a leaf node.
2) Once 7 is found, linearly traverse till 15 is found.

See following diagram


Question 91

A file is organized so that the ordering of data records is the same as or close
to the ordering of data entries in some index. Then that index is called
(A) Dense
(B) Sparse
(C) Clustered
(D) Unclustered
Answer: (C)

Explanation: In Clustered Index, data blocks are stored in a way to match


the index. Therefore, only one clustered index can be created on a given
database table.
Question 91

Consider a B+-tree in which the maximum number of keys in a node is 5.


What is the minimum number of keys in any non-root node? (GATE CS 2010)
A. 1
B. 2
C. 3
D. 4
Since the maximum number of keys is 5, maximum number of children a
node can have is 6. By definition of B Tree, minimum children that a node
can have would be 6/2 = 3. Therefore, minimum number of keys that a
node can have becomes 2 (3-1)=4.
Question 92
A clustering index is defined on the fields which are of type
(A) non-key and ordering
(B) non-key and non-ordering
(C) key and ordering
(D) key and non-ordering
Answer: (A)

Explanation: A clustering index as the name suggests is


created when the data can be grouped in the form of clusters.
For example: A small database file storing roll no and subjects
enrolled for a particular student. Here data can be grouped on
the basis of Roll No.s.
Hence to create such kind of index files, fields could be non-
key attributes and which are in ordered form so as to form
clusters easily.
Hence option (A) – non key and ordering.
Additional points for Clustered Indexing:
1. The number of entries in the index file are the unique values
of the attribute on which indexing is done.
2. The pointer in the index file will give the base address of the
block in which the value appear for the first time.
Question 93

A B-Tree used as an index for a large database table has four levels including
the root node. If a new key is inserted in this index, then the maximum
number of nodes that could be newly created in the process are:
(A) 5
(B) 4
(C) 3
(D) 2
Answer: (A)

Explanation: Number of children of a node is equal to the number of keys in it


plus 1.
Given tree has 4 levels, the tree will be increased with one more level if a new
key is inserted.
Question 94
B+ -trees are preferred to binary trees in databases because
(A) Disk capacities are greater than memory capacities
(B) Disk access is much slower than memory access
(C) Disk data transfer rates are much less than memory data transfer rates
(D) Disks are more reliable than memory
Answer: (B)

Explanation: Disk access is slow and B+ Tree provide search in less number
of disk hits. This is primarily because unlike binary search trees, B+ trees
have very high fanout (typically on the order of 100 or more), which reduces
the number of I/O operations required to find an element in the tree.
Question 95
There are 5 records in a database.
Name Age Occupation Category
Rama 27 CON A
Abdul 22 ENG A
Jeniffer 28 DOC B
Maya 32 SER D
Dev 24 MUS C
There is an index file associated with this and it contain the values 1, 3, 2, 5
and 4. Which one of the fields is the index built form?
(A). Age
(B). Name
(C). Occupation
(D). Category
Answer: (C)

Explanation:
The index field associated with the values 1, 3, 2, 5 and 4 is the
Occupation field because after sorting the Occupational field
lexicographically will give the sequence 1,3,2,5,4.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 96

Consider a linear list based directory implementation in a file system. Each directory
is a list of nodes, where each node contains the file name along with the file
metadata, such as the list of pointers to the data blocks. Consider a given directory
foo.
Which of the following operations will necessarily require a full scan of foo for
successful completion?
(A) Creation of a new file in foo
(B) Deletion of an existing file from foo
(C) Renaming of an existing file in foo
(D) Opening of an existing file in foo
Answer: (A) (C)

Explanation: Since a directory contains a list of nodes, where each node


contains the file name along with the file a metadata, such as the list of
pointers to the data blocks,
We necessarily have to full scan of foo to rename of an existing file and
repeating file names are not allowed in a directory so, to create a new file,
first we have to check whether it already exists or not, and it requires a full
complete scan.
Question 97

Consider a database implemented using B+ tree for file indexing and installed
on a disk drive with block size of 4 KB. The size of search key is 12 bytes and
the size of tree/disk pointer is 8 bytes. Assume that the database has one
million records. Also assume that no node of the B+ tree and no records are
present initially in main memory. Consider that each record fits into one disk
block.
The minimum number of disk accesses required to retrieve any record in the
database is ___________ .
Question 98

Consider B+ tree in which the search key is 12 bytes long, block size is 1024
bytes, record pointer is 10 bytes long and block pointer is 8 bytes long. The
maximum number of keys that can be accommodated in each non-leaf node
of the tree is
(A) 49
(B) 50
(C) 51
(D) 52
Answer: (B)

Explanation:
Let m be the order of B+ tree

m(8)+(m-1)12 <= 1024


[Note that record pointer is not needed in non-leaf nodes]

m <= 51

Since maximum order is 51, maximum number of keys is 50.


Question 99

The following key values are inserted into a B+ tree in which the order of the
internal nodes is 3, and that of the leaf nodes is 2, in the sequence given
below. The order of internal nodes is the maximum number of tree pointers in
each node, and the order of leaf nodes is the maximum number of data items
stored in them. The B+ tree is initially empty. 10, 3, 6, 8, 4, 2, 1. The maximum
number of times leaf nodes would get split up as a result of these insertions is
(A)2
(B) 3
(C) 4
(D) 5
Answer: (C)

Explanation:
There are 4 splits in worst case:
1.after inserting 6
2.after inserting 4
3.after inserting 2 (there will be an internal node split and a leaf node split)
4.after inserting 1
So, option (C) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 100

Consider a file of 16384 records. Each record is 32 bytes long and its key field is of
size 6 bytes. The file is ordered on a non-key field, and the file organization is
unspanned. The file is stored in a file system with block size 1024 bytes, and the size
of a block pointer is 10 bytes. If the secondary index is built on the key field of the file,
and a multi-level index scheme is used to store the secondary index, the number of
first-level and second-level blocks in the multi-level index are respectively.
(A) 8 and 0
(B) 128 and 6
(C) 256 and 4
(D) 512 and 5
Answer: (C)
Explanation: Indexing mechanisms are used to optimize certain accesses to data (records) managed in files. For
example, the author catalog in a library is a type of index. An Index File consists of records (called index entries) of
the form
-----------------------------------
| Search-Key | Pointer to Block |
-----------------------------------
If even outer index is too large to fit in main memory, yet another level of index can be created, and so on.

Number of records in file = 16384

Record size = 32 bytes


Key Size = 6 bytes
Block Size on file system = 1024 bytes
Size of Block Pointer = 10 bytes

Size of a record or index Entry = 10 + 6 = 16

Number of blocks in first level = (Number of records in file)/


(Disk Block Size)
= (16384 * 16)/(1024)
= 16 * 16
= 256

In second level, there will be 256 * 16 entries.


Number of blocks in second level = (Number of entries) /
(Block Size)
= (256 * 16) / 1024
=4
Question 101

The order of a leaf node in a tree B+ ? is the maximum number of (value,


data record pointer) pairs it can hold. Given that the block size is 1K bytes,
data record pointer is 7 bytes long, the value field is 9 bytes long and a block
pointer is 6 bytes long, what is the order of the leaf node?
(A) 63
(B) 64
(C) 67
(D) 68
Answer: (C)
Explanation:
Key size = 14 bytes (given)
Child pointer = 6 bytes (given)
We assume the order of B+ tree to be ‘n’.
Block size = (n – 1) * key size + n * child pointer
512 >= (n – 1) * 14 + n * 6
512 >= 14 * n – 14 + 6 * n
n = (512 + 14) / 20
n = 526 / 20
n = 26.3
n = 26
Thus, option (C) is correct.
Question 102

A B+ -tree index is to be built on the Name attribute of the relation STUDENT.


Assume that all student names are of length 8 bytes, disk block are size 512
bytes, and index pointers are of size 4 bytes. Given this scenario, what would
be the best choice of the degree (i.e. the number of pointers per node) of the
B+ -tree?
(A)16
(B) 42
(C) 43
(D) 44
Answer: (C)
Explanation:
Size of 1 record = 8 + 4 = 12
Let the order be N.
No. of index values per block = N - 1
(N - 1) 12 + 4 = 512
12N - 12 + 4 = 512
12N - 8 = 512
12N = 520
N = 520/12
N = 43.333
Question 103

The order of an internal node in a B+ tree index is the maximum number of


children it can have. Suppose that a child pointer takes 6 bytes, the search
field value takes 14 bytes, and the block size is 512 bytes. What is the order
of the internal node?
(A) 24
(B) 25
(C) 26
(D) 27
Answer: (A)

Explanation: Since T1 and T3 are not committed yet, they must be


undone. The transaction T2 must be redone because it is after the latest
checkpoint.
Question 104
Consider the following partial Schedule S involving two transactions T1 and T2. Only the read and
the write operations have been shown. The read operation on data item P is denoted by read(P)
and the write operation on data item P is denoted by write(P).

Suppose that the transaction T1 fails immediately after time instance 9. Which one of the following
statements is correct?
(A) T2 must be aborted and then both T1 and T2 must be re-started to ensure transaction atomicity
(B) Schedule S is non-recoverable and cannot ensure transaction atomicity
(C) Only T2 must be aborted and then re-started to ensure transaction atomicity
(D) Schedule S is recoverable and can ensure atomicity and nothing else needs to be done
Answer: (B)
Explanation:
if transaction fails, atomicity requires effect of transaction to be undone. Durability states that once
transaction commits, its change cannot be undone (without running another, compensating,
transaction).
Recoverable schedule: A schedules exactly where, for every set of transaction Ti and Tj. If Tj reads a
data items previously written by Ti, then the commit operation of Ti precedes the commit operation of
Tj.
Aborting involves undoing the operations and redoing them since by the time stamp it is aborted.
Option (A): T2 must be aborted and then both T1 and T2 must be re-started to ensure transaction
atomicity. It is incorrect because it says abort transaction T2 and then redo all the operations. But
there is no guarantee that it will succeed this time as again T1 may be fail.
Option(B): Schedule S is non-recoverable and cannot ensure transaction atomicity. Correct, it is by
definition an irrecoverable schedule so now even if we start to undo the actions one by one(after t1
fails) in order to ensure transaction atomicity. Still we cannot undo a committed transaction. hence
this schedule is irrecoverable by definition and also not atomic since it leaves the database in an
inconsistent state. Simply dirty read so nonrecoverable.
Option (C): Only T2 must be aborted and then re-started to ensure transaction atomicity. It is incorrect
because it says abort only transaction T2 and then redo all the T2 operations. But this is dirty read
problem as it is reading the data item A which is written by T1 and T1 is not committed. Again it will
be the dirty read problem. So incorrect.
Option (D): Schedule S is recoverable and can ensure transaction atomicity and nothing else needs
to be done. Incorrect, it is clearly saying that schedule s is recoverable but it is irrecoverable because
T2 read the data item A which is written by T1 and T1 failed and rollback, at the rollback T1 start undo
all operations and modified the value of A with previous value but T2 is already committed so T2 can’t
change the read value of A which was earlier taken from T1.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 105

Consider the following four schedules due to three transactions (indicated by the subscript) using read and
write on a data item X, denoted by r(X) and w(X) respectively. Which one of them is conflict serializable ?
S1: r1(X); r2(X); w1(X); r3(X); w2(X)

S2: r2(X); r1(X); w2(X); r3(X); w1(X)

S3: r3(X); r2(X); r1(X); w2(X); w1(X)

S4: r2(X); w2(X); r3(X); r1(X); w1(X)


(A) S1
(B) S2
(C) S3
(D) S4
Answer: (D)

Explanation: We can draw precedence graph for each schedule and for
conflict serializability graph must not contain cycle.
Question 106
Consider the following schedule S of transactions T1, T2, T3, T4:

Which one of the following statements is CORRECT?


(A) S is conflict-serializable but not recoverable
(B) S is not conflict-serializable but is recoverable
(C) S is both conflict-serializable and recoverable
(D) S is neither conflict-serializable nor is it recoverable
Answer: (C)

Explanation: To check for conflict-serializable, we need to make a precedence


graph, if the graph contains a cycle, then it’s not conflict serializable, else it is.
Here, for the precedence graph there will be only two directed edges, one from
T2 -> T3 ( Read- Write Conflict), and another from T2 -> T1( Read- Write
Conflict), hence no cycle, so the schedule is conflict serializable.
Now to check for Recoverable, we need to check for a dirty-read operation(
Write by Transaction Ti, followed by Read by Transaction Tj but before Ti
commits) between any pair of operations. If no dirty-read then recoverable
schedule, if a dirty read is there then we need to check for commit operations.
Here no dirty read operation ( as T3 and T1 commits before T4 reads the
Write(X) of T3 and T1 , and T2 commits before T4 reads the Write(Y) of T2 ).
Therefore the schedule is recoverable.
Hence, Option C.
Question 107
Consider the following transactions with data items P and Q initialized to zero:
T1: read (P) ;
read (Q) ;
if P = 0 then Q : = Q + 1 ;
write (Q) ;
T2: read (Q) ;
read (P) ;
if Q = 0 then P : = P + 1 ;
write (P) ;
Any non-serial interleaving of T1 and T2 for concurrent execution leads to
(A) A serializable schedule
(B) A schedule that is not conflict serializable
(C) A conflict serializable schedule
(D) A schedule for which a precedence graph cannot be drawn
Answer (B)
Two or more actions are said to be in conflict if:
1) The actions belong to different transactions.
2) At least one of the actions is a write operation.
3) The actions access the same object (read or write).
The schedules S1 and S2 are said to be conflict-equivalent if the following conditions are
satisfied:
1) Both schedules S1 and S2 involve the same set of transactions (including ordering of actions
within each transaction).
2) The order of each pair of conflicting actions in S1 and S2 are the same.
A schedule is said to be conflict-serializable when the schedule is conflict-equivalent to one or
more serial schedules.
In the given scenario, there are two possible serial schedules:
1) T1 followed by T2
2) T2 followed by T1.
In both of the serial schedules, one of the transactions reads the value written by other
transaction as a first step. Therefore, any non-serial interleaving of T1 and T2 will not be conflict
serializable.
Question 108
Consider the following schedule for transactions T1, T2 and T3:

Which one of the schedules below is the correct serialization of the above?
(A)T1->>T3->>T2
(B) T2->>T1->>T3
(C) T2->>T3->>T1
(D) T3->>T1->>T2
Answer: (A)

Explanation:
T1 can complete before T2 and T3 as there is no conflict between
Write(X) of T1 and the operations in T2 and T3 which occur before
Write(X) of T1 in the above diagram.
T3 should can complete before T2 as the Read(Y) of T3 doesn’t conflict
with Read(Y) of T2. Similarly, Write(X) of T3 doesn’t conflict with Read(Y)
and Write(Y) operations of T2.
Another way to solve this question is to create a dependency graph and
topologically sort the dependency graph. After topologically sorting, we
can see the sequence T1, T3, T2.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 109
Consider two transactions T1 and T2, and four schedules S1, S2, S3, S4 of
T1 and T2 as given below:
T1 = R1[X] W1[X] W1[Y]
T2 = R2[X] R2[Y] W2[Y]
S1 = R1[X] R2[X] R2[Y] W1[X] W1[Y] W2[Y]
S2 = R1[X] R2[X] R2[Y] W1[X] W2[Y] W1[Y]
S3 = R1[X] W1[X] R2[X] W1[Y] R2[Y] W2[Y]
S4 = R2[X] R2[Y] R1[X] W1[X] W1[Y] W2[Y]
Which of the above schedules are conflict-serializable?
(A) S1 and S2
(B) S2 and S3
(C) S3 only
(D) S4 only
Answer: (B)

Explanation: There can be two possible serial schedules T1 T2 and T2 T1.


The serial schedule T1 T2 has the following sequence of operations
R1[X] W1[X] W1[Y] R2[X] R2[Y] W2[Y]
And the schedule T2 T1 has the following sequence of operations.
R2[X] R2[Y] W2[Y] R1[X] W1[X] W1[Y]
The Schedule S2 is conflict-equivalent to T2 T1 and S3 is conflict-
equivalent to T1 T2
Question 110

Let R and S be relational schemes such that R={a,b,c} and S={c}. Now consider the
following queries on the database:

IV) SELECT R.a, R.b


FROM R,S
WHERE R.c=S.c
Which of the above queries are equivalent?
(A) I and II
(B) I and III
(C) II and IV
(D) III and IV
Answer: (A)

Explanation: I and II describe the division operator in Relational Algebra


and Tuple Relational Calculus respectively.
Question 111

Consider the following three schedules of transactions T1, T2 and T3. [Notation: In the
following NYO represents the action Y (R for read, W for write) performed by transaction N
on object O.]
(S1) 2RA 2WA 3RC 2WB 3WA 3WC 1RA 1RB 1WA 1WB
(S2) 3RC 2RA 2WA 2WB 3WA 1RA 1RB 1WA 1WB 3WC
(S3) 2RA 3RC 3WA 2WA 2WB 3WC 1RA 1RB 1WA 1WB
Which of the following statements is TRUE?
(A) S1, S2 and S3 are all conflict equivalent to each other
(B) No two of S1, S2 and S3 are conflict equivalent to each other
(C) S2 is conflict equivalent to S3, but not to S1
(D) S1 is conflict equivalent to S2, but not to S3
Answer: (D)

Explanation:
All the conflicting pairs like (3WA, 1WA) are in the same order in both S1
and S2.
Question 112

Consider the following schedules involving two transactions. Which one of the
following statements is TRUE?

(A) Both S1 and S2 are conflict serializable.


(B) S1 is conflict serializable and S2 is not conflict serializable.
(C) S1 is not conflict serializable and S2 is conflict serializable.
(D) Both S1 and S2 are not conflict serializable.
Answer: (C)
Explanation:
S1 is not conflict serializable, but S2 is conflict serializable
Schedule S1
T1 T2
---------------------
r1(X)
r1(Y)
r2(X)
r2(Y)
w2(Y)
w1(X)
The schedule is neither conflict equivalent to T1T2, nor T2T1.
Schedule S2
T1 T2
---------------------
r1(X)
r2(X)
r2(Y)
w2(Y)
r1(Y)
w1(X)
The schedule is conflict equivalent to T2T1.
Question 113
Consider the following two transactions : T1 and T2.

Which of the following schemes, using shared and exclusive locks, satisfy the
requirements for strict two phase locking for the above transactions?
Answer: (C)
Explanation:
Shared locks are used for Read,exclusive locks are used for Write data. one exclusive lock can not
take other exclusive lock which is already taken by other schedule as it will lead to deadlock.
Requirements to follow Strict 2PL:
1. Exclusive locks should be released after the commit (Releasing exclusive lock after commit
restrict the deadlock condition. i.e. we cannot get lock on item were exclusive lock already taken.
2. No Locking can be done after the first Unlock and vice versa.
option (A): Incorrect because to write B,S1 needs exclusive lock on B and to write A,S2 needs
exclusive Lock on A. that’s why it is incorrect.
option (B): Incorrect because one exclusive lock cannot take other’s Exclusive Lock. here, S1 has
taken exclusive lock on item A, S2 has taken exclusive lock on item B so now S1 can’t take
exclusive lock on item B and S2 can’t take exclusive lock on item A. that’s why it is incorrect.
option (C): Correct as it is following all the three requirement for strict 2PL. Here,schedule S1
releases exclusive lock on B after commit and schedule S2 releases exclusive lock on A after
commit.(condition 1 satisfied)
option(D): incorrect as according to condition 1,Exclusive locks should be released after the
commit. here,schedule S1 releases exclusive lock on B before commit and schedule S2 releases
exclusive lock on A before commit. Hence it is incorrect.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 114
Consider three data items D1, D2 and D3 and the following execution schedule of transactions
T1, T2 and T3. In the diagram, R(D) and W(D) denote the actions reading and writing the data
item D respectively.

Which of the following statements is correct?


(A) The schedule is serializable as T2; T3; T1
(B) The schedule is serializable as T2; T1; T3
(C) The schedule is serializable as T3; T2; T1
(D) The schedule is not serialisable
Answer: (D)

Explanation:
T1 and T2 have conflicting operations between them forming a cycle in the
precedence graph.
R(D2) of T2, and W(D2) of T1 ( Read-Write Conflict)
R(D1) of T1, and W(D1) of T2 ( Read-Write Conflict)
Hence in the precedence graph of the schedule there would be a cycle
between T1 and T2 vertices. Therefore not a serializable schedule.
Gate previous year questions
Database management system
Question 115

Given relations r(w, x) and s(y, z), the result of


SELECT DISTINCT w, x
FROM r, s
is guaranteed to be same as r, provided
(A) r has no duplicates and s is non-empty
(B) r and s have no duplicates
(C) s has no duplicates and r is non-empty
(D) r and s have the same number of tuples
Answer: (a)
Explanation:
The query selects all attributes of r. Since we have distinct in query, result
can be equal to r only if r doesn’t have duplicates.
If we do not give any attribute on which we want to join two tables, then
the queries like above become equivalent to Cartesian product. Cartesian
product of two sets will be empty if any of the two sets is empty. So, s
should have atleast one record to get all rows of r.
Question 116

In SQL, relations can contain null values, and comparisons with null values
are treated as unknown. Suppose all comparisons with a null value are
treated as false. Which of the
following pairs is not equivalent? (GATE CS 2000)
(a) x = 5, not (not (x = 5)
(b) x = 5, x > 4 and x < 6, where x is an integer
(c) x < 5, not(x = 5)
(d) None of the above
Answer (c)
Explanation:
It doesn’t need much explanation. For all values smaller than 5, x < 5 will
always be true but x = 5 will be false.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 117

Which of the following is/are correct?


A An SQL query automatically eliminates duplicates.
B An SQL query will not work if there are no indexes on the relations.
C SQL permits attribute names to be repeated in the same relation.
D None of the above.
Solution D
Question 118

Consider the set of relations


EMP(Employee-no, Dept-no, Employee-name, Salary)
DEPT(Dept-no, Dept-name, Location)
Write an SQL query to:
a. Find all employee names who work in departments located at “Calcutta”
and whose salary is greater than Rs. 50,000.
b. Calculate, for each department number, the number of employees with a
salary greater than Rs. 100,000.
(a)
select Employee-name
from EMP, DEPT
where Salary>50000 and EMP.Dept-no=DEPT.Dept-no and
Location="Calcutta"

(b)
select Dept-no, count(*)
from EMP where salary > 100000
group by Dept-no
Question 119

Suppose we have a database consisting of the following three relations.


FREQUENTS(student, parlor) giving the parlors each student visits.
SERVES(parlor, ice-cream) indicating what kind of ice-creams each parlor serves.
LIKES(student, ice-cream) indicating what ice-creams each parlor serves.

(Assuming that each student likes at least one ice-cream and frequents at least one
parlor)
Express the following in SQL:
Print the students that frequent at least one parlor that serves some ice-cream that
they like.
Answer:

Explanation: Answer:
SELECT DISTINCT FREQUENTS.student FROM
FREQUENTS, SERVES, LIKES
WHERE
FREQUENTS.parlor=SERVES.parlor
AND
SERVES.ice-cream=LIKES.ice-cream
AND
FREQUENTS.student=LIKES.student;
Question 120

Let ri(z) and wi(z) denote read and write operations respectively on a data item
z by a transaction Ti. Consider the following two schedules.
S1: r1(x)r1(y)r2(x)r2(y)w2(y)w1(x)
S2: r1(x)r2(x)r2(y)w2(y)r1(y)w1(x)
Which one of the following options is correct?
(A) S1 is conflict serializable, and S2 is not conflict serializable
(B) S1 is not conflict serializable, and S2 is conflict serializable
(C) Both S1 and S2 are conflict serializable
(D) Neither S1 nor S2 is conflict serializable
Solution B
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 121

Consider the following two statements about database transaction schedules:


• I. Strict two-phase locking protocol generates conflict serializable schedules that are
also recoverable.
• II. Timestamp-ordering concurrency control protocol with Thomas’ Write Rule can
generate view serializable schedules that are not conflict serializable.
Which of the above statements is/are TRUE?
(A) I only
(B) II only
(C) Both I and II
(D) Neither I nor II
Answer: (C)

Explanation: Following Strict 2-PL ensures that our schedule is:


serializablity, Recoverable, and Cascadeless. So statement (I) is true.
Thomas Write Rule for concurrency control does not enforce Conflict
Serializablity, so statement (II) is also true.
Option (C) is correct.
Question 122
Suppose a database schedule S involves transactions T1, ….Tn. Construct the
precedence graph of S with vertices representing the transactions and edges
representing the conflicts. If S is serializable, which one of the following orderings
of the vertices of the precedence graph is guaranteed to yield a serial schedule?
(A) Topological order
(B) Depth-first order
(C) Breadth-first order
(D) Ascending order of transaction indices
Answer: (A)

Explanation: Cycle in precedence graph tells that schedule is not conflict


serializable. DFS and BFS traversal of graph are possible even if graph
contains cycle. And hence DFS and BFS are also possible for non
serializable graphs. But Topological sort of any cyclic graph is not
possible. Thus topological sort guarantees graph to be serializable .
Option D is not valid because in a transaction with more indices might
have to come before lower one. Also two non- conflicting schedule can
occur simultaneously.
Question 123

Which one of the following is NOT a part of the ACID properties of database
transactions?
(A) Atomicity
(B) Consistency
(C) Isolation
(D) Deadlock-freedom
Answer: (D)

Explanation: D refers to Durability.


Question 124
Consider the following transaction involving two bank accounts x and y.
read(x); x := x – 50; write(x); read(y); y := y + 50; write(y)
The constraint that the sum of the accounts x and y should remain constant is
that of
(A) Atomicity
(B) Consistency
(C) Isolation
(D) Durability
Answer: (B)

Explanation: Consistency in database systems refers to the requirement that


any given database transaction must only change affected data in allowed
ways, that is sum of x and y must not change.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 125
Which of the following concurrency control protocols ensure both conflict
serializability and freedom from deadlock? I. 2-phase locking II. Time-stamp
ordering
(A) I only
(B) II only
(C). Both I and II
(D) Neither I nor II
Answer: (B)

Explanation:
2 Phase Locking (2PL) is a concurrency control method that guarantees
serializability. The protocol utilizes locks, applied by a transaction to data, which
may block (interpreted as signals to stop) other transactions from accessing the
same data during the transaction’s life. 2PL may be lead to deadlocks that result
from the mutual blocking of two or more transactions. See the following situation,
neither T3 nor T4 can make progress.

Timestamp-based concurrency control algorithm is a non-lock concurrency


control method. In Timestamp based method, deadlock cannot occur as no
transaction ever waits.
Question 126

Amongst the ACID properties of a transaction, the ‘Durability’ property requires


that the changes made to the database by a successful transaction persist

(A) Except in case of an Operating System crash


(B) Except in case of a Disk crash
(C) Except in case of a power failure
(D) Always, even if there is a failure of any kind
Answer: (D)

Explanation: ACID properties:


Atomicity: By this, we mean that either the entire transaction takes place at once
or doesn’t happen at all.
Consistency: This means that integrity constraints must be maintained so that the
database is consistent before and after the transaction.
Isolation: This property ensures that multiple transactions can occur concurrently
without leading to inconsistency of database state.
Durability: This property ensures that once the transaction has completed
execution, the updates and modifications to the database are stored in and
written to disk and they persist even if system failure occurs no matter which type
of failure.
Therefore option D
Question 127

Which level of locking provides the highest degree of concurrency in a


relational database?
A Page.
B Table.
C Row.
D Page, table and row level locking allow the same degree of concurrency.
Solution C

Row has lower level of granularity( granularity of locks in a database


refers to how much of the data is locked at one time) among page, table
and row. As in case of Row the amount of data which is locked very less
so it takes less amount of memory then many processes can run at the
same time. So concurrency is high for Row level locking.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 128

Which of the following scenarios may lead to an irrecoverable error in a


database system?
A A transaction writes a data item after it is read by an uncommitted
transaction
B A transaction reads a data item after it is read by an uncommitted
transaction
C A transaction reads a data item after it is written by a committed transaction
D A transaction reads a data item after it is written by an uncommitted
transaction
Answer: (D)

Explanation: Option C is a normal operation.


Option B is also fine as no write operation is involved.
Option A can be recovered, but option D can’t be.
Question 129

Suppose a database system crashes again while recovering from a previous


crash. Assume checkpointing is not done by the database either during the
transactions or during recovery.
Which of the following statements is/are correct?
A The same undo and redo list will be used while recovering again.
B The database will become inconsistent.
C All the transactions that are already undone and redone will not be
recovered again.
D The system cannot recover any further.
Answer: (A)

Explanation: Assuming undo/redo list are persistent (Log records), while undo/redo
system records any changes done. So if the system crashes during recovery, the
next recovery will take DB into a consistent state
If checkpointing is not done by the database either during the transactions or during
recovery, then Recover system using Log records : After a system crash has
occurred, the system consults the log to determine which transactions need to be
redone and which need to be undone.
• Transaction Ti needs to be undone if the log contains the record but does not
contain either the record or the record .
• Transaction Ti needs to be redone if log contains record and either the record or
the record .
Question 130

Consider the transactions T1, T2, and T3 and the schedules S1 and S2 given below.
T1: r1(X); r1(Z); w1(X); w1(Z)
T2: r2(Y); r2(Z); w2(Z)
T3: r3(Y); r3(X); w3(Y)
S1: r1(X); r3(Y); r3(X); r2(Y); r2(Z);
w3(Y); w2(Z); r1(Z); w1(X); w1(Z)
S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z);
r2(Z); w3(Y); w1(X); w2(Z); w1(Z)
Which one of the following statements about the schedules is TRUE?
(A) Only S1 is conflict-serializable.
(B) Only S2 is conflict-serializable.
(C) Both S1 and S2 are conflict-serializable.
(D) Neither S1 nor S2 is conflict-serializable.
Answer: (A)

Explanation: For conflict serializability of a schedule( which gives same effect


as a serial schedule ) we should check for conflict operations, which are
Read-Write, Write-Read and Write-Write between each pair of transactions,
and based on those conflicts we make a precedence graph, if the graph
contains a cycle, it’s not a conflict serializable schedule.
To make a precedence graph: if Read(X) in Ti followed by Write(X) in Tj (
hence a conflict ), then we draw an edge from Ti to Tj ( Ti -> Tj)
If we make a precedence graph for S1 and S2 , we would get directed edges
for S1 as T2->T1, T2->T3, T3->T1, and for S2 as T2->T1, T2->T3, T3->T1,
T1->T2. In S1 there is no cycle, but S2 has a cycle. Hence only S1 is conflict
serializable.
Note : The serial order for S1 is T2 -> T3 -> T1.
Question 131

where ri(Z) denotes a read operation by transaction Ti on a variable Z, wi(Z)


denotes a write operation by Ti on a variable Z and ai denotes an abort by
transaction Ti .
Which one of the following statements about the above schedule is TRUE?
(A) S is non-recoverable
(B) S is recoverable, but has a cascading abort
(C) S does not have a cascading abort
(D) S is strict
Answer: (C)

Explanation:
As we can see in figure,
• T2 overwrites a value that T1 writes
• T1 aborts: its “remembered” values are restored.
• Cascading Abort could have arised if – > Abort of T1 required abort of T2
but as T2 is already aborted , its not a cascade abort. Therefore, Option C
Option A – is not true because the given schedule is recoverable
Option B – is not true as it is recoverable and avoid cascading aborts;
Option D – is not true because T2 is also doing abort operation after T1 does,
so NOT strict.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 132

Consider the following two phase locking protocol. Suppose a transaction T accesses (for read
or write operations), a certain set of objects {O1,…,Ok}. This is done in the following manner:
Step 1. T acquires exclusive locks to O1, . . . , Ok in increasing order of their addresses.
Step 2. The required operations are performed.
Step 3. All locks are released.
This protocol will
(A) guarantee serializability and deadlock-freedom
(B) guarantee neither serializability nor deadlock-freedom
(C) guarantee serializability but not deadlock-freedom
(D) guarantee deadlock-freedom but not serializability
Answer: (A)
Explanation: The above scenario is Conservative 2PL( or Static 2PL). In Conservative 2PL
protocol, a transaction has to lock all the items it access before the transaction begins
execution. It is used to avoid deadlocks. Also, 2PL is conflict serializable, therefore it
guarantees serializability.
Therefore option A
Advantages of Conservative 2PL :
• No possibility of deadlock.
• Ensure serializability.
Drawbacks of Conservative 2PL :
• Less throughput and resource utilisation because it holds the resources before the
transaction begins execution.
• Starvation is possible since no restriction on unlock operation.
• 2pl is a deadlock free protocol but it is difficult to use in practice
Question 133

Consider a simple checkpointing protocol and the following set of operations in the log.
(start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4); (write, T1, z, 5, 7);
(checkpoint);
(start, T2); (write, T2, x, 1, 9); (commit, T2); (start, T3); (write, T3, z, 7, 2);
If a crash happens now and the system tries to recover using both undo and redo
operations, what are the contents of the undo list and the redo list
(A) Undo: T3, T1; Redo: T2
(B) Undo: T3, T1; Redo: T2, T4
(C) Undo: none; Redo: T2, T4, T3; T1
(D) Undo: T3, T1, T4; Redo: T2
Answer: (A)

Explanation: Since T1 and T3 are not committed yet, they must be


undone. The transaction T2 must be redone because it is after the latest
checkpoint.
Question 134
Consider the following partial Schedule S involving two transactions T1 and T2. Only the read and
the write operations have been shown. The read operation on data item P is denoted by read(P)
and the write operation on data item P is denoted by write(P).

Suppose that the transaction T1 fails immediately after time instance 9. Which one of the following
statements is correct?
(A) T2 must be aborted and then both T1 and T2 must be re-started to ensure transaction atomicity
(B) Schedule S is non-recoverable and cannot ensure transaction atomicity
(C) Only T2 must be aborted and then re-started to ensure transaction atomicity
(D) Schedule S is recoverable and can ensure atomicity and nothing else needs to be done
Answer: (B)
Explanation:
if transaction fails, atomicity requires effect of transaction to be undone. Durability states that once
transaction commits, its change cannot be undone (without running another, compensating,
transaction).
Recoverable schedule: A schedules exactly where, for every set of transaction Ti and Tj. If Tj reads
a data items previously written by Ti, then the commit operation of Ti precedes the commit operation
of Tj.
Aborting involves undoing the operations and redoing them since by the time stamp it is aborted.
Option (A): T2 must be aborted and then both T1 and T2 must be re-started to ensure transaction
atomicity. It is incorrect because it says abort transaction T2 and then redo all the operations. But
there is no guarantee that it will succeed this time as again T1 may be fail.
Option(B): Schedule S is non-recoverable and cannot ensure transaction atomicity. Correct, it is by
definition an irrecoverable schedule so now even if we start to undo the actions one by one(after t1
fails) in order to ensure transaction atomicity. Still we cannot undo a committed transaction. hence
this schedule is irrecoverable by definition and also not atomic since it leaves the database in an
inconsistent state. Simply dirty read so nonrecoverable.
Option (C): Only T2 must be aborted and then re-started to ensure transaction atomicity. It is
incorrect because it says abort only transaction T2 and then redo all the T2 operations. But this is
dirty read problem as it is reading the data item A which is written by T1 and T1 is not committed.
Again it will be the dirty read problem. So incorrect.
Option (D): Schedule S is recoverable and can ensure transaction atomicity and nothing else needs
to be done. Incorrect, it is clearly saying that schedule s is recoverable but it is irrecoverable
because T2 read the data item A which is written by T1 and T1 failed and rollback, at the rollback T1
start undo all operations and modified the value of A with previous value but T2 is already
committed so T2 can’t change the read value of A which was earlier taken from T1.
Question 135

Consider the following four schedules due to three transactions (indicated by the subscript) using read and
write on a data item X, denoted by r(X) and w(X) respectively. Which one of them is conflict serializable ?
S1: r1(X); r2(X); w1(X); r3(X); w2(X)

S2: r2(X); r1(X); w2(X); r3(X); w1(X)

S3: r3(X); r2(X); r1(X); w2(X); w1(X)

S4: r2(X); w2(X); r3(X); r1(X); w1(X)


(A) S1
(B) S2
(C) S3
(D) S4
Answer: (D)

Explanation: We can draw precedence graph for each schedule and for
conflict serializability graph must not contain cycle.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 136
Consider the following schedule S of transactions T1, T2, T3, T4:

Which one of the following statements is CORRECT?


(A) S is conflict-serializable but not recoverable
(B) S is not conflict-serializable but is recoverable
(C) S is both conflict-serializable and recoverable
(D) S is neither conflict-serializable nor is it recoverable
Answer: (C)

Explanation: To check for conflict-serializable, we need to make a precedence


graph, if the graph contains a cycle, then it’s not conflict serializable, else it is.
Here, for the precedence graph there will be only two directed edges, one from
T2 -> T3 ( Read- Write Conflict), and another from T2 -> T1( Read- Write
Conflict), hence no cycle, so the schedule is conflict serializable.
Now to check for Recoverable, we need to check for a dirty-read operation(
Write by Transaction Ti, followed by Read by Transaction Tj but before Ti
commits) between any pair of operations. If no dirty-read then recoverable
schedule, if a dirty read is there then we need to check for commit operations.
Here no dirty read operation ( as T3 and T1 commits before T4 reads the
Write(X) of T3 and T1 , and T2 commits before T4 reads the Write(Y) of T2 ).
Therefore the schedule is recoverable.
Hence, Option C.
Question 137
Consider the following transactions with data items P and Q initialized to zero:
T1: read (P) ;
read (Q) ;
if P = 0 then Q : = Q + 1 ;
write (Q) ;
T2: read (Q) ;
read (P) ;
if Q = 0 then P : = P + 1 ;
write (P) ;
Any non-serial interleaving of T1 and T2 for concurrent execution leads to
(A) A serializable schedule
(B) A schedule that is not conflict serializable
(C) A conflict serializable schedule
(D) A schedule for which a precedence graph cannot be drawn
Answer (B)
Two or more actions are said to be in conflict if:
1) The actions belong to different transactions.
2) At least one of the actions is a write operation.
3) The actions access the same object (read or write).
The schedules S1 and S2 are said to be conflict-equivalent if the following conditions are
satisfied:
1) Both schedules S1 and S2 involve the same set of transactions (including ordering of
actions within each transaction).
2) The order of each pair of conflicting actions in S1 and S2 are the same.
A schedule is said to be conflict-serializable when the schedule is conflict-equivalent to one or
more serial schedules.
In the given scenario, there are two possible serial schedules:
1) T1 followed by T2
2) T2 followed by T1.
In both of the serial schedules, one of the transactions reads the value written by other
transaction as a first step. Therefore, any non-serial interleaving of T1 and T2 will not be
conflict serializable.
Question 138
Consider the following schedule for transactions T1, T2 and T3:

Which one of the schedules below is the correct serialization of the above?
(A)T1->>T3->>T2
(B)T2->>T1->>T3
(C)T2->>T3->>T1
(D)T3->>T1->>T2
Answer: (A)

Explanation:
T1 can complete before T2 and T3 as there is no conflict between Write(X) of
T1 and the operations in T2 and T3 which occur before Write(X) of T1 in the
above diagram.
T3 should can complete before T2 as the Read(Y) of T3 doesn’t conflict with
Read(Y) of T2. Similarly, Write(X) of T3 doesn’t conflict with Read(Y) and
Write(Y) operations of T2.
Another way to solve this question is to create a dependency graph and
topologically sort the dependency graph. After topologically sorting, we can see
the sequence T1, T3, T2.
Question 139
Consider two transactions T1 and T2, and four schedules S1, S2, S3, S4 of
T1 and T2 as given below:
T1 = R1[X] W1[X] W1[Y]
T2 = R2[X] R2[Y] W2[Y]
S1 = R1[X] R2[X] R2[Y] W1[X] W1[Y] W2[Y]
S2 = R1[X] R2[X] R2[Y] W1[X] W2[Y] W1[Y]
S3 = R1[X] W1[X] R2[X] W1[Y] R2[Y] W2[Y]
S4 = R2[X] R2[Y] R1[X] W1[X] W1[Y] W2[Y]
Which of the above schedules are conflict-serializable?
(A) S1 and S2
(B) S2 and S3
(C) S3 only
(D) S4 only
Answer: (B)

Explanation: There can be two possible serial schedules T1 T2 and T2 T1.


The serial schedule T1 T2 has the following sequence of operations
R1[X] W1[X] W1[Y] R2[X] R2[Y] W2[Y]
And the schedule T2 T1 has the following sequence of operations.
R2[X] R2[Y] W2[Y] R1[X] W1[X] W1[Y]
The Schedule S2 is conflict-equivalent to T2 T1 and S3 is conflict-
equivalent to T1 T2
Question 140

Let R and S be relational schemes such that R={a,b,c} and S={c}. Now consider the
following queries on the database:

IV) SELECT R.a, R.b


FROM R,S
WHERE R.c=S.c
Which of the above queries are equivalent?
(A) I and II
(B) I and III
(C) II and IV
(D) III and IV
Answer: (A)

Explanation: I and II describe the division operator in Relational Algebra


and Tuple Relational Calculus respectively.
Question 141

Consider the following three schedules of transactions T1, T2 and T3. [Notation: In the
following NYO represents the action Y (R for read, W for write) performed by transaction N
on object O.]
(S1) 2RA 2WA 3RC 2WB 3WA 3WC 1RA 1RB 1WA 1WB
(S2) 3RC 2RA 2WA 2WB 3WA 1RA 1RB 1WA 1WB 3WC
(S3) 2RA 3RC 3WA 2WA 2WB 3WC 1RA 1RB 1WA 1WB
Which of the following statements is TRUE?
(A) S1, S2 and S3 are all conflict equivalent to each other
(B) No two of S1, S2 and S3 are conflict equivalent to each other
(C) S2 is conflict equivalent to S3, but not to S1
(D) S1 is conflict equivalent to S2, but not to S3
Answer: (D)

Explanation:
All the conflicting pairs like (3WA, 1WA) are in the same order in both S1
and S2.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 142

Consider the following schedules involving two transactions. Which one of the
following statements is TRUE?

(A) Both S1 and S2 are conflict serializable.


(B) S1 is conflict serializable and S2 is not conflict serializable.
(C) S1 is not conflict serializable and S2 is conflict serializable.
(D) Both S1 and S2 are not conflict serializable.
Answer: (C)
Explanation:
S1 is not conflict serializable, but S2 is conflict serializable
Schedule S1
T1 T2
---------------------
r1(X)
r1(Y)
r2(X)
r2(Y)
w2(Y)
w1(X)
The schedule is neither conflict equivalent to T1T2, nor T2T1.
Schedule S2
T1 T2
---------------------
r1(X)
r2(X)
r2(Y)
w2(Y)
r1(Y)
w1(X)
The schedule is conflict equivalent to T2T1.
Question 143
Consider the following two transactions : T1 and T2.

Which of the following schemes, using shared and exclusive locks, satisfy the
requirements for strict two phase locking for the above transactions?
Answer: (C)
Explanation:
Shared locks are used for Read,exclusive locks are used for Write data. one exclusive lock can not
take other exclusive lock which is already taken by other schedule as it will lead to deadlock.
Requirements to follow Strict 2PL:
1. Exclusive locks should be released after the commit (Releasing exclusive lock after commit
restrict the deadlock condition. i.e. we cannot get lock on item were exclusive lock already taken.
2. No Locking can be done after the first Unlock and vice versa.
option (A): Incorrect because to write B,S1 needs exclusive lock on B and to write A,S2 needs
exclusive Lock on A. that’s why it is incorrect.
option (B): Incorrect because one exclusive lock cannot take other’s Exclusive Lock. here, S1 has
taken exclusive lock on item A, S2 has taken exclusive lock on item B so now S1 can’t take
exclusive lock on item B and S2 can’t take exclusive lock on item A. that’s why it is incorrect.
option (C): Correct as it is following all the three requirement for strict 2PL. Here,schedule S1
releases exclusive lock on B after commit and schedule S2 releases exclusive lock on A after
commit.(condition 1 satisfied)
option(D): incorrect as according to condition 1,Exclusive locks should be released after the
commit. here,schedule S1 releases exclusive lock on B before commit and schedule S2 releases
exclusive lock on A before commit. Hence it is incorrect.
Question 144
Consider three data items D1, D2 and D3 and the following execution schedule of transactions
T1, T2 and T3. In the diagram, R(D) and W(D) denote the actions reading and writing the data
item D respectively.

Which of the following statements is correct?


(A) The schedule is serializable as T2; T3; T1
(B) The schedule is serializable as T2; T1; T3
(C) The schedule is serializable as T3; T2; T1
(D) The schedule is not serialisable
Answer: (D)

Explanation:
T1 and T2 have conflicting operations between them forming a cycle in the
precedence graph.
R(D2) of T2, and W(D2) of T1 ( Read-Write Conflict)
R(D1) of T1, and W(D1) of T2 ( Read-Write Conflict)
Hence in the precedence graph of the schedule there would be a cycle
between T1 and T2 vertices. Therefore not a serializable schedule.
Gate previous year questions
Database management system
Question 145
Consider the relational database with the following four schemas and their respective instances.
Student(sNo, sName, dNo) Dept(dNo, dName)
Course(cNo, cName, dNo) Register(sNo, cNo)

SQL Query:
SELECT * FROM Student AS S WHERE NOT EXIST
(SELECT cNo FROM Course WHERE dNo = “D01”
EXCEPT
SELECT cNo FROM Register WHERE sNo = S.sNo)
The number of rows returned by the above SQL query is___________.
The given query is correlated, therefore, for every value of S.sno, we will be running the
inner query.
Inner query will have {C11, C12} EXCEPT {C11, C12} = empty relation for sno = S01.
As a consequence, clauses that are not non-existing will return true, and the tuple tih sno =
S01 will be added to the resulting relation.
Similarly for sno = S02, Inner query will have {C11, C12} EXCEPT {C11} = {C12}
The non-existing clause will return false, and the resulting relationship will not include it. We’ll
look for other issues in the same way. This query will return tuples that are enrolled in all of
department D01’s courses. This query will return tuples that are enrolled in all the courses
offered by department D01.
Thus, there will be 2 tuples in the resultant relation:

Hence, the correct answer is 2.


Sno Sname Dno

So1 James Do1

S04 Jane D01


Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 146
Consider a relational database containing the following schemas.

The primary key of each table is indicated by underlining the constituent fields.
SELECT s.sno, s.sname
FROM Suppliers s, Catalogue c
WHERE s.sno=c.sno AND
cost > (SELECT AVG (cost)
FROM Catalogue
WHERE pno = ‘P4’
GROUP BY pno) ;
The number of rows returned by the above SQL query is
(A) 4
(B) 5
(C) 0
(D) 2
Result of the inner query will be 225(avg(200,250)) and subsequently
every such tuple which has s.sno=c.sno and cost>225 will get selected
from the Cartesian product of supplier and catalogue table.
Option (A) is correct.
Question 147
Consider the following two tables and four queries in SQL.
Book (isbn, bname), Stock (isbn, copies)
Query 1:
SELECT B.isbn, S.copies
FROM Book B INNER JOIN Stock S
ON B.isbn = S.isbn;

Query 2:
SELECT B.isbn, S.copies
FROM B B LEFT OUTER JOIN Stock S
ON B.isbn = S.isbn;

Query 3:
SELECT B.isbn, S.copies
FROM Book B RIGHT OUTER JOIN Stock S
ON B.isbn = S.isbn;

Query 4:
SELECT B.isbn, S.copies
FROM B B FULL OUTER JOIN Stock S
ON B.isbn = S.isbn;

Which one of the queries above is certain to have an output that is a superset of the outputs of the other three queries?
(A) Query 1
(B) Query 2
(C) Query 3
(D) Query 4
Answer: (D)

Explanation: In SQL the FULL OUTER JOIN combines the results of both
left and right outer joins and returns all (matched or unmatched) rows from
the tables on both sides of the join clause.
So, option (D) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 148

Select operation in SQL is equivalent to


(A) the selection operation in relational algebra
(B) the selection operation in relational algebra, except that select in SQL
retains duplicates
(C) the projection operation in relational algebra
(D) the projection operation in relational algebra, except that select in SQL
retains duplicates
Answer: (D)

Explanation: Select operation is equivalent to the projection operation in


relational algebra, except that select in SQL retains duplicates and on the
contrary projection removes the duplicates.
Question 149

Which of the following options will be needed at the end of the SQL query
SELECT P1. address
FROM Cinema P1
Such that it always finds the addresses of theaters with maximum capacity?
(A) WHERE P1. Capacity> = All (select P2. Capacity from Cinema P2)
(B) WHERE P1. Capacity> = Any (select P2. Capacity from Cinema P2)
(C) WHERE P1. Capacity > All (select max(P2. Capacity) from Cinema P2)
(D) WHERE P1. Capacity > Any (select max (P2. Capacity) from Cinema P2)
Answer: (A)

Explanation: When the ALL condition is followed by a list, the optimizer


expands the initial condition to all elements of the list and strings them
together with AND operators.
When the ANY condition is followed by a list, the optimizer expands the
initial condition to all elements of the list and strings them together with
OR operators, as shown below.
Question 150

Given the following statements:


S1: A foreign key declaration can always
be replaced by an equivalent check
assertion in SQL.
S2: Given the table R(a,b,c) where a and
b together form the primary key, the
following is a valid table definition.
CREATE TABLE S (
a INTEGER,
d INTEGER,
e INTEGER,
PRIMARY KEY (d),
FOREIGN KEY (a) references R)
Which one of the following statements is CORRECT?
(A) S1 is TRUE and S2 is FALSE.
(B) Both S1 and S2 are TRUE.
(C) S1 is FALSE and S2 is TRUE.
(D) Both S1 and S2 are FALSE.
Answer: (D)

Explanation: Check assertions are not sufficient to replace foreign key. Foreign key declaration may
have cascade delete which is not possible by just check insertion.
Using a check condition we can have the same effect as Foreign key while adding elements to the child
table. But when we delete an element from the parent table the referential integrity constraint is no longer
valid. So, a check constraint cannot replace a foreign key.
So, we cannot replace it with a single check.
S2: Given the table R(a,b,c) where a and
b together form the primary key, the
following is a valid table definition.
CREATE TABLE S (
a INTEGER,
d INTEGER,
e INTEGER,
PRIMARY KEY (d),
FOREIGN KEY (a) references R)
False:
Foreign key in one table should uniquely identifies a row of other table. In above table definition, table S
has a foreign key that refers to field ‘a’ of R. The field ‘a’ in table S doesn’t uniquely identify a row in table
R.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 151

Which of the following statements are TRUE about an SQL query? P : An


SQL query can contain a HAVING clause even if it does not have a GROUP
BY clause Q : An SQL query can contain a HAVING clause only if it has a
GROUP BY clause R : All attributes used in the GROUP BY clause must
appear in the SELECT clause S : Not all attributes used in the GROUP BY
clause need to appear in the SELECT clause
(A). P and R
(B). P and S
(C). Q and R
(D). Q and S
Answer: (B)
Explanation:
According to standard SQL answer should be option (C) which is answer key given by GATE authority. If we talk about different SQL
implementations like MySQL, then option (B) is also right. But in question they seem to be talking about standard SQL not about
implementation. For example below is a P is correct in most of the implementations. HAVING clause can also be used with aggregate
function. If we use a HAVING clause without a GROUP BY clause, the HAVING condition applies to all rows that satisfy the search condition.
In other words, all rows that satisfy the search condition make up a single group. See this for more details. S is correct . To verify S, try
following queries in SQL.
CREATE TABLE temp
(
id INT,
name VARCHAR(100)
);
INSERT INTO temp VALUES (1, \"abc\");
INSERT INTO temp VALUES (2, \"abc\");
INSERT INTO temp VALUES (3, \"bcd\");
INSERT INTO temp VALUES (4, \"cde\");
SELECT Count(*)
FROM temp
GROUP BY name;
Output:
count(*)
--------
2
1
1
Question 152
A relational schema for a train reservation database is given below.
Passenger (pid, pname, age)
Reservation (pid, class, tid)
Table: Passenger
pid pname age What pids are returned by the following SQL query for the above instance of the
-----------------
0 Sachin 65 tables?
1 Rahul 66 SELECT pid
2 Sourav 67 FROM Reservation ,
3 Anil 69 WHERE class ‘AC’ AND
EXISTS (SELECT *
Table : Reservation FROM Passenger
pid class tid WHERE age > 65 AND
--------------- Passenger. pid = Reservation.pid)
0 AC 8200
1 AC 8201 (A) 1, 0
2 SC 8201 (B) 1, 2
5 AC 8203 (C) 1, 3
1 SC 8204
3 AC 8202 (D) 1, 5
Answer: (C)

Explanation: When a subquery uses values from outer query, the


subquery is called correlated subquery. The correlated subquery is
evaluated once for each row processed by the outer query.
The outer query selects 4 entries (with pids as 0, 1, 5, 3) from Reservation
table. Out of these selected entries, the subquery returns Non-Null values
only for 1 and 3.
Question 153

where the primary keys are shown underlined. The number of tuples in the
Student and Enroll tables are 120 and 8 respectively. What are the maximum
and minimum number of tuples that can be present in (Student * Enroll),
where ‘*’ denotes natural join ?
(A) 8, 8
(B) 120, 8
(C) 960, 8
(D) 960, 120
Answer: (A)

Explanation: The result of the natural join is the set of all combinations of tuples in R and S that are equal on their common
attribute names.
What is the maximum possible number of tuples?
The result of natural join becomes equal to the Cartesian product when there are no common attributes. The given tables have a
common attribute, so the result of natural join cannot have more than the number of tuples in larger table.
Student
-------------------------------------
Rollno name Address Result of natural join
------------------------------------- ----------------------------------------------
1 a abc Rollno Name Address Courseno Coursename
2 b bcd ----------------------------------------------
3 c cde 1 a abc 12 pqr
1 a abc 14 qrs
1 a abc 15 rst
2 b bcd 13 uvw
Enroll 2 b bcd 14 qrs
---------------------------------------------- What is the minimum possible number of tuples?
Rollno Courseno Coursename It might be possible that there is no rollno common. In that case, the number of
---------------------------------------------- tuples would be 0. But in the question rollno is a primary key in Student table and it
1 12 pqr is a prime attribute in the Enroll table.
1 14 qrs So there is no chance of having null values in the rollno column in enroll table and
1 15 rst Student table and every tuple in Enroll will have a parent. So minimum number of
2 13 uvw tuples possible are 8 (only 8 tuples in the Enroll table).
2 14 qrs Option (A) is correct
Question 154
A relational database contains two tables Student and Performance as shown below:

The primary key of the Student table is Roll_no. For the Performance table, the columns Roll_no. and
Subject_code together from the primary key. Consider the SQL query given below:
SELECT S.Student_name, sum(P.Marks)
FROM Student S, Performance P
WHERE P.Marks > 84
GROUP BY S.Student_name;
The number of rows returned by the above SQL query is _________ .
Note: This was Numerical Type question.
(A) 5
(B) 4
(C) 3
Answer: (A)
Explanation: In where condition no condition over Roll_no so query produces all groups.

student_name sum(P.marks)

Amit 452

Rohan 452

Smita 452

Vinit 452

Priya 452

Total 5 different student names all 5 group records in result. See


Question 155
Consider the following database table named water_schemes :

The number of tuples returned by the following SQL query is


with total(name, capacity) as
select district_name, sum(capacity)
from water_schemes
group by district_name
with total_avg(capacity) as
select avg(capacity)
from total
select name
from total, total_avg
where total.capacity >= total_avg.capacity
Answer: (B)
Explanation: First group by district name is performed and total capacities obtained as
following
Ajmer 20
Bikaner 40
Charu 30
Dungargarh 10
Then average capacity is computed,
Average Capacity = (20 + 40 + 30 + 10)/4
= 100/4
= 25.

Finally districts with more than average are selected.


Bikaner is 40 which is greater than average (25)
Charu is 30 which is also greater than average (25).

Therefore answer is 2 tuples.


Question 156

Consider the following relations:

SELECT S. Student_Name, sum(P.Marks)


FROM Student S, Performance P
WHERE S.Roll_No = P.Roll_No
GROUP BY S.Student_Name
The number of rows that will be returned by the SQL
query is _________
Explanation: Below is result of given query. Note that there are only two
student names and query prints sum(P.Marks) for every student.
Student_Name Marks
Raj 310
Rohit 140
Question 157
Given the following schema:
employees(emp-id, first-name, last-name, hire-date, dept-id, salary)
departments(dept-id, dept-name, manager-id, location-id)
You want to display the last names and hire dates of all latest hires in their respective departments in
the location ID 1700. You issue the following query:
SQL> SELECT last-name, hire-date
FROM employees
WHERE (dept-id, hire-date) IN ( SELECT dept-id, MAX(hire-date)
FROM employees JOIN departments USING(dept-id)
WHERE location-id = 1700
GROUP BY dept-id);
What is the outcome?
(A) It executes but does not give the correct result.
(B) It executes and gives the correct result.
(C) It generates an error because of pairwise comparison.
(D) It generates an error because the GROUP BY clause cannot be used with table joins in a
subquery
Answer: (B)
Explanation: The given query uses below inner query.
SELECT dept-id, MAX(hire-date)
FROM employees JOIN departments USING(dept-id)
WHERE location-id = 1700
GROUP BY dept-id
The inner query produces last max hire-date in every department located at
location id 1700.
The outer query simply picks all pairs of inner query. Therefore, the query
produces correct result.
SELECT last-name, hire-date
FROM employees
WHERE (dept-id, hire-date) IN
(Inner-Query);
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 158

Consider the following relational schema:


employee(empId, empName, empDept)
customer(custId, custName, salesRepId, rating)
salesRepId is a foreign key referring to empId of the employee relation. Assume that each employee
makes a sale to at least one customer. What does the following query return?
SELECT empName
FROM employee E
WHERE NOT EXISTS ( SELECT custId
FROM customer C
WHERE C.salesRepId = E.empId
AND C.rating <> `GOOD`);
(A) Names of all the employees with at least one of their customers having a ‘GOOD’ rating.
(B) Names of all the employees with at most one of their customers having a ‘GOOD’ rating.
(C) Names of all the employees with none of their customers having a ‘GOOD’ rating.
(D) Names of all the employees with all their customers having a ‘GOOD’ rating.
Answer: (D)

Explanation: If any employee has received rating other than ‘GOOD’ from
any of their customers, then there will be some rows returned by the inner
query;
And NOT EXISTS will return false so those employees won’t be printed.
Only those employees which have got rating ‘GOOD’ from all of their
customers will be printed.
Question 159

SQL allows tuples in relations, and correspondingly defines the multiplicity of


tuples in the result of joins. Which one of the following queries always gives
the same answer as the nested query shown below:
select * from R where a in (select S.a from S)
(A) select R.* from R, S where R.a=S.a
(D)
(B) select distinct R.* from R,S where R.a=S.a
(C) select R.* from R,(select distinct a from S) as S1 where
R.a=S1.a
(D) select R.* from R,S where R.a=S.a and is unique R
Answer: (C)
Explanation: The solution of this question lies in the data set(tuples) of Relations R and S we define. If we miss some case then we may get wrong answer.
Let’s say,
Relation R(BCA) with attributes B, C and A contains the following tuples.
BCA
---------
721
721
895
895
And Relation S(AMN) with attributes A, M, and N contains the following tuples.
AMN
---------
167
284
596
553
———————————————————————————————————–
Now ,the original Query will give result as:
“select * from R where a in (select S.a from S) ” – The query asks to display every tuple of Relation R where R.a is present in the complete set S.a.
BCA
---------
721
721
895
895
———————————————————————————————————–
Option A query will result in :
“select R.* from R, S where R.a=S.a”
BCA
---------
721
721
895
895
895
895
———————————————————————————————————–
Option B query will result in :
” select distinct R.* from R,S where R.a=S.a”
BCA
---------
721
895
———————————————————————————————————–
Option C query will result in :
“select R.* from R,(select distinct a from S) as S1 where
R.a=S1.a”
B C A
———
7 2 1
7 2 1
8 9 5
895
———————————————————————————————————–
Option D query will result in : NULL set
“select R.* from R,S where R.a=S.a and is unique R”
———————————————————————————————————-
Hence option C query matches the original result set.
Note : As mentioned earlier, we should take those data sets which can show us the difference in different queries. Suppose in R if you don’t put identical tuples then you will get wrong answers. (Try this yourself, this is left as an exercise for you )
Question 160
Consider the following relational schema.
Students(rollno: integer, sname: string)
Courses(courseno: integer, cname: string)
Registration(rollno: integer, courseno: integer, percent: real)
Which of the following queries are equivalent to this query in English?
"Find the distinct names of all students who score more than 90% in the course numbered 107"
(I) SELECT DISTINCT S.sname
FROM Students as S, Registration as R
WHERE R.rollno=S.rollno AND
R.courseno=107 AND R.percent >90
(II) ∏sname(σcourseno = 107 ∧ percent > 90 (Registration ⋈ Students))
(III) { T | ∃S ∈ Students, ∃R ∈ Registration ( S.rollno=R.rollno ∧ R.courseno=107 ∧ R.percent > 90 ∧
T.sname=S.sname)}
(iv) { < SN >| ∃SR∃RP ( < SR, SN > ∈ Students ∧ ∈ Registration ∧ RP > 90)}
(A) I, II, III and IV
(B) I, II and III only
(C) I, II and IV only
(D) II, III and IV only
Answer: (A)
Explanation:
Option A:

This is a SQL query expression. It first perform a cross product of Students


and Registration, then WHERE clause only keeps those rows in the cross product
set where the student is registered for course no 107, and percentage is > 90.
Then select distinct statement gives the distinct names of those students as the
result set.

Option B:

This is a relational algebra expression. It first perform a NATURAL JOIN


of Students and Registration (NATURAL JOIN implicitly joins on the basis
of common attribute, which here is rollno ), then the select operation( sigma)
keeps only those rows where the student is registered for courseno 107,
and percentage is > 90. And then the projection operation (pi) projects only
distinct student names from the set.

Note: Projection operation (pi) always gives the distinct result.


It is not a procedural language (i.e. it only tells “what to do”,
not “how to do”). It just represents a declarative mathematical
expression.
Here T is a Tuple variable.
From left to right, it can be read like this, “It is a set of
tuples T, where, there exists a tuple S in Relation Students, and
there exist a tuple R in relation Registration, such that
S.rollno = R.rollno AND R.couseno = 107 AND R.percent > 90 AND
T.sname = S.sname”. And the schema of this result is (sname), i.e. each
tuple T will contain only student name, because only T.sname has been defined
in the expression.
As TRC is a mathematical expression, hence it is expected to give only distinct result set.

Option D:
This is a Domain Relational Calculus (DRC) language expression.
This is also not procedural. Here SN is a Domain Variable. It can be read
from left to right like this “The set of domain variable SN, where,
there exist a domain variable SR , and a domain variable Rp, such that,
SN and SR domain variables is in relation Students and SR,107,RP is a domain
variables set in relation Registration, AND RP > 90 “

Above, SN represents sname domain attribute in Students relation, SR


represents rollno domain attribute in Students relation, and RP represents
percentage domain attribute in Registration relation.
The schema for the result set is (SN), i.e. only student name.

As DRC is a mathematical expression, hence it is expected to


give only distinct result set.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 161

Database table by name Loan_Records is given below.


Borrower Bank_Manager Loan_Amount
Ramesh Sunderajan 10000.00
Suresh Ramgopal 5000.00
Mahesh Sunderajan 7000.00
What is the output of the following SQL query?
SELECT Count(*)
FROM ( ( SELECT Borrower, Bank_Manager
FROM Loan_Records) AS S
NATURAL JOIN ( SELECT Bank_Manager, Loan_Amount
FROM Loan_Records) AS T );
(A) 3
(B) 9
(C) 5
(D) 6
Answer (C)
Following will be contents of temporary table S
Borrower Bank_Manager
--------------------------
Ramesh Sunderajan
Suresh Ramgopal
Mahesh Sunderajan
Following will be contents of temporary table T
Bank_Manager Loan_Amount
---------------------------
Sunderajan 10000.00
Ramgopal 5000.00
Sunderajan 7000.00
Following will be the result of natural join of above two tables. The key thing to note is that the natural join
happens on column name with same name which is Bank_Manager in the above example. “Sunderajan”
appears two times in Bank_Manager column, so there will be four entries with Bank_Manager as “Sunderajan”.
Borrower Bank_Manager Loan_Amount
------------------------------------
Ramesh Sunderajan 10000.00
Ramesh Sunderajan 7000.00
Suresh Ramgopal 5000.00
Mahesh Sunderajan 10000.00
Mahesh Sunderajan 7000.00
Question 162

Consider a database table T containing two columns X and Y each of type integer. After the creation of
the table, one record (X=1, Y=1) is inserted in the table.
Let MX and My denote the respective maximum values of X and Y among all records in the table at any
point in time. Using MX and MY, new records are inserted in the table 128 times with X and Y values
being MX+1, 2*MY+1 respectively. It may be noted that each time after the insertion, values of MX and
MY change. What will be the output of the following SQL query after the steps mentioned above are
carried out?
SELECT Y FROM T WHERE X=7;

(A) 127
(B) 255
(C) 129
(D) 257
Answer (A)
X Y
-------
1 1
2 3
3 7
4 15
5 31
6 63
7 127
......
Question 163
Consider the following relational schema:

Suppliers(sid:integer, sname:string, city:string, street:string)


Parts(pid:integer, pname:string, color:string)
Catalog(sid:integer, pid:integer, cost:real)
Consider the following relational query on the above database:

SELECT S.sname
FROM Suppliers S
WHERE S.sid NOT IN (SELECT C.sid
FROM Catalog C
WHERE C.pid NOT IN (SELECT P.pid
FROM Parts P
WHERE P.color<> \'blue\'))
Assume that relations corresponding to the above schema are not empty. Which one of the following is the correct interpretation of the
above query?

.
(A) Find the names of all suppliers who have supplied a non-blue part.

(B). Find the names of all suppliers who have not supplied a non-blue part.

(C) Find the names of all suppliers who have supplied only blue parts.

.
(D) Find the names of all suppliers who have not supplied only blue parts.

(E). None
Answer: (D)

Explanation:
(D) option matched because given query returns suppliers who have not
supplied any blue parts. That means it can include other than blue parts.
(A): False, as this may include blue parts and may not include \”null\”
parts.
(B): Obviously false because it returning other than any blue part.
(C): Obviously false because it does not return this.
(D): Correct
Question 164

Consider the following relational schema:


Suppliers(sid:integer, sname:string, city:string, street:string)
Parts(pid:integer, pname:string, color:string)
Catalog(sid:integer, pid:integer, cost:real)
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?
(A) The schema is in BCNF
(B) The schema is in 3NF but not in BCNF
(C) The schema is in 2NF but not in 3NF
(D) The schema is not in 2NF
Answer: (A)

Explanation: A relation is in BCNF if for every one of its dependencies X →


Y, at least one of the following conditions hold:
X → Y is a trivial functional dependency (Y ⊆ X)
X is a superkey for schema R
Since (sname, city) forms a candidate key, there is no non-trivial
dependency X → Y where X is not a superkey
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 165

Student (school-id, sch-roll-no, sname, saddress)


School (school-id, sch-name, sch-address, sch-phone)
Enrolment(school-id sch-roll-no, erollno, examname)
ExamResult(erollno, examname, marks)
What does the following SQL query output?
SELECT sch-name, COUNT (*)
FROM School C, Enrolment E, ExamResult R
WHERE E.school-id = C.school-id
AND
E.examname = R.examname AND E.erollno = R.erollno
AND
R.marks = 100 AND S.school-id IN (SELECT school-id
FROM student
GROUP BY school-id
HAVING COUNT (*) > 200)
GROUP By school-id
(A) for each school with more than 200 students appearing in exams, the name of the school and the number of 100s scored by its students
(B) for each school with more than 200 students in it, the name of the school and the number of 100s scored by its students
(C) for each school with more than 200 students in it, the name of the school and the number of its students scoring 100 in at least one exam
(D) nothing; the query has a syntax error
Answer: (D)

Explanation: In outer SQL query in SELECT sch-name is used where as


in GROUP BY clause, school-id is used, that should be same as in
SELECT clause.
Question 166
Consider the table employee(empId, name, department, salary) and the two queries Q1 ,Q2 below. Assuming that
department 5 has more than one employee, and we want to find the employees who get higher salary than anyone in the
department 5, which one of the statements is TRUE for any arbitrary employee table?
Q1 : Select e.empId
From employee e
Where not exists
(Select * From employee s where s.department = “5” and
s.salary >=e.salary)
Q2 : Select e.empId
From employee e
Where e.salary > Any
(Select distinct salary From employee s Where s.department = “5”)

(A) Q1 is the correct query


(B) Q2 is the correct query
(C) Both Q1 and Q2 produce the same answer.
(D) Neither Q1 nor Q2 is the correct query
Answer: (A)
Explanation: First note that they asked for Anyone (= All) not for Any.
Here, Everyone means all of the group.
Anyone means all or any part of the group.
Let the employee(empId, name, department, salary) have the following instance.
empId name department salary
———————————-
e1 ------- A-------- 1---------10000
e2 -------B ------- 5 ---------5000
e3 -------C ------- 5----------7000
e4 -------D ------- 2----------2000
e5 -------E ------- 3----------6000

Now the actual result should contain empId : e1 , e3 and e5 ( because they have salary greater than anyone employee in the
department ‘5’)
——————————————————–
Q1 will result only empId e1.
Now Q1 : ———————————————————
Note : EXISTS(empty set) gives FALSE, whereas Q2 :
and NOT EXISTS(empty set) gives TRUE.
Select e.empId
Select e.empId From employee e
From employee e Where e.salary > Any
Where not exists (Select distinct salary From employee s Where s.department = “5”)
(Select * From employee s where s.department = “5” and
s.salary >=e.salary)
Q2 will result empId e1, e3 and e5.
——————————————————–
Hence Q1 is the correct query.
Note that if we use ALL in place of Any in second query then this will be
correct.
Option (A) is correct
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 167
Consider the relation account (customer, balance) where customer is a primary key and there are no null values. We
would like to rank customers according to decreasing balance. The customer with the largest balance gets rank 1. ties
are not broke but ranks are skipped: if exactly two customers have the largest balance they each get rank 1 and rank 2
is not assigned
Query1:
select A.customer, count(B.customer)
from account A, account B
where A.balance <=B.balance
group by A.customer
Query2:
select A.customer, 1+count(B.customer)
from account A, account B
where A.balance < B.balance
group by A.customer
Consider these statements about Query1 and Query2.
1. Query1 will produce the same row set as Query2 for
some but not all databases.
2. Both Query1 and Query2 are correct implementation
of the specification
3. Query1 is a correct implementation of the specification
but Query2 is not
4. Neither Query1 nor Query2 is a correct implementation
of the specification
5. Assigning rank with a pure relational query takes
less time than scanning in decreasing balance order
assigning ranks using ODBC.
Which two of the above statements are correct?
(A) 2 and 5
(B) 1 and 3
(C) 1 and 4
(D) 3 and 5
Answer: (C)

Explanation: Query 1 and Query 2 will give the same result if all the
customers have distinct balance. So, for some databases, the result of query
1 and query 2 will be same.

Now, let us consider a fact that all the entries in the database have the same
value for balance. Ideally, all the customers should have rank 1, but both the
queries will give all the customers a rank equal to the number of customers
in the database.
So, both the queries do not give us the required output.

Thus, C is the correct choice.


Question 168
Consider the relation “enrolled(student, course)” in which (student, course) is the primary key, and the relation
“paid(student, amount)” where student is the primary key. Assume no null values and no foreign keys or integrity
constraints. Given the following four queries:
Query1: select student from enrolled where
student in (select student from paid)
Query2: select student from paid where
student in (select student from enrolled)
Query3: select E.student from enrolled E, paid P
where E.student = P.student
Query4: select student from paid where exists
(select * from enrolled where enrolled.student
= paid.student)
Which one of the following statements is correct?
(A) All queries return identical row sets for any database
(B) Query2 and Query4 return identical row sets for all databases but there exist databases for which Query1 and
Query2 return different row sets.
(C) There exist databases for which Query3 returns strictly fewer rows than Query2
(D) There exist databases for which Query4 will encounter an integrity violation at runtime.
Answer: (B)
Explanation: Take an example:
Table enrolled
student course
----------------
abc c1
xyz c1
abc c2
pqr c1

Table paid
student amount
-----------------
abc 20000
xyz 10000
rst 10000

Output of Query 1
abc
abc
xyz
Output of Query 2
abc
xyz
Output of Query 3
abc
xyz
Output of Query 4
abc
xyz
Query 1 and Query 3 may return repetitive student values as “student” is not a key in relation enrolled, however query 2 and
query 4 always return same row sets.
So, option (B) is correct.
Question 169
A company maintains records of sales made by its salespersons and pays them commission based on each individual\’s total
sales made in a year. This data is maintained in a table with following schema:
salesinfo = (salespersonid, totalsales, commission)
In a certain year, due to better business results, the company decides to further reward its salespersons by enhancing the
commission paid to them as per the following formula:
If commission < = 50000, enhance it by 2%
If 50000 < commission < = 100000, enhance it by 4%
If commission > 100000, enhance it by 6%
The IT staff has written three different SQL scripts to calculate enhancement for each slab, each of these scripts is to run as a
separate transaction as follows:
T1:Update salesinfo
Set commission = commission * 1.02
Where commission < = 50000;
:
T2 Update salesinfo
Set commission = commission * 1.04
Where commission > 50000 and commission is < = 100000;
:
T3 Update salesinfo
Set commission = commission * 1.06
Where commission > 100000;
Which of the following options of running these transactions will update the commission of all salespersons correctly

(A) Execute T1 followed by T2 followed by T3


(B) Execute T2, followed by T3; T1 running concurrently throughout
(C) Execute T3 followed by T2; T1 running concurrently throughout
(D) Execute T3 followed by T2 followed by T1
Answer: (D)
Explanation:
T3 followed by T2 followed by T1
If this sequence is not followed then it may happen that the Officer of one slab gets
benefited twice.
Say an officer is having commission as 99,999, He must get an updated commission
according to T2. But then
99,999*1.04=1,03998 and he again becomes eligible for next slab of commission.
T3 followed by T2 followed by T1 will be check all border cases like above.So
Answer is D
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 170

The relation book (title, price) contains the titles and prices of different books.
Assuming that no two books have the same price, what does the following SQL query
list?
select title
from book as B
where (select count(*)
from book as T
where T.price > B.price) < 5
(A) Titles of the four most expensive books
(B) Title of the fifth most inexpensive book
(C) Title of the fifth most expensive bookTitles of the five most expensive books
(D) Titles of the five most expensive books
Answer (d)
When a subquery uses values from outer query, the subquery is called
correlated subquery. The correlated subquery is evaluated once for each
row processed by the outer query.
The outer query selects all titles from book table. For every selected book,
the subquery returns count of those books which are more expensive than
the selected book. The where clause of outer query will be true for 5 most
expensive book. For example count (*) will be 0 for the most expensive
book and count(*) will be 1 for second most expensive book.
Question 171
In an inventory management system implemented at a trading corporation, there are several tables designed to hold all
the information. Amongst these, the following two tables hold information on which items are supplied by which
suppliers, and which warehouse keeps which items along with the stock-level of these items.
Supply = (supplierid, itemcode)
Inventory = (itemcode, warehouse, stocklevel)
For a specific information required by the management, following SQL query has been written
Select distinct STMP.supplierid
From Supply as STMP
Where not unique (Select ITMP.supplierid
From Inventory, Supply as ITMP
Where STMP.supplierid = ITMP.supplierid
And ITMP.itemcode = Inventory.itemcode
And Inventory.warehouse = 'Nagpur');

For the warehouse at Nagpur, this query will find all suppliers who
(A) do not supply any item
(B) supply exactly one item
(C) supply one or more items
(D) supply two or more items
Answer: (D)

Explanation: Here [not unique] in nested query ensures that only for those
suppliers it return True which supplies more than 1 item in which case
supplier id in inner query will be repeated for that supplier.
Hence, answer is (D) supply two or more items.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 172

The employee information in a company is stored in the relation


Employee (name, sex, salary, deptName)
Consider the following SQL query
select deptName
from Employee
where sex = 'M'
group by deptName
having avg (salary) > (select avg (salary) from Employee)

It returns the names of the department in which


(A) the average salary is more than the average salary in the company
(B) the average salary of male employees is more than the average salary of all male employees in the
company
(C) the average salary of male employees is more than the average salary of employees in the same
department
(D) the average salary of male employees is more than the average salary in the company
Answer: (D)

Explanation: In this SQL query, we have


select deptName --------------- Select the department name
from Employee ---------------- From the database of employees
where sex = 'M' --------------- Where sex is male (M)
group by deptName ------------- Group by the name of the department
having avg (salary) >
(select avg (salary) from Employee) ----- Having the average salary
greater than the average salary
of all employees in the organization.

So, this query would return the name of all departments in which the average salary of male
employees is greater than the average salary of all employees in the company.
Hence, D is the correct choice.
Question 173

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:
Insert into department values (1, 'Mathematics')
Insert into department values (2, 'Physics')
Insert into student values (l, 'Navin', 1)
Insert into student values (2, 'Mukesh', 2)
Insert into student values (3, 'Gita', 1)
How many rows and columns will be retrieved by the following SQL statement?
Select * from student, department
(A) 0 row and 4 columns
(B) 3 rows and 4 columns
(C) 3 rows and 5 columns
(D) 6 rows and 5 columns
Answer: (D)

Explanation: Simple,Cartesian product of two tables will result


Rows = 3*2 = 6
Columns = 3+2 = 5
Option (D) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 174

Consider the set of relations shown below and the SQL query that follows.
Students: (Roll_number, Name, Date_of_birth)
Courses: (Course number, Course_name, Instructor)
Grades: (Roll_number, Course_number, Grade)
select distinct Name
from Students, Courses, Grades
where Students. Roll_number = Grades.Roll_number
and Courses.Instructor = Korth
and Courses.Course_number = Grades.Course_number
and Grades.grade = A
Which of the following sets is computed by the above query?
(A) Names of students who have got an A grade in all courses taught by Korth
(B) Names of students who have got an A grade in all courses
(C) Names of students who have got an A grade in at least one of the courses taught by Korth
(D) None of the above
Answer: (C)

Explanation: The query gives the name of all the students who have
scored “A” grade in any of the courses that are taught by Korth.
So, C is the correct choice.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 175
Consider the following relational schema.
Students(rollno: integer, sname: string)
Courses(courseno: integer, cname: string)
Registration(rollno: integer, courseno: integer, percent: real)
Which of the following queries are equivalent to this query in English?
"Find the distinct names of all students who score
more than 90% in the course numbered 107"

A.I, II, III and IV


B.I, II and III only
C.I, II and IV only
D.II, III and IV only
Option A:
Here T is a Tuple variable.

This is a SQL query expression. It first perform a cross product of Students


and Registration, then WHERE clause only keeps those rows in the cross product From left to right, it can be read like this, “It is a set of
set where the student is registered for course no 107, and percentage is > 90. tuples T, where, there exists a tuple S in Relation Students, and
Then select distinct statement gives the distinct names of those students as the there exist a tuple R in relation Registration, such that
result set. S.rollno = R.rollno AND R.couseno = 107 AND R.percent > 90 AND
T.sname = S.sname”. And the schema of this result is (sname), i.e. each
tuple T will contain only student name, because only T.sname has been defined
in the expression.
Option B:
As TRC is a mathematical expression, hence it is expected to give only distinct re
This is a relational algebra expression. It first perform a NATURAL JOIN set.
of Students and Registration (NATURAL JOIN implicitly joins on the basis
of common attribute, which here is rollno ), then the select operation( sigma) Option D:
keeps only those rows where the student is registered for courseno 107,
and percentage is > 90. And then the projection operation (pi) projects only
distinct student names from the set. This is a Domain Relational Calculus (DRC) language expression.
This is also not procedural. Here SN is a Domain Variable. It can be read
from left to right like this “The set of domain variable SN, where,
Note: Projection operation (pi) always gives the distinct result. there exist a domain variable SR , and a domain variable Rp, such that,
SN and SR domain variables is in relation Students and SR,107,RP is a domain
Option C: variables set in relation Registration, AND RP > 90 “

This is a Tuple Relational Calculus (TRC) language expression, Above, SN represents sname domain attribute in Students relation, SR
It is not a procedural language (i.e. it only tells “what to do”, represents rollno domain attribute in Students relation, and RP represents
not “how to do”). It just represents a declarative mathematical percentage domain attribute in Registration relation.
expression. The schema for the result set is (SN), i.e. only student name.

As DRC is a mathematical expression, hence it is expected to


give only distinct result set.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 176

Given the basic ER and relational models, which of the following is


INCORRECT?
A
An attribute of an entity can have more than one value
B
An attribute of an entity can be composite
C
In a row of a relational table, an attribute can have more than one value
D
In a row of a relational table, an attribute can have exactly one value or a
NULL value
The term ‘entity’ belongs to ER model and the term ‘relational table’
belongs to relational model. A and B both are true. ER model supports
both multivalued and composite attributes See this for more details. (C) is
false and (D) is true. In Relation model, an entry in relational table can can
have exactly one value or a NULL.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 177

What is the min and max number of tables required to convert an ER diagram
with 2 entities and 1 relationship between them with partial participation
constraints of both entities?
A
Min 1 and max 2
B
Min 1 and max 3
C
Min 2 and max 3
D
Min 2 and max 2
Maximum number of tables required is 3 in case of many to many
relationships between entities. Minimum number of tables is 1 in case of
unary relationship and total participation of atleast one entity. But in case
of partial participation of both entities, minimum number of tables required
is 2.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 178

Consider the join of a relation R with a relation S. If K has m tuples and S has
n tuples, then the maximum and minimum sizes of the join respectively are:
A
m+n and 0
B
mn and 0
C
m+n and m-n
D
mn and m+n
When there is no foreign key constraint between two tables then the max and
min number of tuples in their join is mn and 0 respectively.
Question 179
Consider the following relational schema.
Students(rollno: integer, sname: string)
Courses(courseno: integer, cname: string)
Registration(rollno: integer, courseno: integer, percent: real)
Which of the following queries are equivalent to this query in English?
"Find the distinct names of all students who score
more than 90% in the course numbered 107"
A I, II, III and IV
B I, II and III only
C I, II and IV only
D II, III and IV only
Option A:

This is a SQL query expression. It first perform a cross product of Students


and Registration, then WHERE clause only keeps those rows in the cross product Here T is a Tuple variable.
set where the student is registered for course no 107, and percentage is > 90.
Then select distinct statement gives the distinct names of those students as the
result set. From left to right, it can be read like this, “It is a set of
tuples T, where, there exists a tuple S in Relation Students, and
there exist a tuple R in relation Registration, such that
S.rollno = R.rollno AND R.couseno = 107 AND R.percent > 90 AND
Option B: T.sname = S.sname”. And the schema of this result is (sname), i.e. each
tuple T will contain only student name, because only T.sname has been defined
in the expression.
This is a relational algebra expression. It first perform a NATURAL JOIN
of Students and Registration (NATURAL JOIN implicitly joins on the basis
of common attribute, which here is rollno ), then the select operation( sigma) As TRC is a mathematical expression, hence it is expected to give only distinct result
keeps only those rows where the student is registered for courseno 107, set.
and percentage is > 90. And then the projection operation (pi) projects only
distinct student names from the set. Option D:

Note: Projection operation (pi) always gives the distinct result. This is a Domain Relational Calculus (DRC) language expression.
This is also not procedural. Here SN is a Domain Variable. It can be read
Option C: from left to right like this “The set of domain variable SN, where,
there exist a domain variable SR , and a domain variable Rp, such that,
SN and SR domain variables is in relation Students and SR,107,RP is a domain
This is a Tuple Relational Calculus (TRC) language expression, variables set in relation Registration, AND RP > 90 “
It is not a procedural language (i.e. it only tells “what to do”,
not “how to do”). It just represents a declarative mathematical
expression. Above, SN represents sname domain attribute in Students relation, SR
represents rollno domain attribute in Students relation, and RP represents
percentage domain attribute in Registration relation.
The schema for the result set is (SN), i.e. only student name.

As DRC is a mathematical expression, hence it is expected to


give only distinct result set.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 180

The relational algebra expression equivalent to the following tuple calculus expression
{ t | t ∈ r ∧ (t[A] = 10 ∧ t[B] = 20 }
is
In Given relational algebra, Tuple t should have two attributes A=10 and
B=20 In A, we select tuples having A=10 or B=20 so, it is wrong choice. In
B, we select tuples having A=10 or we can select tuples having B=20, so it
is also wrong choice. D is also wrong choice. In C, we select tuples having
A=10 and tuples having B=20, it is same as above relational algebra.
Hence, option (C) is Correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 181
Consider the following tables T1 and T2:In table T1, P is the primary key, Q is the
foreign key referencing R in table T2 with on-delete cascade and on-update cascade.
In table T2, R is the primary key and S is the foreign key referencing P in the table T1
with on-delete set NULL and on-update cascade. In order to delete record (3,8) from
table, numbers of additional record that need to be deleted from table T1 is ______.
Note: This question appeared as Numerical Answer Type
.
A. 0 B. 1 C 2. D. 3
Given,
• Q -> R(Primary Key)
• S -> P (Primary Key)
Entry to be deleted - P (3) and Q(8)
• Q can be deleted directly
• Now, S - > P but the relationship given is on delete set NULL, Therefore
when we delete 3 from T1 ,the entry in T2 having 3 will be NULL.
Therefore, Option A - Answer is 0 entries
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 182
In an Entity-Relationship (ER) model, suppose R is a many-to-one relationship
from entity set E1 to entity set E2. Assume that E1 and E2 participate totally in R
and that the cardinality of E1 is greater that the cardinality of E2. Which one of the
following is true about R?
A Every entity in E1 is associated with exactly one entity in E2.
B Some entity in E1 is associated with more than one entity in E2.
C Every entity in E2 is associated with exactly one entity in E1.
D Every entity in E2 is associated with at most one entity in E1.
Since given relation is many to one :
Therefore, no entity in E1 can be related to more than one entity in E2 and an
entity in E2 can be related to more than one entity in E1. Only option (A) is
correct.
Question 183

Consider the relations r(A, B) and s(B, C), where s.B is a primary key and r.B is a foreign
key referencing s.B. Consider the query
Q: r⋈(σB<5(s))
Let LOJ denote the natural left outer-join operation. Assume that r and s contain no null
values. Which one of the following is NOT equivalent to Q?
A σB<5(r ⋈ s)
B σB<5(r LOJ s)
C r LOJ (σB<5(s))
D σB<5(r)LOJ s
Since, we are joining/LOJ using attribute B which is primary key of table s and
foreign key of table r. So, we need to apply condition σB<5 on left table of join
always, i.e., table r because left outer join (LOJ) returns all the values from an
inner join plus all values in the left table that do not match to the right table. So,
option (C) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 184
Match the following with respect to RDBMS :
Codd's rule says that entity integrity must be maintained so that no duplicate
record exist in DB. In RDBMS table column entry must be valid, It also comes
under codd's rule. Referential data items strictly follows integrity on insertion,
deletion and modification of table and user defined integrity constraints enlist
some specific business rule, these rule don't fall into entity or domain. So,
option (B) is correct.
Question 185
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
Functional dependency is a constraint that describes the relationship between
attributes in a relation. Data integrity refers to the accuracy and consistency of
data stored in a database, data warehouse, data mart or other construct.
Referential integrity is a relational database concept, which states that table
relationships must always be consistent. Normalization is a process of
organizing the data in database to avoid data redundancy, insertion anomaly,
update anomaly & deletion anomaly. 1NF, 2NF, 3NF and BCNF are types of
normal forms. So, option (D) is correct.
Question 186
Consider the following schema :
Sailors (sid, sname, rating, age)
Boats (bid, bname, colour)
Reserves (sid, bid, day)
Two boats can have the same name but the colour differentiates them. The two
relations
ρ (Tempsids, (Ⲡ sid, bid Reserves)/(Ⲡ bid ( σ bname ='Ganga' Boats))),
Ⲡ sname (Tempsids ⋈ Sailors)
If / is division operation, the above set of relations represents the query
A Names of sailors who have reserved all boats called Ganga
B Names of sailors who have not reserved any Gangaboat
C Names of sailors who have reserved at least one Gangaboat
D Names of sailors who have reserved at most one Ganga boat
According to Division operator, Tempsids gives sid and bid of who have
reserved all boats called Ganga And Ⲡ sname (Tempsids ⋈ Sailors) will
return sname of sailors who have reserved all boats called Ganga So,
option (A) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 187

Consider a relation R (A, B, C, D, E, F, G, H), where each attribute is atomic, and


following functional dependencies exist.
CH → G
A → BC
B → CFH
E→A
F → EG
The relation R is __________ .
A in 1NF but not in 2NF
B in 2NF but not in 3NF
C in 3NF but not in BCNF
D in BCNF
If we find closure of A: A+ → All attribute except D. Similarly for other keys
we can find closure, but D can't be derived from any key and it must be
added to all keys to be derived from. That's why this relation is in 1NF,
since there is partial dependency so, this relation is not in 2NF. So, option
(A) is correct.
Question 188

Which symbol denote derived attributes in ER Model?


A Double ellipse
B Dashed ellipse
C Squared ellipse
D Ellipse with attribute name underlined

Solution B
Question 189

Integrity constraints ensure that changes made to the database by authorized users do not result
into loss of data consistency. Which of the following statement(s) is (are) true w.r.t. the examples
of integrity constraints ?
(A) An instructor Id. No. cannot be null, provided Instructor Id No. being primary key.
(B) No two citizens have same Aadhaar-Id.
(C) Budget of a company must be zero.
A (A), (B) and (C) are true.
B (A) false, (B) and (C) are true.
C (A) and (B) are true; (C) false.
D (A), (B) and (C) are false
(A) An instructor Id. No. cannot be null, provided Instructor Id No. being primary key.
Correct by Codd's rule
(B) No two citizens have same Adhar-Id. Correct because Adhar is identification for
citizens so it must be unique
(C) Budget of a company must be zero. We cant say or it is not necessarily true
So, option (C) is correct.
Question 190

Let M and N be two entities in an E-R diagram with simple single value
attributes. R1 and R2 are two relationship between M and N, where as R1 is
one-to-many and R2 is many-to-many. The minimum number of tables
required to represent M, N, R1 and R2 in the relational model are _______.
A. 4
B. 6
C. 7
D. 3
Solution D
Question 191

Which one is correct w.r.t. RDBMS ?


A. primary key ⊆ super key ⊆ candidate key
B. primary key ⊆ candidate key ⊆ super key
C. super key ⊆ candidate key ⊆ primary key
D. super key ⊆ primary key ⊆ candidate key
primary key ⊆ candidate key ⊆ super key in RDBMS For more information
Option (B) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 192

Let pk(R) denotes primary key of relation R. A many-to-one relationship that


exists between two relations R1 and R2 can be expressed as follows :
A. pk(R2) → pk(R1)
B. pk(R1) → pk(R2)
C. pk(R2) → R1 ∩ R2
D. pk(R1) → R1 ∩ R2

Solution B
Question 193

Consider the join of a relation R , with a relation S . If R has m number of


tuples and S has n number of tuples then the maximum and minimum sizes of
the join respectively are:
A. m + n & 0
B. mn & 0
C. m + n & | m - n |
D. mn & m + n
Case 1: Maximum tuples- When the common attribute contains identical values
Relation R Relation S R⋈S
a b a d a b d
1 2 1 10 1 2 10
1 3 1 11 1 2 11
1 4 1 3 10
1 3 11
1 4 10
1 4 11
Case 2: Minimum Tuples- When Both the relations have a common attribute but no tuple in both
relations match.
Relation R Relation S R⋈S
a b a d a b d
1 2 2 10 No tuple
1 3 3 11
1 4
So, option (B) is correct.
Question 194
Let R(a, b, c) and S(d, e, f) be two relations in which d is the foreign key of S
that refers to the primary key of R. Consider the following four operations R
and S. I. Insert into R II. Insert into S III. Delete from R IV. Delete from S
Which of the following can cause violation of the referential integrity constraint
above?
A. Both I and IV
B. Both II and III
C. All of these
D. None of these
II and III statement can cause the violation of the referential integrity
constraint as d is the foreign key of S that refers to the primary key of R. So, d
should always be a subset of primary key of R. But insertion to S and deletion
from R may cause the violation of subset property as after these operations d
may contain a value that is not present in the primary key of A. So, option (B)
is correct.
Question 195

Goals for the design of the logical scheme include


A. avoiding data inconsistency
B. being able to construct query easily
C. being able to access data efficiently
D. All of the above
Logical schema is developed using diagrams that define the content of
databases in the form of tables and it also describe how the tables are linked
with each for data access and how actually data is stored in the database . A
conceptual model is created during the first phase of logical design based on
the needs assessment performed in stage one. Actually a conceptual model
is an Entity -Relation (i.e., ER) diagram. It shows the tables, fields, and
primary keys of the database, and how tables are related or linked with each
other. While designing the logical scheme we avoiding data inconsistency i.e.,
data should be consistent as well as efficient (duplicate data is not allowed in
a row) and query should be easily construct using the table . Hence, option
(D) is correct among all.
Question 196
Given the relations employee (name, salary, dept-no), and department (dept-
no, dept-name,address) Which of the following queries cannot be expressed
using the basic relational algebra operations (σ, π, x, -, ∪, p)
A. Department address of every employee
B. Employees whose name is the same as their department name
C. The sum of all employees' salaries
D. All employees of a given department
The sum of all employees' salaries can not be found using these above
operations as to calculate sum we need aggregate functions and operators.
So, option (C) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 197
Consider the following Relationship Entity Diagram(ERD) Which of the
following possible relations will not hold if the above ERD is mapped into a
relation model?

A. Person (NID, Name)


B. Qualification (NID, ExamID, QualifiedDate)
C. Exam (ExamID, NID, ExamName)
D. Exam (ExamID, ExamName)
If we convert an ER diagram into relational model then we can create
table for each entity. We get two tables One for Entity Person -
Person(NID,Name) One for Entity Exam - Exam(ExamID,ExamName)
Now for relationship Entity Qualification, we can not add QualifiedDate in
any of the two tables formed so we need to create a new table using
Primary Key from both Entity Person and Entity Exam. We obtain
Qualification(NID, ExamID, QualifiedDate) Hence Option (C) does not
make any sense.
Question 198
If D1, D2...Dn are domains in a relational model, then the relation is a table,
which is a subset of
A. D1⊕D2⊕...⊕Dn
B. D1xD2x...xDn
C. D1∪D2∪...∪Dn
D. D1∩D2∩...∩Dn

Solution B
Question 199
Relational database schema normalization is NOT for:
A. reducing the number of joins required to satisfy a query.
B. eliminating uncontrolled redundancy of data stored in the database.
C. eliminating number of anomalies that could otherwise occur with inserts
and deletes.
D. ensuring that functional dependencies are enforced.
• Relational database schema normalization is NOT for reducing the
number of joins required to satisfy a query.
• Relational database schema normalization is for eliminating uncontrolled
redundancy of data stored in the database.
• Relational database schema normalization is for eliminating number of
anomalies that could otherwise occur with inserts and deletes.
• Relational database schema normalization is for ensuring that functional
dependencies are enforced.
So, option (A) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 200

Consider the following statements regarding relational database model: (a)


NULL values can be used to opt a tuple out of enforcement of a foreign key.
(b) Suppose that table T has only one candidate key. If Q is in 3NF, then it is
also in BCNF. (c) The difference between the project operator (Π) in relational
algebra and the SELECT keyword in SQL is that if the resulting table/set has
more than one occurrences of the same tuple, then Π will return only one of
them, while SQL SELECT will return all. One can determine that:
A. (a) and (b) are true.
B. (a) and (c) are true.
C. (b) and (c) are true.
D. (a), (b) and (c) are true.
IN relational database model: (a) NULL values can be used to opt a tuple
out of enforcement of a foreign key.Correct (b) Suppose that table T has
only one candidate key. If Q is in 3NF, then it is also in BCNF.Correct (c)
The difference between the project operator (Π) in relational algebra and
the SELECT keyword in SQL is that if the resulting table/set has more
than one occurrences of the same tuple, then Π will return only one of
them, while SQL SELECT will return all.Correct So, option (D) is correct.
Question 201

Consider the following Entity-Relationship (E-R) diagram and three possible relationship sets
(I, II and III) for this E-R diagram:
If different symbols stand for different values (e.g., t1 is definitely not equal to t2), then which
of the above could not be the relationship set for the E-R diagram ?
A. I only
B. I and II only
C. II only
D. I, II and III

Solution A

(I) (II) (III)


Question 202

An aggregation association is drawn using which symbol?


A. A line which loops back on to the same table
B. A small open diamond at the end of a line connecting two tables
C. A small closed diamond at the end of a line connecting two tables
D. A small closed triangle at the end of a line connecting two tables
Association is a relationship where all objects have their own lifecycle and
there is no owner. Aggregation is a specialised form of Association where all
objects have their own lifecycle, but there is ownership and child objects can
not belong to another parent object. Composition is again specialised form of
Aggregation and we can call this as a “death” relationship. It is a strong type
of Aggregation. Child object does not have its lifecycle and if parent object is
deleted, all child objects will also be deleted.
So, option (B) is correct. See: Association, Composition and Aggregation
Question 203
Every time the attribute A appears, it is matched with the same value of
attribute B but not the same value of attribute C. Which of the following is
true?
A. A-> (B,C)
B. A ->B, A->>C
C. A->B, C->>A
D. A->>B, B->C
Functional dependency is a relationship that exists when one attribute
uniquely determines another attribute, therefore A→B. Multivalued
dependency occurs when there are more than one independent multivalued
attributes in a table. If A->> C is a dependency, it means for A, attribute C has
more than one value. So, option (B) is correct.
Question 204
Suppose database table T1(P, R) currently has tuples {(10, 5), (15, 8), (25,
6)} and table T2 (A, C) currently has {(10, 6), (25, 3), (10, 5)}. Consider the
following three relational algebra queries RA1, RA2 and RA3:
RA1 : T1 ⨝ T1.P = T2.A T2 where ⨝is natural join symbol
RA2 : T1 ⟕ T1.P = T2.A T2 where ⟕ is left outer join symbol
RA3 : T1 ⨝ T1.P = T2.A and T1.R = T2.CT2
The number of tuples in the resulting table of RA1, RA2 and RA3 are given
by:
A. 2, 4, 2 respectively
B. 2, 3, 2 respectively
C. 3, 3, 1 respectively
D. 3, 4, 1 respectively
Solution D
Question 205

Which of the following statement(s) is/are FALSE in the context of Relational


DBMS ? I. Views in a database system are important because they help with
access control by allowing users to see only a particular subset of the data in
the database. II. E-R diagrams are useful to logically model concepts. III. An
update anomaly is when it is not possible to store information unless some
other, unrelated information is stored as well. IV. SQL is a procedural
language.
A. I and IV only
B. III and IV only
C. I, II and III only
D. II, III and IV only
• Views in a database system are important because they help with access
control by allowing users to see only a particular subset of the data in the
database.Correct
• E-R diagrams are useful to logically model concepts.Inorrect
• An update anomaly is when it is not possible to store information unless
some other, unrelated information is stored as well.Inorrect
• SQL is a procedural language.Inorrect
So, option (D) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 206
In a relational database model, NULL values can be used for all but which
one of the following ?
A. To allow duplicate tuples in the table by filling the primary key column(s)
with NULL.
B. To avoid confusion with actual legitimate data values like 0 (zero) for
integer columns and ’’ (the empty string) for string columns.
C. To leave columns in a tuple marked as ’’unknown’’ when the actual value is
unknown.
D. To fill a column in a tuple when that column does not really ”exist” for that
particular tuple.

Solution A
Question 207

Consider the following two commands C1 and C2 on the relation R from an


SQL database: C1 : drop table R; C2 : delete from R; Which of the following
statements is TRUE ? I. Both C1 and C2 delete the schema for R. II. C2
retains relation R, but deletes all tuples in R. III. C1 deletes not only all tuples
of R, but also the schema for R.
A. I only
B. I and II only
C. II and III only
D. I, II and III

Solution C
Question 208

Consider the following database table having A, B, C and D as its four attributes and four possible
candidate keys (I, II, III and IV) for this table :
I : {B} II : {B, C} III : {A, D} IV : {C, D} If different symbols stand for different values in the table (e.g., d1
is definitely not equal to d2), then which of the above could not be the candidate key for the database
table ?
A I and III only
B III and IV only
C II only
D I only
Upon carefully observing the tuples in the relation, we can see that the
functional dependency B -> {A, C, D} holds. Hence {B} is one candidate
key. A,D -> {A, B, C, D} ; C,D -> {A, B, C, D} and B,C -> {A, B, C, D} also
holds true. Therefore, these all can be candidate keys. But in B,C -> {A, B,
C, D} , there exist a partial dependency of B->{A, B, C, D}. Hence {B, C}
cannot be a candidate key. So option (C) is correct.
Question 209

A relation R = {A, B, C, D, E, F,G} is given with following set of functional


dependencies: F = {AD → E, BE → F, B → C, AF → G} Which of the
following is a candidate key ?
A. A
B. AB
C. ABC
D. ABD
[AD]+ = ADE. [BE]+ = BCEF. [B]+ = BC. [AF]+ = AFG. Nothing drives all
the attributes, but if We add B in first key i.e. [ADB] then it will give all the
attribute [ADB]+ = ABCDEFG. So, option (D) is correct.
Question 210

Drop Table cannot be used to drop a Table referenced by __________


constraint. (a)Primary key (b)Sub key (c)Super key (d)Foreign key
A. (a)
B. (a), (b) and (c)
C. (d)
D. (a) and (d)
Drop Table cannot be used to drop a Table referenced by foreign key
constraint. For more information on keys
Option (C) is correct
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 211

For a weak entity set to be meaningful, it must be associated with another


entity set in combination with some of their attribute values, is called as:
A. Neighbour Set
B. Strong Entity Set
C. Owner Entity Set
D. Weak Set

Solution C
Question 212

Which of the following statements is FALSE about weak entity set?


A Weak entities can be deleted automatically when their strong entity is deleted.
B Weak entity set avoids the data duplication and consequent possible
inconsistencies caused by duplicating the key of the strong entity.
C A weak entity set has no primary keys unless attributes of the strong entity set on
which it depends are included
D Tuples in a weak entity set are not partitioned according to their relationship with
tuples in a strong entity set.
• Weak entities can be deleted automatically when their strong entity is
deleted. Correct
• Weak entity set avoids the data duplication and consequent possible
inconsistencies caused by duplicating the key of the strong entity. Correct
• A weak entity set has no primary keys unless attributes of the strong entity
set on which it depends are includedCorrect
• Tuples in a weak entity set are not partitioned according to their relationship
with tuples in a strong entity set.This is Incorrect, because tuples in a weak
entity set are partitioned according to their relationship with tuples in a
strong entity set.
So, option (D) is correct.
Question 213

In functional dependency Armstrong inference rules refers to


A. Reflexivity, Augmentation and Decomposition
B. Transitivity, Augmentation and Reflexivity
C. Augmentation, Transitivity, Reflexivity and Decomposition
D. Reflexivity, Transitivity and Decomposition
Armstrong inference rules refer to a set of inference rules used to infer all the
functional dependencies on a relational database. It consists of the following
axioms:
Axiom of Reflexivity:
This axiom states: if Y is a subset of X, then X determines Y
Axiom of Augmentation:
The axiom of augmentation, also known as a partial dependency,
states if X determines Y, then XZ determines YZ, for any Z
Axiom of Transitivity:
The axiom of transitivity says if X determines Y, and Y
determines Z, then X must also determine Z.
Question 214

The 'command' used to change contents of one database using the contents
of another database by linking them on a common key field?
A. Replace
B. Join
C. Change
D. Update
Join is used to change content of one table using the content of another
table. Join actually link two table on a common attribute field and join to
binary operation that allow to combine two table. Option (B) is correct.
Question 215

The join operation can be defined as


A. a cartesian product of two relations followed by a selection
B. a cartesian product of two relations
C. a union of two relations followed by cartesian product of the two relations
D. a union of two relations
A SQL Join statement is used to combine data or rows from two or more
tables based on the selection of common field between them. Different
types of Joins are: INNER JOIN LEFT JOIN RIGHT JOIN FULL JOIN So,
option (A) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 216

The relation schemas R1 and R2 form a Lossless join decomposition of R if


and only if: (a) R1 ∩ R2 ↠ (R1 - R2) (b) R1 → R2 (c) R1 ∩ R2 ↠ (R2 - R1 )
(d)(R2 → R1) ∩ R2
A. (a) and (b) happens
B. (a) and (d) happens
C. (a) and (c) happens
D. (b) and (c) happens
The relation schemas R1 and R2 form a Lossless join decomposition of R
if and only if: 1 - R1 ∩ R2 ↠ (R1 - R2) 2 - R1 ∩ R2 ↠ (R2 - R1 ) For more
information on Lossless Decomposition option (C) is correct.
Question 217

Which commands are used to control access over objects in relational


database?
A. CASCADE & MVD
B. GRANT & REVOKE
C. QUE & QUIST
D. None of these
DCL(Data Control Language) includes commands such as GRANT and
REVOKE which mainly deals with the rights, permissions and other
controls of the database system. Examples of DCL commands: GRANT-
gives user’s access privileges to database. REVOKE-withdraw user’s
access privileges given by using the GRANT command
Option (B) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 218

A view of database that appears to an application program is known as


A. Schema
B. Subschema
C. Virtual table
D. None of these
A subschema is a subset of the schema and inherits the same property
that a schema has. The plan for a view is often called subschema.
Subschema refers to an application programmer's view of the data item
types and record types, which he or she uses. Option (B) is correct.
Question 219

Which operation is used to extract specified columns from a table?


A. Project
B. Join
C. Extract
D. Substitute
Projection (π) Projection is used to project required column data from a relation. By Default
projection removes duplicate data. Example :
R
(A B C)
----------
1 2 4
2 2 3
3 2 3
4 3 4
π (BC)
B C
-----
2 4
2 3
3 4
So, option (A) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 220

What kind of mechanism is to be taken into account for converting a weak


entity set into strong entity set in entity-relationship diagram?
A. Generalization
B. Aggregation
C. Specialization
D. Adding suitable attributes
Weak entity is an entity which does not have sufficient attributes to form a
primary key. Weak entity is represented by Double rectangle In an ER
Diagram. It must be in a 1:M relation. A member of a weak entity is called
a subordinate entity. For converting a weak entity set into strong entity set
in entity-relationship diagram by simply adding appropriate attributes. So,
option (D) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 221

Identify the minimal key for relational scheme R(A, B, C, D, E) with functional
dependencies F = {A → B, B → C, AC → D}
A. A
B. AE
C. BE
D. CE
A+ = ABCD But we can't derive E from A, so We have to add E i A I.e.
AE+ = ABCDE. So, option (B) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 222

How to express that some person keeps animals as pets?

Solution A
Question 223

In E-R model, Y is the dominant entity and X is subordinate entity


A. If X is deleted, then Y is also deleted
B. If Y is deleted, then X is also deleted
C. If Y is deleted, then X is not deleted
D. None of the above
If any changes occur in dominant entity then they are also reflected in
subordinate entity but not the vice versa. So, option (B) is correct.
Question 224

Immunity of the external schemas (or application programs) to changes in the


conceptual schema is referred to as:
A. Physical Data Independence
B. Logical Data Independence
C. Both (a) and (b)
D. None of the above
Immunity is when data at one layer is changed, it does not affect the data
at another level. Physical data independence:- if changes are made in the
physical storage of schema then it will not affect the logical schema of the
database. Logical data independence:- if any changes are made in the
conceptual schema then it will not affect external schema or the view level
of the database. So, option (B) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 225

In RDBMS, which type of Join returns all rows that satisfy the join condition?
A. Inner Join
B. Outer Join
C. Semi Join
D. Anti Join
In RDBMS, inner join returns all rows that satisfy the given join condition.
Option (A) is correct.
Question 226

A many-to-one relationship exists between entity sets r 1 and r 2 . How will it


be represented using functional dependencies if Pk(r) denotes the primary
key attribute of relation r ?
A. Pk(r1 ) → Pk(r 2)
B. Pk(r2 ) → Pk(r 1 )
C. Pk(r2 ) → Pk(r1 ) and Pk(r 1 ) → Pk(r 2 )
D. Pk(r 2 ) → Pk(r1 ) or Pk(r 1 ) → Pk(r 2)
A many to one relationship set exists between entity sets Employee and
Department. Let two relations R1(employee with pk empId)
R2(Department with pk DId) Here, empId can uniquely identify DId but DId
can not uniquely identify the empId. Hence, pk(R1) -> pk(R2)
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 227

Let R1 (a, b, c) and R2 (x, y, z) be two relations in which a is the foreign key
of R1 that refers to the primary key of R2 . Consider following four options.
(a)Insert into R 1 (b)Insert into R 2 (c)Delete from R 1 (d)Delete from R 2
Which of the following is correct about the referential integrity constraint with
respect to above?
A. Operations (a) and (b) will cause violation.
B. Operations (b) and (c) will cause violation.
C. Operations (c) and (d) will cause violation.
D. Operations (d) and (a) will cause violation.
Let x is the primary key in R2(x, y, z) Insert into R1 - Can cause violation
because if we want to insert any value into a of R1, which is not in x of R2.
Insert into R2 - Can not cause violation Delete from R1 - Can not cause
violation. Delete from R2 - Can cause violation if we delete any value of x
in R2, then the value referred by a in R1 should also be deleted. Hence,
option (D) is correct.
Question 228

Which one of the following is used to represent the supporting many-one


relationships of a weak entity set in an entity-relationship diagram ?
A. Diamonds with double/bold border
B. Rectangles with double/bold border
C. Ovals with double/bold border
D. Ovals that contain underlined identifiers
According to Weak Entity Set in ER diagrams:The relation between one
strong and one weak entity is represented by double diamond. Option (A)
is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 229

In a relational data model, which one of the following statements is TRUE?


A. A relation with only two attributes is always in BCNF.
B. If all attributes of a relation are prime attributes, then the relation is in
BCNF.
C. Every relation has at least one non-prime attribute
D. BCNF decompositions preserve functional dependencies
Option A: It is true to say that every binary relation is always in BCNF
Option B: This is false because it is not necessary to have a relation in
BCNF if all the attributes are prime attributes. For example, R(A, B, C)
with FD A -> C, B -> C, C -> A Here all the attributes are prime but it is not
in BCNF.
Option C: No, it is not necessary to have at least one non-prime attribute
in a relation
Option D: No, it is not necessary that every lossless BCNF decomposition
is dependency preserving
Question 230

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
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 AD, BD, ED and FD
Question 231

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
A. in 1NF, but not in 2NF.
B. in 2NF, but not in 3NF.
C. in 3NF, but not in BCNF.
D. in BCNF
The table is not in 2nd Normal Form as the non-prime attributes are
dependent on subsets of candidate keys. The candidate keys are AD, BD,
ED and FD. In all of the following FDs, the non-prime attributes are
dependent on a partial candidate key. A -> BC B -> CFH F -> EG
Question 232

Which option is true about the SQL query given below?


SELECT firstName, lastName
FROM Employee
WHERE lastName BETWEEN 'A%' AND 'D%';

A
It will display all the employees having last names starting with the alphabets 'A' till 'D' inclusive of A and
exclusive of D.
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'.
The BETWEEN operator works with the range of character values also.
Question 233

Which of the given options define a transaction correctly?


A
A transaction consists of DDL statements on the database schema.
B
A transaction consists of COMMIT or ROLLBACK in a database session.
C
A transaction consists of either a collection of DML statements or a DDL or
DCL or TCL statement to form a logical unit of work in a database session.
D
A transaction consists of collection of DML and DDL statements in different
sessions of the database.
A database transaction consists of one or more DML statements to
constitute one consistent change in data, or a DDL statement or a DCL
command (GRANT or REVOKE). It starts with the first DML statement and
ends with a DCL or DDL or TCL (COMMIT or ROLLBACK) command.
Note that DDL and DCL commands hold auto commit feature.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 234

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
D. All of the above
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 dependencies. Option (B) is
correct.
Question 235

Consider a database with the following schema:


Person ( name, age, gender )
name is a key
Frequents ( name, pizzeria )
(name, pizzeria) is a key
Eats ( name, pizza )
(name, pizza) is a key
Serves ( pizzeria, pizza, price )
(pizzeria, pizza) is a key

Relational algebra expression for query "Names of all people who frequent only pizzeria's serving at least one pizza they eat" is
Find names of all people who frequent only pizzerias serving at least one
pizza they eat :
Option (B) is correct.
Question 236

How many minimum relation tables are required which satisfy 1NF?

A
2, 2, and 1 respectively
B
2, 2, and 2 respectively
C
1, 2, and 1 respectively
D
1, 1, and 1 respectively
First ER model will required minimum number of two tables for 1NF with
{E2R}, and {E1}. "Many" side of the relation can be merged because it is
many to one relation and participation is partial both sides of the relation.
Second ER model will required minimum number of two tables for 1NF
with {E2R}, and {E1}. "One" side entity cannot be merged because it has
total participation in "many" side of the relationship and "one" side of the
relationship is participating partially. Third ER model will required
minimum number of 1 table if no redundancy is occurred. It is a many to
many relationship but total participation is here both sides of the
relationship. Therefore, (A) 2, 2, and 1 respectively is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 237

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 →
email email → rollno
• Schema III: Registration (rollno, courseid, marks, grade) Non-trivial functional dependencies: rollno,
courseid, → marks, grade marks → grade
• Schema IV: Registration (rollno, courseid, credit) Non-trivial functional dependencies: rollno, courseid
→ credit courseid → 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
• 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
Since, rollno is primary key, so this relation is in BCNF as well as 3 NF.
• Schema II: Registration (rollno, coursid, email) Non-trivial functional dependencies: rollno,
courseid → email email → rollno Since, {rollno, coursid} is primary key so rollno and coursid are
prime attributes. email is non-prime attribute. Functional depedency (FD) rollno, courseid →
email is in BCNF and 3NF, but FD email → rollno violates the rule of BCNF because email is
not superkey. But it satisfies rule of 3 NF because rollno is prime-attribute. So, overall this
relation is in 3 NF but not in BCNF.
• Schema III: Registration (rollno, courseid, marks, grade) Non-trivial functional dependencies:
rollno, courseid, → marks, grade marks → grade Since rollno, courseid is primary key, so rollno
and courseid are prime attributes and marks and grade are non-prime attributes. FD rollno,
courseid, → marks, grade satisfies BCNF as well as 3 NF. FD marks → grade does not satifies
3 NF because neither marks is superkey nor grade is prime-attribute. So, aslo can not be in
BCNF. So, overall this relation is not in 3 NF and not in BCNF but it does not violates rule of 2
NF, so can be only in 2 NF.
• Schema IV: Registration (rollno, courseid, credit) Non-trivial functional dependencies: rollno,
courseid → credit courseid → credit Since, rollno, courseid is primary key, so rollno and
courseid are prime-attributes and credit is non-prime attribute. FD rollno, courseid → credit
satifies BCNF as well as 3 NF. FD courseid → credit violates rule of 2 NF, so can not be in
2NF. So, overall this is not in 2 NF, 3 NF, and BCNF. But it is only in 1 NF.
Therefore only schema-II is in 3 NF but not in BCNF. Option (B) is correct.
Question 238

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
Functional dependency is a constraint that describes the relationship
between attributes in a relation. Data integrity refers to the accuracy and
consistency of data stored in a database, data warehouse, data mart or
other construct. Referential integrity is a relational database concept,
which states that table relationships must always be consistent.
Normalization is a process of organizing the data in database to avoid
data redundancy, insertion anomaly, update anomaly & deletion anomaly.
1NF, 2NF, 3NF and BCNF are types of normal forms. So, option (D) is
correct.
Question 239

If every non-key attribute is functionally dependent on the primary key, then


the relation is in __________ .
A. First normal form
B. Second normal form
C. Third normal form
D. Fourth normal form
Conditions for various normal forms:
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-transitively 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 but not
in 3NF because of every non-key attribute is transitively dependent on the primary
key. Here {X} will be candidate key. So, option (B) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 240

Consider a schema R(A, B, C, D) and following functional dependencies.


A→B
B→C
C→D
D→B
Then decomposition of R into R1 (A, B), R2(B, C) and R3(B, D) is __________
.
A. Dependency preserving and lossless join.
B. Lossless join but not dependency preserving.
C. Dependency preserving but not lossless join.
D. Not dependency preserving and not lossless join.
Schema R(A, B, C, D) is decomposed into three relation → R1 (A, B),
R2(B, C) and R3(B, D) Now dependencies derived 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 All the
dependencies are preserved and it is a lossless decomposition. So, option
(A) is correct.
Question 241

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
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 242

Consider a schema R(MNPQ) and functional dependencies M → N, P → Q.


Then the decomposition of R into R1 (MN) and R2(PQ) is________.
A. Dependency preserving but not lossless join
B. Dependency preserving and lossless join
C. Lossless join but not dependency preserving
D. Neither dependency preserving nor lossless join.
Schema R(MNPQ) is decomposed into R1(MN) M → N is preserved and
R2(PQ) P → Q is also preserved, dependency will be preserved and there
will be no loss of any dependency. So, option (A) is correct.
Question 243

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
_______.
A. First normal form but not in second normal form.
B. Both in first normal form as well as in second normal form.
C. Second normal form but not in third normal form.
D. Both in second normal form as well as in third normal form.
A relation is in first normal form if every attribute in that relation is single
valued attribute. It is in 1NF. {A,B} are prime 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 244

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
Functional Dependencies of R = C->F, E->A, EC->D, A->B Through the
attributes C and E, we get all other attributes present in R. So, EC is the
key of R
Question 245

DBMS provides the facility of accessing data from a database through


A. DDL
B. DML
C. DBA
D. Schema
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, insertion and updation of data in a
database. Examples of DML: SELECT, INSERT, UPDATE, DELETE. 2- DDL - Data Definition
Language - This commands in SQL includes the creation, deletion and modification of
structure of database objects. Examples of DDL commands: CREATE, DROP, ALTER,
TRUNCATE, COMMENT, RENAME. It provides the facility of accessing data from a
database. 3- Functions of a DBA include: Schema definition, Storage structure and access-
method definition, Schema and physical-organization modification, Granting of authorization
for data access, Routine maintenance. 4- Schema: The term "schema" refers to the
organization of data as a blueprint of how the database is constructed (divided into database
tables in the case of relational databases). The formal definition of a database schema is a
set of formulas (sentences) called integrity constraints imposed on a database. So, option (A)
is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 246

Consider a database table R with attributes A and B. Which of the following


SQL queries is illegal ?
A
SELECT A FROM R;
B
SELECT A, COUNT(*) FROM R;
C
SELECT A, COUNT(*) FROM R GROUP BY A;
D
SELECT A, B, COUNT(*) FROM R GROUP BY A, B;
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 247

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?
A. Preserves dependency but cannot perform lossless join
B. Preserves dependency and performs lossless join
C. Does not perform dependency and cannot perform lossless join
D. Does not preserve dependency but perform lossless join
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)+,where 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 and 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 248

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.
A. II and III only
B. I and IV only
C. I, II, and III only
D. I, III and IV only
• An OODBMS avoids the “impedance mismatch” problem.Correct.
• An OODBMS doesn't avoids the “phantom” problem.
• An OODBMS doesn't provides higher performance concurrency control
than most relational databases. Since it is distributed.
• An OODBMS provides faster access to individual data objects once they
have been read from disk.Correct
SO, option (B) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 249

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?
A
{x,y} and {a,b}
B
{x} and {a,b}
C
{x,y,z} and {a,b,c}
D
{z} and {c}
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 250
Which one of the following pairs is correctly matched in the context of
database design?
• Result of taking a subset of a higher-level entity set to form a lower-level
entity set is Specialization
• Result of taking the union of two or more disjoint(lower-level) entity sets
to produce a higher-level entity set is Generalization
• An abstraction in which relationship sets (along with their associated
entity sets) are treated as higher-level entity sets, and can participate in
relationships.Aggregation
• Express the number of entities to which another entity can be associated
via a relationship set Mapping cardinalities
So, option (D) is correct.
Question 251

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
• In RDBMS, the constraint that no key attribute (column) may be NULL is
referred to as Entity Integrity
• Referential integrity states that table relationships must always be
consistent.
• Multi-valued dependencies 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.
So, option (C) is correct.
Question 252

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
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 253

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
A
First Normal Form
B
Second Normal Form
C
Third Normal Form
D
BCNF
Candidate key = ISBN For a relation having functional dependencies of
the form α → β, a relation is in 2-NF if: i) α should 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 254

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:
A
Select * from customers where city = ‘%GAR%’;
B
Select * from customers where city = ‘$GAR$’;
C
Select * from customers where city like ‘%GAR%’;
D
Select * from customers where city as ‘%GAR’;
Solution C
Question 255

Data which improves the performance and accessibility of the database are
called:
A. Indexes
B. User Data
C. Application Metadata
D. Data Dictionary
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
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 256

Which type of DBMS provides support for maintaining several versions of the same entity?
A
Relational Database Management System
B
Hierarchical
C
Object Oriented Database Management System
D
Network
Object Oriented Database Management Systems allow object-oriented
programmers to develop the product, store them as objects, and replicate
or modify existing objects to make new objects within the OODBMS.
Option (C) is correct.
Question 257

Which normal form is based on the concept of 'full functional dependency'?


A
First Normal Form
B
Second Normal Form
C
Third Normal Form
D
Fourth Normal Form
A full functional dependency is a state of database normalization similar to
Second Normal Form (2NF). It means that the schema should meet the
requirements of First Normal Form (1NF), and all non-key attributes are
fully functionally dependent on the primary key and partial dependency on
the candidate key should not exist. So, Option (B) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 258

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
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 dominate.
i.e. check(two >= 1 and <= 5) 5 tuples.
So, option (A) is correct.
Question 259

Purpose of 'Foreign Key' in a table is to ensure


A. Null Integrity
B. Referential Integrity
C. Domain Integrity
D. Null and Domain Integrity
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 or parent table. Although there may be exceptions,
the values in the foreign key columns usually must correspond to values
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 260

Select the 'False' statement from the following statements about Normal
Forms:
A. Lossless preserving decomposition into 3NF is always possible
B. Lossless preserving decomposition into BCNF is always possible
C. Any Relation with two attributes is in BCNF
D. BCNF is stronger than 3NF
Lossless preserving decomposition into 3NF is always possible. True
Lossless preserving decomposition into BCNF is always possible. False
Not always possible.
Any Relation with two attributes is in BCNF. True
BCNF is stronger than 3NF. True
For more information on Normal form
Option (B) is correct.
Question 261

The Relation Vendor Order (V_no, V_ord_no, V_name, Qty_sup, unit_price)


is in 2NF because:
A. Non_key attribute V_name is dependent on V_no which is part of
composite key
B. Non_key attribute V_name is dependent on Qty_sup
C. Key attribute Qty_sup is dependent on primary_key unit price
D. Key attribute V_ord_no is dependent on primary_key unit price
The Relation Vendor Order (V_no, V_ord_no, V_name, Qty_sup,
unit_price) is in 2NF because: Non_key attribute V_name is dependent on
V_no which is part of composite key. For more information on Normal
forms
Option (A) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 262

BCNF is not used for cases where a relation has


A. Two (or more) candidate keys
B. Two candidate keys and composite
C. The candidate key overlap
D. Two mutually exclusive foreign keys
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 CK.
Option (D) is correct.
Question 263

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
A. Boyce-Codd Normal form
B. Third Normal form
C. Second Normal form
D. First Normal form
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 correct.
Question 264

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
The attribute closures of A: A+ = ABCD The attribute closures of E: E+ =
E. So, option (B) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 265

Which of the following is false?


A. Every binary relation is never be in BCNF.
B. Every BCNF relation is in 3NF.
C. 1 NF, 2 NF, 3 NF and BCNF are based on functional dependencies.
D. Multivalued Dependency (MVD) is a special case of Join Dependency
(JD).
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 266

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
A. First normal form but not in second normal form
B. Second normal form but not in third normal form
C. Third normal form
D. None of the above
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 (partial dependency) must not present in
2NF. And every relation is already in 1NF. Option (A) is correct.
Question 267

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
B. X is not functionally dependent on any subset of Y
C. Both (a) and (b)
D. None of these
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 conditions are satisfied:
i) X is functionally dependent on Y and
ii) X is not functionally dependent on any
subset of Y.

Example: In relation StuGrade:


{stud_id, course_id, course_name} -> {course_grade}
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_id, course_id, course_name}, namely, {stud_id,
course_id}, to determine the course_grade Thus, the correct full functional dependency
can be written as:
{stud_id, course_id} -> {course_grade}
So, option (C) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 268

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
Here candidate Key is A and B -> C , C -> D , D -> E all are. (Non prime
attribute -> Non prime attribute.). This type of FD must not be present in
3NF therefore highest normal form of this FDs are 2NF. Option (B) is
correct.
Question 269

Relations produced from E - R Model will always be in ________.


A. 1 NF
B. 2 NF
C. 3 NF
D. 4 NF
As we know that every table is already in 1NF. and relations produced
from E – R Model will always be a table which is in 1Nf. Hence (A) is
correct.
Question 270

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
_________.
A. First normal form but not in second normal form
B. Second normal form but not in third normal form
C. Third normal form
D. BCNF

Solution A
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 271

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?
A. PS → T
B. R → T
C. P → R
D. PS → Q
Answer: (A) (C) (D)

Explanation:
P-> QR
RS-> T
From P->QR we derived P->Q and P->R.
After getting R from P we derive PS->T .
We directly derive Q from P so PS->Q also holds true.
Correct Option A , C, D
Question 272

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?
A
Both S1 and S2 are true
B
S1 is true and S2 is false
C
S1 is false and S2 is true
D
Both S1 and S2 are false
• 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 273

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
D. A cell in R holds a set instead of an atomic value

Solution A
Question 274

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
Probability of first condition satisfies, P(A) = 10/15 Probability of second
condition satisfies, P(B) = 1/20 Probability of both condition satisfy,
P(A∩B) = 10/15*1/20 Because of independent. So, either first or second
condition satisfy P(A∪B) = P(A) + P(B) - P(A∩B) = 10/15 + 1/20 -
10/15*1/20 = 0.6833 Therefore, estimated number of tuples in the output,
= 1200*0.6833 = 820
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 275
Consider the following relational schema.
Students(rollno: integer, sname: string)
Courses(courseno: integer, cname: string)
Registration(rollno: integer, courseno: integer, percent: real)
Which of the following queries are equivalent to this query in English?
"Find the distinct names of all students who score
more than 90% in the course numbered 107"

A.I, II, III and IV


B.I, II and III only
C.I, II and IV only
D.II, III and IV only
Option A:
Here T is a Tuple variable.

This is a SQL query expression. It first perform a cross product of Students


and Registration, then WHERE clause only keeps those rows in the cross product From left to right, it can be read like this, “It is a set of
set where the student is registered for course no 107, and percentage is > 90. tuples T, where, there exists a tuple S in Relation Students, and
Then select distinct statement gives the distinct names of those students as the there exist a tuple R in relation Registration, such that
result set. S.rollno = R.rollno AND R.couseno = 107 AND R.percent > 90 AND
T.sname = S.sname”. And the schema of this result is (sname), i.e. each
tuple T will contain only student name, because only T.sname has been defined
in the expression.
Option B:
As TRC is a mathematical expression, hence it is expected to give only distinct re
This is a relational algebra expression. It first perform a NATURAL JOIN set.
of Students and Registration (NATURAL JOIN implicitly joins on the basis
of common attribute, which here is rollno ), then the select operation( sigma) Option D:
keeps only those rows where the student is registered for courseno 107,
and percentage is > 90. And then the projection operation (pi) projects only
distinct student names from the set. This is a Domain Relational Calculus (DRC) language expression.
This is also not procedural. Here SN is a Domain Variable. It can be read
from left to right like this “The set of domain variable SN, where,
Note: Projection operation (pi) always gives the distinct result. there exist a domain variable SR , and a domain variable Rp, such that,
SN and SR domain variables is in relation Students and SR,107,RP is a domain
Option C: variables set in relation Registration, AND RP > 90 “

This is a Tuple Relational Calculus (TRC) language expression, Above, SN represents sname domain attribute in Students relation, SR
It is not a procedural language (i.e. it only tells “what to do”, represents rollno domain attribute in Students relation, and RP represents
not “how to do”). It just represents a declarative mathematical percentage domain attribute in Registration relation.
expression. The schema for the result set is (SN), i.e. only student name.

As DRC is a mathematical expression, hence it is expected to


give only distinct result set.
Question 276

Given the basic ER and relational models, which of the following is


INCORRECT?
A
An attribute of an entity can have more than one value
B
An attribute of an entity can be composite
C
In a row of a relational table, an attribute can have more than one value
D
In a row of a relational table, an attribute can have exactly one value or a
NULL value
The term ‘entity’ belongs to ER model and the term ‘relational table’
belongs to relational model. A and B both are true. ER model supports
both multivalued and composite attributes See this for more details. (C) is
false and (D) is true. In Relation model, an entry in relational table can can
have exactly one value or a NULL.
Question 277

What is the min and max number of tables required to convert an ER diagram
with 2 entities and 1 relationship between them with partial participation
constraints of both entities?
A
Min 1 and max 2
B
Min 1 and max 3
C
Min 2 and max 3
D
Min 2 and max 2
Maximum number of tables required is 3 in case of many to many
relationships between entities. Minimum number of tables is 1 in case of
unary relationship and total participation of atleast one entity. But in case
of partial participation of both entities, minimum number of tables required
is 2.
Question 278

Consider the join of a relation R with a relation S. If K has m tuples and S has
n tuples, then the maximum and minimum sizes of the join respectively are:
A
m+n and 0
B
mn and 0
C
m+n and m-n
D
mn and m+n
When there is no foreign key constraint between two tables then the max and
min number of tuples in their join is mn and 0 respectively.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 279
Consider the following relational schema.
Students(rollno: integer, sname: string)
Courses(courseno: integer, cname: string)
Registration(rollno: integer, courseno: integer, percent: real)
Which of the following queries are equivalent to this query in English?
"Find the distinct names of all students who score
more than 90% in the course numbered 107"
A I, II, III and IV
B I, II and III only
C I, II and IV only
D II, III and IV only
Option A:

This is a SQL query expression. It first perform a cross product of Students


and Registration, then WHERE clause only keeps those rows in the cross product Here T is a Tuple variable.
set where the student is registered for course no 107, and percentage is > 90.
Then select distinct statement gives the distinct names of those students as the
result set. From left to right, it can be read like this, “It is a set of
tuples T, where, there exists a tuple S in Relation Students, and
there exist a tuple R in relation Registration, such that
S.rollno = R.rollno AND R.couseno = 107 AND R.percent > 90 AND
Option B: T.sname = S.sname”. And the schema of this result is (sname), i.e. each
tuple T will contain only student name, because only T.sname has been defined
in the expression.
This is a relational algebra expression. It first perform a NATURAL JOIN
of Students and Registration (NATURAL JOIN implicitly joins on the basis
of common attribute, which here is rollno ), then the select operation( sigma) As TRC is a mathematical expression, hence it is expected to give only distinct result
keeps only those rows where the student is registered for courseno 107, set.
and percentage is > 90. And then the projection operation (pi) projects only
distinct student names from the set. Option D:

Note: Projection operation (pi) always gives the distinct result. This is a Domain Relational Calculus (DRC) language expression.
This is also not procedural. Here SN is a Domain Variable. It can be read
Option C: from left to right like this “The set of domain variable SN, where,
there exist a domain variable SR , and a domain variable Rp, such that,
SN and SR domain variables is in relation Students and SR,107,RP is a domain
This is a Tuple Relational Calculus (TRC) language expression, variables set in relation Registration, AND RP > 90 “
It is not a procedural language (i.e. it only tells “what to do”,
not “how to do”). It just represents a declarative mathematical
expression. Above, SN represents sname domain attribute in Students relation, SR
represents rollno domain attribute in Students relation, and RP represents
percentage domain attribute in Registration relation.
The schema for the result set is (SN), i.e. only student name.

As DRC is a mathematical expression, hence it is expected to


give only distinct result set.
Question 280

The relational algebra expression equivalent to the following tuple calculus expression
{ t | t ∈ r ∧ (t[A] = 10 ∧ t[B] = 20 }
is
In Given relational algebra, Tuple t should have two attributes A=10 and
B=20 In A, we select tuples having A=10 or B=20 so, it is wrong choice. In
B, we select tuples having A=10 or we can select tuples having B=20, so it
is also wrong choice. D is also wrong choice. In C, we select tuples having
A=10 and tuples having B=20, it is same as above relational algebra.
Hence, option (C) is Correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 281
Consider the following tables T1 and T2:In table T1, P is the primary key, Q is the
foreign key referencing R in table T2 with on-delete cascade and on-update cascade.
In table T2, R is the primary key and S is the foreign key referencing P in the table T1
with on-delete set NULL and on-update cascade. In order to delete record (3,8) from
table, numbers of additional record that need to be deleted from table T1 is ______.
Note: This question appeared as Numerical Answer Type
.
A. 0 B. 1 C 2. D. 3
Given,
• Q -> R(Primary Key)
• S -> P (Primary Key)
Entry to be deleted - P (3) and Q(8)
• Q can be deleted directly
• Now, S - > P but the relationship given is on delete set NULL, Therefore
when we delete 3 from T1 ,the entry in T2 having 3 will be NULL.
Therefore, Option A - Answer is 0 entries
Question 282
In an Entity-Relationship (ER) model, suppose R is a many-to-one relationship
from entity set E1 to entity set E2. Assume that E1 and E2 participate totally in R
and that the cardinality of E1 is greater that the cardinality of E2. Which one of the
following is true about R?
A Every entity in E1 is associated with exactly one entity in E2.
B Some entity in E1 is associated with more than one entity in E2.
C Every entity in E2 is associated with exactly one entity in E1.
D Every entity in E2 is associated with at most one entity in E1.
Since given relation is many to one :
Therefore, no entity in E1 can be related to more than one entity in E2 and an
entity in E2 can be related to more than one entity in E1. Only option (A) is
correct.
Question 283

Consider the relations r(A, B) and s(B, C), where s.B is a primary key and r.B is a foreign
key referencing s.B. Consider the query
Q: r⋈(σB<5(s))
Let LOJ denote the natural left outer-join operation. Assume that r and s contain no null
values. Which one of the following is NOT equivalent to Q?
A σB<5(r ⋈ s)
B σB<5(r LOJ s)
C r LOJ (σB<5(s))
D σB<5(r)LOJ s
Since, we are joining/LOJ using attribute B which is primary key of table s and
foreign key of table r. So, we need to apply condition σB<5 on left table of join
always, i.e., table r because left outer join (LOJ) returns all the values from an
inner join plus all values in the left table that do not match to the right table. So,
option (C) is correct.
Question 284
Match the following with respect to RDBMS :
Codd's rule says that entity integrity must be maintained so that no duplicate
record exist in DB. In RDBMS table column entry must be valid, It also comes
under codd's rule. Referential data items strictly follows integrity on insertion,
deletion and modification of table and user defined integrity constraints enlist
some specific business rule, these rule don't fall into entity or domain. So,
option (B) is correct.
Question 285
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
Functional dependency is a constraint that describes the relationship between
attributes in a relation. Data integrity refers to the accuracy and consistency of
data stored in a database, data warehouse, data mart or other construct.
Referential integrity is a relational database concept, which states that table
relationships must always be consistent. Normalization is a process of
organizing the data in database to avoid data redundancy, insertion anomaly,
update anomaly & deletion anomaly. 1NF, 2NF, 3NF and BCNF are types of
normal forms. So, option (D) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 286
Consider the following schema :
Sailors (sid, sname, rating, age)
Boats (bid, bname, colour)
Reserves (sid, bid, day)
Two boats can have the same name but the colour differentiates them. The two
relations
ρ (Tempsids, (Ⲡ sid, bid Reserves)/(Ⲡ bid ( σ bname ='Ganga' Boats))),
Ⲡ sname (Tempsids ⋈ Sailors)
If / is division operation, the above set of relations represents the query
A Names of sailors who have reserved all boats called Ganga
B Names of sailors who have not reserved any Gangaboat
C Names of sailors who have reserved at least one Gangaboat
D Names of sailors who have reserved at most one Ganga boat
According to Division operator, Tempsids gives sid and bid of who have
reserved all boats called Ganga And Ⲡ sname (Tempsids ⋈ Sailors) will
return sname of sailors who have reserved all boats called Ganga So,
option (A) is correct.
Question 287

Consider a relation R (A, B, C, D, E, F, G, H), where each attribute is atomic, and


following functional dependencies exist.
CH → G
A → BC
B → CFH
E→A
F → EG
The relation R is __________ .
A in 1NF but not in 2NF
B in 2NF but not in 3NF
C in 3NF but not in BCNF
D in BCNF
If we find closure of A: A+ → All attribute except D. Similarly for other keys
we can find closure, but D can't be derived from any key and it must be
added to all keys to be derived from. That's why this relation is in 1NF,
since there is partial dependency so, this relation is not in 2NF. So, option
(A) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 288

Which symbol denote derived attributes in ER Model?


A Double ellipse
B Dashed ellipse
C Squared ellipse
D Ellipse with attribute name underlined

Solution B
Question 289

Integrity constraints ensure that changes made to the database by authorized users do not result
into loss of data consistency. Which of the following statement(s) is (are) true w.r.t. the examples
of integrity constraints ?
(A) An instructor Id. No. cannot be null, provided Instructor Id No. being primary key.
(B) No two citizens have same Aadhaar-Id.
(C) Budget of a company must be zero.
A (A), (B) and (C) are true.
B (A) false, (B) and (C) are true.
C (A) and (B) are true; (C) false.
D (A), (B) and (C) are false
(A) An instructor Id. No. cannot be null, provided Instructor Id No. being primary key.
Correct by Codd's rule
(B) No two citizens have same Adhar-Id. Correct because Adhar is identification for
citizens so it must be unique
(C) Budget of a company must be zero. We cant say or it is not necessarily true
So, option (C) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 290

Let M and N be two entities in an E-R diagram with simple single value
attributes. R1 and R2 are two relationship between M and N, where as R1 is
one-to-many and R2 is many-to-many. The minimum number of tables
required to represent M, N, R1 and R2 in the relational model are _______.
A. 4
B. 6
C. 7
D. 3
Solution D
Question 291

Which one is correct w.r.t. RDBMS ?


A. primary key ⊆ super key ⊆ candidate key
B. primary key ⊆ candidate key ⊆ super key
C. super key ⊆ candidate key ⊆ primary key
D. super key ⊆ primary key ⊆ candidate key
primary key ⊆ candidate key ⊆ super key in RDBMS For more information
Option (B) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 292

Let pk(R) denotes primary key of relation R. A many-to-one relationship that


exists between two relations R1 and R2 can be expressed as follows :
A. pk(R2) → pk(R1)
B. pk(R1) → pk(R2)
C. pk(R2) → R1 ∩ R2
D. pk(R1) → R1 ∩ R2

Solution B
Question 193

Consider the join of a relation R , with a relation S . If R has m number of


tuples and S has n number of tuples then the maximum and minimum sizes of
the join respectively are:
A. m + n & 0
B. mn & 0
C. m + n & | m - n |
D. mn & m + n
Case 1: Maximum tuples- When the common attribute contains identical values
Relation R Relation S R⋈S
a b a d a b d
1 2 1 10 1 2 10
1 3 1 11 1 2 11
1 4 1 3 10
1 3 11
1 4 10
1 4 11
Case 2: Minimum Tuples- When Both the relations have a common attribute but no tuple in both
relations match.
Relation R Relation S R⋈S
a b a d a b d
1 2 2 10 No tuple
1 3 3 11
1 4
So, option (B) is correct.
Question 294
Let R(a, b, c) and S(d, e, f) be two relations in which d is the foreign key of S
that refers to the primary key of R. Consider the following four operations R
and S. I. Insert into R II. Insert into S III. Delete from R IV. Delete from S
Which of the following can cause violation of the referential integrity constraint
above?
A. Both I and IV
B. Both II and III
C. All of these
D. None of these
II and III statement can cause the violation of the referential integrity
constraint as d is the foreign key of S that refers to the primary key of R. So, d
should always be a subset of primary key of R. But insertion to S and deletion
from R may cause the violation of subset property as after these operations d
may contain a value that is not present in the primary key of A. So, option (B)
is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 295

Goals for the design of the logical scheme include


A. avoiding data inconsistency
B. being able to construct query easily
C. being able to access data efficiently
D. All of the above
Logical schema is developed using diagrams that define the content of
databases in the form of tables and it also describe how the tables are linked
with each for data access and how actually data is stored in the database . A
conceptual model is created during the first phase of logical design based on
the needs assessment performed in stage one. Actually a conceptual model
is an Entity -Relation (i.e., ER) diagram. It shows the tables, fields, and
primary keys of the database, and how tables are related or linked with each
other. While designing the logical scheme we avoiding data inconsistency i.e.,
data should be consistent as well as efficient (duplicate data is not allowed in
a row) and query should be easily construct using the table . Hence, option
(D) is correct among all.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 296
Given the relations employee (name, salary, dept-no), and department (dept-
no, dept-name,address) Which of the following queries cannot be expressed
using the basic relational algebra operations (σ, π, x, -, ∪, p)
A. Department address of every employee
B. Employees whose name is the same as their department name
C. The sum of all employees' salaries
D. All employees of a given department
The sum of all employees' salaries can not be found using these above
operations as to calculate sum we need aggregate functions and operators.
So, option (C) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 297
Consider the following Relationship Entity Diagram(ERD) Which of the
following possible relations will not hold if the above ERD is mapped into a
relation model?

A. Person (NID, Name)


B. Qualification (NID, ExamID, QualifiedDate)
C. Exam (ExamID, NID, ExamName)
D. Exam (ExamID, ExamName)
If we convert an ER diagram into relational model then we can create
table for each entity. We get two tables One for Entity Person -
Person(NID,Name) One for Entity Exam - Exam(ExamID,ExamName)
Now for relationship Entity Qualification, we can not add QualifiedDate in
any of the two tables formed so we need to create a new table using
Primary Key from both Entity Person and Entity Exam. We obtain
Qualification(NID, ExamID, QualifiedDate) Hence Option (C) does not
make any sense.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 298
If D1, D2...Dn are domains in a relational model, then the relation is a table,
which is a subset of
A. D1⊕D2⊕...⊕Dn
B. D1xD2x...xDn
C. D1∪D2∪...∪Dn
D. D1∩D2∩...∩Dn

Solution B
Question 299
Relational database schema normalization is NOT for:
A. reducing the number of joins required to satisfy a query.
B. eliminating uncontrolled redundancy of data stored in the database.
C. eliminating number of anomalies that could otherwise occur with inserts
and deletes.
D. ensuring that functional dependencies are enforced.
• Relational database schema normalization is NOT for reducing the
number of joins required to satisfy a query.
• Relational database schema normalization is for eliminating uncontrolled
redundancy of data stored in the database.
• Relational database schema normalization is for eliminating number of
anomalies that could otherwise occur with inserts and deletes.
• Relational database schema normalization is for ensuring that functional
dependencies are enforced.
So, option (A) is correct.
Question 300

Consider the following statements regarding relational database model: (a)


NULL values can be used to opt a tuple out of enforcement of a foreign key.
(b) Suppose that table T has only one candidate key. If Q is in 3NF, then it is
also in BCNF. (c) The difference between the project operator (Π) in relational
algebra and the SELECT keyword in SQL is that if the resulting table/set has
more than one occurrences of the same tuple, then Π will return only one of
them, while SQL SELECT will return all. One can determine that:
A. (a) and (b) are true.
B. (a) and (c) are true.
C. (b) and (c) are true.
D. (a), (b) and (c) are true.
IN relational database model: (a) NULL values can be used to opt a tuple
out of enforcement of a foreign key.Correct (b) Suppose that table T has
only one candidate key. If Q is in 3NF, then it is also in BCNF.Correct (c)
The difference between the project operator (Π) in relational algebra and
the SELECT keyword in SQL is that if the resulting table/set has more
than one occurrences of the same tuple, then Π will return only one of
them, while SQL SELECT will return all.Correct So, option (D) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 301

Consider the following Entity-Relationship (E-R) diagram and three possible relationship sets
(I, II and III) for this E-R diagram:
If different symbols stand for different values (e.g., t1 is definitely not equal to t2), then which
of the above could not be the relationship set for the E-R diagram ?
A. I only
B. I and II only
C. II only
D. I, II and III

Solution A

(I) (II) (III)


Question 302

An aggregation association is drawn using which symbol?


A. A line which loops back on to the same table
B. A small open diamond at the end of a line connecting two tables
C. A small closed diamond at the end of a line connecting two tables
D. A small closed triangle at the end of a line connecting two tables
Association is a relationship where all objects have their own lifecycle and
there is no owner. Aggregation is a specialised form of Association where all
objects have their own lifecycle, but there is ownership and child objects can
not belong to another parent object. Composition is again specialised form of
Aggregation and we can call this as a “death” relationship. It is a strong type
of Aggregation. Child object does not have its lifecycle and if parent object is
deleted, all child objects will also be deleted.
So, option (B) is correct. See: Association, Composition and Aggregation
Question 303
Every time the attribute A appears, it is matched with the same value of
attribute B but not the same value of attribute C. Which of the following is
true?
A. A-> (B,C)
B. A ->B, A->>C
C. A->B, C->>A
D. A->>B, B->C
Functional dependency is a relationship that exists when one attribute
uniquely determines another attribute, therefore A→B. Multivalued
dependency occurs when there are more than one independent multivalued
attributes in a table. If A->> C is a dependency, it means for A, attribute C has
more than one value. So, option (B) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 304
Suppose database table T1(P, R) currently has tuples {(10, 5), (15, 8), (25,
6)} and table T2 (A, C) currently has {(10, 6), (25, 3), (10, 5)}. Consider the
following three relational algebra queries RA1, RA2 and RA3:
RA1 : T1 ⨝ T1.P = T2.A T2 where ⨝is natural join symbol
RA2 : T1 ⟕ T1.P = T2.A T2 where ⟕ is left outer join symbol
RA3 : T1 ⨝ T1.P = T2.A and T1.R = T2.CT2
The number of tuples in the resulting table of RA1, RA2 and RA3 are given
by:
A. 2, 4, 2 respectively
B. 2, 3, 2 respectively
C. 3, 3, 1 respectively
D. 3, 4, 1 respectively
Solution D
Question 305

Which of the following statement(s) is/are FALSE in the context of Relational


DBMS ? I. Views in a database system are important because they help with
access control by allowing users to see only a particular subset of the data in
the database. II. E-R diagrams are useful to logically model concepts. III. An
update anomaly is when it is not possible to store information unless some
other, unrelated information is stored as well. IV. SQL is a procedural
language.
A. I and IV only
B. III and IV only
C. I, II and III only
D. II, III and IV only
• Views in a database system are important because they help with access
control by allowing users to see only a particular subset of the data in the
database.Correct
• E-R diagrams are useful to logically model concepts.Inorrect
• An update anomaly is when it is not possible to store information unless
some other, unrelated information is stored as well.Inorrect
• SQL is a procedural language.Inorrect
So, option (D) is correct.
Question 306
In a relational database model, NULL values can be used for all but which
one of the following ?
A. To allow duplicate tuples in the table by filling the primary key column(s)
with NULL.
B. To avoid confusion with actual legitimate data values like 0 (zero) for
integer columns and ’’ (the empty string) for string columns.
C. To leave columns in a tuple marked as ’’unknown’’ when the actual value is
unknown.
D. To fill a column in a tuple when that column does not really ”exist” for that
particular tuple.

Solution A
Question 307

Consider the following two commands C1 and C2 on the relation R from an


SQL database: C1 : drop table R; C2 : delete from R; Which of the following
statements is TRUE ? I. Both C1 and C2 delete the schema for R. II. C2
retains relation R, but deletes all tuples in R. III. C1 deletes not only all tuples
of R, but also the schema for R.
A. I only
B. I and II only
C. II and III only
D. I, II and III

Solution C
Question 308

Consider the following database table having A, B, C and D as its four attributes and four possible
candidate keys (I, II, III and IV) for this table :
I : {B} II : {B, C} III : {A, D} IV : {C, D} If different symbols stand for different values in the table (e.g., d1
is definitely not equal to d2), then which of the above could not be the candidate key for the database
table ?
A I and III only
B III and IV only
C II only
D I only
Upon carefully observing the tuples in the relation, we can see that the
functional dependency B -> {A, C, D} holds. Hence {B} is one candidate
key. A,D -> {A, B, C, D} ; C,D -> {A, B, C, D} and B,C -> {A, B, C, D} also
holds true. Therefore, these all can be candidate keys. But in B,C -> {A, B,
C, D} , there exist a partial dependency of B->{A, B, C, D}. Hence {B, C}
cannot be a candidate key. So option (C) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 309

A relation R = {A, B, C, D, E, F,G} is given with following set of functional


dependencies: F = {AD → E, BE → F, B → C, AF → G} Which of the
following is a candidate key ?
A. A
B. AB
C. ABC
D. ABD
[AD]+ = ADE. [BE]+ = BCEF. [B]+ = BC. [AF]+ = AFG. Nothing drives all
the attributes, but if We add B in first key i.e. [ADB] then it will give all the
attribute [ADB]+ = ABCDEFG. So, option (D) is correct.
Question 310

Drop Table cannot be used to drop a Table referenced by __________


constraint. (a)Primary key (b)Sub key (c)Super key (d)Foreign key
A. (a)
B. (a), (b) and (c)
C. (d)
D. (a) and (d)
Drop Table cannot be used to drop a Table referenced by foreign key
constraint. For more information on keys
Option (C) is correct
Question 311

For a weak entity set to be meaningful, it must be associated with another


entity set in combination with some of their attribute values, is called as:
A. Neighbour Set
B. Strong Entity Set
C. Owner Entity Set
D. Weak Set

Solution C
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 312

Which of the following statements is FALSE about weak entity set?


A Weak entities can be deleted automatically when their strong entity is deleted.
B Weak entity set avoids the data duplication and consequent possible
inconsistencies caused by duplicating the key of the strong entity.
C A weak entity set has no primary keys unless attributes of the strong entity set on
which it depends are included
D Tuples in a weak entity set are not partitioned according to their relationship with
tuples in a strong entity set.
• Weak entities can be deleted automatically when their strong entity is
deleted. Correct
• Weak entity set avoids the data duplication and consequent possible
inconsistencies caused by duplicating the key of the strong entity. Correct
• A weak entity set has no primary keys unless attributes of the strong entity
set on which it depends are includedCorrect
• Tuples in a weak entity set are not partitioned according to their relationship
with tuples in a strong entity set.This is Incorrect, because tuples in a weak
entity set are partitioned according to their relationship with tuples in a
strong entity set.
So, option (D) is correct.
Question 313

In functional dependency Armstrong inference rules refers to


A. Reflexivity, Augmentation and Decomposition
B. Transitivity, Augmentation and Reflexivity
C. Augmentation, Transitivity, Reflexivity and Decomposition
D. Reflexivity, Transitivity and Decomposition
Armstrong inference rules refer to a set of inference rules used to infer all the
functional dependencies on a relational database. It consists of the following
axioms:
Axiom of Reflexivity:
This axiom states: if Y is a subset of X, then X determines Y
Axiom of Augmentation:
The axiom of augmentation, also known as a partial dependency,
states if X determines Y, then XZ determines YZ, for any Z
Axiom of Transitivity:
The axiom of transitivity says if X determines Y, and Y
determines Z, then X must also determine Z.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 314

The 'command' used to change contents of one database using the contents
of another database by linking them on a common key field?
A. Replace
B. Join
C. Change
D. Update
Join is used to change content of one table using the content of another
table. Join actually link two table on a common attribute field and join to
binary operation that allow to combine two table. Option (B) is correct.
Question 315

The join operation can be defined as


A. a cartesian product of two relations followed by a selection
B. a cartesian product of two relations
C. a union of two relations followed by cartesian product of the two relations
D. a union of two relations
A SQL Join statement is used to combine data or rows from two or more
tables based on the selection of common field between them. Different
types of Joins are: INNER JOIN LEFT JOIN RIGHT JOIN FULL JOIN So,
option (A) is correct.
Question 316

The relation schemas R1 and R2 form a Lossless join decomposition of R if


and only if: (a) R1 ∩ R2 ↠ (R1 - R2) (b) R1 → R2 (c) R1 ∩ R2 ↠ (R2 - R1 )
(d)(R2 → R1) ∩ R2
A. (a) and (b) happens
B. (a) and (d) happens
C. (a) and (c) happens
D. (b) and (c) happens
The relation schemas R1 and R2 form a Lossless join decomposition of R
if and only if: 1 - R1 ∩ R2 ↠ (R1 - R2) 2 - R1 ∩ R2 ↠ (R2 - R1 ) For more
information on Lossless Decomposition option (C) is correct.
Question 317

A view of database that appears to an application program is known as


A. Schema
B. Subschema
C. Virtual table
D. None of these
A subschema is a subset of the schema and inherits the same property
that a schema has. The plan for a view is often called subschema.
Subschema refers to an application programmer's view of the data item
types and record types, which he or she uses. Option (B) is correct.
Question 318

Which operation is used to extract specified columns from a table?


A. Project
B. Join
C. Extract
D. Substitute
Projection (π) Projection is used to project required column data from a relation. By Default
projection removes duplicate data. Example :
R
(A B C)
----------
1 2 4
2 2 3
3 2 3
4 3 4
π (BC)
B C
-----
2 4
2 3
3 4
So, option (A) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 319

What kind of mechanism is to be taken into account for converting a weak


entity set into strong entity set in entity-relationship diagram?
A. Generalization
B. Aggregation
C. Specialization
D. Adding suitable attributes
Weak entity is an entity which does not have sufficient attributes to form a
primary key. Weak entity is represented by Double rectangle In an ER
Diagram. It must be in a 1:M relation. A member of a weak entity is called
a subordinate entity. For converting a weak entity set into strong entity set
in entity-relationship diagram by simply adding appropriate attributes. So,
option (D) is correct.
Question 320

Identify the minimal key for relational scheme R(A, B, C, D, E) with functional
dependencies F = {A → B, B → C, AC → D}
A. A
B. AE
C. BE
D. CE
A+ = ABCD But we can't derive E from A, so We have to add E i A I.e.
AE+ = ABCDE. So, option (B) is correct.
Question 321

How to express that some person keeps animals as pets?

Solution A
Question 322

In E-R model, Y is the dominant entity and X is subordinate entity


A. If X is deleted, then Y is also deleted
B. If Y is deleted, then X is also deleted
C. If Y is deleted, then X is not deleted
D. None of the above
If any changes occur in dominant entity then they are also reflected in
subordinate entity but not the vice versa. So, option (B) is correct.
Question 323

Immunity of the external schemas (or application programs) to changes in the


conceptual schema is referred to as:
A. Physical Data Independence
B. Logical Data Independence
C. Both (a) and (b)
D. None of the above
Immunity is when data at one layer is changed, it does not affect the data
at another level. Physical data independence:- if changes are made in the
physical storage of schema then it will not affect the logical schema of the
database. Logical data independence:- if any changes are made in the
conceptual schema then it will not affect external schema or the view level
of the database. So, option (B) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 324

In RDBMS, which type of Join returns all rows that satisfy the join condition?
A. Inner Join
B. Outer Join
C. Semi Join
D. Anti Join
In RDBMS, inner join returns all rows that satisfy the given join condition.
Option (A) is correct.
Question 325

A many-to-one relationship exists between entity sets r 1 and r 2 . How will it


be represented using functional dependencies if Pk(r) denotes the primary
key attribute of relation r ?
A. Pk(r1 ) → Pk(r 2)
B. Pk(r2 ) → Pk(r 1 )
C. Pk(r2 ) → Pk(r1 ) and Pk(r 1 ) → Pk(r 2 )
D. Pk(r 2 ) → Pk(r1 ) or Pk(r 1 ) → Pk(r 2)
A many to one relationship set exists between entity sets Employee and
Department. Let two relations R1(employee with pk empId)
R2(Department with pk DId) Here, empId can uniquely identify DId but DId
can not uniquely identify the empId. Hence, pk(R1) -> pk(R2)
Question 326

Let R1 (a, b, c) and R2 (x, y, z) be two relations in which a is the foreign key
of R1 that refers to the primary key of R2 . Consider following four options.
(a)Insert into R 1 (b)Insert into R 2 (c)Delete from R 1 (d)Delete from R 2
Which of the following is correct about the referential integrity constraint with
respect to above?
A. Operations (a) and (b) will cause violation.
B. Operations (b) and (c) will cause violation.
C. Operations (c) and (d) will cause violation.
D. Operations (d) and (a) will cause violation.
Let x is the primary key in R2(x, y, z) Insert into R1 - Can cause violation
because if we want to insert any value into a of R1, which is not in x of R2.
Insert into R2 - Can not cause violation Delete from R1 - Can not cause
violation. Delete from R2 - Can cause violation if we delete any value of x
in R2, then the value referred by a in R1 should also be deleted. Hence,
option (D) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 327

Which one of the following is used to represent the supporting many-one


relationships of a weak entity set in an entity-relationship diagram ?
A. Diamonds with double/bold border
B. Rectangles with double/bold border
C. Ovals with double/bold border
D. Ovals that contain underlined identifiers
According to Weak Entity Set in ER diagrams:The relation between one
strong and one weak entity is represented by double diamond. Option (A)
is correct.
Question 328

In a relational data model, which one of the following statements is TRUE?


A. A relation with only two attributes is always in BCNF.
B. If all attributes of a relation are prime attributes, then the relation is in
BCNF.
C. Every relation has at least one non-prime attribute
D. BCNF decompositions preserve functional dependencies
Option A: It is true to say that every binary relation is always in BCNF
Option B: This is false because it is not necessary to have a relation in
BCNF if all the attributes are prime attributes. For example, R(A, B, C)
with FD A -> C, B -> C, C -> A Here all the attributes are prime but it is not
in BCNF.
Option C: No, it is not necessary to have at least one non-prime attribute
in a relation
Option D: No, it is not necessary that every lossless BCNF decomposition
is dependency preserving
Question 329

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
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 AD, BD, ED and FD
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 330

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
A. in 1NF, but not in 2NF.
B. in 2NF, but not in 3NF.
C. in 3NF, but not in BCNF.
D. in BCNF
The table is not in 2nd Normal Form as the non-prime attributes are
dependent on subsets of candidate keys. The candidate keys are AD, BD,
ED and FD. In all of the following FDs, the non-prime attributes are
dependent on a partial candidate key. A -> BC B -> CFH F -> EG
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 331

Which option is true about the SQL query given below?


SELECT firstName, lastName
FROM Employee
WHERE lastName BETWEEN 'A%' AND 'D%';

A
It will display all the employees having last names starting with the alphabets 'A' till 'D' inclusive of A and
exclusive of D.
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'.
The BETWEEN operator works with the range of character values also.
Question 332

Which of the given options define a transaction correctly?


A
A transaction consists of DDL statements on the database schema.
B
A transaction consists of COMMIT or ROLLBACK in a database session.
C
A transaction consists of either a collection of DML statements or a DDL or
DCL or TCL statement to form a logical unit of work in a database session.
D
A transaction consists of collection of DML and DDL statements in different
sessions of the database.
A database transaction consists of one or more DML statements to
constitute one consistent change in data, or a DDL statement or a DCL
command (GRANT or REVOKE). It starts with the first DML statement and
ends with a DCL or DDL or TCL (COMMIT or ROLLBACK) command.
Note that DDL and DCL commands hold auto commit feature.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 333

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
D. All of the above
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 dependencies. Option (B) is
correct.
Question 334

Consider a database with the following schema:


Person ( name, age, gender )
name is a key
Frequents ( name, pizzeria )
(name, pizzeria) is a key
Eats ( name, pizza )
(name, pizza) is a key
Serves ( pizzeria, pizza, price )
(pizzeria, pizza) is a key

Relational algebra expression for query "Names of all people who frequent only pizzeria's serving at least one pizza they eat" is
Find names of all people who frequent only pizzerias serving at least one
pizza they eat :
Option (B) is correct.
Question 335

How many minimum relation tables are required which satisfy 1NF?

A
2, 2, and 1 respectively
B
2, 2, and 2 respectively
C
1, 2, and 1 respectively
D
1, 1, and 1 respectively
First ER model will required minimum number of two tables for 1NF with
{E2R}, and {E1}. "Many" side of the relation can be merged because it is
many to one relation and participation is partial both sides of the relation.
Second ER model will required minimum number of two tables for 1NF
with {E2R}, and {E1}. "One" side entity cannot be merged because it has
total participation in "many" side of the relationship and "one" side of the
relationship is participating partially. Third ER model will required
minimum number of 1 table if no redundancy is occurred. It is a many to
many relationship but total participation is here both sides of the
relationship. Therefore, (A) 2, 2, and 1 respectively is correct.
Question 336

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 →
email email → rollno
• Schema III: Registration (rollno, courseid, marks, grade) Non-trivial functional dependencies: rollno,
courseid, → marks, grade marks → grade
• Schema IV: Registration (rollno, courseid, credit) Non-trivial functional dependencies: rollno, courseid
→ credit courseid → 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
• 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
Since, rollno is primary key, so this relation is in BCNF as well as 3 NF.
• Schema II: Registration (rollno, coursid, email) Non-trivial functional dependencies: rollno,
courseid → email email → rollno Since, {rollno, coursid} is primary key so rollno and coursid are
prime attributes. email is non-prime attribute. Functional depedency (FD) rollno, courseid →
email is in BCNF and 3NF, but FD email → rollno violates the rule of BCNF because email is
not superkey. But it satisfies rule of 3 NF because rollno is prime-attribute. So, overall this
relation is in 3 NF but not in BCNF.
• Schema III: Registration (rollno, courseid, marks, grade) Non-trivial functional dependencies:
rollno, courseid, → marks, grade marks → grade Since rollno, courseid is primary key, so rollno
and courseid are prime attributes and marks and grade are non-prime attributes. FD rollno,
courseid, → marks, grade satisfies BCNF as well as 3 NF. FD marks → grade does not satifies
3 NF because neither marks is superkey nor grade is prime-attribute. So, aslo can not be in
BCNF. So, overall this relation is not in 3 NF and not in BCNF but it does not violates rule of 2
NF, so can be only in 2 NF.
• Schema IV: Registration (rollno, courseid, credit) Non-trivial functional dependencies: rollno,
courseid → credit courseid → credit Since, rollno, courseid is primary key, so rollno and
courseid are prime-attributes and credit is non-prime attribute. FD rollno, courseid → credit
satifies BCNF as well as 3 NF. FD courseid → credit violates rule of 2 NF, so can not be in
2NF. So, overall this is not in 2 NF, 3 NF, and BCNF. But it is only in 1 NF.
Therefore only schema-II is in 3 NF but not in BCNF. Option (B) is correct.
Question 337

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
Functional dependency is a constraint that describes the relationship
between attributes in a relation. Data integrity refers to the accuracy and
consistency of data stored in a database, data warehouse, data mart or
other construct. Referential integrity is a relational database concept,
which states that table relationships must always be consistent.
Normalization is a process of organizing the data in database to avoid
data redundancy, insertion anomaly, update anomaly & deletion anomaly.
1NF, 2NF, 3NF and BCNF are types of normal forms. So, option (D) is
correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 338

If every non-key attribute is functionally dependent on the primary key, then


the relation is in __________ .
A. First normal form
B. Second normal form
C. Third normal form
D. Fourth normal form
Conditions for various normal forms:
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-transitively 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 but not
in 3NF because of every non-key attribute is transitively dependent on the primary
key. Here {X} will be candidate key. So, option (B) is correct.
Question 339

Consider a schema R(A, B, C, D) and following functional dependencies.


A→B
B→C
C→D
D→B
Then decomposition of R into R1 (A, B), R2(B, C) and R3(B, D) is __________
.
A. Dependency preserving and lossless join.
B. Lossless join but not dependency preserving.
C. Dependency preserving but not lossless join.
D. Not dependency preserving and not lossless join.
Schema R(A, B, C, D) is decomposed into three relation → R1 (A, B),
R2(B, C) and R3(B, D) Now dependencies derived 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 All the
dependencies are preserved and it is a lossless decomposition. So, option
(A) is correct.
Question 340

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
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 341

Consider a schema R(MNPQ) and functional dependencies M → N, P → Q.


Then the decomposition of R into R1 (MN) and R2(PQ) is________.
A. Dependency preserving but not lossless join
B. Dependency preserving and lossless join
C. Lossless join but not dependency preserving
D. Neither dependency preserving nor lossless join.
Schema R(MNPQ) is decomposed into R1(MN) M → N is preserved and
R2(PQ) P → Q is also preserved, dependency will be preserved and there
will be no loss of any dependency. So, option (A) is correct.
Question 342

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
_______.
A. First normal form but not in second normal form.
B. Both in first normal form as well as in second normal form.
C. Second normal form but not in third normal form.
D. Both in second normal form as well as in third normal form.
A relation is in first normal form if every attribute in that relation is single
valued attribute. It is in 1NF. {A,B} are prime 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.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 343

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
Functional Dependencies of R = C->F, E->A, EC->D, A->B Through the
attributes C and E, we get all other attributes present in R. So, EC is the
key of R
Question 344

DBMS provides the facility of accessing data from a database through


A. DDL
B. DML
C. DBA
D. Schema
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, insertion and updation of data in a
database. Examples of DML: SELECT, INSERT, UPDATE, DELETE. 2- DDL - Data Definition
Language - This commands in SQL includes the creation, deletion and modification of
structure of database objects. Examples of DDL commands: CREATE, DROP, ALTER,
TRUNCATE, COMMENT, RENAME. It provides the facility of accessing data from a
database. 3- Functions of a DBA include: Schema definition, Storage structure and access-
method definition, Schema and physical-organization modification, Granting of authorization
for data access, Routine maintenance. 4- Schema: The term "schema" refers to the
organization of data as a blueprint of how the database is constructed (divided into database
tables in the case of relational databases). The formal definition of a database schema is a
set of formulas (sentences) called integrity constraints imposed on a database. So, option (A)
is correct.
Question 345

Consider a database table R with attributes A and B. Which of the following


SQL queries is illegal ?
A
SELECT A FROM R;
B
SELECT A, COUNT(*) FROM R;
C
SELECT A, COUNT(*) FROM R GROUP BY A;
D
SELECT A, B, COUNT(*) FROM R GROUP BY A, B;
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 346

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?
A. Preserves dependency but cannot perform lossless join
B. Preserves dependency and performs lossless join
C. Does not perform dependency and cannot perform lossless join
D. Does not preserve dependency but perform lossless join
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)+,where 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 and 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.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 347

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.
A. II and III only
B. I and IV only
C. I, II, and III only
D. I, III and IV only
• An OODBMS avoids the “impedance mismatch” problem.Correct.
• An OODBMS doesn't avoids the “phantom” problem.
• An OODBMS doesn't provides higher performance concurrency control
than most relational databases. Since it is distributed.
• An OODBMS provides faster access to individual data objects once they
have been read from disk.Correct
SO, option (B) is correct.
Question 348

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?
A
{x,y} and {a,b}
B
{x} and {a,b}
C
{x,y,z} and {a,b,c}
D
{z} and {c}
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 349
Which one of the following pairs is correctly matched in the context of
database design?
• Result of taking a subset of a higher-level entity set to form a lower-level
entity set is Specialization
• Result of taking the union of two or more disjoint(lower-level) entity sets
to produce a higher-level entity set is Generalization
• An abstraction in which relationship sets (along with their associated
entity sets) are treated as higher-level entity sets, and can participate in
relationships.Aggregation
• Express the number of entities to which another entity can be associated
via a relationship set Mapping cardinalities
So, option (D) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 350

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
• In RDBMS, the constraint that no key attribute (column) may be NULL is
referred to as Entity Integrity
• Referential integrity states that table relationships must always be
consistent.
• Multi-valued dependencies 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.
So, option (C) is correct.
Question 351

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
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 352

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
A
First Normal Form
B
Second Normal Form
C
Third Normal Form
D
BCNF
Candidate key = ISBN For a relation having functional dependencies of
the form α → β, a relation is in 2-NF if: i) α should 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 353

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:
A
Select * from customers where city = ‘%GAR%’;
B
Select * from customers where city = ‘$GAR$’;
C
Select * from customers where city like ‘%GAR%’;
D
Select * from customers where city as ‘%GAR’;
Solution C
Question 354

Data which improves the performance and accessibility of the database are
called:
A. Indexes
B. User Data
C. Application Metadata
D. Data Dictionary
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 355

Which type of DBMS provides support for maintaining several versions of the same entity?
A
Relational Database Management System
B
Hierarchical
C
Object Oriented Database Management System
D
Network
Object Oriented Database Management Systems allow object-oriented
programmers to develop the product, store them as objects, and replicate
or modify existing objects to make new objects within the OODBMS.
Option (C) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 356

Which normal form is based on the concept of 'full functional dependency'?


A
First Normal Form
B
Second Normal Form
C
Third Normal Form
D
Fourth Normal Form
A full functional dependency is a state of database normalization similar to
Second Normal Form (2NF). It means that the schema should meet the
requirements of First Normal Form (1NF), and all non-key attributes are
fully functionally dependent on the primary key and partial dependency on
the candidate key should not exist. So, Option (B) is correct.
Question 357

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
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 dominate.
i.e. check(two >= 1 and <= 5) 5 tuples.
So, option (A) is correct.
Question 358

Purpose of 'Foreign Key' in a table is to ensure


A. Null Integrity
B. Referential Integrity
C. Domain Integrity
D. Null and Domain Integrity
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 or parent table. Although there may be exceptions,
the values in the foreign key columns usually must correspond to values
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 359

Select the 'False' statement from the following statements about Normal
Forms:
A. Lossless preserving decomposition into 3NF is always possible
B. Lossless preserving decomposition into BCNF is always possible
C. Any Relation with two attributes is in BCNF
D. BCNF is stronger than 3NF
Lossless preserving decomposition into 3NF is always possible. True
Lossless preserving decomposition into BCNF is always possible. False
Not always possible.
Any Relation with two attributes is in BCNF. True
BCNF is stronger than 3NF. True
For more information on Normal form
Option (B) is correct.
Question 360

The Relation Vendor Order (V_no, V_ord_no, V_name, Qty_sup, unit_price)


is in 2NF because:
A. Non_key attribute V_name is dependent on V_no which is part of
composite key
B. Non_key attribute V_name is dependent on Qty_sup
C. Key attribute Qty_sup is dependent on primary_key unit price
D. Key attribute V_ord_no is dependent on primary_key unit price
The Relation Vendor Order (V_no, V_ord_no, V_name, Qty_sup,
unit_price) is in 2NF because: Non_key attribute V_name is dependent on
V_no which is part of composite key. For more information on Normal
forms
Option (A) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 361

BCNF is not used for cases where a relation has


A. Two (or more) candidate keys
B. Two candidate keys and composite
C. The candidate key overlap
D. Two mutually exclusive foreign keys
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 CK.
Option (D) is correct.
Question 362

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
A. Boyce-Codd Normal form
B. Third Normal form
C. Second Normal form
D. First Normal form
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 correct.
Question 363

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
The attribute closures of A: A+ = ABCD The attribute closures of E: E+ =
E. So, option (B) is correct.
Question 364

Which of the following is false?


A. Every binary relation is never be in BCNF.
B. Every BCNF relation is in 3NF.
C. 1 NF, 2 NF, 3 NF and BCNF are based on functional dependencies.
D. Multivalued Dependency (MVD) is a special case of Join Dependency
(JD).
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.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 365

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
A. First normal form but not in second normal form
B. Second normal form but not in third normal form
C. Third normal form
D. None of the above
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 (partial dependency) must not present in
2NF. And every relation is already in 1NF. Option (A) is correct.
Question 366

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
B. X is not functionally dependent on any subset of Y
C. Both (a) and (b)
D. None of these
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 conditions are satisfied:
i) X is functionally dependent on Y and
ii) X is not functionally dependent on any
subset of Y.

Example: In relation StuGrade:


{stud_id, course_id, course_name} -> {course_grade}
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_id, course_id, course_name}, namely, {stud_id,
course_id}, to determine the course_grade Thus, the correct full functional dependency
can be written as:
{stud_id, course_id} -> {course_grade}
So, option (C) is correct.
Question 367

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
Here candidate Key is A and B -> C , C -> D , D -> E all are. (Non prime
attribute -> Non prime attribute.). This type of FD must not be present in
3NF therefore highest normal form of this FDs are 2NF. Option (B) is
correct.
Question 368

Relations produced from E - R Model will always be in ________.


A. 1 NF
B. 2 NF
C. 3 NF
D. 4 NF
As we know that every table is already in 1NF. and relations produced
from E – R Model will always be a table which is in 1Nf. Hence (A) is
correct.
Question 369

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
_________.
A. First normal form but not in second normal form
B. Second normal form but not in third normal form
C. Third normal form
D. BCNF

Solution A
Question 370

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?
A. PS → T
B. R → T
C. P → R
D. PS → Q
Answer: (A) (C) (D)

Explanation:
P-> QR
RS-> T
From P->QR we derived P->Q and P->R.
After getting R from P we derive PS->T .
We directly derive Q from P so PS->Q also holds true.
Correct Option A , C, D
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.
Question 371

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?
A
Both S1 and S2 are true
B
S1 is true and S2 is false
C
S1 is false and S2 is true
D
Both S1 and S2 are false
• 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 372

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
D. A cell in R holds a set instead of an atomic value

Solution A
Question 373

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
Probability of first condition satisfies, P(A) = 10/15 Probability of second
condition satisfies, P(B) = 1/20 Probability of both condition satisfy,
P(A∩B) = 10/15*1/20 Because of independent. So, either first or second
condition satisfy P(A∪B) = P(A) + P(B) - P(A∩B) = 10/15 + 1/20 -
10/15*1/20 = 0.6833 Therefore, estimated number of tuples in the output,
= 1200*0.6833 = 820
Question 374

Which commands are used to control access over objects in relational


database?
A. CASCADE & MVD
B. GRANT & REVOKE
C. QUE & QUIST
D. None of these
DCL(Data Control Language) includes commands such as GRANT and
REVOKE which mainly deals with the rights, permissions and other
controls of the database system. Examples of DCL commands: GRANT-
gives user’s access privileges to database. REVOKE-withdraw user’s
access privileges given by using the GRANT command
Option (B) is correct.
Download Exampreptool ( EPT App)

https://play.google.com/store/apps/details?id=com.ept.requestteacher

For important Questions & Answers with video solutions

(Prepared by rankers: Hymavati Ratul Soumya Divyanshu)

Note: If any doubt in any question post with subject & question number in EPT App.

You might also like