Get Latest Exam Updates, Free Study materials and Tips

[MCQs] Database Management Systems

Module 01

1. A relational database consists of a collection of

a) Tables

b) Fields

c) Records

d) Keys

Answer: a

Explanation: Fields are the column of the relation or tables. Records are each row in a 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

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

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

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

Answer: a

Explanation: The values of the attribute should be present in the domain. Domain is a set of values permitted. 

 

6. Database __________  which is the logical design of the database, and the database _______ which is a snapshot of the data in the database at a given instant in time.

a) Instance, Schema

b) Relation, Schema

c) Relation, Domain

d) Schema, Instance

Answer: d

Explanation: Instance is an instance of time and schema is a representation. 

 

7. Course(course_id,sec_id,semester)

Here the course_id,sec_id and semester are __________ and course is a _________

a) Relations, Attribute

b) Attributes, Relation

c) Tuple, Relation

d) Tuple, Attributes

Answer: b

Explanation: The relation course has a set of attributes course_id,sec_id,semester . 

 

8. Department (dept name, building, budget) and Employee (employee_id, name, dept name, salary)

Here the dept_name attribute appears in both the relations. Here using common attributes in relation schema is one way of relating ___________ relations.

a) Attributes of common

b) Tuple of common

c) Tuple of distinct

d) Attributes of distinct

Answer: c

Explanation: Here the relations are connected by the common attributes. 

 

9. A domain is atomic if elements of the domain are considered to be ____________ units.

a) Different

b) Indivisbile

c) Constant

d) Divisible

Answer: b

Explanation: None. 

 

10. The tuples of the relations can be of ________ order.

a) Any

b) Same

c) Sorted

d) Constant

Answer: a

Explanation: The values only count. The order of the tuples does not matter. 

 

11. Using which language can a user request information from a database?

a) Query

b) Relational

c) Structural

d) Compiler

 Answer: a

Explanation: Query language is a method through which the database entries can be accessed.

 

12. Student(ID, name, dept name, tot_cred)

In this query which attributes form the primary key?

a) Name

b) Dept

c) Tot_cred

d) ID

Answer: d

Explanation: The attributes name, dept and tot_cred can have same values unlike ID. 

 

13. Which one of the following is a procedural language?

a) Domain relational calculus

b) Tuple relational calculus

c) Relational algebra

d) Query language

Answer: c

Explanation: Domain and Tuple relational calculus are non-procedural language. Query language is a method through which database entries can be accessed. 

 

14. The_____ operation allows the combining of two relations by merging pairs of tuples, one from each relation, into a single tuple.

a) Select

b) Join

c) Union

d) Intersection

Answer: b

Explanation: Join finds the common tuple in the relations and combines it. 

 

15. The result which operation contains all pairs of tuples from the two relations, regardless of whether their attribute values match.

a) Join

b) Cartesian product

c) Intersection

d) Set difference

Answer: b

Explanation: Cartesian product is the multiplication of all the values in the attributes. 

 

16. The _______operation performs a set union of two “similarly structured” tables

a) Union

b) Join

c) Product

d) Intersect

Answer: a

Explanation: Union just combines all the values of relations of same attributes. 

 

17. The most commonly used operation in relational algebra for projecting a set of tuple from a relation is

a) Join

b) Projection

c) Select

d) Union

Answer: c

Explanation: Select is used to view the tuples of the relation with or without some constraints. 

 

18. The _______ operator takes the results of two queries and returns only rows that appear in both result sets.

a) Union

b) Intersect

c) Difference

d) Projection

Answer: b

Explanation: The union operator gives the result which is the union of two queries and difference is the one where query which is not a part of second query. 

 

19. A ________ is a pictorial depiction of the schema of a database that shows the relations in the database, their attributes, and primary keys and foreign keys.

a) Schema diagram

b) Relational algebra

c) Database diagram

d) Schema flow

Answer: a

Explanation: None. 

 

20. The _________ provides a set of operations that take one or more relations as input and return a relation as an output.

a) Schematic representation

b) Relational algebra

c) Scheme diagram

d) Relation flow

Answer: b

Explanation: None.

Module 02

Module 02: Entity–Relationship Data Model  
1.Which one of the following is a set of one or more attributes taken collectively to uniquely identify a record?
a) Candidate key
b) Sub key
c) Super key
d) Foreign key
Answer: c
Explanation: Super key is the superset of all the keys in a relation. 

 2.Consider attributes ID, CITY and NAME. Which one of this can be considered as a super key?
a) NAME
b) ID
c) CITY
d) CITY, ID
Answer: b
Explanation: Here the id is the only attribute which can be taken as a key. Other attributes are not uniquely identified. 

3.The subset of a super key is a candidate key under what condition?
a) No proper subset is a super key
b) All subsets are super keys
c) Subset is a super key
d) Each subset is a super key
Answer: a
Explanation: The subset of a set cannot be the same set. Candidate key is a set from a super key which cannot be the whole of the super set.

 4.A _____ is a property of the entire relation, rather than of the individual tuples in which each tuple is unique.
a) Rows
b) Key
c) Attribute
d) Fields
Answer: b
Explanation: Key is the constraint which specifies uniqueness. 

5. Which one of the following attribute can be taken as a primary key?
a) Name
b) Street
c) Id
d) Department
Answer: c
Explanation: The attributes name, street and department can repeat for some tuples. But the id attribute has to be unique. So it forms a primary key. 

6. Which one of the following cannot be taken as a primary key?
a) Id
b) Register number
c) Dept_id
d) Street
Answer: d
Explanation: Street is the only attribute which can occur more than once. 

7. An attribute in a relation is a foreign key if the _______ key from one relation is used as an attribute in that relation.
a) Candidate
b) Primary
c) Super
d) Sub
Answer: b
Explanation: The primary key has to be referred in the other relation to form a foreign key in that relation. 

 8.The relation with the attribute which is the primary key is referenced in another relation. The relation which has the attribute as a primary key is called ______________
a) Referential relation
b) Referencing relation
c) Referenced relation
d) Referred relation
Answer: c
Explanation: None. 

 9.The ______ is the one in which the primary key of one relation is used as a normal attribute in another relation.
a) Referential relation
b) Referencing relation
c) Referenced relation
d) Referred relation
Answer: c
Explanation: None. 

10. A _________ integrity constraint requires that the values appearing in specified attributes of any tuple in the referencing relation also appear in specified attributes of at least one tuple in the referenced relation.
a) Referential
b) Referencing
c) Specific
d) Primary
Answer: a
Explanation: A relation, say r1, may include among its attributes the primary key of another relation, say r2. This attribute is called a foreign key from r1, referencing r2. The relation r1 is also called the referencing relation of the foreign key dependency, and r2 is called the referenced relation of the foreign key. 

 11.An ________  is a set of entities of the same type that share the same properties, or attributes.
a) Entity set
b) Attribute set
c) Relation set
d) Entity model
Answer: a
Explanation: An entity is a “thing” or “object” in the real world that is distinguishable from all other objects. 

 12.Entity is a _________
a) Object of relation
b) Present working model
c) Thing in real world
d) Model of relation
Answer: c
Explanation: For example, each person in a university is an entity.

 13.The descriptive property possessed by each entity set is _________
a) Entity
b) Attribute
c) Relation
d) Model
Answer: b
Explanation: Possible attributes of the instructor entity set are ID, name, dept name, and salary. 

