Showing posts with label MCQ. Show all posts
Showing posts with label MCQ. Show all posts

Wednesday, November 17, 2021

Relational database management systems mcq quiz with answers 23

MCQ on various aspects in DBMS including time required to read disk block pages, block access per second,  primary dense index, secondary, b+ tree index, RDBMS Multiple Choice Questions with Answers

Database management systems - MCQ exam questions

1. You have a table with 1 million records. Each record fits exactly in one disk block in the hard disk, and the blocks for the table are sequential. The hard disk drive has a 10ms seek latency to start a read operation, and after it starts, it can read 10,000 blocks per second. How much time will you spend to read the entire table?

a) 10.01 seconds

b) 51.01 seconds

c) 100.01 seconds

d) 25.01 seconds

Answer: (c) 100.01 seconds

Since the data stored in sequential (contiguous) order, in one seek we can read all data. Hence, the time required to read the entire table can be calculated as follows;

Seektime + time to read all the disk blocks = 10ms + (1000000 blocks / 10000 blocks per sec)

                                                                                    = 0.01 + 100 = 100.01 seconds.

 

2. Which of the following statements is wrong / irrelevant?

a) First and second level of secondary index are dense

b) Primary index can be dense

c) Primary index can be sparse

d) Secondary indices are always dense

Answer: (a) First and second level of secondary index are dense

Multiple levels of indices are used to improve the accessibility in case if the index itself is very large. But a dense index includes all the search key values. Hence, building a dense index in second level on top of first level dense index is redundant.

 

3. The maximum number of levels between the root node and a leaf node in a B+ tree is called as

a) Degree of a tree

b) Order of a tree

c) Depth of a tree

d) None of the above

Answer: (c) Depth of a tree

The depth of a tree is the maximum number of levels between the root node and a leaf node in the tree.

The maximum number of children allowed per parent is referred as Degree or Order of a tree.

 

************************
Related posts:


Quiz questions with answers on DBMS concepts

calculate the time required to access the table from hard disk drive

How much time required to access a table from disk block pages for sequentially stored records

What is degree of a tree?

What is depth of a B+ tree?

What is order of a tree?

Monday, July 23, 2018

Relational model in DBMS Multiple choice questions with answers

Relational model in DBMS Multiple choice questions with answers

Multiple Choice Questions 30:

1. Which one of the following is correct?
a) Each candidate key is a primary key
b) Each primary key is a foreign key
c) Each foreign key must refer a primary key of a relation.
d) Each foreign key refers a candidate key in a relation.
Answer:
d) Each foreign key refers a candidate key in a relation.
Foreign key attribute refers attribute that contains unique values. It need not be the primary key always.

2. The value of an attribute in a table may be NULL because,
a) the value is not known
b) the value does not exist
c) the value is not applicable
d) all of the above
Answer:
d) all of the above.
NULL refers to all the options a, b, and c.

3. Consider a relation office with the following schema;

Office(Cabin_no, Room_no, Phone)

Room number is unique. Each room consists of approximately 20 cabins and each cabin number is unique with respect to room number. The same cabin number may be used in different rooms. Each room has unique phone number.

Which of the following is correct?
a) Room_no is a candidate key
b) Phone is a candidate key
c) (Cabin_no, Phone) and (Cabin_no, Room_no) are the candidate keys.
d) (Room_no, Phone) and (Room_no, Cabin_no) are the candidate keys.
Answer:
c) (Cabin_no, Phone) and (Cabin_no, Room_no) are the candidate keys.
Room_no is unique and each room has 20 cabins hence, retrieving data with Room_no as key will end up in at least 20 records. The same is applicable for Phone.
Cabin_no is unique for each room[or phone]. So, (cabin_no, phone) or (cabin_no, room_no) can uniquely identify records.

4. Consider the following schema of relation R;

R (A, B, C)

Attributes A, B, and C are all unique valued attributes. Which of the following is TRUE for R?
a) A is a candidate key for R
b) B is a candidate key for R
c) (A, C) is a super key for R
d) all of the above
Answer:
d) all of the above
As all attributes are unique valued attributes, each one of them is a candidate key on its own. Also, the combination of candidate keys cannot form another candidate key but a super key.

5. Which of the following is usually chosen as a primary key for a relation.
a) A candidate key that is composite
b) A super key
c) A candidate key that is minimal
d) All of the above
Answer:
c) A candidate key that is minimal
A candidate key that is composite can also be chosen as primary key. But in practice people usually prefers a minimal candidate key, that is, a candidate key that has minimal number of attributes. For example, if in a relation R(A, B, C), A is a candidate key and (B,C) is another candidate key we prefer A as the primary key though (B, C) can also act as a primary key.

***********



Go to Advanced DBMS Concepts page




multiple choice questions in relational model of DBMS
MCQs in relational model
MCQ about super key, candidate key and primary key
relational data model in database
solved quiz questions with answer in relational model

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents

data recovery