Explore topic-wise MCQs in Database.

This section includes 125 Mcqs, each offering curated multiple-choice questions to sharpen your Database knowledge and support exam preparation. Choose a topic below to get started.

51.

Let R and S be relational schemas such that R = {a, b, c} and S = {c}. Now consider the following queries on the database:
1. R - S - R - S ( R - S(r) S - r - S , S (r))
2. { t | t R - S(r) u s ( v r ( u = v[s] t = v[ R - S ] ) ) }
3. { t | t R - S(r) u s ( u s ( u = v[s] t = v[ R - S ] ) ) }
4. Select R.a, R. b
From R, S
Where R.c = S.c
Which of the above queries are equivalent?

A. 1 and 2
B. 1 and 3
C. 2 and 4
D. 3 and 4
Answer» D. 3 and 4
52.

Consider a relational table with a single record for each registered student with the following attributes:
1. Registration_Number: Unique registration number for each registered student
2. UID: Unique Identity Number, unique at the national level for each citizen
3. Bank Account_Number: unique account number at the bank. A student can have multiple accounts or joint accounts. This attributes stores the primary account number
4. Name: Name of the Student
5. Hostel_Room: Room number of the hostel
Which of the following options is incorrect?

A. Bank Account_Number is a candidate key
B. Registration Account_Number can be primary key
C. UID is a 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 super key
Answer» B. Registration Account_Number can be primary key
53.

Consider the relation Student (Name, sex, marks), where the primary key is shown underlined, pertaining to students in a class that has at least one boy and one girl. What does the following relational algebra expression produce?
(Note: p is the rename operator)
name (rsex female (student)) - name (studentsex Po , x , m

A. names of girl students with the highest marks
B. names of girl students with more marks than some boy student
C. names of girl students with marks not less than some boy student
D. names of girl students with more marks than all the boy students
Answer» E.
54.

Consider the following relational schema pertaining to a student s database:
Students (Rollno., name, address)
Enroll (Rollno., Courseno., coursename)
Where the primary keys are shown underlined. The numbers of tuples in the student and Enroll tables are 120 and 8 respectively. What are the maximum and minimum numbers 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» B. 120, 8
55.

Let r be a rational 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 = r
C. r s
D. r * s = s
Answer» D. r * s = s
56.

Which of the following statements are true about an SQL query?

A. P and R
B. P and S
C. Q and R
D. Q and S
Answer» D. Q and S
57.

Consider the following log sequence of two transactions on a bank account, with initial balance 12000, that transfer 2000 to a mortagage payment and then apply a 5% interest.

A. We must redo log record 6 to set B to 10500
B. We must redo log record 6 to set B to 10000 and the redo log records 2 and 3.
C. We need not redo log records 2 and 3 because transaction T1 has committed
D. We can apply redo and undo operations in arbitrary order because they are idempotent
Answer» C. We need not redo log records 2 and 3 because transaction T1 has committed
58.

Let E

A. 2
B. 3
C. 4
D. 5
Answer» C. 4
59.

Consider the relation

A. Names of employees with a male supervisor
B. Names of employees with no immediate male subordinates
C. Names of employees with no immediate female subordinates
D. Names of employees with a female supervisor
Answer» D. Names of employees with a female supervisor
60.

Information about a collection of students is given by the relation

A. Courses in which all the female students are enrolled
B. Courses in which a proper subset of female students are enrolled
C. Courses in which only male students are enrolled
D. None of the above
Answer» C. Courses in which only male students are enrolled
61.

Let R and S be two relations with the following schemas.

A. 1 and 2
B. 1 and 3
C. 1, 2 and 3
D. 1, 3 and 4
Answer» E.
62.

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

A. 1 and 2
B. 1 and 3
C. 2 and 4
D. 3 and 4
Answer» D. 3 and 4
63.

Consider a join (relation algebra) between relations r (R)and s (S) using the nested loop method. There are 3 buffers each of size equal to disk block size, out of which one buffer is reserved for intermediate results. Assuming size (r (R))< size(s (S)), the join will have fewer number of disk block accesses if

A. relation r (R) is in the outer loop.
B. relation s (S) is in the outer loop.
C. join selection factor between r (R) and s (S) is more than 0.5.
D. join selection factor between r (R) and s (S) is less than 0.5.
Answer» B. relation s (S) is in the outer loop.
64.

Consider two relations R

A. R contains a, b, e, f, g but not c, d.
B. R contains all of a, b, c, d, e, f, g.
C. R contains e, f, g but not a, b.
D. R contains e but not f, g.
Answer» D. R contains e but not f, g.
65.

Which of the following is NOT a superkey in a relational schema with attributes V,W, X, Y, Z and primary key V Y?

A. VXYZ
B. VWXZ
C. VWXY
D. VWXYZ
Answer» C. VWXY
66.

Which one of the following is not logically equivalent to x ( y ( ) z ( ) ) ?

A. x ( z ( ) y ( ) )
B. x ( z ( ) y ( ) )
C. x ( y ( ) z ( ) )
D. x ( y ( ) z ( ) )
Answer» B. x ( z ( ) y ( ) )
67.

The minimum number of tables needed to represent M, N, P, R

A. 2
B. 3
C. 4
D. 5
Answer» C. 4
68.

Consider a relation geq which represents greater than or equal to , that is, (x, y) geq only if y x.

A. A tupel (z, w) with z > y is deleted
B. A tuple (z, w) with z > x is deleted
C. A tuple (z, w) with w < x is deleted
D. The deletion of (x, y) is prohibited
Answer» D. The deletion of (x, y) is prohibited
69.

SQL allows duplicate tuples in relations, and correspondingly defines the multiplicity of tuples in the result of joins. Which one of the following queries always gives the same answer as the nested query shown below :

A. select distinct R.* from R, S where R.a = S.a
B. select R.* from R, (select distinct a from S) as S1
C. where R.a = S1.a
D. select R.* from R,S where R.a = S.a and is unique R
Answer» D. select R.* from R,S where R.a = S.a and is unique R
70.

Suppose the adjacency relation of vertices in a graph is represented in a table Adj (X, Y). Which of the following queries cannot be expressed by a relational algebra expression of constant length?

A. List of all vertices adjacent to a given vertex
B. List of all vertices which have self loops
C. List of all vertices which belong to cycles of less than three vertices
D. List of all vertices reachable from a given vertex
Answer» E.
71.

Consider the following relation

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) form Cinema P2)
D. WHERE P1. capacity > Any (select max (P2. capacity) from Cinema P2)
Answer» B. WHERE P1. capacity >= Any (select P2. capacity from Cinema P2)
72.