14. The function that an entity plays in a relationship is called that entity’s _____________
a) Participation
b) Position
c) Role
d) Instance
Answer: c
Explanation: A relationship is an association among several entities. 

15. The attribute name could be structured as an attribute consisting of first name, middle initial, and last name. This type of attribute is called
a) Simple attribute
b) Composite attribute
c) Multivalued attribute
d) Derived attribute
Answer: b
Explanation: Composite attributes can be divided into subparts (that is, other attributes). 

16. The attribute AGE is calculated from DATE_OF_BIRTH. The attribute AGE is
a) Single valued
b) Multi valued
c) Composite
d) Derived
Answer: d
Explanation: The value for this type of attribute can be derived from the values of other related attributes or entities. 

17. Not applicable condition can be represented in relation entry as
a) NA
b) 0
c) NULL
d) Blank Space
Answer: c
Explanation: NULL always represents that the value is not present. 

18. Which of the following can be a multivalued attribute?
a) Phone_number
b) Name
c) Date_of_birth
d) All of the mentioned
Answer: a
Explanation: Name and Date_of_birth cannot hold more than 1 value. 

19. Which of the following is a single valued attribute
a) Register_number
b) Address
c) SUBJECT_TAKEN
d) Reference
View Answer Answer: a
Explanation: None. 

 20.In a relation between the entities the type and condition of the relation should be specified. That is called as______attribute.
a) Desciptive
b) Derived
c) Recursive
d) Relative
Answer: a
Explanation: Consider the entity sets student and section, which participate in a relationship set takes. We may wish to store a descriptive attribute grade with the relationship to record the grade that a student got in the class. 

 21.The entity set person is classified as student and employee. This process is called _________
a) Generalization
b) Specialization
c) Inheritance
d) Constraint generalization
Answer: b
Explanation: The process of designating subgroupings within an entity set is called specialization.

22. Which relationship is used to represent a specialization entity?
a) ISA
b) AIS
c) ONIS
d) WHOIS
Answer: a
Explanation: In terms of an E-R diagram, specialization is depicted by a hollow arrow-head pointing from the specialized entity to the other entity.

 23.The refinement from an initial entity set into successive levels of entity subgroupings represents a ________ design process in which distinctions are made explicit.
a) Hierarchy
b) Bottom-up
c) Top-down
d) Radical
Answer: c
Explanation: The design process may also proceed in a bottom-up manner, in which multiple entity sets are synthesized into a higher-level entity set on the basis of common features.

 24.There are similarities between the instructor entity set and the secretary entity set in the sense that they have several attributes that are conceptually the same across the two entity sets: namely, the identifier, name, and salary attributes. This process is called
a) Commonality
b) Specialization
c) Generalization
d) Similarity
 Answer: c
Explanation: Generalization is used to emphasize the similarities among lower-level entity sets and to hide the differences.

 25.If an entity set is a lower-level entity set in more than one ISA relationship, then the entity set has
a) Hierarchy
b) Multilevel inheritance
c) Single inheritance
d) Multiple inheritance
Answer: d
Explanation: The attributes of the higher-level entity sets are said to be inherited by the lower-level entity sets.

 26.A _____________ constraint requires that an entity belong to no more than one lower-level entity set.
a) Disjointness
b) Uniqueness
c) Special
d) Relational
Answer: a
Explanation: For example, student entity can satisfy only one condition for the student type attribute; an entity can be either a graduate student or an undergraduate student, but cannot be both.

27. Consider the employee work-team example, and assume that certain employees participate in more than one work team. A given employee may therefore appear in more than one of the team entity sets that are lower level entity sets of employee. Thus, the generalization is _____________
a) Overlapping
b) Disjointness
c) Uniqueness
d) Relational
Answer: a
Explanation: In overlapping generalizations, the same entity may belong to more than one lower-level entity set within a single generalization.

 28.The completeness constraint may be one of the following: Total generalization or specialization, Partial generalization or specialization. Which is the default?
a) Total
b) Partial
c) Should be specified
d) Cannot be determined
Answer: b
Explanation: Partial generalization or specialization – Some higher-level entities may not belong to any lower-level entity set.

29. Functional dependencies are a generalization of
a) Key dependencies
b) Relation dependencies
c) Database dependencies
d) None of the mentioned
Answer: a
Explanation: The subclasses are combined to form the superclass.

30. Which of the following is another name for a weak entity?
a) Child
b) Owner
c) Dominant
d) All of the mentioned
Answer: a
Explanation: A parent may be called as a strong entity.

31. _____________ express the number of entities to which another entity can be associated via a relationship set.
a) Mapping Cardinality
b) Relational Cardinality
c) Participation Constraints
d) None of the mentioned
Answer: a
Explanation: Mapping cardinality is also called as cardinality ratio. 

32. An entity in A is associated with at most one entity in B, and an entity in B is associated with at most one entity in A.This is called as
a) One-to-many
b) One-to-one
c) Many-to-many
d) Many-to-one
Answer: b
Explanation: Here one entity in one set is related to one one entity in other set. 

 33.An entity in A is associated with at most one entity in B. An entity in B, however, can be associated with any number (zero or more) of entities in A.
a) One-to-many
b) One-to-one
c) Many-to-many
d) Many-to-one
Answer: d
Explanation: Here more than one entity in one set is related to one one entity in other set. 

34. Data integrity constraints are used to:
a) Control who is allowed access to the data
b) Ensure that duplicate records are not entered into the table
c) Improve the quality of data entered for a specific property
d) Prevent users from changing the values stored in the table
 Answer: c
Explanation: The data entered will be in a particular cell (i.e., table column). 

 35.Establishing limits on allowable property values, and specifying a set of acceptable, predefined options that can be assigned to a property are examples of:
a) Attributes
b) Data integrity constraints
c) Method constraints
d) Referential integrity constraints
Answer: b
Explanation: Only particular value satisfying the constraints are entered in the column. 

 36.Which of the following can be addressed by enforcing a referential integrity constraint?
a) All phone numbers must include the area code
b) Certain fields are required (such as the email address, or phone number) before the record is accepted
c) Information on the customer must be known before anything can be sold to that customer
d) Then entering an order quantity, the user must input a number and not some text (i.e., 12 rather than ‘a dozen’)
Answer: c
Explanation: None. 

37. ______ is a special type of integrity constraint that relates two relations & maintains consistency across the relations.
a) Entity Integrity Constraints
b) Referential Integrity Constraints
c) Domain Integrity Constraints
d) Domain Constraints
Answer: b
Explanation: None. 

38. Which one of the following uniquely identifies the elements in the relation?
a) Secondary Key
b) Primary key
c) Foreign key
d) Composite key
Answer: b
Explanation: Primary key checks for not null and uniqueness constraint. 

 39.Drop Table cannot be used to drop a table referenced by a _________ constraint.
a) Local Key
b) Primary Key
c) Composite Key
d) Foreign Key
Answer: d
Explanation: Foreign key is used when primary key of one relation is used in another relation. 

40. ____________ is preferred method for enforcing data integrity
a) Constraints
b) Stored Procedure
c) Triggers
d) Cursors
Answer: a
Explanation: Constraints are specified to restrict entries in the relation. 

Module 03

Module 03: Entity–Relationship Data Model

