Dbms MCQ
Dbms MCQ
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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?
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?
Answer: (B)
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: 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
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)
(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)
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.
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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:
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.
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 17
Answer: (C)
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
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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:
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.
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.
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.
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:
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
Note: If any doubt in any question post with subject & question number in EPT App.
Question 28
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)
Candidate Key.
A) {EF}+ = {EFGIJ} ≠ R(The given relation)
D) {E}+ = {E} ≠ R
Solution B
Question 33
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 34
(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)
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)
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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)
• 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.
(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
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.).
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
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
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.
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:
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
• 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
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.
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.
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)
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
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
(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
So answer is B
Download Exampreptool ( EPT App)
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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)
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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)
D) {E}+ = {E} ≠ R
Solution B
Question 62
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 63
(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
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)
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)
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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)
• 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.
(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
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.).
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
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
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.
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:
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
• 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.
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.
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
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)
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
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
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
(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)
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
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
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.
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)
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: 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
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)
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 <= 51
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
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.
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
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)
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 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
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)
Let R and S be relational schemes such that R={a,b,c} and S={c}. Now consider the
following queries on the database:
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?
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
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.
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
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
Note: If any doubt in any question post with subject & question number in EPT App.
Question 117
(b)
select Dept-no, count(*)
from EMP where salary > 100000
group by Dept-no
Question 119
(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
Note: If any doubt in any question post with subject & question number in EPT App.
Question 121
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)
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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.
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 128
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:
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
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)
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)
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
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 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)
Let R and S be relational schemes such that R={a,b,c} and S={c}. Now consider the
following queries on the database:
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
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?
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.
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:
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
Note: If any doubt in any question post with subject & question number in EPT App.
Question 148
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: 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
Note: If any doubt in any question post with subject & question number in EPT App.
Question 151
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 158
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
Option B:
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 “
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 161
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:
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 165
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
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.
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
Note: If any doubt in any question post with subject & question number in EPT App.
Question 172
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)
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
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"
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.
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 176
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
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:
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.
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
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
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
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
Note: If any doubt in any question post with subject & question number in EPT App.
Question 187
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 192
Solution B
Question 193
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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?
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
Note: If any doubt in any question post with subject & question number in EPT App.
Question 200
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 211
Solution C
Question 212
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 216
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 218
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 220
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
Note: If any doubt in any question post with subject & question number in EPT App.
Question 222
Solution A
Question 223
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 229
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
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
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
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 240
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 246
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
Note: If any doubt in any question post with subject & question number in EPT App.
Question 249
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
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 262
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 265
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 268
Solution A
Download Exampreptool ( EPT App)
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 271
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
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"
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.
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
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:
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.
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
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
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 288
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
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 292
Solution B
Question 193
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 295
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
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?
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
Solution A
Question 307
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
Note: If any doubt in any question post with subject & question number in EPT App.
Question 309
Solution C
Download Exampreptool ( EPT App)
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 312
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 319
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
Solution A
Question 322
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
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
Note: If any doubt in any question post with subject & question number in EPT App.
Question 327
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
Note: If any doubt in any question post with subject & question number in EPT App.
Question 331
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 338
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 343
https://play.google.com/store/apps/details?id=com.ept.requestteacher
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 350
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
Note: If any doubt in any question post with subject & question number in EPT App.
Question 356
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
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 361
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.
Question 365
Solution A
Question 370
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
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
https://play.google.com/store/apps/details?id=com.ept.requestteacher
Note: If any doubt in any question post with subject & question number in EPT App.