Dbms Important MCQ

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

1.

A relational database consists of a collection of


a) Tables
b) Fields
c) Records
d) Keys
View Answer
Answer:a
Explanation:Fields are the column of the relation or tables.Records are each row in relation.Keys are the constraints in a
relation .
2. A ________ in a table represents a relationship among a set of values.
a) Column
b) Key
c) Row
d) Entry
View Answer
Answer:c
Explanation:Column has only one set of values.Keys are constraints and row is one whole set of attributes.Entry is just
a piece of data.
3. The term _______ is used to refer to a row.
a) Attribute
b) Tuple
c) Field
d) Instance
View Answer
Answer:b
Explanation:Tuple is one entry of the relation with several attributes which are fields.
4. The term attribute refers to a ___________ of a table.
a) Record
b) Column
c) Tuple
d) Key
View Answer
Answer:b
Explanation:Attribute is a specific domain in the relation which has entries of all tuples.
5. For each attribute of a relation, there is a set of permitted values, called the ________ of that attribute.
a) Domain
b) Relation
c) Set
d) Schema
View Answer
Answer:a
Explanation:The values of the attribute should be present in the domain.Domain is a set of values permitted .
b) DDL(Data Definition Langauge)
c) Query
d) Relational Schema
View Answer
Answer:b
Explanation: Data Definition language is the language which performs all the operation in defining structure of
relation.
12. Which one of the following provides the ability to query information from the database and to insert tuples
into, delete tuples from, and modify tuples in the database ?
a) DML(Data Manipulation Langauge)
b) DDL(Data Definition Langauge)
c) Query
d) Relational Schema
View Answer
Answer:a
Explanation: DML performs change in the values of the relation .
13. Create table employee (name varchar ,id integer)
What type of statement is this ?
a) DML
b) DDL
c) View
d) Integrity constraint
View Answer
Answer:b
Explanation:Data Definition language is the language which performs all the operation in defining structure of
relation.
14. Select * from employee
What type of statement is this?
a) DML
b) DDL
c) View
d) Integrity constraint
View Answer
Answer:a
Explanation: Select operation just shows the required fields of the relation. So it forms a DML
15. The basic data type char(n) is a _____ length character string and varchar(n) is _____ length character.
a) Fixed, equal
b) Equal, variable
c) Fixed, variable
d) Variable, equal
View Answer
Answer:c
Explanation: Varchar changes its length accordingly whereas char has a specific length which has to be filled
by either letters or spaces .
16. An attribute A of datatype varchar(20) has the value “Avi” . The attribute B of datatype char(20) has value
”Reed” .Here attribute A has ____ spaces and attribute B has ____ spaces .
a) 3, 20

1. A _________ consists of a sequence of query and/or update statements.


a) Transaction
b) Commit
c) Rollback
d) Flashback
View Answer
Answer:a
Explanation:Transaction is a set of operation until commit.
2. Which of the following makes the transaction permanent in the database ?
a) View
b) Commit
c) Rollback
d) Flashback
View Answer
Answer:b
Explanation:Commit work commits the current transaction.
3. In order to undo the work of transaction after last commit which one should be used ?
a) View
b) Commit
c) Rollback
d) Flashback
View Answer
Answer:c
Explanation:Rollback work causes the current transaction to be rolled back; that is, it undoes all the updates
performed by the SQL statements in the transaction.
4. Consider the following action:
Transaction…..
Commit;
Rollback;
What does Rollback do?
a) Undoes the transactions before commit
b) Clears all transactions
c) Redoes the transactions before commit
d) No action
View Answer
Answer:d
Explanation:Once a transaction has executed commit work, its effects can no longer be undone by rollback
work.
5. In case of any shut down during transaction before commit which of the following statement is done
automatically ?
a) View
b) Commit
c) Rollback
.
Get More Questions

DEAD LOCK
1. A system is in a ______ state if there exists a set of transactions such that every transaction in the set is
waiting for another transaction in the set.
a) Idle
b) Waiting
c) Deadlock
d) Ready
View Answer
Answer:c
Explanation:When one data item is waiting for another data item in a transaction then system is in deadlock.
2. The deadlock state can be changed back to stable state by using _____________ statement.
a) Commit
b) Rollback
c) Savepoint
d) Deadlock
View Answer
Answer:b
Explanation:Rollback is used to rollback to the point before lock is obtained.
3. What are the ways of dealing with deadlock ?
a) Deadlock prevention
b) Deadlock recovery
c) Deadlock detection
d) All of the mentioned
View Answer
Answer:d
Explanation:Deadlock prevention is also called as deadlock recovery.Prevention is commonly used if the
probability that the system would enter a deadlock state is relatively high; otherwise, detection and recovery are
more efficient.
4. When transaction Ti requests a data item currently held by Tj , Ti is allowed to wait only if it has a timestamp
smaller than that of Tj (that is, Ti is older than Tj ). Otherwise, Ti is rolled back (dies). This is
a) Wait-die
b) Wait-wound
c) Wound-wait
d) Wait
View Answer
Answer:a
Explanation:The wait–die scheme is a non-preemptive technique.
5. When transaction Ti requests a data item currently held by Tj , Ti is allowed to wait only if it has a timestamp
larger than that of Tj (that is, Ti is younger than Tj ). Otherwise, Tj is rolled back (Tj is wounded by Ti ). This is
a) Wait-die
b) Wait-wound
c) Wound-wait
Answer:b
Explanation:In total rollback abort the transaction and then restart it.

Get More Questions

RELATIONAL ALGEBRA
This set of Database Questions & Answers focuses on “Relational Algebra”
1. Relational Algebra is a __________ query language that takes two relation as input and produces another
relation as output of the query.
a) Relational
b) Structural
c) Procedural
d) Fundamental
View Answer
Answer:c
Explanation:This language has fundamental and other operations which are used on relations.
2. Which of the following is a fundamental operation in relational algebra ?
a) Set intersection
b) Natural join
c) Assignment
d) None of the mentioned
View Answer
Answer:d
Explanation:The fundamental operations are select, project, union, set difference, Cartesian product, and
rename.
3. Which of the following is used to denote the selection operation in relational algebra ?
a) Pi (Greek)
b) Sigma (Greek)
c) Lambda (Greek)
d) Omega (Greek)
View Answer
Answer:b
Explanation:The select operation selects tuples that satisfy a given predicate.
4. For select operation the ________ appear in the subscript and the ___________ argument appears in the
paranthesis after the sigma.
a) Predicates, relation
b) Relation, Predicates
c) Operation, Predicates
d) Relation, Operation
View Answer
Answer:a
Explanation:None.
5. The ___________ operation, denoted by −, allows us to find tuples that are in one relation but are not in
another.
a) Union
b) Set-difference
c) Difference
abcd
efgh
ijkl
mnop

You might also like