1. Choose the correct statement regarding superkeys
a)A superkey is an attribute or a group of multiple attributes that can uniquely identify a tuple
b)A superkey is a tuple or a set of multiple tuples that can uniquely identify an attribute
c)Every superkey is a candidate key
d)A superkey is an attribute or a set of attributes that distinguish the relation from other relations
Answer: a
Explanation: A superkey is an attribute or a set of multiple attributes that can uniquely identify a tuple. It is used to differentiate between tuples.

 2.What is an Instance of a Database?
a)The logical design of the database system
b)The entire set of attributes of the Database put together in a single relation
c)The state of the database system at any given point of time
d)The initial values inserted into the Database immediately after its creation
Answer: c
Explanation: The state of the database system at any given point of time is called as an Instance of the database.

3. What is a foreign key?
a)A foreign key is a primary key of a relation which is an attribute in another relation
b)A foreign key is a superkey of a relation which is an attribute in more than one other relations
c)A foreign key is an attribute of a relation that is a primary key of another relation
d)A foreign key is the primary key of a relation that does not occur anywhere else in the schema
Answer: c
Explanation: A foreign key is an attribute of a relation that is initially a primary key of another relation. A foreign key usage preserves referential integrity.

 4.What action does  ⋈  operator perform in relational algebra
a)Output specified attributes from all rows of the input relation and remove duplicate tuples from the output
b)Outputs pairs of rows from the two input relations that have the same value on all attributes that have the same name
c)Output all pairs of rows from the two input relations (regardless of whether or not they have the same values on common attributes)
d)Return rows of the input relation that satisfy the predicate
Answer: a
Explanation: ⋈ Outputs specified attributes from all rows of the input relation. Remove duplicate tuples from the output. The operation is called the join operation. 

 5.What does the “x” operator do in relational algebra?
a)Output specified attributes from all rows of the input relation. Remove duplicate tuples from the output
b)Output pairs of rows from the two input relations that have the same value on all attributes that have the same name
c)Output all pairs of rows from the two input relations (regardless of whether or not they have the same values on common attributes)
d)Returns the rows of the input relation that satisfy the predicate
Answer: c
Explanation: The “x” operator outputs all pairs of rows from the two input relations (regardless of whether or not they have the same values on common attributes). This operation is called as the Cartesian product operation and is similar to the Cartesian product of sets.

 6.An attribute is a __________ in a relation.
a) Row
b) Column
c) Value
d) Tuple
Answer: b
Explanation: An attribute is a column in a relation. A tuple is a row in a relation.

7.What is the method of specifying a primary key in a schema description?
a) By writing it in bold letters
b) By underlining it using a dashed line
c) By writing it in capital letters
d) By underlining it using a bold line
Answer: d
Explanation: We can specify a primary key in schema description by underlining the respective attribute with a bold line.
 
8.Statement 1: A tuple is a row in a relation
  Statement 2: Existence of multiple foreign keys in a same relation is possible
a) Both the statements are true
b) Statement 1 is correct but Statement 2 is false
c) Statement 1 is false but Statement 2 is correct
d) Both the statements are false
Answer: a
Explanation: A tuple is a row is a relation. There can exist multiple foreign keys in the same relation because there can exist multiple attributes in the relation that are primary keys in two or more other relations.

9.Choose the option that correctly explains in words, the function of the following relational algebra expression
σyear≥2009 (book  ⋈  borrow)
a) Selects all tuples from the Cartesian product of book and borrow
b) Selects all the tuples from the natural join of book and borrow wherever the year is lesser than 2009
c) Selects all the tuples from the natural join of book and student wherever the year is greater than or equal to 2009
d) Selects all tuples from the Cartesian product of book and borrow wherever the year is greater than or equal to 2009
Answer: b
Explanation: The condition under the select statement represents the condition that must be satisfied by the tuples and the symbol ⋈  represents natural join between the two relations on either side of the operator.

10. State true or false: If a relation consists of a foreign key, then it is called a referenced relation of the foreign key dependency.
a) True
b) False
Answer: b
Explanation: If a relation has a foreign key, then it is called a referencing relation of the foreign key dependency.

11. Relational Algebra is a __________ query language that takes two relations as input and produces another relation as an output of the query.
a) Relational
b) Structural
c) Procedural
d) Fundamental
Answer: c
Explanation: This language has fundamental and other operations which are used on relations.

 12.Which of the following is a fundamental operation in relational algebra?
a) Set intersection
b) Natural join
c) Assignment
d) None of the mentioned
Answer: d
Explanation: The fundamental operations are select, project, union, set difference, Cartesian product, and rename.

13. 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)
Answer: b
Explanation: The select operation selects tuples that satisfy a given predicate.

14. 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
Answer: a
Explanation: None.

15. 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
d) Intersection
Answer: b
Explanation: The expression r − s produces a relation containing those tuples in r but not in s.

16. Which is a unary operation:
a) Selection operation
b) Primitive operation
c) Projection operation
d) Generalized selection
Answer: d
Explanation: Generalization Selection takes only one argument for operation.

 17.Which is a join condition contains an equality operator:
a) Equijoins
b) Cartesian
c) Natural
d) Left
Answer: a
Explanation: None.

18. In precedence of set operators, the expression is evaluated from
a) Left to left
b) Left to right
c) Right to left
d) From user specification
Answer: b
Explanation: The expression is evaluated from left to right according to the precedence.

19. Which of the following is not outer join?
a) Left outer join
b) Right outer join
c) Full outer join
d) All of the mentioned
Answer: d
Explanation: The FULL OUTER JOIN keyword combines the result of both LEFT and RIGHT joins.

20. The assignment operator is denoted by
a) ->
b) <-
c) =
d) ==
Answer: b
Explanation: The result of the expression to the right of the ← is assigned to the relation variable on the left of the ←.

 21.Which of the following is not a relational algebra function?
a) Select
b) Project
c) Manipulate
d) Union
Answer: c
Explanation: There does not exist any operation named as manipulate operation in relational algebra. The union gives the union of two sets. Project is similar to select in SQL and select is similar to where in SQL.

22. The select operation’s function in relational algebra is identical to the _______ clause in SQL
a) where
b) from
c) select
d) none of the mentioned
Answer: a
Explanation: The select operation’s function in relational algebra is identical to the where clause in SQL standard. It is therefore used to check for a particular condition.

 23.The project operation’s function in relational algebra is identical to the _______ clause in SQL
a) where
b) from
c) select
d) none of the mentioned
Answer: c
Explanation: The project operation’s function in relational algebra is identical to the select clause in SQL standard. It is used to list the attributes that are to be displayed.

 24.What does the following relational operation perform?
ρx(A1,A2,A3…) (E)
a) It returns the result of expression E with the previous attribute names
b) It returns the result of expression E renaming the attributes as A1, A2, …
c) It returns the result of the relation E but saves the old attributes
d) None of the mentioned
Answer: b
Explanation: If a relational-algebra expression E has arity n, then the above expression returns the result of expression E under the name X, and with the  attributes renamed to A1 , A2 , …., An.

 25.What does the following relational algebra expression do?
σamount > 1200 (loan)
a) Finds all the tuples in loan
b) Finds the tuples in loan where the amount is greater than 12000
c) Finds all the tuples in loan where the amount is greater than 1200
d) Finds all the amounts in loan where the number of values is greater than 1200
 Answer: c
