• Tutorials
  • Courses
  • Tracks

50 DBMS MCQs with Answers

Last Updated :
Discuss
Comments

Question 1

Consider the following transactions with data items P and Q initialized to zero:

T1: read (P) ;
read (Q) ;
if P = 0 then Q : = Q + 1 ;
write (Q) ;
T2: read (Q) ;
read (P) ;
if Q = 0 then P : = P + 1 ;
write (P) ;

Any non-serial interleaving of T1 and T2 for concurrent execution leads to

  • A serializable schedule

  • A schedule that is not conflict serializable

  • A conflict serializable schedule

  • A schedule for which a precedence graph cannot be drawn

Question 2

Table A
Id Name Age
----------------
12 Arun 60
15 Shreya 24
99 Rohit 11


Table B
Id Name Age
----------------
15 Shreya 24
25 Hari 40
98 Rohit 20
99 Rohit 11


Table C
Id Phone Area
-----------------
10 2200 02
99 2100 01

Consider the above tables A, B and C. How many tuples does the result of the following SQL query contains?

SELECT A.id 
FROM A
WHERE A.age > ALL (SELECT B.age
FROM B
WHERE B. name = "arun")
  • 4

  • 3

  • 0

  • 1

Question 3

Database table by name Loan_Records is given below.

Borrower    Bank_Manager   Loan_Amount
Ramesh Sunderajan 10000.00
Suresh Ramgopal 5000.00
Mahesh Sunderajan 7000.00

What is the output of the following SQL query?

SELECT Count(*) 
FROM ( ( SELECT Borrower, Bank_Manager
FROM Loan_Records) AS S
NATURAL JOIN ( SELECT Bank_Manager, Loan_Amount
FROM Loan_Records) AS T );
  • 3

  • 9

  • 5

  • 6

Question 4

Consider the following relational schema: 
 

Suppliers(sid:integer, sname:string, city:string, street:string)
Parts(pid:integer, pname:string, color:string)
Catalog(sid:integer, pid:integer, cost:real)


Consider the following relational query on the above database: 
 

SELECT S.sname
FROM Suppliers S
WHERE S.sid NOT IN (SELECT C.sid
FROM Catalog C
WHERE C.pid NOT IN (SELECT P.pid
FROM Parts P
WHERE P.color<> 'blue'))


Assume that relations corresponding to the above schema are not empty. Which one of the following is the correct interpretation of the above query?
 

  • Find the names of all suppliers who have supplied a non-blue part.
     

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

  • Find the names of all suppliers who have supplied only blue parts.
     

  • Find the names of all suppliers who have not supplied only blue parts.
     

Question 5

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?

  • Operations (a) and (b) will cause violation.
  • Operations (b) and (c) will cause violation.
  • Operations (c) and (d) will cause violation.
  • Operations (d) and (a) will cause violation.

Question 6

How to express that some person keeps animals as pets?

  • (A)
  • (B)
  • (C)
  • (D)

Question 7

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

  • Schema

  • Subschema

  • Virtual table

  • Index Table

Question 8

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

  • Project

  • Join

  • Extract

  • Substitute

Question 9

The relation schemas R1 and R2 form a Lossless join decomposition of R if and only if: (a) R1 ∩ R2 ↠ (R1 - R2) (b) R1 → R2 (c) R1 ∩ R2 ↠ (R2 - R1 ) (d)(R2 → R1) ∩ R2

  • (a) and (b) happens
  • (a) and (d) happens
  • (a) and (c) happens
  • (b) and (c) happens

Question 10

In functional dependency Armstrong inference rules refers to

  • Reflexivity, Augmentation and Decomposition

  • Transitivity, Augmentation and Reflexivity

  • Augmentation, Transitivity, Reflexivity and Decomposition

  • Reflexivity, Transitivity and Decomposition

There are 50 questions to complete.

Take a part in the ongoing discussion