

MCQOPTIONS
Saved Bookmarks
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.
1. |
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 | |
2. |
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 | |
3. |
Which of the following concurrency control protocols ensure both conflict serializability and freedom from deadlock ?
|
A. | 1 only |
B. | 2 only |
C. | Both 1 and 2 |
D. | Neither 1 nor 2 |
Answer» C. Both 1 and 2 | |
4. |
Consider the following transactions with data items P and Q initialized to zero :
|
A. | a serializable schedule |
B. | a schedule that is not conflict serializable |
C. | a conflict serializable schedule |
D. | a schedule for which a precedence graph cannot be drawn |
Answer» C. a conflict serializable schedule | |
5. |
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. | |
6. |
Consider a simple checkpointing protocol and the following set of operations in the log.
|
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» B. Undo: T3, T1; Redo: T2, T4 | |
7. |
Consider the following transaction involving two bank accounts x and y.
|
A. | Atomicity |
B. | Consistency |
C. | Isolation |
D. | Durability |
Answer» C. Isolation | |
8. |
Consider the following database schedule with two transactions, T1 and T2.
|
A. | S is non-recoverable |
B. | S is recoverable, but has a cascading abort |
C. | S does not have a cascading abort |
D. | S is strict |
Answer» D. S is strict | |
9. |
Suppose a database schedule S involves transactions T1, ...., Tn. Construct the precedence graph of S with vertices representing the transactions and edges representing the conflicts. If S is serializable, which one of the following orderings of the vertices of the precedence graph is guaranteed to yield a serial schedule? |
A. | Topological order |
B. | Depth-first order |
C. | Breadth-first order |
D. | Ascending order of transaction indices |
Answer» B. Depth-first order | |
10. |
Consider the following database table named top_scorer.
Consider the following SQL query: SELECT ta.player FROM top_scorer AS ta WHERE ta.goals >ALL (SELECT tb.goals FROM top_scorer AS tb WHERE tb.country = Spain ) AND ta.goals >ANY (SELECT tc.goals FROM top_scorer AS tc WHERE tc.country = Germany ) The number of tuples returned by the above SQL query is ________. |
||||||||||||||||||||||||||||||||||||||||||
A. | 21 | ||||||||||||||||||||||||||||||||||||||||||
B. | 7 | ||||||||||||||||||||||||||||||||||||||||||
C. | 0 | ||||||||||||||||||||||||||||||||||||||||||
D. | 3 | ||||||||||||||||||||||||||||||||||||||||||
Answer» C. 0 | |||||||||||||||||||||||||||||||||||||||||||
11. |
Two transactions T1 and T2 are given as
|
A. | 27 |
B. | 23 |
C. | 54 |
D. | 45 |
Answer» D. 45 | |
12. |
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. | |
13. |
B+ trees are preferred to binary trees in databases because |
A. | disk capacities are greater than memory capacities |
B. | disk access is much slower than memory access |
C. | disk data transfer rates are much less than memory data transfer rates |
D. | disks are more reliable than memory |
Answer» C. disk data transfer rates are much less than memory data transfer rates | |
14. |
A B+ tree index is to be built on the name attribute of the relation STUDENT. Assume that all student names are of length 8 byte, disk blocks are of size 512 byte and index pointers are of size 4 byte. Given this scenario, what would be the best choice of the degree (i.e., the number of pointers per node) of the B+ tree? |
A. | 16 |
B. | 42 |
C. | 43 |
D. | 44 |
Answer» D. 44 | |
15. |
The order of an internal node in a B+ tree index is the maximum number of children it can have. Suppose that a child pointer takes 6 byte, the search field value takes 14 byte, and the block size is 512 byte. What is the order of the internal node? |
A. | 24 |
B. | 25 |
C. | 26 |
D. | 27 |
Answer» D. 27 | |
16. |
The order of a leaf node in a B+ tree is the maximum number of (value, data record pointer) pairs it can hold. Given that the block size is 1 kbyte, data record pointer is 7 byte long, the value field is 9 byte long and a block pointer is 6 byte long, what is the order of the leaf node? |
A. | 63 |
B. | 64 |
C. | 67 |
D. | 68 |
Answer» B. 64 | |
17. |
The following key values are inserted into a B+ tree in which 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 that can be stored in it. The B+ tree is initially empty.
|
A. | 32 |
B. | 3 |
C. | 4 |
D. | 5 |
Answer» B. 3 | |
18. |
Consider a B+ tree in which the maximum number of keys in a node is 5. What is the minimum number of keys in any nonroot node? |
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 |
Answer» C. 3 | |
19. |
Consider a relational table r with sufficient number of records, having attributes A1, A2,... An, let 1 p n . Two queries Q1 and Q2 are given below.
|
A. | Only a |
B. | Only b |
C. | Both a and b |
D. | None of the above |
Answer» D. None of the above | |
20. |
Given the following relation instance |
X | Y | Z |
1 | 4 | 2 |
1 | 5 | 3 |
1 | 6 | 3 |
3 | 2 | 2 |
21. |
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. | |
22. |
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 | |
23. |
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 | |
24. |
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 | |
25. |
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} | |
26. |
Given the following two statements:
|
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» B. Both S1 and S2 are TRUE. | |
27. |
A database of research articles in a journal uses the following schema.
|
A. | 1NF |
B. | 2NF |
C. | 3NF |
D. | BCNF |
Answer» C. 3NF | |
28. |
Consider a bank database with only one relation transaction (transno, acctno, data, amount) The amount attribute value is positive for deposits and negative for withdrawals.
|
A. | Only a |
B. | only b |
C. | Both a and b |
D. | None of the above |
Answer» B. only b | |
29. |
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 | |
30. |
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. | |
31. |
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 | |
32. |
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 + 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 the carried out?
|
A. | 127 |
B. | 255 |
C. | 190 |
D. | 257 |
Answer» B. 255 | |
33. |
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?
|
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. | |
34. |
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 | |
35. |
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. | |
36. |
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. | |
37. |
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 | |
38. |
Database table by name Loan_Records is given below.
What is the output of the following SQL query ? SELECT count (*) FROM( (SELECT Borrower. Bank_Manager FROM Loan_ Records) AS S NATURAL JOIN (SELECT Bank_Manager, Loan_Amount FROM Loan_Records) AS T ); |
||||||||||||
A. | 3 | ||||||||||||
B. | 9 | ||||||||||||
C. | 5 | ||||||||||||
D. | |||||||||||||
E. | 6 | ||||||||||||
Answer» D. | |||||||||||||
39. |
How many tuples does the result of the following SQL query contain?
|
A. | 4 |
B. | 3 |
C. | 0 |
D. | 1 |
Answer» C. 0 | |
40. |
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) | |
41. |
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 | |
42. |
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 of which is the key attribute. E3 has two singlevalued attributes a31 and a32 of which a31 is the key attribute. The relationships do not have any attributes. If a relational model is the derived from the above ER model, then the minimum number of relations that would be generated if all the relations are in 3NF is _______. |
A. | 21 |
B. | 5 |
C. | 7 |
D. | 0 |
Answer» C. 7 | |
43. |
Let E1 and E2 be two entities in an E/R diagram with simple single valued attributes. R1 and R2 are two relationship between E1 and E2, where R1 is one-to-many and R2 is manyto-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» C. 4 | |
44. |
The minimum number of tables needed to represent M, N, P, R1, R2 is |
A. | 2 |
B. | 3 |
C. | 4 |
D. | 5 |
Answer» C. 4 | |
45. |
Consider two relations R1 (A,B) with the tuples(1, 5), (3, 7) and R2 (A, C) = (1, 7), (4, 9). Assume that R(A,B,C) is the full natural outer join of R1 and R2 . Consider the following tuples of the form (A, B, C): a = (1, 5, null), b = (1, null, 7), c = (3, null, 9), d = (4, 7, null), e = (1, 5, 7), f = (3, 7, null), g = (4, null, 9). Which one of the following statements is correct? |
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. | |
46. |
Consider a database that has the relation schemas EMP(EmpId, EmpName, DeptId), and DEPT(DeptName, DeptId). Note that the DeptId can be permitted to be NULL in the relation EMP. Consider the following queries on the database expressed in tuple relational calculus.
|
A. | (I) and (II) only |
B. | (I) and (III) only |
C. | (II) and (III) only |
D. | (I), (II) and (III) |
Answer» E. | |
47. |
Consider the relational schema given below, where eId of the relation dependent is a foreign key referring to empId of the relation employee. Assume that every employee has at least one associated dependent in the dependent relation. employee (empId, empName, empAge) dependent(depId, eId, depName, depAge) Consider the following relational algebra query :
|
A. | some dependent. |
B. | all dependents. |
C. | some of his/her dependents. |
D. | all of his/her dependents. |
Answer» E. | |
48. |
Consider the relation employee (name, sex, supervisorName) with name as the key. supervisorName gives the name of the supervisor of the employee under consideration. What does the following tuple relational calculus query produce?
|
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 | |
49. |
Information about a collection of students is given by the relation studinfo (studld, name, sex). The relation enroll (studld, courseld) gives which student has enrolled for (or taken) what course(s). Assume that every course is taken by at least one male and at least one female student. What does the following relational algebra expression represent?
|
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 | |
50. |
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. | |