Explanation: The above expression finds all the tuples in loan wherever the amount is greater than 1200. Because the condition specifies that the amount should be greater than 1200.

 Πcustomer_name, loan_number, amount (borrower ⋈loan)

26.What does the above expression perform?
a) It finds the customer_name, loan_number and amount from borrower
b) It finds the customer_name, loan_number and amount from loan
c) It finds the customer_name, loan_number and amount from the full outer join of borrower and loan
d) It finds the customer_name, loan_number and amount from the natural join of borrower and loan
Answer: d
Explanation: The above relational algebra expression finds the customer_name, loan_number and amount from the natural join of borrower and loan as the attributes are written next to the project symbol and the relation to be extracted from is mentioned in the parentheses which is the natural join of borrower and loan.

27. Updating, Deleting and Inserting in relational algebra is done using the ________ operator
a) Assignment
b) Modification
c) Alteration
d) Inclusion
Answer: a
Explanation: Updating, Deleting and Inserting in relational algebra is done using the assignment operator.

 28.State true or false: There exists a division operator in Relational Algebra
a) True
b) False
Answer: a
Explanation: The division is a binary operation that is labeled as R ÷ S. The result consists of the restrictions of tuples in R to the attributes unique to R, i.e., in the relation R but not in the relation S.

 29.The collections on which aggregate functions can operate are called as __________
a) Multisets
b) Multivalues
c) Multicollections
d) Multivariables
View AnswerAnswer: a

30. A relational database consists of a collection of
a) Tables
b) Fields
c) Records
d) Keys
Answer: a
Explanation: Fields are the column of the relation or tables. Records are each row in a relation. Keys are the constraints in a relation. 

31. A ________ in a table represents a relationship among a set of values.
a) Column
b) Key
c) Row
d) Entry
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.  

32. The term _______ is used to refer to a row.
a) Attribute
b) Tuple
c) Field
d) Instance
Answer: b
Explanation: Tuple is one entry of the relation with several attributes which are fields. 

 33.The term attribute refers to a ___________ of a table.
a) Record
b) Column
c) Tuple
d) Key
Answer: b
Explanation: Attribute is a specific domain in the relation which has entries of all tuples. 

34. 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
Answer: a
Explanation: The values of the attribute should be present in the domain. Domain is a set of values permitted. 

35. Database __________  which is the logical design of the database, and the database _______ which is a snapshot of the data in the database at a given instant in time.
a) Instance, Schema
b) Relation, Schema
c) Relation, Domain
d) Schema, Instance
Answer: d
Explanation: Instance is an instance of time and schema is a representation. 
 Course(course_id,sec_id,semester)

36.Here the course_id,sec_id and semester are __________ and course is a _________
a) Relations, Attribute
b) Attributes, Relation
c) Tuple, Relation
d) Tuple, Attributes
Answer: b
Explanation: The relation course has a set of attributes course_id,sec_id,semester . 

 Department (dept name, building, budget) and Employee (employee_id, name, dept name, salary)

37.Here the dept_name attribute appears in both the relations. Here using common attributes in relation schema is one way of relating ___________ relations.
a) Attributes of common
b) Tuple of common
c) Tuple of distinct
d) Attributes of distinct
Answer: c
Explanation: Here the relations are connected by the common attributes. 

38. A domain is atomic if elements of the domain are considered to be ____________ units.
a) Different
b) Indivisbile
c) Constant
d) Divisible
Answer: b
Explanation: None. 

 39.The tuples of the relations can be of ________ order.
a) Any
b) Same
c) Sorted
d) Constant
Answer: a
Explanation: The values only count. The order of the tuples does not matter. 

Module 04

Module 04: Entity–Relationship Data Model

 1.Choose the correct statement regarding superkeys

a)A superkey is an attribute or a group of multiple attributes that can uniquely identify a tuple
b)A superkey is a tuple or a set of multiple tuples that can uniquely identify an attribute
c)Every superkey is a candidate key
d)A superkey is an attribute or a set of attributes that distinguish the relation from other relations
Answer: a
Explanation: A superkey is an attribute or a set of multiple attributes that can uniquely identify a tuple. It is used to differentiate between tuples.



 2.What is an Instance of a Database?

a)The logical design of the database system
b)The entire set of attributes of the Database put together in a single relation
c)The state of the database system at any given point of time
d)The initial values inserted into the Database immediately after its creation
Answer: c
Explanation: The state of the database system at any given point of time is called as an Instance of the database.


 3.What is a foreign key?

a)A foreign key is a primary key of a relation which is an attribute in another relation
b)A foreign key is a superkey of a relation which is an attribute in more than one other relations
c)A foreign key is an attribute of a relation that is a primary key of another relation
d)A foreign key is the primary key of a relation that does not occur anywhere else in the schema
Answer: c
Explanation: A foreign key is an attribute of a relation that is initially a primary key of another relation. A foreign key usage preserves referential integrity.


 4.What action does  ⋈  operator perform in relational algebra

a)Output specified attributes from all rows of the input relation and remove duplicate tuples from the output
b)Outputs pairs of rows from the two input relations that have the same value on all attributes that have the same name
c)Output all pairs of rows from the two input relations (regardless of whether or not they have the same values on common attributes)
d)Return rows of the input relation that satisfy the predicate
Answer: a
Explanation: ⋈ Outputs specified attributes from all rows of the input relation. Remove duplicate tuples from the output. The operation is called the join operation. 


 5.What does the “x” operator do in relational algebra?

a)Output specified attributes from all rows of the input relation. Remove duplicate tuples from the output
b)Output pairs of rows from the two input relations that have the same value on all attributes that have the same name
c)Output all pairs of rows from the two input relations (regardless of whether or not they have the same values on common attributes)
d)Returns the rows of the input relation that satisfy the predicate
Answer: c
Explanation: The “x” operator outputs all pairs of rows from the two input relations (regardless of whether or not they have the same values on common attributes). This operation is called as the Cartesian product operation and is similar to the Cartesian product of sets.


 6.An attribute is a __________ in a relation.
a) Row
b) Column
c) Value
d) Tuple
Answer: b
Explanation: An attribute is a column in a relation. A tuple is a row in a relation.

7. What is the method of specifying a primary key in a schema description?
a) By writing it in bold letters
b) By underlining it using a dashed line
c) By writing it in capital letters
d) By underlining it using a bold line
Answer: d
Explanation: We can specify a primary key in schema description by underlining the respective attribute with a bold line.

 8.Statement 1: A tuple is a row in a relation

    Statement 2: Existence of multiple foreign keys in a same relation is possible

a) Both the statements are true
b) Statement 1 is correct but Statement 2 is false
c) Statement 1 is false but Statement 2 is correct
d) Both the statements are false
Answer: a
Explanation: A tuple is a row is a relation. There can exist multiple foreign keys in the same relation because there can exist multiple attributes in the relation that are primary keys in two or more other relations.

9. Choose the option that correctly explains in words, the function of the following relational algebra expression
σyear≥2009 (book  ⋈  borrow)
a) Selects all tuples from the Cartesian product of book and borrow
b) Selects all the tuples from the natural join of book and borrow wherever the year is lesser than 2009
c) Selects all the tuples from the natural join of book and student wherever the year is greater than or equal to 2009
d) Selects all tuples from the Cartesian product of book and borrow wherever the year is greater than or equal to 2009
Answer: b
Explanation: The condition under the select statement represents the condition that must be satisfied by the tuples and the symbol ⋈  represents natural join between the two relations on either side of the operator.

 9.State true or false: If a relation consists of a foreign key, then it is called a referenced relation of the foreign key dependency.
