MCQ Dbms
MCQ Dbms
MCQ Dbms
Option A: To modify schema definition in one level without affecting schema definition in
the next lower level.
Option B: To modify schema definition in one level without affecting schema definition in
the next higher level.
Option C: To modify data in one level without affecting the data in the next lower level.
Option D: To modify data in one level without affecting the data in the next higher level.
2. Data redundancy leads to higher storage and access cost. It may lead to
Option A: Data isolation
Option B: Data inconsistency
Option C: Integrity problem
Option D: Atomicity
3. The an attribute (say X) of entity set is calculated from other attribute value
(say Y). The attribute X is called
1
Option A: Single valued
Option B: Multi valued
Option C: Composite
Option D: Derived
4. A weak entity type always has a total participation constraint w.r.t. its identifying
relationship, because
Option A: Weak entity have a partial key
Option B: Weak entity cannot be identified with an owner entity.
Option C: Weak entity cannot be identified without an owner entity.
Option D: Weak entity cannot identified without an identifying relationship
2
Option B: Two or more tables share the same number of columns and same domain
Option C: Two or more tables have the same degree
Option D: Two or more tables share the same domains
8. r∩s=
Option A: r – (r – s)
Option B: s – (r – s)
Option C: (r u s) – (r – s)
Option D: (r u s) /(s u r)
9. Let E1 and E2 be two entities in an E-R diagram with one multi-valued attribute
in E1,R1 and R2 are two relationships between E1 and E2, where R1 is one-to-
many and R2 is many-to-many,R1 and R2 do not have any attributes of their
own,What is the minimum number of tables required to represent this situation in
the relational model.
Option A: 2
Option B: 4
Option C: 3
Option D: 5
10. Write a query to set default value for salary to 25000 for table employee
Option A: UPDATE employee MODIFY salary DEFAULT 25000
Option B: UPDATE employee SET salary To DEFAULT 25000
Option C: ALTER TABLE employee SET salary To DEFAULT 25000
Option D: ALTER TABLE employee MODIFY salary DEFAULT 25000
11. ⦁ Consider the employee table:employee ( employee id, name, dept name,
salary )Create a new employee `E-101', named `Ashwin singh', with
50,000 salary for department `developer'. Identify the appropriate SQL.
Option A: INSERT INTO TABLE employee VALUES (`E-101',`Ashwin Singh',`Wireless',
100000)
3
Option B: INSERT INTO employee (`E-101',`Ashwin Singh',`DEVELOPER', 50000)
Option C: INSERT INTO employee VALUES(`E-101',`Ashwin Singh',`DEVELOPER',
50000)
Option D: INSERT INTO employee table(employee id, name, dept name, salary) VALUES
(`E-101',`Ashwin Singh',`DEVELOPER', 50000)
14. Let R= (A,B,C,D,E,F) be a relation with the following dependencies. C->F, E->A,
EC->D, A->B. Which of the following is a key for R
Option A: CD
Option B: EC
4
Option C: AE
Option D: AC
17. Identify correct rules in growing phase (first phase) in two-phase locking protocol.
Option A: Transaction can only acquire shared lock(lock-s) and exclusive (lock-X)
Option B: transaction can only acquire shared lock(lock-s) ,exclusive (lock-X) and covert
lock-s to lock-X
Option C: transaction can release shared lock(lock-s) ,release exclusive (lock-X) and covert
lock-s to lock-X
Option D: transaction can acquire only shared lock(lock-s) and release exclusive (lock-X)
5
18. Suppose in a database, there are three transactions T1, T2 and T3 with timestamp
10, 20 and 30 respectively. T2 is holding a data item which T1 and T3 are
requesting to acquire. Which of the following statement is correct in respect of
Wait-die Deadlock Prevention scheme?
Option A: Transaction T1 will wait for T2 to release the data item.
Option B: Transaction T1 will be aborted.
Option C: Transaction T3 will wait for T2 to release the data item.
Option D: Transaction T2 will wait for T1 to release the data item.
22. The operation produces a new relation with only some of the attributes of R, and
removes duplicate tuples.
6
Option A: Union
Option B: Intersect
Option C: Select
Option D: Project
23. In which operation the resultant relation contains all pairs of tuples from the two
relations, regardless of whether their attribute values match.
Option A: Join
Option B: Set Difference
Option C: Cartesian product
Option D: Union
24. What is not true for a file based system to store data?
Option A: Provides data consistency
Option B: More redundancy
Option C: No security
Option D: Difficulty in accessing data.
26. An ER model of a database consists of entity types E1 and E2. These are
connected by a relationship R which does not have its own attribute. Under which
one of the following conditions, can the relational table for R be merged with that
of E1?
Option A: Relationship R is one-to-many and the participation of E1 in R is total.
Option B: Relationships are one-to-many and the participation of E1 in R is partial.
7
Option C: Relationship R is many-to-one and the participation of E1 in R is total.
Option D: Relationship R is many-to-one and the participation of E1 in R is partial.
29. The Join operation in which it keeps every tuple in first or left relation R if no
matching tuple is found in S, then the attributes of S in join result filled with
NULL values
Option A: Left outer join
8
Option B: Right outer join
Option C: Full join
Option D: Inner join
30. Consider the employee table:employee ( employee id, name, dept name, salary )
Create a new employee `E-101', named `Ashwin singh', with 50,000 salary for
department `developer'. Identify the appropriate SQL.
Option A: INSERT INTO TABLE employee VALUES (`E-101',`Ashwin Singh',`Wireless',
10,00,000)
Option B: INSERT INTO employee (`E-101',`Ashwin Singh',`DEVELOPER', 50,000)
Option C: INSERT INTO employee VALUES(`E-101',`Ashwin Singh',`DEVELOPER',
50,000)
Option D: INSERT INTO employee table(employee id, name, dept name, salary) VALUES
(`E-101',`Ashwin Singh',`DEVELOPER', 50,000)
32. If several concurrent transactions are executed over the same data set and the
second transaction updates the database before the first transaction is finished, the
____ property is violated and the database is no longer consistent
Option A: Atomicity
Option B: Consistency
Option C: Durability
Option D: Isolation
9
33. "Consider a relation R (A, B, C, D, E, F, G, H), where each attribute is
atomic, and following functional dependencies exist. CH → G , A → BC,
B → CFH, E → A, F → EG The relation R is __________ ."
Option A: in 1NF but not in 2NF
Option B: in 2NF but not in 3NF
Option C: in 3NF but not in BCNF
Option D: in BCNF
34. In the process of normalization, the decomposition should satisfy the following
properties
Option A: lossy but dependency preserving
Option B: lossless but not dependency preserving
Option C: lossless and dependency preserving
Option D: lossy and not dependency preserving
36. The scheme of database recovery is that all the updates of transactions are
recorded in the database on disk before the transaction commits.
Option A: Immediate update
Option B: Deferred update
Option C: Shadow paging
Option D: Checkpoint
10
37. Consider following 2 schedules
S1:r1(X);r3(Y);r3(X);r2(Y);r2(Z);w3(Y);w2(Z);r1(Z);w1(X);w1(Z)
S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z);r2(Z); w3(Y); w1(X); w2(Z);w1(Z);W3(Z)
Option A: S1 and S2 both are conflict serializable
Option B: only S1 is conflict serializable
Option C: only S2 is conflict serializable
Option D: S1 and S2 both are not conflict serializable
38. ⦁ Choose the option that correctly explains in words, the function of the
following relational algebra expression
39. When a person in the university is belonging to more than one lower level entity
set such as student as well as faculty then the constraint is
Option A: Disjoint
Option B: Total
Option C: Overlapping
Option D: Partial
11
Consider the following two statements about database transaction schedules:
40.
I. Strict two-phase locking protocol generates conflict serializable schedules that
are also recoverable.
41. The capacity to alter the database schema at one level without affecting any other
levels is termed as
Option A: Data Independence
Option B: Data Mapping
Option C: Data Isolation
Option D: Data Transformation
42. Which of the following describes the database structure and constraints?
Option A: View
Option B: Schema
Option C: Meta data
Option D: Instance
12
Option D: When an entity instance may be a member of at least one lower level entity set..
44. If car is the entity type then Maruti 800, Swift dzire are the ________?
Option A: Instance
Option B: Schema
Option C: Field
Option D: Attribute
46. If relation r contains Nr tuples, and relation s contains Ns tuples, then the result of
which operation contains Nr × Ns tuples?
Option A: Union
Option B: Join
Option C: Cartesian Product
Option D: Set difference
13
48. ⦁ What is the cardinality of column A, if a relation R(A,B,C,D,E) contains
40 rows and every column contains unique values.
Option A: 200
Option B: 40
Option C: 4
Option D: 20
49. Consider Entity set A and B in ER diagram having many to many relationship
between A and B. How to map this relationship into a relational model?
Option A: By adding primary key of Entity set A as a foreign key component in Entity set B
Option B: By adding primary key of Entity set B as a foreign key component in Entity set A
Option C: By creating a separate relation(R) for mapping binary many to many relationships
which includes the primary key of both A and B.
Option D: By creating combine relation for entity set A and B
50. Consider Table Employees have 10 records and it has NOT NULL salary column
which is also UNIQUE.
14
51. Consider Schema:
Dept(dept_name, location, city);
Which command can be used to delete column location from the given relation
Option A: MODIFY TABLE Dept DROP COLUMN location;
Option B: ALTER TABLE Dept DROP COLUMN location;
Option C: ALTER TABLE Dept DROP location;
Option D: MODIFY TABLE Dept DROP location;
Option D: INSERT INTO instructor tableinstr_id, name, dept name, salary) VALUES (`I-101',
`Ashwin Singh',`maths', 50,000)
15
Option C: In 2NF ,there should not be any Full functional dependencies
Option D: In BCNF, trivial FD are allowed
Option B: 3NF
Option C: 1NF
Option D: BCNF
57. What is true about the Wait-Die Algorithm for deadlock handling.
Option A: Preemptive
Option B: Non-preemptive
Option C: Prefers Younger Transactions
Option D: Both B And C
58. ⦁ Identify correct rules in growing phase (first phase) in two-phase locking
protocol.
Option A: Transaction can acquire only shared lock(LOCK-S) and exclusive (lock-X)
Option B: Transaction can acquire only shared lock(LOCK-s) ,exclusive (lOCK-X) and
covert Lock-S to Lock-X
16
Option C: Transaction can release shared lock(LOCK-s) ,release exclusive (lOCK-X) and
covert Lock-S to Lock-X
Option D: Transaction can acquire only shared lock(LOCK-S) and release exclusive (lock-X)
Descriptive Questions
Consider a dependency diagram of relation R and normalize it up to third normal
form.
17
Produce ER Diagram from the following relational database Schema.
Consider above relational schema and formulate SQL queries for the following:
6
(i)Modify the cost of DBMS books by 10%
(ii)Find the author of the books which are available in Mumbai store
(iii)Find the title of the most expensive book
(iv)Find the total quantity of books in each store
(v) Add a new record in Book(Assume values as per requirement)
Explain the transaction processing with the help of a state diagram?
7
8
What is the key of R?
Decompose R into 2NF and 3NF relations.
18
Explain log based recovery techniques with examples?
10 Explain different types of Database users and the responsibilities of the DBA?
Design an EER schema for a BANK database.
Each bank can have multiple branches, and each branch can have multiple accounts and
loans. Bank keeps the track of different types of Accounts (Saving_aacount,
11 Checking_account) , Loans(Car_loans,Home_loans,…) , each account’s Transaction
(deposit, withdrawal,check,..) and each loan’s Payments; both of these include the
amount, date and time.
State any assumptions you make about the additional requirement clearly.
Write SQL queries for the given database :
Emp(Eid, Ename, Sal, City)
Works(Eid, Cid)
Company(Cid, Cname, City)
⦁ Find how many employees are working for the company ‘ANZ Cooperation”.
Explain the three levels of abstraction in DBMS including physical and logical
13 data independence.
19
Consider the given schema:
1. List the employees who have a manager who works for a department
14 based in Mumbai.
20
Convert following E-R diagram to relational schema and equivalent schema
diagram
15
Explain 3NF .Consider relation r1 with the functional dependencies that hold on
it.
16 r1(p, q, r, s, t)
p → q,r,s,t
s→t
check whether r1 is in 3NF or not .If it is not in 3NF decompose into 3NF.
17 Explain transaction ,properties and states with suitable example
Explain timestamp based protocol and how timestamp-ordering protocol
18
guarantees serializability
21