0% found this document useful (0 votes)
9 views

100 MCQs on Databases

The document contains 100 multiple-choice questions (MCQs) on databases, covering various topics such as the relational model, ER model, relational algebra, SQL, indexing, normalization, transactions, and concurrency control. Each question is followed by four answer options, with the correct answer indicated. The questions range from basic concepts to more advanced topics, providing a comprehensive overview of database knowledge.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

100 MCQs on Databases

The document contains 100 multiple-choice questions (MCQs) on databases, covering various topics such as the relational model, ER model, relational algebra, SQL, indexing, normalization, transactions, and concurrency control. Each question is followed by four answer options, with the correct answer indicated. The questions range from basic concepts to more advanced topics, providing a comprehensive overview of database knowledge.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

100 MCQs on Databases covering topics like relational model, ER model, relational algebra, SQL, indexing,

normalization, transactions, and concurrency control:

1–20: Relational Model & ER Model


1. Which of the following is a basic concept of the ER model?
A) Table
B) Attribute
C) Entity
D) Column
Answer: C
2. A weak entity has:
A) A primary key
B) No attributes
C) No key attribute
D) Foreign key
Answer: C
3. A relationship in ER model is represented by:
A) Rectangle
B) Diamond
C) Ellipse
D) Circle
Answer: B
4. Which operation is not part of relational algebra?
A) Select
B) Project
C) Merge
D) Join
Answer: C
5. Tuple Relational Calculus is based on:
A) First-order logic
B) Second-order logic
C) Set theory
D) Algebra
Answer: A
6. Cardinality refers to:
A) Number of tuples
B) Number of attributes
C) Number of relationships
D) Number of entities
Answer: A
7. Which key uniquely identifies a record in a relation?
A) Foreign key
B) Candidate key
C) Super key
D) Primary key
Answer: D
8. Derived attribute is represented in ER diagram as:
A) Rectangle
B) Double ellipse
C) Dashed ellipse
D) Solid line
Answer: C
9. Which is a valid relational algebra operation?
A) Cross join
B) Intersection
C) Union
D) All of the above
Answer: D
10. Total participation is represented by:
A) Single line
B) Double rectangle
C) Double line
D) Dashed line
Answer: C
11. The relational model was proposed by:
A) E. F. Codd
B) Peter Chen
C) Donald Knuth
D) Edgar Hoover
Answer: A
12. Entity set is a collection of:
A) Tables
B) Attributes
C) Entities of same type
D) Primary keys
Answer: C
13. Which of the following is a unary relationship?
A) Man - Wife
B) Teacher - Class
C) Employee - Employee
D) Student - Course
Answer: C
14. Which is not an aggregate function in SQL?
A) MAX
B) COUNT
C) MULTIPLY
D) AVG
Answer: C
15. In relational algebra, the operation σ represents:
A) Projection
B) Selection
C) Join
D) Union
Answer: B
16. Functional dependency is a property of:
A) Relationships
B) Transactions
C) Relations
D) Entities
Answer: C
17. Which of these is a binary operation in relational algebra?
A) Project
B) Select
C) Join
D) Rename
Answer: C
18. Which one is a one-to-many relationship?
A) One student - many courses
B) One course - one professor
C) Many students - one course
D) One manager - many employees
Answer: D
19. Which symbol represents projection in relational algebra?
A) π
B) σ
C) ∪
D) ×
Answer: A
20. In ER diagram, attributes are represented by:
A) Circle
B) Ellipse
C) Triangle
D) Diamond
Answer: B

21. Which normal form eliminates multivalued dependencies?


A) 2NF
B) 3NF
C) BCNF
D) 4NF
Answer: D
22. What is the main purpose of normalization?
A) Increase redundancy
B) Improve query speed
C) Eliminate data redundancy and ensure integrity
D) Decrease number of tables
Answer: C

23. Which normal form removes partial dependency?


A) 1NF
B) 2NF
C) 3NF
D) BCNF
Answer: B

24. A table with no repeating groups is in:


A) 1NF
B) 2NF
C) 3NF
D) BCNF
Answer: A