a) True
b) False
Answer: b
Explanation: If a relation has a foreign key, then it is called a referencing relation of the foreign key dependency.

10. Relational Algebra is a __________ query language that takes two relations as input and produces another relation as an output of the query.
a) Relational
b) Structural
c) Procedural
d) Fundamental
Answer: c
Explanation: This language has fundamental and other operations which are used on relations.

 11.Which of the following is a fundamental operation in relational algebra?
a) Set intersection
b) Natural join
c) Assignment
d) None of the mentioned
Answer: d
Explanation: The fundamental operations are select, project, union, set difference, Cartesian product, and rename.

 12.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)
Answer: b
Explanation: The select operation selects tuples that satisfy a given predicate.

 13.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
Answer: a
Explanation: None

 14.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
d) Intersection
Answer: b
Explanation: The expression r − s produces a relation containing those tuples in r but not in s.

 15.Which is a unary operation:
a) Selection operation
b) Primitive operation
c) Projection operation
d) Generalized selection
Answer: d
Explanation: Generalization Selection takes only one argument for operation.

 16.Which is a join condition contains an equality operator:
a) Equijoins
b) Cartesian
c) Natural
d) Left
Answer: a
Explanation: None.

 17.In precedence of set operators, the expression is evaluated from
a) Left to left
b) Left to right
c) Right to left
d) From user specification
Answer: b
Explanation: The expression is evaluated from left to right according to the precedence.

18. Which of the following is not outer join?
a) Left outer join
b) Right outer join
c) Full outer join
d) All of the mentioned
Answer: d
Explanation: The FULL OUTER JOIN keyword combines the result of both LEFT and RIGHT joins.

 19.The assignment operator is denoted by
a) ->
b) <-
c) =
d) ==
Answer: b
Explanation: The result of the expression to the right of the ← is assigned to the relation variable on the left of the ←.

20. Which of the following is not a relational algebra function?
a) Select
b) Project
c) Manipulate
d) Union
Answer: c
Explanation: There does not exist any operation named as manipulate operation in relational algebra. The union gives the union of two sets. Project is similar to select in SQL and select is similar to where in SQL.

21. The select operation’s function in relational algebra is identical to the _______ clause in SQL
a) where
b) from
c) select
d) none of the mentioned
Answer: a
Explanation: The select operation’s function in relational algebra is identical to the where clause in SQL standard. It is therefore used to check for a particular condition.

 22.The project operation’s function in relational algebra is identical to the _______ clause in SQL
a) where
b) from
c) select
d) none of the mentioned
Answer: c
Explanation: The project operation’s function in relational algebra is identical to the select clause in SQL standard. It is used to list the attributes that are to be displayed.

 23.What does the following relational operation perform?
ρx(A1,A2,A3…) (E)
a) It returns the result of expression E with the previous attribute names
b) It returns the result of expression E renaming the attributes as A1, A2, …
c) It returns the result of the relation E but saves the old attributes
d) None of the mentioned
Answer: b
Explanation: If a relational-algebra expression E has arity n, then the above expression returns the result of expression E under the name X, and with the  attributes renamed to A1 , A2 , …., An.

24. What does the following relational algebra expression do?
σamount > 1200 (loan)
a) Finds all the tuples in loan
b) Finds the tuples in loan where the amount is greater than 12000
c) Finds all the tuples in loan where the amount is greater than 1200
d) Finds all the amounts in loan where the number of values is greater than 1200
 Answer: c
Explanation: The above expression finds all the tuples in loan wherever the amount is greater than 1200. Because the condition specifies that the amount should be greater than 1200.
 
Πcustomer_name, loan_number, amount (borrower ⋈loan)

25.What does the above expression perform?
a) It finds the customer_name, loan_number and amount from borrower
b) It finds the customer_name, loan_number and amount from loan
c) It finds the customer_name, loan_number and amount from the full outer join of borrower and loan
d) It finds the customer_name, loan_number and amount from the natural join of borrower and loan
Answer: d
Explanation: The above relational algebra expression finds the customer_name, loan_number and amount from the natural join of borrower and loan as the attributes are written next to the project symbol and the relation to be extracted from is mentioned in the parentheses which is the natural join of borrower and loan.

26. Updating, Deleting and Inserting in relational algebra is done using the ________ operator
a) Assignment
b) Modification
c) Alteration
d) Inclusion
Answer: a
Explanation: Updating, Deleting and Inserting in relational algebra is done using the assignment operator.

 28.State true or false: There exists a division operator in Relational Algebra
a) True
b) False
Answer: a
Explanation: The division is a binary operation that is labeled as R ÷ S. The result consists of the restrictions of tuples in R to the attributes unique to R, i.e., in the relation R but not in the relation S.

 29.The collections on which aggregate functions can operate are called as __________
a) Multisets
b) Multivalues
c) Multicollections
d) Multivariables
View AnswerAnswer: a

30. A relational database consists of a collection of
a) Tables
b) Fields
c) Records
d) Keys
Answer: a
Explanation: Fields are the column of the relation or tables. Records are each row in a relation. Keys are the constraints in a relation. 

 31.A ________ in a table represents a relationship among a set of values.
a) Column
b) Key
c) Row
d) Entry
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.  

 32.The term _______ is used to refer to a row.
a) Attribute
b) Tuple
c) Field
d) Instance
Answer: b
Explanation: Tuple is one entry of the relation with several attributes which are fields. 

 33.The term attribute refers to a ___________ of a table.
a) Record
b) Column
c) Tuple
d) Key
Answer: b
Explanation: Attribute is a specific domain in the relation which has entries of all tuples. 

 34.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
Answer: a
Explanation: The values of the attribute should be present in the domain. Domain is a set of values permitted. 

35. Database __________  which is the logical design of the database, and the database _______ which is a snapshot of the data in the database at a given instant in time.
a) Instance, Schema
b) Relation, Schema
c) Relation, Domain
d) Schema, Instance
Answer: d
Explanation: Instance is an instance of time and schema is a representation. 

 Course(course_id,sec_id,semester)

37.Here the course_id,sec_id and semester are __________ and course is a _________
a) Relations, Attribute
b) Attributes, Relation
c) Tuple, Relation
d) Tuple, Attributes
Answer: b
Explanation: The relation course has a set of attributes course_id,sec_id,semester . 

 Department (dept name, building, budget) and Employee (employee_id, name, dept name, salary)

38.Here the dept_name attribute appears in both the relations. Here using common attributes in relation schema is one way of relating ___________ relations.
a) Attributes of common
b) Tuple of common
c) Tuple of distinct
d) Attributes of distinct
Answer: c
Explanation: Here the relations are connected by the common attributes. 

 39.A domain is atomic if elements of the domain are considered to be ____________ units.
a) Different
b) Indivisbile
c) Constant
d) Divisible
Answer: b
Explanation: None. 

 40.The tuples of the relations can be of ________ order.
a) Any
b) Same
c) Sorted
d) Constant
Answer: a
Explanation: The values only count. The order of the tuples does not matter. 

 41.Which of the following is the syntax for views where v is view name?
