Placement Preparation Questions
Placement Preparation questions are free resources offered by mobiprep that can help you ace any company placement process. We have curated a list of the most important MCQ questions which are asked in most companies such as Infosys, TCS, Wipro, Accenture, etc. The placement preparation questions also have detailed explanations for every question ensuring you revise all the questions with detailed answers and explanations.
Q
11
A surrogate key can be created using _____ property in MySQL?
a.
UNIQUE
b.
AUTO_INCREMENT
c.
NOT NULL
d.
CREATE
Correct Answer & Explanation:
b
When a relation does not have any set of attributes that can be used as a key, we include a surrogate key to uniquely identify each tuple of the relation. The surrogate keys are integers which increment themselves on the addition of a tuple to the database. Hence, we use AUTO_INCREMENT property for surrogate keys (the DBMS itself adds a surrogate key value for each tuple)
Q
12
_____ and _____ clauses are used to apply filter condition to each row and group of rows in a relation respectively.
a.
WHERE and HAVING
b.
HAVING and WHERE
c.
WHERE and GROUP BY
d.
GROUP BY and WHERE
Correct Answer & Explanation:
a
The WHERE clause is used to filter out the required tuples of a relation. The HAVING clause is used to filter out the groups of tuples of a relation.
Q
13
The Database Administrator (DBA) coordinates _____ and ______
a.
Database, DBMS
b.
Application, database
c.
Application, users
d.
Database, users
Correct Answer & Explanation:
d
The database administrator manages the data in the database. He decides who should be allowed access of the database. Thus, the database administrator (DBA) coordinates the database and its users.
Q
14
A parent-child relationship between the tables in a database is created by combining
a.
Primary key and foreign key
b.
Super key and foreign key
c.
Primary key and candidate key
d.
Foreign key and foreign key
Correct Answer & Explanation:
a
A parent-child relationship between tables can be established between the tables in a database by using the primary key and foreign key. The foreign key of the referencing relation refers to the primary key of the referenced relation. Thus, the referenced relation can be considered as the parent relation, and the referencing relation can be considered as the referenced relation.
Q
15
Which of the following operations is used to combine the tuples of the relations containing the same number of attributes?
a.
Join
b.
Union
c.
Product
d.
Combine
Correct Answer & Explanation:
b
1) The ‘join’ operation is used to combine the attributes of the tables based on the given condition.
2) The ‘union’ operation is used to combine the tuples of the relations containing same number of attributes.
3) The ‘product’ operation is used to match every tuple of a relation to every tuple of the other relation.
Q
16
Relational algebra is a _____ language. Relational calculus is a _____ language.
a.
Procedural, non-procedural
b.
Non-procedural, procedural
c.
Procedural, procedural
d.
Non-procedural, non-procedural
Correct Answer & Explanation:
a
Relation algebra is a procedural language as it describes how the result should be obtained. Relation calculus is a non-procedural (or) descriptive language, because it describes what result must be obtained.
Q
17
Given below is a bank transaction between two accounts x and y Read(x); x=x-2500; write(x); Read(y); y=y+2500; write(y); Which of the following constraints is used to ensure that the sum of the amounts in x and y remains constant?
a.
Durability
b.
Integrity
c.
Consistency
d.
Atomicity
Correct Answer & Explanation:
c
Consistency of a database ensures that any database transaction changes only the affected data in allowed ways so that the sum of amounts in x and y does not change.
Q
18
What are the ACID properties?
a.
Atomicity, Consistency, Isolation, Database
b.
Atomicity, Consistency, Integrity, Database
c.
Atomicity, Consistency, Isolation, Durability
d.
Atomicity, Consistency, Integrity, Durability
Correct Answer & Explanation:
b
The acid properties of database transactions are Atomicity, Consistency, Isolation, and Durability.
Q
19
Two-phase locking protocol ensures
a.
Conflict serializability
b.
Freedom from deadlock
c.
Both a and b
d.
None of the above
Correct Answer & Explanation:
a
Time stamp ordering ensures both conflict serializability and deadlock avoidance. But, the two-phase locking protocol ensures only conflict serializability.
Q
20
What are the four isolation levels in transaction control (in ascending order i.e. from the lowest level to the highest level)
a.
Repeatable read, read uncommitted, read committed, seralizable
b.
Read uncommitted, read committed, repeatable read, serializable
c.
Read uncommitted, read committed, serializable, repeatable read
d.
repeatable read, serializable, read uncommitted, read committed
Correct Answer & Explanation:
b
The isolation level describes the locking strategy employed in the database system to improve consistency of data. The ascending order of isolation levels of transaction control is Read uncommitted, read committed, repeatable read, serializable. The highest level of isolation is the serializability.



.png)