










































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











































Question 1. Which of the following best describes the primary advantage of a DBMS over a traditional file-system approach? A) Faster data entry B) Data independence C) Unlimited storage capacity D) Automatic data backup Answer: B Explanation: Data independence means applications are insulated from changes in data storage structures, a key benefit of DBMSs. Question 2. In the DBMS components model, which element is responsible for defining the rules that govern data access? A) Hardware B) Software C) Procedures D) Users Answer: C Explanation: Procedures (or policies) dictate how users may interact with the data, ensuring consistency and security. Question 3. Which relational model characteristic guarantees that each row in a table can be uniquely identified? A) Atomic values B) Unordered rows C) Primary key constraint D) Domain integrity Answer: C Explanation: The primary key enforces uniqueness for each tuple in a relation. Question 4. In a relational table, what does the term “domain” refer to?
A) The set of all rows B) The set of permissible values for an attribute C) The primary key column D) The foreign key relationship Answer: B Explanation: A domain defines the data type and allowable values for a column (attribute). Question 5. Which of the following is NOT a type of key in relational database design? A) Candidate key B) Super key C) Composite key D) Index key Answer: D Explanation: “Index key” is not a formal key type; indexes are structures that improve access but are not keys per relational theory. Question 6. What integrity rule is violated when a foreign key column contains a value that does not exist in the referenced primary key column? A) Entity integrity B) Referential integrity C) Domain integrity D) User integrity Answer: B Explanation: Referential integrity ensures that foreign key values must match existing primary key values. Question 7. During the database life-cycle, which phase follows “Requirements Gathering”?
Answer: B Explanation: One department (the “one” side) can relate to many employees (the “many” side). Question 11. When converting an ER model to a relational schema, a many-to-many relationship is typically implemented by: A) Adding a foreign key to one of the participating tables B) Merging the two tables into one C) Creating a junction (associative) table with foreign keys to both entities D) Using a composite primary key in one of the original tables Answer: C Explanation: An associative table resolves M:N relationships by storing pairs of foreign keys. Question 12. Which of the following is a characteristic of a physical database design? A) Identifying entities and attributes B. Defining primary keys C. Choosing specific data types for columns D. Determining relationship cardinalities Answer: C Explanation: Physical design involves selecting storage-specific data types, indexes, and partitioning strategies. Question 13. A relation is in First Normal Form (1NF) when: A) All attributes are atomic and there are no repeating groups
B) All non-key attributes depend on the whole primary key C) There are no transitive dependencies D. All candidate keys are identified Answer: A Explanation: 1NF eliminates multivalued or composite attributes, ensuring each field holds a single value. Question 14. Which normal form specifically addresses partial dependency of non-key attributes on a composite primary key? A) 1NF B) 2NF C) 3NF D) BCNF Answer: B Explanation: 2NF removes partial dependencies, requiring that non-key attributes depend on the whole primary key. Question 15. A table that meets 3NF but not BCNF typically suffers from: A) Multivalued attributes B) Transitive dependencies C) Overlapping candidate keys D) Redundant rows Answer: C Explanation: BCNF resolves cases where a non-key attribute is part of a candidate key, which 3NF may allow. Question 16. Which DDL command would you use to add a new column named “email” to an existing “customers” table? A) INSERT INTO customers (email) B) ALTER TABLE customers ADD COLUMN email VARCHAR(255);
Answer: C Explanation: INNER JOIN returns the intersection of rows that satisfy the join condition. Question 20. Which SQL aggregate function ignores NULL values when calculating the result? A) COUNT() B) SUM() C) AVG() D) All of the above Answer: D Explanation: Aggregate functions like SUM, AVG, COUNT(column) automatically skip NULLs; COUNT() counts rows regardless. Question 21. In relational algebra, the σ (sigma) operator corresponds to which SQL clause? A) SELECT (column list) B) WHERE C) FROM D) GROUP BY Answer: B Explanation: σ performs row selection based on a predicate, equivalent to the SQL WHERE clause. Question 22. Which relational algebra operator is used to eliminate duplicate tuples from a relation? A) π (project) B) δ (duplicate elimination) C) ∪ (union) D) ρ (rename)
Answer: B Explanation: The δ operator removes duplicate rows, similar to SQL’s SELECT DISTINCT. Question 23. A database index primarily improves performance for which type of operation? A) Data definition statements (CREATE, ALTER) B) Data manipulation statements that search for specific values C) Backup and recovery processes D) Transaction commit logging Answer: B Explanation: Indexes speed up query retrieval by providing quick lookups for searched columns. Question 24. Denormalization is sometimes applied to improve performance. Which scenario best justifies this technique? A) Reducing storage cost B) Eliminating update anomalies C) Decreasing join complexity in read-heavy reporting queries D) Enforcing stricter referential integrity Answer: C Explanation: Denormalization adds redundant data to avoid costly joins in heavy read environments. Question 25. Which ACID property ensures that a transaction’s effects are permanent even after a system crash? A) Atomicity B) Consistency C) Isolation D) Durability
Explanation: Views present a virtual table derived from a query; unless specified as materialized, they are not physically stored. Question 29. Which backup strategy captures only the data that has changed since the last full backup? A) Full backup B) Incremental backup C) Differential backup D) Snapshot backup Answer: B Explanation: Incremental backups record changes since the most recent backup of any type. Question 30. Which of the following best defines “entity integrity”? A) No duplicate rows in a table B) Primary key columns cannot contain NULL values C) Foreign keys must reference existing primary keys D) All attributes must follow domain rules Answer: B Explanation: Entity integrity requires that primary key fields are always populated with unique, non-NULL values. Question 31. Which of the following statements about flat-file storage versus relational databases is true? A) Flat files automatically enforce referential integrity. B) Relational databases support ad-hoc queries without predefined schemas. C) Flat files store data in tables with rows and columns. D) Relational databases eliminate data redundancy completely. Answer: B
Explanation: Relational DBMSs allow dynamic SQL queries over structured schemas; flat files lack such query capabilities. Question 32. In the context of DBMS hardware, which component most directly affects transaction throughput? A) CPU speed B) Network bandwidth C) Disk I/O subsystem D) Monitor resolution Answer: C Explanation: Disk I/O determines how quickly data can be read/written, a critical factor for transaction processing. Question 33. Which SQL statement creates a unique constraint on the “username” column of the “users” table? A) ALTER TABLE users ADD UNIQUE (username); B) CREATE CONSTRAINT UNIQUE ON users(username); C) MODIFY TABLE users SET UNIQUE username; D) UPDATE TABLE users UNIQUE username; Answer: A Explanation: ALTER TABLE … ADD UNIQUE defines a unique constraint on a column. Question 34. What does the term “atomic value” imply in the context of relational databases? A) The value can be split into multiple sub-values B) The value is indivisible and stored as a single unit C) The value is automatically indexed D) The value is a foreign key reference Answer: B
Explanation: The combination of both foreign keys uniquely identifies each student-course pairing; a composite primary key enforces this. Question 38. Which of the following is a valid reason to use a surrogate key instead of a natural key? A) The natural key is short and immutable B) The natural key contains business meaning that may change C) The surrogate key improves data readability for end-users D) Surrogate keys enforce referential integrity automatically Answer: B Explanation: Surrogate keys are preferred when natural keys are unstable or carry business semantics that could change. Question 39. Which of these SQL functions returns the current date and time? A) GETDATE() B) CURRENT_TIME() C) SYSDATE() D) ALL OF THE ABOVE (depending on DBMS) Answer: D Explanation: Different DBMSs implement different functions (GETDATE in SQL Server, SYSDATE in Oracle, CURRENT_TIMESTAMP in ANSI SQL). Question 40. When a foreign key is defined with ON DELETE CASCADE, what happens if the referenced parent row is deleted? A) The delete operation is rejected B) The child rows are automatically deleted C) The foreign key values are set to NULL D) The database generates an error and rolls back the transaction Answer: B
Explanation: CASCADE propagates the delete to dependent rows, maintaining referential integrity. Question 41. Which relational algebra operation would you use to retrieve only the “name” and “salary” columns from the “employees” relation? A) σ (selection) B) π (projection) C) ⋈ (join) D) ∪ (union) Answer: B Explanation: Projection (π) selects specific attributes from a relation. Question 42. In SQL, which keyword is used to combine the result sets of two SELECT statements while removing duplicates? A) UNION ALL B) UNION C) INTERSECT D) EXCEPT Answer: B Explanation: UNION merges results and eliminates duplicate rows; UNION ALL keeps all rows. Question 43. Which of the following best describes a “deadlock” in a multi-user database environment? A) Two transactions waiting for each other’s locks, causing indefinite waiting B) A transaction that never commits because of a syntax error C) A system crash that corrupts the transaction log D) A lock that is held indefinitely by a single user Answer: A
Question 47. Which of the following statements about a “candidate key” is true? A) Every candidate key must be a composite key B) A table can have multiple candidate keys, but only one is chosen as primary C) Candidate keys can contain NULL values D) Candidate keys are automatically indexed by the DBMS Answer: B Explanation: A candidate key uniquely identifies rows; one is selected as the primary key, others remain alternate keys. Question 48. What does the SQL clause “GROUP BY ROLLUP” provide that a standard GROUP BY does not? A) Filtering of groups B) Hierarchical subtotal and grand-total rows C) Sorting of groups in descending order D) Automatic creation of indexes on grouped columns Answer: B Explanation: ROLLUP adds aggregate rows for each level of grouping, useful for reporting. Question 49. Which DDL command would you use to permanently remove the “products” table and all its data? A) DROP TABLE products; B) DELETE FROM products; C) TRUNCATE TABLE products; D) REMOVE TABLE products; Answer: A Explanation: DROP TABLE deletes the table definition and its stored data. Question 50. In a transaction log, the “commit” record indicates:
A) The start of a transaction B) That all changes made by the transaction are durable C) That the transaction has been rolled back D) That the transaction encountered an error Answer: B Explanation: A commit record signals that the transaction’s changes are saved and can be recovered after a crash. Question 51. Which of the following best describes “domain integrity”? A) Ensuring primary keys are unique B) Enforcing data type and permissible values for each attribute C) Preventing orphaned foreign key records D) Guaranteeing that all tables have at least one row Answer: B Explanation: Domain integrity enforces that column values conform to defined data types and constraints. Question 52. Which SQL keyword is used to change the data type of an existing column? A) MODIFY COLUMN B) ALTER COLUMN TYPE C) ALTER TABLE … ALTER COLUMN … TYPE … D) CHANGE COLUMN Answer: C Explanation: The ANSI syntax uses ALTER TABLE … ALTER COLUMN column_name TYPE new_type. Question 53. A view that includes a WHERE clause restricting rows to “department = ‘HR’” is primarily used to: A) Reduce storage space
D) They simplify foreign key relationships Answer: B Explanation: Surrogate keys are system-generated and have no inherent business meaning. Question 57. Which backup method ensures that you can restore the database to any point in time? A) Full backup only B) Incremental backup only C) Full + incremental + transaction log backups D) Differential backup only Answer: C Explanation: Combining full, incremental, and transaction log backups enables point-in-time recovery. Question 58. Which SQL statement would you use to change the default value of the “status” column in the “orders” table to ‘Pending’? A) ALTER TABLE orders ALTER COLUMN status SET DEFAULT 'Pending'; B) MODIFY TABLE orders SET DEFAULT status='Pending'; C) UPDATE orders SET status='Pending' WHERE status IS NULL; D) CREATE DEFAULT ON orders.status = 'Pending'; Answer: A Explanation: ALTER TABLE … ALTER COLUMN … SET DEFAULT changes the column’s default value. Question 59. Which isolation level permits “dirty reads”? A) READ UNCOMMITTED B) READ COMMITTED C) REPEATABLE READ D) SERIALIZABLE
Answer: A Explanation: READ UNCOMMITTED allows a transaction to read uncommitted changes made by other transactions. Question 60. In a relational schema, a relation that is both in 3NF and has every determinant as a candidate key is said to be in: A) 2NF B) BCNF C) 4NF D) 5NF Answer: B Explanation: BCNF requires that for every functional dependency, the determinant be a candidate key. Question 61. Which SQL clause would you use to sort the result set by “salary” in descending order? A) ORDER BY salary DESC B) SORT BY salary DESCENDING C) GROUP BY salary DESC D) HAVING salary DESC Answer: A Explanation: ORDER BY with DESC orders rows from highest to lowest salary. Question 62. A “compound primary key” is: A) A primary key that consists of multiple columns together B) A primary key that references another table C) A primary key that is automatically generated D) A primary key that can contain NULL values Answer: A