a) Create view v as “query name”
b) Create “query expression” as view;
c) Create view v as “query expression”;
d) Create view “query expression”;
Answer: c
Explanation:  is any legal query expression. The view name is represented by v. 

Module 05

1. We can use the following three rules to find logically implied functional dependencies. This collection of rules is called
a) Axioms
b) Armstrong’s axioms
c) Armstrong
d) Closure
Answer: b
Explanation: By applying these rules repeatedly, we can find all of F+, given F.

2.Which of the following is not Armstrong’s Axiom?
a) Reflexivity rule
b) Transitivity rule
c) Pseudotransitivity rule
d) Augmentation rule
Answer: c
Explanation: It is possible to use Armstrong’s axioms to prove that Pseudotransitivity rule is sound.

3.The relation employee(ID,name,street,Credit,street,city,salary) is decomposed into
employee1 (ID, name)
employee2 (name, street, city, salary)
This type of decomposition is called
a) Lossless decomposition
b) Lossless-join decomposition
c) All of the mentioned
d) None of the mentioned
Answer: d
Explanation: Lossy-join decomposition is the decomposition used here .

4.Inst_dept (ID, name, salary, dept name, building, budget) is decomposed into
instructor (ID, name, dept name, salary)
department (dept name, building, budget)
This comes under
a) Lossy-join decomposition
b) Lossy decomposition
c) Lossless-join decomposition
d) Both Lossy and Lossy-join decomposition
Answer: d
Explanation: Lossy-join decomposition is the decomposition used here .

5.There are two functional dependencies with the same set of attributes on the left side of the arrow:
A->BC
A->B
This can be combined as
a) A->BC
b) A->B
c) B->C
d) None of the mentioned
Answer: a
Explanation: This can be computed as the canonical cover.

6. Consider a relation R(A,B,C,D,E) with the following functional dependencies:
ABC -> DE and
D -> AB
The number of superkeys of R is:
a) 2
b) 7
c) 10
d) 12
Answer: c
Explanation: A superkey is a combination of columns that uniquely identifies any row within a relational database management system (RDBMS) table.

7. Suppose we wish to find the ID’s of the employees that are managed by people who are managed by the employee with ID 123. Here are two possible queries:
I.SELECT ee.empID
  FROM Emps ee, Emps ff
  WHERE ee.mgrID = ff.empID AND ff.mgrID = 123;
II.SELECT empID
  FROM Emps
  WHERE mgrID IN
  (SELECT empID FROM Emps WHERE mgrID = 123);
Which, if any, of the two queries above will correctly (in SQL2) get the desired set of employee ID’s?
a) Both I and II
b) I only
c) II only
d) Neither I nor I
Answer: a
Explanation: The query can be satisfied by any of the two options.

8.Suppose relation R(A,B) currently has tuples {(1,2), (1,3), (3,4)} and relation S(B,C) currently has {(2,5), (4,6), (7,8)}. Then the number of tuples in the result of the SQL query:
<i>SELECT *
FROM R NATURAL OUTER JOIN S; </i>IS:
a) 2
b) 4
c) 6
d) None of the mentioned
Answer: a
Explanation: The SQL NATURAL JOIN is a type of EQUI JOIN and is structured in such a way that, columns with same name of associate tables will appear once only.

9.Suppose now that R(A,B) and S(A,B) are two relations with r and s tuples, respectively (again, not necessarily distinct). If m is the number of (not necessarily distinct) tuples in the result of the SQL query:
R intersect S;
Then which of the following is the most restrictive, correct condition on the value of m?
a) m = min(r,s)
b) 0 <= m <= r + s
c) min(r,s) <= m <= max(r,s)
d) 0 <= m <= min(r,s)
Answer: d
Explanation: The value of m must lie between the min value of r and s and 0.

10.Suppose relation R(A,B,C,D,E) has the following functional dependencies:
A -> B
B -> C
BC -> A
A -> D
E -> A
D -> E

11.Which of the following is not a key?
a) A
b) E
c) B, C
d) D
Answer: c
Explanation: Here the keys are not formed by B and C.

12.In the __________ normal form, a composite attribute is converted to individual attributes.
a) First
b) Second
c) Third
d) Fourth
Answer: a
Explanation: The first normal form is used to eliminate the duplicate information. 

13.A table on the many side of a one to many or many to many relationship must:
a) Be in Second Normal Form (2NF)
b) Be in Third Normal Form (3NF)
c) Have a single attribute key
d) Have a composite key
Answer: d
Explanation:  The relation in second normal form is also in first normal form and no partial dependencies on any column in primary key. 

14.Tables in second normal form (2NF):
a) Eliminate all hidden dependencies
b) Eliminate the possibility of a insertion anomalies
c) Have a composite key
d) Have all non key fields depend on the whole primary key
Answer: a
Explanation:  The relation in second normal form is also in first normal form and no partial dependencies on any column in primary key. 

15.Which-one ofthe following statements about normal forms is FALSE?
a) BCNF is stricter than 3 NF
b) Lossless, dependency -preserving decomposition into 3 NF is always possible
c) Loss less, dependency – preserving decomposition into BCNF is always possible
d) Any relation with two attributes is BCNF
Answer: c
Explanation:  We say that the decomposition is a lossless decomposition if there is no loss of information by replacing r (R) with two relation schemas r1(R1) andr2(R2).

16.Functional Dependencies are the types of constraints that are based on______
a) Key
b) Key revisited
c) Superset key
d) None of the mentioned
Answer: a
Explanation:  Key is the basic element needed for the constraints.

17.Which is a bottom-up approach to database design that design by examining the relationship between attributes:
a) Functional dependency
b) Database modeling
c) Normalization
d) Decomposition
Answer: c
Explanation:  Normalisation is the process of removing redundancy and unwanted data. 

18.Which forms simplifies and ensures that there are minimal data aggregates and repetitive groups:
a) 1NF
b) 2NF
c) 3NF
d) All of the mentioned
Answer: c
Explanation:  The first normal form is used to eliminate the duplicate information. 

19.Which forms has a relation that possesses data about an individual entity:
a) 2NF
b) 3NF
c) 4NF
d) 5NF
 Answer: c
Explanation:   A Table is in 4NF if and only if, for every one of its non-trivial multivalued dependencies X \twoheadrightarrow Y, X is a superkey—that is, X is either a candidate key or a superset thereof. 

20.Which forms are based on the concept of functional dependency:
a) 1NF
b) 2NF
c) 3NF
d) 4NF
Answer: c
Explanation:  The table is in 3NF if every non-prime attribute of R is non-transitively dependent (i.e. directly dependent) on every superkey of R. 

Empdt1(empcode, name, street, city, state, pincode).

21.For any pincode, there is only one city and state. Also, for given street, city and state, there is just one pincode. In normalization terms, empdt1 is a relation in
a) 1 NF only
b) 2 NF and hence also in 1 NF
c) 3NF and hence also in 2NF and 1NF
d) BCNF and hence also in 3NF, 2NF and 1NF
Answer: b
Explanation:  The relation in second normal form is also in first normal form and no partial dependencies on any column in primary key. 

Module 06

Module 06: Transactions Management and Concurrency

1.A _________ consists of a sequence of query and/or update statements.
a) Transaction
b) Commit
c) Rollback
d) Flashback
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
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
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
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
d) Flashback
Answer: c
Explanation: Once a transaction has executed commit work, its effects can no longer be undone by rollback work.

 6.In order to maintain the consistency during transactions, database provides