25. Transitive dependency is removed in:


A) 1NF
B) 2NF
C) 3NF
D) 4NF
Answer: C

26. Functional dependency X → Y means:


A) For each X there is exactly one Y
B) For each Y there is one X
C) X and Y are unrelated
D) Y depends on multiple X
Answer: A

27. A candidate key is:


A) A key that uniquely identifies tuples but is minimal
B) Any key with redundancy
C) Foreign key
D) A non-key attribute
Answer: A

28. Which is true for BCNF?


A) Every determinant is a candidate key
B) No keys exist
C) Only primary keys matter
D) It is weaker than 3NF
Answer: A

29. What is a super key?


A) A set of attributes that uniquely identify a tuple
B) A foreign key
C) An attribute with no dependency
D) None of the above
Answer: A

30. If a relation has two candidate keys and violates 3NF but satisfies BCNF, what does it mean?
A) BCNF is weaker than 3NF
B) BCNF is stricter and may not preserve all dependencies
C) Both are same
D) Relation is invalid
Answer: B

31. What is denormalization?


A) Combining normalized tables to improve performance
B) Breaking tables into smaller ones
C) Removing keys
D) Adding redundant data to all tables
Answer: A

32. Which is NOT a type of dependency?


A) Functional dependency
B) Multivalued dependency
C) Transitive dependency
D) Absolute dependency
Answer: D

33. Lossless decomposition means:


A) No data is lost when a relation is decomposed
B) Data is partially lost
C) Data is compressed
D) Data is encrypted
Answer: A

34. An attribute that uniquely identifies a tuple is:


A) Foreign key
B) Candidate key
C) Primary key
D) Composite key
Answer: C

35. Referential integrity is maintained by:


A) Primary key
B) Foreign key
C) Composite key
D) Candidate key
Answer: B

36. Redundancy in a database can cause:


A) Faster queries
B) Update anomalies
C) No effect
D) Better performance
Answer: B

37. A functional dependency is trivial if:


A) Y is subset of X in X → Y
B) X is subset of Y
C) X and Y are independent
D) Both X and Y are empty
Answer: A

38. Which normal form ensures no partial or transitive dependencies?


A) 1NF
B) 2NF
C) 3NF
D) BCNF
Answer: C

39. Decomposition is dependency preserving if:


A) All dependencies are preserved in decomposed relations
B) Some dependencies are lost
C) None are preserved
D) Decomposition is impossible
Answer: A

40. Which of the following is a composite key?


A) Single attribute key
B) Key made up of multiple attributes
C) Foreign key
D) Candidate key
Answer: B

41. In the relational model, a tuple is:


A) A column
B) A row
C) A table
D) An attribute
Answer: B

42. Which SQL statement is used to retrieve data from a database?


A) INSERT
B) UPDATE
C) SELECT
D) DELETE
Answer: C

43. Which SQL keyword is used to sort the result set?


A) ORDER BY
B) GROUP BY
C) SORT
D) FILTER
Answer: A
44. The JOIN operation in SQL is used to:
A) Combine rows from two or more tables
B) Create a new table
C) Delete data
D) Insert new rows
Answer: A

45. Which join returns only matching rows between tables?


A) INNER JOIN
B) LEFT JOIN
C) RIGHT JOIN
D) FULL JOIN
Answer: A

46. Which SQL command removes all rows from a table but keeps the table structure?
A) DELETE
B) DROP
C) TRUNCATE
D) REMOVE
Answer: C

47. What is a view in SQL?


A) A physical table
B) A virtual table
C) An index
D) A stored procedure
Answer: B

48. What does the acronym ACID stand for in databases?


A) Atomicity, Consistency, Isolation, Durability
B) Atomicity, Connectivity, Indexing, Durability
C) Access, Consistency, Isolation, Durability
D) Atomicity, Consistency, Integration, Durability
Answer: A

49. What is a transaction in a database?


A) A single SQL command
B) A sequence of operations performed as a single logical unit
C) A connection to the database
D) A data backup
Answer: B

50. Which of the following is a concurrency control method?


