Database MCQs (201-300)
201. The main goal of query optimization is:
A) To minimize query execution time
B) To maximize query cost
C) To increase data redundancy
D) To reduce normalization
Answer: A
202. A query execution plan shows:
A) Steps chosen by the optimizer to execute a query
B) Database schema
C) Indexing details only
D) None
Answer: A
203. Cost-based optimization uses:
A) Statistics about tables and indexes
B) Query rewriting only
C) Manual hints only
D) None
Answer: A
204. Rule-based optimization depends on:
A) Predetermined set of rules
B) Statistics
C) Cost of disk I/O
D) None
Answer: A
205. Indexing improves:
A) Query performance
B) Insert performance
C) Data redundancy
D) None
Answer: A
206. The main disadvantage of indexing is:
A) Slower inserts and updates
B) Faster queries
C) More normalization
D) None
Answer: A
207. A clustered index:
A) Determines the physical order of data
B) Is created on non-key columns
C) Cannot be used in SQL
D) None
Answer: A
208. A non-clustered index:
A) Stores index separately from table data
B) Determines physical order
C) Cannot have duplicates
D) None
Answer: A
209. A composite index is created on:
A) Multiple columns
B) One column
C) Foreign key only
D) None
Answer: A
210. B-tree index is commonly used because:
A) It balances search paths
B) It is faster than sequential scan
C) Both A and B
D) None
Answer: C
211. Hash indexing is efficient for:
A) Equality searches
B) Range queries
C) Sorting
D) None
Answer: A
212. Bitmap indexes are best for:
A) Columns with few distinct values
B) Columns with many distinct values
C) Text columns
D) None
Answer: A
213. Dense index stores:
A) An index entry for every search key value
B) Entries for some values only
C) Unique values only
D) None
Answer: A
214. Sparse index stores:
A) Entries for some search key values
B) All records
C) Duplicate keys
D) None
Answer: A
215. The ACID property in transactions ensures:
A) Atomicity, Consistency, Isolation, Durability
B) Accuracy, Control, Isolation, Durability
C) Access, Concurrency, Integrity, Durability
D) None
Answer: A
216. Atomicity ensures:
A) All or none of the operations are done
B) Transactions are fast
C) Data is normalized
D) None
Answer: A
217. Consistency ensures:
A) Database remains valid before and after transactions
B) Data is encrypted
C) Queries are optimized
D) None
Answer: A
218. Isolation ensures:
A) Concurrent transactions do not affect each other
B) Only one transaction runs at a time
C) Faster execution
D) None
Answer: A
219. Durability ensures:
A) Changes persist even after a system crash
B) Temporary updates only
C) No transaction logs
D) None
Answer: A
220. A transaction log is used for:
A) Recovery after failure
B) Query optimization
C) Index creation
D) None
Answer: A
221. COMMIT statement is used to:
A) Save all changes made in a transaction
B) Undo all changes
C) Start a new transaction
D) None
Answer: A
222. ROLLBACK statement:
A) Undoes changes in a transaction
B) Saves changes
C) Deletes tables
D) None
Answer: A
223. SAVEPOINT in SQL is used to:
A) Set a point to roll back to within a transaction
B) Commit a transaction
C) Delete records
D) None
Answer: A
224. Serializability ensures:
A) Transactions produce the same result as if executed serially
B) Transactions always run concurrently
C) Indexes are created
D) None
Answer: A
225. Concurrency control avoids:
A) Conflicts among transactions
B) Database design
C) Indexing
D) None
Answer: A
226. Lost update problem occurs when:
A) Two transactions update the same data simultaneously
B) A transaction fails
C) A table is locked
D) None
Answer: A
227. Dirty read occurs when:
A) A transaction reads uncommitted data from another
B) Data is missing
C) Data is normalized
D) None
Answer: A
228. Non-repeatable read occurs when:
A) A row changes between reads by different transactions
B) A transaction rolls back
C) Data is locked
D) None
Answer: A
229. Phantom read occurs when:
A) New rows appear in subsequent reads
B) Data is deleted
C) Transaction fails
D) None
Answer: A
230. Locking is used in databases to:
A) Maintain consistency during concurrent access
B) Speed up queries
C) Backup data
D) None
Answer: A
231. Shared locks allow:
A) Read-only access
B) Write access
C) No access
D) None
Answer: A
232. Exclusive locks allow:
A) Write operations only
B) Read-only
C) Multiple users
D) None
Answer: A
233. Deadlock occurs when:
A) Two transactions wait for each other’s resources
B) Database shuts down
C) Too many locks
D) None
Answer: A
234. Deadlocks can be prevented by:
A) Resource ordering or timeout methods
B) Ignoring them
C) Dropping tables
D) None
Answer: A
235. The log-based recovery method uses:
A) Redo and Undo operations
B) Index scans
C) SQL plans
D) None
Answer: A
236. Checkpoints help in:
A) Faster recovery after a crash
B) Index creation
C) Normalization
D) None
Answer: A
237. Shadow paging is a technique used for:
A) Database recovery
B) Query optimization
C) Encryption
D) None
Answer: A
238. Database security ensures:
A) Data confidentiality, integrity, and availability
B) Query speed
C) Storage increase
D) None
Answer: A
239. Authentication verifies:
A) The user’s identity
B) Access permissions
C) Encryption strength
D) None
Answer: A
240. Authorization defines:
A) What actions an authenticated user can perform
B) Who can log in
C) Database schema
D) None
Answer: A
241. Encryption protects data by:
A) Converting it into unreadable format
B) Duplicating it
C) Deleting sensitive info
D) None
Answer: A
242. A role in DBMS is used to:
A) Group privileges
B) Create databases
C) Manage logs
D) None
Answer: A
243. GRANT command is used to:
A) Give privileges to a user
B) Remove privileges
C) Delete users
D) None
Answer: A
244. REVOKE command is used to:
A) Remove privileges granted to users
B) Grant access
C) Backup data
D) None
Answer: A
245. Database auditing helps in:
A) Tracking user activities
B) Increasing redundancy
C) Creating indexes
D) None
Answer: A
246. In file organization, data records can be stored:
A) Sequentially or randomly
B) Only sequentially
C) In memory only
D) None
Answer: A
247. Sequential file organization is best suited for:
A) Batch processing
B) Random access
C) Real-time updates
D) None
Answer: A
248. Hashed file organization uses:
A) Hash function to compute record location
B) Sequential search
C) Tree structure
D) None
Answer: A
249. Heap file organization stores records:
A) In the order they arrive
B) In sorted order
C) Using indexes
D) None
Answer: A
250. An overflow area in file organization is used to:
A) Handle collisions or full data blocks
B) Store indexes
C) Backup data
D) None
Answer: A
251. In an ER model, entities are represented by:
A) Rectangles
B) Ellipses
C) Diamonds
D) Lines
Answer: A
252. Attributes in an ER diagram are represented by:
A) Ellipses
B) Rectangles
C) Diamonds
D) Squares
Answer: A
253. Relationships in an ER model are represented by:
A) Diamonds
B) Circles
C) Rectangles
D) Arrows
Answer: A
254. A weak entity is one that:
A) Depends on another entity for its identification
B) Has its own key attribute
C) Is not related to any entity
D) None
Answer: A
255. The key attribute of an entity is represented in ER diagram by:
A) Underlining it
B) Double ellipse
C) Dotted line
D) None
Answer: A
256. A multivalued attribute is represented in ER diagram by:
A) Double ellipse
B) Dashed ellipse
C) Rectangle
D) None
Answer: A
257. A derived attribute is represented by:
A) Dashed ellipse
B) Double ellipse
C) Rectangle
D) None
Answer: A
258. A one-to-many relationship is represented by:
A) 1:N
B) M:N
C) 1:1
D) None
Answer: A
259. A many-to-many relationship is represented by:
A) M:N
B) 1:1
C) 1:N
D) None
Answer: A
260. A relationship between two entities is called:
A) Binary relationship
B) Unary relationship
C) Recursive relationship
D) None
Answer: A
261. A relationship between three entities is called:
A) Ternary relationship
B) Binary relationship
C) Recursive
D) None
Answer: A
262. Generalization in ER model means:
A) Combining similar entities into a higher-level entity
B) Splitting entities
C) Deleting relationships
D) None
Answer: A
263. Specialization in ER model means:
A) Creating sub-entities from a higher-level entity
B) Combining entities
C) Removing attributes
D) None
Answer: A
264. The process of converting ER diagram into tables is called:
A) Mapping
B) Merging
C) Joining
D) None
Answer: A
265. A primary key is:
A) A unique identifier for records
B) A foreign key
C) Duplicate attribute
D) None
Answer: A
266. A foreign key is used to:
A) Establish relationship between tables
B) Identify rows uniquely
C) Store binary data
D) None
Answer: A
267. A candidate key is:
A) Any attribute that can uniquely identify a record
B) Non-unique key
C) Foreign key only
D) None
Answer: A
268. A super key is:
A) A set of attributes that uniquely identifies a record
B) A minimal key
C) Always composite
D) None
Answer: A
269. The minimal super key is called:
A) Candidate key
B) Alternate key
C) Primary key
D) None
Answer: A
270. An alternate key is:
A) Candidate key not chosen as primary key
B) Foreign key
C) Non-key attribute
D) None
Answer: A
271. The attribute that cannot be divided further is:
A) Atomic attribute
B) Composite attribute
C) Derived attribute
D) None
Answer: A
272. Composite attributes can be:
A) Split into smaller sub-parts
B) Stored as atomic values
C) Both A and B
D) None
Answer: A
273. First Normal Form (1NF) requires:
A) All attributes contain atomic values only
B) No partial dependency
C) No transitive dependency
D) None
Answer: A
274. Second Normal Form (2NF) requires:
A) No partial dependency on primary key
B) Atomic attributes
C) No transitive dependency
D) None
Answer: A
275. Third Normal Form (3NF) removes:
A) Transitive dependencies
B) Partial dependencies
C) Composite attributes
D) None
Answer: A
276. A table is in BCNF if:
A) Every determinant is a candidate key
B) No transitive dependency
C) Every table has a primary key
D) None
Answer: A
277. 4NF deals with:
A) Multivalued dependencies
B) Transitive dependencies
C) Functional dependencies
D) None
Answer: A
278. 5NF deals with:
A) Join dependencies
B) Multivalued dependencies
C) Transitive dependencies
D) None
Answer: A
279. Denormalization is:
A) Combining tables to improve performance
B) Splitting tables
C) Normalizing again
D) None
Answer: A
280. Functional dependency is a relationship between:
A) Attributes
B) Tables
C) Databases
D) None
Answer: A
281. If A → B and B → C, then A → C is called:
A) Transitive dependency
B) Partial dependency
C) Multivalued dependency
D) None
Answer: A
282. A determinant is:
A) Any attribute that determines another attribute
B) Always a key
C) A derived field
D) None
Answer: A
283. Relational algebra is:
A) A procedural query language
B) A non-procedural query language
C) A DDL language
D) None
Answer: A
284. Relational calculus is:
A) A non-procedural query language
B) Procedural language
C) DDL
D) None
Answer: A
285. The SELECT operation in relational algebra is used to:
A) Choose rows satisfying a condition
B) Choose columns
C) Join tables
D) None
Answer: A
286. The PROJECT operation in relational algebra is used to:
A) Select specific columns
B) Select specific rows
C) Delete data
D) None
Answer: A
287. The UNION operation combines:
A) All rows from both relations, removing duplicates
B) Only distinct columns
C) Joins
D) None
Answer: A
288. The INTERSECTION operation returns:
A) Common tuples between two relations
B) All tuples
C) Difference of tuples
D) None
Answer: A
289. The DIFFERENCE operation returns:
A) Tuples in one relation but not in the other
B) Common tuples
C) Joined tuples
D) None
Answer: A
290. The CARTESIAN PRODUCT in relational algebra is used for:
A) Joining all tuples from both relations
B) Sorting data
C) Deleting data
D) None
Answer: A
291. The JOIN operation in relational algebra combines:
A) Tuples from two relations based on a condition
B) Duplicate rows
C) Attributes only
D) None
Answer: A
292. The DIVISION operation in relational algebra is used to:
A) Find tuples related to all values of another relation
B) Split tables
C) Normalize tables
D) None
Answer: A
293. Integrity constraints ensure:
A) Accuracy and consistency of data
B) Query optimization
C) Security
D) None
Answer: A
294. Entity integrity ensures:
A) Primary key cannot be NULL
B) Foreign key cannot be NULL
C) All values unique
D) None
Answer: A
295. Referential integrity ensures:
A) Foreign key matches a primary key in another table
B) Primary key is unique
C) Columns are atomic
D) None
Answer: A
296. Domain constraint restricts:
A) The range of valid values for an attribute
B) Number of rows
C) Indexing
D) None
Answer: A
297. The NOT NULL constraint ensures:
A) Attribute must have a value
B) Attribute can be empty
C) Unique values only
D) None
Answer: A
298. The UNIQUE constraint ensures:
A) All values in a column are distinct
B) Values can repeat
C) No foreign key
D) None
Answer: A
299. The CHECK constraint is used to:
A) Limit values based on a condition
B) Enforce foreign keys
C) Create indexes
D) None
Answer: A
300. The DEFAULT constraint provides:
A) A value automatically when none is supplied
B) Null value
C) Random data
D) None
Answer: A