a) Commit
b) Atomic
c) Flashback
d) Retain
Answer: b
Explanation: By atomic, either all the effects of the transaction are reflected in the database, or none are (after rollback).

 7.Transaction processing is associated with everything below except
a) Conforming an action or triggering a response
b) Producing detail summary or exception report
c) Recording a business activity
d) Maintaining a data
Answer: a
Explanation: None.

 8.A transaction completes its execution is said to be
a) Committed
b) Aborted
c) Rolled back
d) Failed
Answer: a
Explanation: A complete transaction always commits.

 9.Which of the following is used to get back all the transactions back after rollback?
a) Commit
b) Rollback
c) Flashback
d) Redo
Answer: c
Explanation: None.

10. ______ will undo all statements up to commit?
a) Transaction
b) Flashback
c) Rollback
d) Abort
Answer: c
Explanation: Flashback will undo all the statements and Abort will terminate the operation.

11. I and J are _________ if they are operations by different transactions on the same data item, and at least one of them is a write operation.
a) Conflicting
b) Overwriting
c) Isolated
d) Durable
Answer: a
Explanation: I and J are conflicting if they are operations by different transactions on the same data item, and at least one of them is a write operation.

12. If a schedule S can be transformed into a schedule S’ by a series of swaps of non-conflicting instructions, then S and S’ are
a) Non conflict equivalent
b) Equal
c) Conflict equivalent
d) Isolation equivalent
Answer: c
Explanation: If a schedule S can be transformed into a schedule S’ by a series of swaps of non-conflicting instructions, then S and S’ are conflict equivalent. Not all serial schedules are conflict equivalent to each other.

 13.A schedule is __________ if it is conflict equivalent to a serial schedule.
a) Conflict serializable
b) Conflicting
c) Non serializable
d) None of the mentioned
Answer: a
Explanation: A schedule is conflict serializable if it is conflict equivalent to a serial schedule. The concept of conflict equivalence leads to the concept.

 14.The set of ________ in a precedence graph consists of all the transactions participating in the schedule
a) Vertices
b) Edges
c) Directions
d) None of the mentioned
Answer: a
Explanation: The set of vertices in a precedence graph consists of all the transactions participating in the schedule. Precedence graph is a simple and efficient way of determining conflict serializability of the schedule.

 15.A ___________of the transactions can be obtained by finding a linear order consistent with the partial order of the precedence graph.
a) Serializability order
b) Direction graph
c) Precedence graph
d) Scheduling scheme
Answer: a
Explanation: A Serializability order of the transactions can be obtained by finding a linear order consistent with the partial order of the precedence graph. This process is called as topological sorting.

 16.State true or false: If I = read(Q) and J = read(Q) then the order of I and J does not matter.
a) True
b) False
Answer: a
Explanation: If I = read(Q) and J = read(Q) then the order of I and J does not matter because both I and J are read operations on the query.

17. State true or false: If I = read(Q) and J = write(Q) then the order of I and J does not matter.
a) True
b) False
Answer: b
Explanation: If I = read(Q) and J = write(Q) then the order of I and J matters because both I and J are different operations on the query. The order of execution determines the state of the database that is being read or written.

 18.Which of the following is the most expensive method?
a) Timestamping
b) Plain locking
c) Predicate locking
d) Snapshot isolation
Answer: c
Explanation: Predicate locking is the most expensive method and is generally not used in most databases.

 19.If a transaction has obtained a __________ lock, it can read but cannot write on the item
a) Shared mode
b) Exclusive mode
c) Read only mode
d) Write only mode
Answer: a
Explanation: If a transaction Ti has obtained a shared-mode lock (denoted by S) on item Q, then Ti can read, but cannot write, Q.

 20.If a transaction has obtained a ________ lock, it can both read and write on the item
a) Shared mode
b) Exclusive mod
c) Read only mode
d) Write only mode
Answer: b
Explanation: If a transaction has obtained an exclusive mode lock, then it can both read and write on the item on which it in operating.

 21.A transaction can proceed only after the concurrency control manager ________ the lock to the transaction
a) Grants
b) Requests
c) Allocates
d) None of the mentioned
Answer: a
Explanation: A transaction can proceed only after the concurrency control manager grants the lock to the transaction.

 22.If a transaction can be granted a lock on an item immediately in spite of the presence of another mode, then the two modes are said to be ________
a) Concurrent
b) Equivalent
c) Compatible
d) Executable
Answer: c
Explanation: If a transaction can be granted a lock on an item immediately in spite of the presence of another mode, then the two modes are said to be compatible.

 23.A transaction is made to wait until all ________ locks held on the item are released
a) Compatible
b) Incompatible
c) Concurrent
d) Equivalent
Answer: a
Explanation: A transaction is made to wait until all compatible locks held on the item are released. This ensures that no other transaction is concurrently accessing the same item.

 24.State true or false: It is not necessarily desirable for a transaction to unlock a data item immediately after its final access
a) True
b) False
Answer: a
Explanation: It is not necessarily desirable for a transaction to unlock a data item immediately after its final access because serializability may be violated due to this.

 25.The situation where no transaction can proceed with normal execution is known as ________
a) Road block
b) Deadlock
c) Execution halt
d) Abortion
Answer: b
Explanation: The situation where no transaction can proceed with normal execution is known as a deadlock.

 26.The protocol that indicates when a transaction may lock and unlock each of the data items is called as __________
a) Locking protocol
b) Unlocking protocol
c) Granting protocol
d) Conflict protocol
Answer: a
Explanation: The protocol that indicates when a transaction may lock and unlock each of the data items is called as locking protocol. Locking protocols restrict the number of schedules.

 27.If a transaction Ti may never make progress, then the transaction is said to be ____________
a) Deadlocked
b) Starved
c) Committed
d) Rolled back
Answer: b
Explanation: If a transaction Ti may never make progress, then the transaction is said to be starved.

 28.The two phase locking protocol consists which of the following phases?
a) Growing phase
b) Shrinking phase
c) More than one of the mentioned
d) None of the mentioned
Answer: c
Explanation: The two phased locking protocol consists of the growing phase and the shrinking phase.

 29.If a transaction may obtain locks but may not release any locks then it is in _______ phase
a) Growing phase
b) Shrinking phase
c) Deadlock phase
d) Starved phase
Answer: a
Explanation: If a transaction may obtain locks but may not release any locks then it is in growing phase. Growing phase is a phase in two phased locking protocol.

 30.If a transaction may release locks but may not obtain any locks, it is said to be in ______ phase
a) Growing phase
b) Shrinking phase
c) Deadlock phase
d) Starved phase
Answer: b
Explanation: If a transaction may release locks but may not obtain any locks, it is said to be in shrinking phase. Shrinking phase is a phase in two phased locking protocol.

 31.In order to maintain transactional integrity and database consistency, what technology does a DBMS deploy?
a) Triggers
b) Pointers
c) Locks
d) Cursors
Answer: c
Explanation: Locks are used to maintain database consistency.

 32.A lock that allows concurrent transactions to access different rows of the same table is known as a
a) Database-level lock
b) Table-level lock
c) Page-level lock
d) Row-level lock
Answer: d
Explanation: Locks are used to maintain database consistency.

 33.Which of the following are introduced to reduce the overheads caused by the log-based recovery?