A) Locking
B) Indexing
C) Clustering
D) Partitioning
Answer: A

51. Which isolation level allows dirty reads?


A) Read Uncommitted
B) Read Committed
C) Repeatable Read
D) Serializable
Answer: A

52. In hashing, collisions are resolved by:


A) Open addressing
B) Chaining
C) Both A and B
D) None of the above
Answer: C

53. Which tree data structure is commonly used for indexing in databases?
A) Binary Tree
B) B+ Tree
C) AVL Tree
D) Trie
Answer: B

54. Which SQL command is used to create a new table?


A) CREATE TABLE
B) MAKE TABLE
C) NEW TABLE
D) ADD TABLE
Answer: A

55. In a relational schema, foreign key constraints ensure:


A) Uniqueness of rows
B) Referential integrity
C) Data normalization
D) Transaction atomicity
Answer: B

56. Which SQL clause is used to filter rows based on a condition?


A) WHERE
B) HAVING
C) ORDER BY
D) GROUP BY
Answer: A

57. Which operator in SQL is used to combine the result of two SELECT queries?
A) UNION
B) JOIN
C) INTERSECT
D) MERGE
Answer: A

58. The concept of a deadlock is related to:


A) Transaction management
B) Query optimization
C) Database backup
D) Data replication
Answer: A

59. Which type of index stores the actual data pointers?


A) Dense Index
B) Sparse Index
C) Primary Index
D) Secondary Index
Answer: A

60. The process of ensuring database consistency after a system crash is called:
A) Rollback
B) Recovery
C) Backup
D) Commit
Answer: B

61. Which of the following is NOT a characteristic of a transaction?


A) Atomicity
B) Consistency
C) Isolation
D) Redundancy
Answer: D

62. In SQL, which command is used to remove a table and all its data?
A) DELETE TABLE
B) DROP TABLE
C) REMOVE TABLE
D) TRUNCATE TABLE
Answer: B

63. What does the term “Tuple” mean in the relational model?
A) Column
B) Row
C) Table
D) Database
Answer: B

64. The closure of a set of functional dependencies is:


A) The minimal set of dependencies
B) The set of all dependencies logically implied by the original set
C) The set of all keys
D) The set of all attributes
Answer: B

65. What type of join returns all rows from the left table and matched rows from the right table?
A) INNER JOIN
B) LEFT OUTER JOIN
C) RIGHT OUTER JOIN
D) FULL OUTER JOIN
Answer: B
66. What is the main function of a query optimizer?
A) To generate query results
B) To find the most efficient way to execute a query
C) To parse the query
D) To store query results
Answer: B

67. Which SQL keyword is used to group rows sharing a property?


A) GROUP BY
B) ORDER BY
C) HAVING
D) WHERE
Answer: A

68. What does ACID property “Durability” mean?


A) Once a transaction commits, its results are permanent
B) Transactions are isolated
C) Transactions are atomic
D) Database is consistent
Answer: A

69. The minimal set of attributes that can uniquely identify a tuple is called:
A) Candidate key
B) Primary key
C) Foreign key
D) Super key
Answer: A

70. Which of the following is NOT a type of file organization?


A) Sequential
B) Indexed
C) Clustered
D) Non-clustered
Answer: D

71. What is the primary purpose of an index in a database?


A) To maintain data integrity
B) To speed up data retrieval
C) To store data
D) To secure data
Answer: B

72. Which is a property of a B+ tree?


A) All values are stored in leaf nodes
B) Values stored only in internal nodes
C) It is not balanced
D) It stores duplicate values in root only
Answer: A

73. What does the term “Deadlock” refer to in databases?


A) Failure of a disk
B) Two or more transactions waiting indefinitely for each other to release locks
C) Inconsistent data
D) Slow query performance
Answer: B

74. The term “Isolation” in transactions means:


A) Transactions are processed in a sequence
B) Intermediate transaction states are visible to others
C) Transactions do not affect each other’s execution
D) Transactions rollback after failure
Answer: C