Given relations r(w, x) and s(y, z), the result of select distinct w, x from r, s is guaranteed to be same as r, provided

A. r has no duplicates and s is non-empty
B. r and s have no duplicates
C. s has no duplicates and r is non-empty
D. r and s have the same number of tuples
Answer» B. r and s have no duplicates
73.

Database table by name Loan_Records is given below.

A. 3
B. 9
C. 5
D.
E. 6
Answer» D.
74.

How many tuples does the result of the following SQL query contain?

A. 4
B. 3
C. 0
D. 1
Answer» C. 0
75.

How many tuples does the result of the following relational algebra expression contain? Assume that the schema of A B is the same as that of A.

A. 7
B. 4
C. 5
D. 9
Answer» B. 4
76.

Assume that, in the suppliers relation above, each supplier and each street within a city has a unique name, and (sname, city) forms a candidate key. No other functional dependencies are implied other than those implied by primary and candidate keys. Which one of the following is true about the above schema?

A. The schema is in BCNF
B. The schema is in 3NF but not in BCNF
C. The schema is in 2NF but not in 3NF
D. The schema is not in 2NF
Answer» B. The schema is in 3NF but not in BCNF
77.

Consider the following relational query on the above database :

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
Answer» B. Find the names of all suppliers who have not supplied a non-blue part
78.

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 M

A. 127
B. 255
C. 190
D. 257
Answer» B. 255
79.

The employee information in a company is stored in the relation

A. the average salary is more than the average salary in the company
B. the average salary of male employees is more than the average salary of all male employees in the company the
C. average salary of male employees is more than the average salary of employees in the same department
D. the average salary of male employees is more than the average salary in the company
Answer» E.
80.

The relation

A. Title of four most expensive book
B. Title of fifth most inexpensive book
C. Titles of fifth most expensive book
D. Titles of five most expensive book
Answer» E.
81.

Consider the set of relations shown below and the SQL query that follows:

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» D. None of the above
82.

Consider the following relational schemas for a library database:

A. Both Book and Collection are in BCNF
B. Both Book and Collection are in 3 NF only
C. Book is in 2 NF and Collection is in 3 NF
D. Both Book and Collection are in 2 NF only
Answer» D. Both Book and Collection are in 2 NF only
83.

The following functional dependencies hold for relations R(A, B, C) and S(B, D, E)

A. 100
B. 200
C. 300
D. 2000
Answer» B. 200
84.

Consider a relational schema 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» E.
85.

R(A, B, C, D) is a relation. Which of the following does not have a lossless join, dependency preserving BCNF decomposition?

A. A B, B CD
B. A B, B C, C D
C. AB C, C AD
D. A BCD
Answer» D. A BCD
86.

Consider the following functional dependencies in a database:

A. in second normal form but not in third normal form
B. in third normal form but not in BCNF
C. in BCNF
D. none of the above
Answer» E.
87.

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 of 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. indetermine
Answer» B. more than zero but less than that of an equivalent 3NF decomposition
88.

Relation R is decomposed using a set of functional dependencies F, and relation S is decomposed using another set of functional dependencies G. One decomposition is definitely BCNF, the other is definitely 3NF, but it is not known which is to make a guaranteed identification, which one of the following tests should be used on the deocmpositions? (Assume that the closures of F and G are available).

A. Dependency-preservation
B. Lossless-join
C. BCNF definition
D. 3NF definition
Answer» D. 3NF definition
89.

Given the following statements: S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL. S2: Given the table R(a,b,c) where a and b together form the primary key, the following is a valid table definition.

A. S1 is TRUE and S2 is FALSE.
B. Both S1 and S2 are TRUE.
C. S1 is FALSE and S2 is TRUE.
D. Both S1 and S2 are FALSE.
Answer» E.
90.

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.

A. {E, F}
B. {E, F, H}
C. {E, F, H, K, L}
D. {E}
Answer» C. {E, F, H, K, L}
91.

Given the following schema: employees (emp-id, first-name, last-name, hire-date, deptid, salary)

A. It executes but does not give the correct result.
B. It executes and gives the correct result.
C. It generates an error because of pairwise comparison.
D. It generates an error because the GROUP BY clause cannot be used with table joins in a subquery.
Answer» C. It generates an error because of pairwise comparison.
92.

The relational schema Student Performance (name, coureNo., rollNo., grade) has the following functional dependencies

A. 2NF
B. 3NF
C. BCNF
D. 4NF
Answer» C. BCNF
93.

In a database system, unique timestamps are assigned to each transaction using Lamport s logical clock. Let TS( T1) and TS(T2) be the timestamps of transactions T1 and T2 respectively. Besides, T1 holds a lock on the resource R and T2 has requested a conflicting lock on the same resource R. The following algorithm is used to prevent deadlocks in the database system assuming that a killed transaction is restarted with the same timestamp.

A. The database system is both deadlock-free and starvation-free.
B. The database system is deadlock-free, but not starvation-free.
C. The database system is starvation-free, but not deadlock-free.
D. The database system is neither deadlock-free nor starvation-free.
Answer» B. The database system is deadlock-free, but not starvation-free.
94.

A B

A. 16
B. 42
C. 43
D. 44
Answer» D. 44
95.

Consider a B

A. 1
B. 2
C. 3
D. 4
Answer» C. 3
96.

In the index allocation scheme of blocks to a file, the maximum possible size of the file depends on

A. the size of the blocks, and the size of the address of the blocks
B. the number of blocks used for the index and the size of the blocks
C. the size of the blocks, the number of blocks used for the index and the size of the address of the blocks
D. None of the above
Answer» C. the size of the blocks, the number of blocks used for the index and the size of the address of the blocks
97.

Consider a relational table r with sufficient number of records, having attributes A

A. Only a
B. Only b
C. Both a and b
D. None of the above
Answer» D. None of the above
98.

Which one of the following is a key factor for preferring B+ trees to binary search trees for indexing database relations?

A. Database relations have a large number of records
B. Database relations are sorted on the primary key
C.
D. B+ trees require less memory than binary search trees
E. Data transfer from disks is in blocks
Answer» E. Data transfer from disks is in blocks
99.

The order of a leaf node in a B

A. 63
B. 64
C. 67
D. 68
Answer» B. 64
100.

Consider the transactions T1, T2, and T3 and the schedules S1 and S2 given below.

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» B. Only S2 is conflict-serializable.