a) Checkpoints
b) Indices
c) Deadlocks
d) Locks
Answer: a
Explanation: Checkpoints are introduced to reduce overheads caused by the log-based recovery.

34. Which of the following protocols ensures conflict serializability and safety from deadlocks?
a) Two-phase locking protocol
b) Time-stamp ordering protocol
c) Graph based protocol
d) None of the mentioned
Answer: b
Explanation: Time-stamp ordering protocol ensures conflict serializability and safety from deadlocks.

 35.Which of the following is the block that is not permitted to be written back to the disk?
a) Dead code
b) Read only
c) Pinned
d) Zapped
Answer: c
Explanation: A block that is not permitted to be written back to the disk is called pinned.

36. If transaction Ti gets an explicit lock on the file Fc in exclusive mode, then it has an ­­­­­­__________ on all the records belonging to that file.
a) Explicit lock in exclusive mode
b) Implicit lock in shared mode
c) Explicit lock in shared mode
d) Implicit lock in exclusive mode
Answer: d
Explanation: If transaction Ti gets an explicit lock on the file Fc in exclusive mode, then it has an implicit lock in exclusive mode on all the records belonging to that file.

 37.Which refers to a property of computer to run several operation simultaneously and possible as computers await response of each other
a) Concurrency
b) Deadlock
c) Backup
d) Recovery
Answer: a
Explanation: Concurrency is a property of systems in which several computations are executing simultaneously, and potentially interacting with each other.

 38.All lock information is managed by a __________ which is responsible for assigning and policing the locks used by the transactions.
a) Scheduler
b) DBMS
c) Lock manager
d) Locking agent
Answer: c
Explanation: A distributed lock manager (DLM) provides distributed software applications with a means to synchronize their accesses to shared resources.

 39.The ____ lock allows concurrent transactions to access the same row as long as they require the use of different fields within that row.
a) Table-level
b) Page-level
c) Row-level
d) Field-level
Answer: d
Explanation: Lock is limited to the attributes of the relation.

 40.Which of the following is a procedure for acquiring the necessary locks for a transaction where all necessary locks are acquired before any are released?
a) Record controller
b) Exclusive lock
c) Authorization rule
d) Two phase lock
Answer: d
Explanation: Two-phase lock is a procedure for acquiring the necessary locks for a transaction where all necessary locks are acquired before any are released.

41. 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
Answer: c
Explanation: When one data item is waiting for another data item in a transaction then system is in deadlock.

 42.The deadlock state can be changed back to stable state by using _____________ statement.
a) Commit
b) Rollback
c) Savepoint
d) Deadlock
Answer: b
Explanation: Rollback is used to rollback to the point before lock is obtained.

 43.What are the ways of dealing with deadlock?
a) Deadlock prevention
b) Deadlock recovery
c) Deadlock detection
d) All of the mentioned
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.

44. 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
Answer: a
Explanation: The wait–die scheme is a non-preemptive technique.

 45.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
d) Wait
Answer: c
Explanation: The wound–wait scheme is a preemptive technique. It is a counterpart to the wait–die scheme.

46. The situation where the lock waits only for a specified amount of time for another lock to be released is
a) Lock timeout
b) Wait-wound
c) Timeout
d) Wait
Answer: a
Explanation: The timeout scheme is particularly easy to implement, and works well if transactions are short and if longwaits are likely to be due to deadlocks.

 47.The deadlock in a set of a transaction can be determined by
a) Read-only graph
b) Wait graph
c) Wait-for graph
d) All of the mentioned
Answer: a
Explanation: Each transaction involved in the cycle is said to be deadlocked.

48. A deadlock exists in the system if and only if the wait-for graph contains a ___________
a) Cycle
b) Direction
c) Bi-direction
d) Rotation
Answer: a
Explanation: Each transaction involved in the cycle is said to be deadlocked.

 49.Selecting the victim to be rollbacked to the previous state is determined by the minimum cost. The factors determining cost of rollback is
a) How long the transaction has computed, and how much longer the transaction will compute before it completes its designated task
b) How many data items the transaction has used
c) How many more data items the transaction needs for it to complete
d) All of the mentioned
Answer: d
Explanation: We should roll back those transactions that will incur the minimum cost.

50. __________ rollback requires the system to maintain additional information about the state of all the running transactions.
a) Total
b) Partial
c) Time
d) Commit
Answer: b
Explanation: In total rollback abort the transaction and then restart it.

 51.A system is in a _______ state if there exists a set of transactions in which every transaction is waiting for another transaction in the set.
a) Deadlock
b) Starved
c) Isolated
d) None of the mentioned
Answer: a
Explanation: A system is in a deadlock state if there exists a set of transactions in which every transaction is waiting for another transaction in the set.

52. Which of the following is not a method in deadlock handling
a) Deadlock prevention
b) Deadlock detection
c) Deadlock recovery
d) Deadlock distribution
Answer: d
Explanation: Deadlock distribution is not a method in deadlock handling whereas, deadlock prevention is followed by deadlock detection and deadlock recovery.

53. Deadlocks can be prevented using
a) Preemption and transaction rollbacks
b) Wait and die scheme
c) Wound-wait scheme
d) All of the mentioned
Answer: d
Explanation: Preemption and transaction rollbacks, wait and die scheme, wound wait scheme are all different methods of deadlock prevention.

 54.State true or false: Wait die scheme is a non-preemptive technique
a) True
b) False
Answer: a
Explanation: The wait-die scheme is a non-preemptive technique. 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).

 55.Lock timeouts have which of the following advantages?
a) Unnecessary rollbacks do not occur
b) Transactions do not starve
c) It is easy to implement
d) All of the mentioned
Answer: d
Explanation: In lock timeout method, unnecessary rollbacks do not occur, transactions do not starve and it is also easy to implement and is hence widely used if transactions are short and long waits are likely to be due to deadlocks.

 56.The _________ graph describes deadlocks precisely
a) Wound wait graph
b) Wait die graph
c) Wait for graph
d) None of the mentioned
Answer: c
Explanation: The wait for graph describes deadlocks precisely. Existence of a cycle in this graph implies that a deadlock will occur.

 57.How do we generally recover from a deadlock?
a) By aborting all the transactions
b) By rolling back all the transactions
c) By rolling back only a selected number of transactions
d) None of the mentioned
Answer: c
Explanation: We generally recover from deadlocks by rolling back only a selected number of transactions

 58.State true or false: Partial rollback is not possible.
a) True
b) False
Answer: b
Explanation: Partial rollback is possible but it requires the system too maintain an additional amount of information on the states of the transactions.

 59.Which of the following steps must be taken while choosing a victim?
a) Avoiding starvation
b) Number of transactions involved in rollback
c) Data items used by the transaction
d) All of the mentioned
Answer: d
Explanation: While choosing a victim we much choose the one with a minimum cost. That is the one which avoids starvation, the one with the least number of transaction involved in the rollback and the one with the least amount of data items used

















































Prepare For Your Placements: https://lastmomenttuitions.com/courses/placement-preparation/

/ Youtube Channel: https://www.youtube.com/channel/UCGFNZxMqKLsqWERX_N2f08Q

Follow For Latest Updates, Study Tips & More Content!

/lastmomenttuition

/ Last Moment Tuitions

/ lastmomentdost