75. In SQL, which command is used to save all changes made during the current transaction?
A) SAVE
B) COMMIT
C) ROLLBACK
D) STORE
Answer: B

76. A file that contains data sorted in order is called:


A) Sequential file
B) Indexed file
C) Hashed file
D) Random file
Answer: A

77. Which of the following is a pessimistic concurrency control method?


A) Timestamp ordering
B) Locking
C) Optimistic concurrency control
D) Multiversion concurrency control
Answer: B

78. In SQL, the HAVING clause is used:


A) To filter rows before grouping
B) To filter groups after grouping
C) To sort results
D) To join tables
Answer: B

79. Which type of join returns all rows from both tables, matching rows where possible?
A) INNER JOIN
B) FULL OUTER JOIN
C) LEFT JOIN
D) RIGHT JOIN
Answer: B

80. Which of the following is NOT a part of the relational algebra?


A) Selection
B) Projection
C) Join
D) Update
Answer: D

81. What is tuple calculus used for in databases?


A) Physical data storage
B) A non-procedural query language
C) To create tables
D) For transaction control
Answer: B

82. What does the SELECT operation in relational algebra do?


A) Selects columns
B) Selects rows satisfying a condition
C) Joins tables
D) Deletes tuples
Answer: B

83. Which of the following is NOT a relational algebra operation?


A) Union
B) Intersection
C) Aggregation
D) Cartesian product
Answer: C

84. In relational algebra, the projection operation:


A) Selects certain columns
B) Selects certain rows
C) Combines tables
D) Deletes rows
Answer: A

85. Which is true about tuple relational calculus?


A) Procedural query language
B) Non-procedural query language
C) Used for schema design
D) Not related to queries
Answer: B

86. Which of the following is NOT part of the ER model?


A) Entity
B) Attribute
C) Functional dependency
D) Relationship
Answer: C

87. Which of these represents a one-to-many relationship in ER model?


A) One entity linked to multiple entities of another type
B) Multiple entities linked to one entity
C) Both entities linked to one entity
D) No relation
Answer: A
88. Which constraint in ER model restricts number of entities in a relationship?
A) Participation constraint
B) Cardinality constraint
C) Key constraint
D) Dependency constraint
Answer: B

89. A weak entity is one that:


A) Has no primary key of its own
B) Has a primary key
C) Is not related to other entities
D) Has multiple keys
Answer: A

90. What is the difference between a primary key and a candidate key?
A) Primary key is chosen candidate key
B) Candidate key is chosen primary key
C) They are the same
D) Candidate key is always composite
Answer: A

91. Which of the following is an example of a data manipulation language (DML)?


A) CREATE
B) SELECT
C) DROP
D) ALTER
Answer: B

92. Which SQL command is used to modify existing data in a table?


A) UPDATE
B) MODIFY
C) CHANGE
D) ALTER
Answer: A

93. Which indexing technique uses hashing?


A) B+ Tree
B) Bitmap index
C) Static hashing
D) Clustered index
Answer: C

94. Which type of database backup captures only changes since last backup?
A) Full backup
B) Incremental backup
C) Differential backup
D) Snapshot
Answer: B

95. In SQL, which command is used to remove duplicates from the result set?
A) UNIQUE
B) DISTINCT
C) DIFFERENT
D) NO DUPLICATES
Answer: B

96. Which anomaly is caused by update on redundant data?


A) Insertion anomaly
B) Deletion anomaly
C) Update anomaly
D) Key anomaly
Answer: C

97. A foreign key in one table that references primary key in another table is used for:
A) Data integrity
B) Speeding up queries
C) Data backup
D) Data encryption
Answer: A

98. What does “Tuple Relational Calculus” allow?


A) Specifies what to retrieve without how to retrieve
B) Specifies how to retrieve
C) Specifies database design
D) Specifies transactions
Answer: A

99. In SQL, which command removes all rows but retains table structure?
A) DELETE
B) TRUNCATE
C) DROP
D) REMOVE
Answer: B

100. Which property of transactions ensures partial completion does not occur?
A) Atomicity
B) Consistency
C) Isolation
D) Durability
Answer: A

You might also like