Docsity

DATABASE MANAGEMENT SYSTEMS EXAM PREPARATION – SQL, RELATIONAL DATABASES, NORMALIZATION, D, Exams of Nursing

Toggle sidebar
bg1
DATABASE MANAGEMENT SYSTEMS EXAM PREPARATION – SQL, RELATIONAL
DATABASES, NORMALIZATION, DATABASE DESIGN, TRANSACTIONS & DATA
SECURITY 2026-2027
1. In the context of database normalization, what is the primary objective of achieving Third Normal Form
(3NF)?
A. Ensuring that every non-key attribute is dependent only on the primary key.
B. Eliminating all transitive dependencies between non-prime attributes.
C. Removing all multi-valued dependencies from the relation.
D. Reducing the table to a single atomic value per cell.
Correct Answer: B
Rationale / Explanation: 3NF requires that a table is in 2NF and that all non-prime attributes are non-transitively dependent
on the primary key. Option B describes 2NF, while C describes 4NF. Option D refers to 1NF. Eliminating transitive dependencies is
the defining characteristic of 3NF, which minimizes data redundancy and update anomalies.
2. Which ACID property ensures that a transaction is treated as a single unit of work, where either all operations
succeed or none are applied?
A. Atomicity
B. Consistency
C. Isolation
D. Durability
Correct Answer: A
Rationale / Explanation: Atomicity guarantees that a transaction is 'all or nothing.' If any part of the transaction fails, the
entire transaction is aborted and the database state remains unchanged. Consistency ensures valid state transitions, Isolation manages
concurrent execution, and Durability ensures that committed changes persist even in the event of a system failure.
3. When using SQL, which join type returns all rows from the left table and the matched rows from the right
table, filling with NULLs where no match exists?
A. INNER JOIN
B. CROSS JOIN
C. LEFT OUTER JOIN
D. FULL OUTER JOIN
Correct Answer: C
Rationale / Explanation: A LEFT OUTER JOIN preserves all records from the left table regardless of whether a match
exists in the right table. INNER JOIN only returns rows with matches in both tables. CROSS JOIN produces a Cartesian product, and
FULL OUTER JOIN returns all rows from both tables, filling NULLs on both sides where matches are missing.
Page 1 of 51
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33

Partial preview of the text

Download DATABASE MANAGEMENT SYSTEMS EXAM PREPARATION – SQL, RELATIONAL DATABASES, NORMALIZATION, D and more Exams Nursing in PDF only on Docsity!

DATABASE MANAGEMENT SYSTEMS EXAM PREPARATION – SQL, RELATIONAL

DATABASES, NORMALIZATION, DATABASE DESIGN, TRANSACTIONS & DATA

SECURITY 2026-

1. In the context of database normalization, what is the primary objective of achieving Third Normal Form

(3NF)?

A. Ensuring that every non-key attribute is dependent only on the primary key. B. Eliminating all transitive dependencies between non-prime attributes. C. Removing all multi-valued dependencies from the relation. D. Reducing the table to a single atomic value per cell.

Correct Answer: B

Rationale / Explanation: 3NF requires that a table is in 2NF and that all non-prime attributes are non-transitively dependent on the primary key. Option B describes 2NF, while C describes 4NF. Option D refers to 1NF. Eliminating transitive dependencies is the defining characteristic of 3NF, which minimizes data redundancy and update anomalies.

2. Which ACID property ensures that a transaction is treated as a single unit of work, where either all operations

succeed or none are applied?

A. Atomicity B. Consistency C. Isolation D. Durability

Correct Answer: A

Rationale / Explanation: Atomicity guarantees that a transaction is 'all or nothing.' If any part of the transaction fails, the entire transaction is aborted and the database state remains unchanged. Consistency ensures valid state transitions, Isolation manages concurrent execution, and Durability ensures that committed changes persist even in the event of a system failure.

3. When using SQL, which join type returns all rows from the left table and the matched rows from the right

table, filling with NULLs where no match exists?

A. INNER JOIN

B. CROSS JOIN

C. LEFT OUTER JOIN

D. FULL OUTER JOIN

Correct Answer: C

Rationale / Explanation: A LEFT OUTER JOIN preserves all records from the left table regardless of whether a match exists in the right table. INNER JOIN only returns rows with matches in both tables. CROSS JOIN produces a Cartesian product, and FULL OUTER JOIN returns all rows from both tables, filling NULLs on both sides where matches are missing.

4. What is the primary purpose of a database index in a relational management system?

A. To enforce referential integrity constraints across tables. B. To reduce the storage space required for large datasets. C. To prevent unauthorized access to sensitive column data. D. To accelerate the retrieval of rows by minimizing disk I/O operations.

Correct Answer: D

Rationale / Explanation: Indexes are data structures, such as B-trees, that allow the database engine to locate specific rows without scanning the entire table. While they improve read performance, they do not enforce integrity (which is the role of constraints), nor do they reduce storage; in fact, they increase storage overhead.

5. In database security, what is the fundamental difference between Discretionary Access Control (DAC) and

Mandatory Access Control (MAC)?

A. DAC is used for read-only access, while MAC is used for write access. B. DAC is implemented at the hardware level, while MAC is implemented at the application level. C. DAC is based on user identity, while MAC is based on system-wide security labels. D. DAC allows the administrator to override all rules, whereas MAC prevents any administrative intervention.

Correct Answer: C

Rationale / Explanation: DAC allows object owners to grant access permissions to other users, making it identity-based. MAC is a non-discretionary model where the system enforces access based on security clearances and object labels, preventing users from changing permissions. This distinction is critical for maintaining strict data confidentiality in high-security environments.

6. Which SQL command is used to permanently save all changes made during the current transaction to the

database?

A. ROLLBACK

B. COMMIT

C. SAVEPOINT

D. GRANT

Correct Answer: B

Rationale / Explanation: The COMMIT command finalizes the transaction, making all changes permanent and visible to other users. ROLLBACK undoes changes, SAVEPOINT creates intermediate markers for partial rollbacks, and GRANT is used for security permissions. COMMIT is the standard mechanism for ensuring the Durability property of ACID transactions.

10. In SQL, what is the effect of the 'CASCADE' option when defining a FOREIGN KEY constraint?

A. It prevents the deletion of a parent record if child records exist. B. It automatically deletes or updates child records when the parent record is deleted or updated. C. It sets the child record's foreign key column to NULL upon parent deletion. D. It forces the database to perform a full table scan before any deletion.

Correct Answer: B

Rationale / Explanation: The CASCADE referential action ensures that changes to a parent table are propagated to dependent child tables, maintaining referential integrity automatically. Option A describes the RESTRICT or NO ACTION behavior. Option C describes the SET NULL behavior. CASCADE is essential for managing complex relationships without manual intervention.

11. In the context of database normalization, what specific condition must be met to satisfy the Boyce-Codd

Normal Form (BCNF) that is not required by 3NF?

A. Every non-prime attribute must be fully functionally dependent on the primary key. B. All transitive dependencies must be removed from the relation. C. Every determinant must be a candidate key. D. The relation must contain only atomic values in every column.

Correct Answer: C

Rationale / Explanation: BCNF is a stricter version of 3NF. While 3NF allows a determinant to be a non-key attribute if the dependent attribute is part of a candidate key, BCNF requires that every determinant in the table must be a candidate key, thereby eliminating all remaining redundancy from functional dependencies.

12. Which isolation level in SQL transactions provides the highest level of consistency by preventing dirty reads,

non-repeatable reads, and phantom reads?

A. Read Uncommitted B. Serializable C. Read Committed D. Repeatable Read

Correct Answer: B

Rationale / Explanation: The Serializable isolation level is the most restrictive, ensuring that concurrent transactions are executed in a way that produces the same result as if they were executed serially. This prevents all three common concurrency phenomena, whereas lower levels allow varying degrees of interference between transactions.

13. What is the primary function of the SQL 'GRANT' command within a Database Management System's

security framework?

A. To assign specific permissions to users or roles for database objects. B. To revoke existing access privileges from a specific database user. C. To define the structural integrity constraints of a new table. D. To initiate a new transaction block within a stored procedure.

Correct Answer: A

Rationale / Explanation: The GRANT command is a fundamental Data Control Language (DCL) statement used to provide specific privileges, such as SELECT, INSERT, or UPDATE, to database users or roles. It is essential for implementing Discretionary Access Control, whereas REVOKE is used to remove those permissions.

14. When designing an Entity-Relationship (ER) diagram, what does a 'weak entity' represent?

A. An entity that is not related to any other entity in the schema. B. An entity that contains only null values in its attributes. C. An entity that exists independently of other entities. D. An entity that does not have a primary key of its own.

Correct Answer: D

Rationale / Explanation: A weak entity is an entity that cannot be uniquely identified by its own attributes alone; it requires a relationship with an identifying owner entity. Its primary key is a combination of the owner's primary key and its own partial key, known as a discriminator.

15. Which SQL aggregate function is used to calculate the average value of a numeric column while automatically

ignoring NULL values?

A. SUM()

B. COUNT()

C. TOTAL()

D. AVG()

Correct Answer: D

Rationale / Explanation: The AVG() function calculates the arithmetic mean of a set of values. By standard SQL definition, aggregate functions like AVG, SUM, and MAX ignore NULL values in the calculation, ensuring that missing data does not skew the result of the mathematical operation.

19. In SQL, what is the difference between the 'WHERE' clause and the 'HAVING' clause?

A. WHERE filters rows before grouping, while HAVING filters groups after aggregation. B. HAVING is used for string comparisons, while WHERE is used for numeric comparisons. C. WHERE is used for joins, while HAVING is used for subqueries. D. There is no functional difference; they are interchangeable in all SQL dialects.

Correct Answer: A

Rationale / Explanation: The WHERE clause is applied to individual rows before any grouping or aggregation occurs. In contrast, the HAVING clause is applied to the result set after the GROUP BY operation, allowing for filtering based on aggregate values like SUM or COUNT.

20. Which ACID property ensures that once a transaction is committed, its changes are permanent and survive

subsequent system failures?

A. Atomicity B. Consistency C. Durability D. Isolation

Correct Answer: C

Rationale / Explanation: Durability guarantees that once a transaction has been committed, it will remain committed even in the event of a power loss, crash, or other system failure. This is typically achieved by writing transaction logs to non-volatile storage before confirming the commit to the user.

21. Which SQL clause is specifically required to filter the results of an aggregate function after a GROUP BY

operation has been performed?

A. WHERE

B. ORDER BY

C. LIMIT

D. HAVING

Correct Answer: D

Rationale / Explanation: The HAVING clause is designed to filter groups created by the GROUP BY clause based on aggregate conditions. The WHERE clause filters individual rows before grouping occurs, making it unsuitable for aggregate filtering. ORDER BY sorts the final result set, and LIMIT restricts the number of rows returned.

22. In the context of database normalization, what is the primary structural requirement for a table to be in

Second Normal Form (2NF)?

A. The table must contain no transitive dependencies. B. All attributes must be atomic, containing no repeating groups. C. All non-key attributes must be fully functionally dependent on the entire primary key. D. Every determinant must be a candidate key.

Correct Answer: C

Rationale / Explanation: 2NF requires that a table is in 1NF and that all non-key attributes are fully functionally dependent on the primary key, eliminating partial dependencies. Option C describes 1NF, Option B describes 3NF, and Option D describes BCNF. Partial dependency removal is the defining characteristic of 2NF.

23. Which concurrency control mechanism uses a timestamp-based approach to ensure that transactions are

executed in a serializable order?

A. Two-Phase Locking (2PL) B. Timestamp Ordering Protocol C. Optimistic Concurrency Control D. Multi-version Concurrency Control (MVCC)

Correct Answer: B

Rationale / Explanation: The Timestamp Ordering Protocol assigns a unique timestamp to each transaction and uses these to order operations, ensuring serializability without requiring locks. 2PL relies on lock acquisition phases, while MVCC maintains multiple versions of data to allow non-blocking reads, and Optimistic Control assumes conflicts are rare.

24. What is the primary security risk mitigated by implementing parameterized queries or prepared statements in

database applications?

A. SQL Injection B. Cross-Site Scripting (XSS) C. Buffer Overflow D. Denial of Service (DoS)

Correct Answer: A

Rationale / Explanation: Parameterized queries separate the SQL code from the user-supplied data, preventing malicious input from being interpreted as executable commands. This is the standard defense against SQL Injection. XSS, buffer overflows, and DoS attacks involve different vectors and are not primarily mitigated by query parameterization.

28. When performing a 'Left Outer Join', what happens to rows in the left table that have no corresponding match

in the right table?

A. They are excluded from the final result set. B. They are duplicated to match the right table's structure. C. The query will throw an error due to missing data. D. They are included in the result set with NULL values for the right table's columns.

Correct Answer: D

Rationale / Explanation: A Left Outer Join preserves all rows from the left table. If no match is found in the right table, the database engine populates the right-side columns with NULL values. This differs from an Inner Join, which would exclude these rows entirely, and is standard SQL behavior.

29. Which database design technique involves intentionally introducing redundancy to improve read performance

in high-traffic systems?

A. Normalization B. Indexing C. Denormalization D. Partitioning

Correct Answer: C

Rationale / Explanation: Denormalization is the process of adding redundant data or grouping data to reduce the number of joins required for complex queries, thereby increasing read speed. Normalization reduces redundancy, indexing speeds up lookups, and partitioning splits large tables into smaller, more manageable segments.

30. In the context of SQL security, what is the primary function of the 'REVOKE' command?

A. To remove previously granted permissions from a user or role. B. To create a new user account with administrative privileges. C. To permanently delete a table from the database schema. D. To audit all failed login attempts in the system.

Correct Answer: A

Rationale / Explanation: The REVOKE command is used in Data Control Language (DCL) to withdraw specific privileges that were previously granted to a user or role. It is the functional opposite of the GRANT command. It does not manage user creation, table deletion, or system auditing.

31. Which SQL command is utilized to modify the structure of an existing database table, such as adding or

dropping columns?

A. ALTER TABLE

B. UPDATE TABLE

C. MODIFY SCHEMA

D. CHANGE STRUCTURE

Correct Answer: A

Rationale / Explanation: The ALTER TABLE command is the standard Data Definition Language (DDL) statement used to change the structure of an existing table. UPDATE is a Data Manipulation Language (DML) command for modifying row data, while MODIFY SCHEMA and CHANGE STRUCTURE are not valid SQL keywords for structural modifications.

32. In specialized assessment: In the context of database normalization, what is the primary objective of achieving

Third Normal Form (3NF)?

A. Eliminating all multi-valued dependencies. B. Removing transitive dependencies from non-prime attributes. C. Ensuring every determinant is a candidate key. D. Removing partial functional dependencies.

Correct Answer: B

Rationale / Explanation: 3NF requires that a table is in 2NF and that no non-prime attribute is transitively dependent on the primary key. Option D describes 2NF, while Option C describes BCNF. Eliminating multi-valued dependencies is the focus of 4NF.

33. Which type of database index is structured as a balanced tree, allowing for efficient searching, insertion, and

deletion operations?

A. Hash Index B. Bitmap Index C. Clustered Index D. B-Tree Index

Correct Answer: D

Rationale / Explanation: A B-Tree index maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. While a clustered index determines physical storage order, the B-Tree is the specific data structure used for the balanced tree organization described.

37. What is the primary function of a 'Database Trigger' in a relational database management system?

A. To encrypt sensitive data at rest within the database files. B. To automatically execute a set of SQL statements in response to specific events on a table. C. To optimize query execution plans for complex joins. D. To manage user authentication and session timeouts.

Correct Answer: B

Rationale / Explanation: A trigger is a stored procedure that automatically executes or 'fires' when an event (such as INSERT, UPDATE, or DELETE) occurs on a specified table. It is used for auditing, enforcing complex business rules, or maintaining data integrity.

38. Which of the following best describes the 'Phantom Read' phenomenon in database transactions?

A. A transaction executes a query twice and finds new rows added by another committed transaction. B. A transaction reads the same row twice and gets different data. C. A transaction reads a row that is later rolled back. D. A transaction is unable to complete due to a deadlock.

Correct Answer: A

Rationale / Explanation: A phantom read occurs when a transaction re-executes a range query and finds new rows that were inserted by another transaction that committed in the interim. Option A describes a non-repeatable read, and Option B describes a dirty read.

39. What is the purpose of the 'UNIQUE' constraint in SQL?

A. To ensure that all values in a column are distinct from one another. B. To ensure that all values in a column are non-null. C. To define the primary key of the table. D. To link two tables together via a foreign key.

Correct Answer: A

Rationale / Explanation: The UNIQUE constraint ensures that no two rows in a table have the same value in the specified column(s). Unlike a primary key, it allows NULL values (depending on the RDBMS implementation), but it does not enforce non-nullability by default.

40. Which SQL clause is used to combine rows from two or more tables based on a related column between them?

A. UNION

B. JOIN

C. MERGE

D. INTERSECT

Correct Answer: B

Rationale / Explanation: The JOIN clause is used to combine rows from two or more tables based on a related column. UNION and INTERSECT are set operators used to combine result sets vertically, while MERGE is used for conditional insert/update/delete operations.

41. In the context of database security, what is the primary objective of implementing Role-Based Access Control

(RBAC)?

A. To encrypt all data stored within the database tables. B. To ensure that every transaction is logged for auditing purposes. C. To prevent SQL injection attacks by sanitizing user inputs. D. To assign permissions to roles rather than individual users, simplifying management.

Correct Answer: D

Rationale / Explanation: RBAC simplifies security administration by grouping permissions into roles, which are then assigned to users. This reduces the complexity of managing individual user privileges. Encryption, logging, and input sanitization are distinct security measures that do not define the core functionality of RBAC.

42. Which normal form is achieved when a table is in 2NF and no non-prime attribute is transitively dependent on

the primary key?

A. Third Normal Form (3NF) B. First Normal Form (1NF) C. Second Normal Form (2NF) D. Boyce-Codd Normal Form (BCNF)

Correct Answer: A

Rationale / Explanation: Third Normal Form (3NF) specifically addresses transitive dependencies, requiring that all non-prime attributes depend only on the primary key. 1NF deals with atomicity, 2NF removes partial dependencies, and BCNF is a stricter version of 3NF that handles overlapping candidate keys.

46. Which type of join returns all rows from the left table and the matched rows from the right table, filling with

NULL if no match exists?

A. INNER JOIN

B. FULL OUTER JOIN

C. CROSS JOIN

D. LEFT OUTER JOIN

Correct Answer: D

Rationale / Explanation: A LEFT OUTER JOIN preserves all records from the left table regardless of matches in the right table. INNER JOIN requires matches on both sides, FULL OUTER JOIN returns all rows from both, and CROSS JOIN produces a Cartesian product.

47. What is the primary purpose of a Foreign Key constraint in a relational database?

A. To uniquely identify each record in a single table. B. To speed up data retrieval operations via indexing. C. To ensure referential integrity between two related tables. D. To restrict the range of values allowed in a specific column.

Correct Answer: C

Rationale / Explanation: Foreign keys maintain referential integrity by ensuring that values in a column match the primary key of another table. Primary keys handle unique identification, indexes handle performance, and CHECK constraints handle value restrictions.

48. Which SQL command is used to permanently remove a table and all its data from the database schema?

A. TRUNCATE TABLE

B. DROP TABLE

C. DELETE FROM

D. ALTER TABLE

Correct Answer: B

Rationale / Explanation: DROP TABLE removes the entire table structure and its data. TRUNCATE removes data but keeps the structure, DELETE removes rows conditionally, and ALTER modifies the structure of an existing table without deleting it.

49. In database design, what is the 'Cardinality' of a relationship?

A. The number of attributes associated with an entity. B. The physical storage size of the database tables. C. The level of normalization applied to the schema. D. The maximum number of times an entity instance can participate in a relationship.

Correct Answer: D

Rationale / Explanation: Cardinality defines the numerical relationship between entity instances (e.g., one-to-one, one-to-many). It does not refer to attribute counts, physical storage, or normalization levels, which are distinct concepts in database architecture.

50. Which isolation level provides the highest level of consistency by preventing Dirty Reads, Non-Repeatable

Reads, and Phantom Reads?

A. READ UNCOMMITTED

B. READ COMMITTED

C. SERIALIZABLE

D. REPEATABLE READ

Correct Answer: C

Rationale / Explanation: SERIALIZABLE is the strictest isolation level, ensuring transactions are executed as if they were sequential. The other levels offer lower isolation, allowing various phenomena like phantom reads or non-repeatable reads to occur for the sake of higher concurrency performance.

51. Which specific SQL constraint ensures that a column or group of columns contains no duplicate values across

the entire table, while allowing NULL values unless otherwise specified?

A. PRIMARY KEY

B. UNIQUE

C. CHECK

D. FOREIGN KEY

Correct Answer: B

Rationale / Explanation: The UNIQUE constraint enforces data integrity by ensuring all values in a column are distinct. Unlike the PRIMARY KEY constraint, which also enforces uniqueness but prohibits NULL values and is limited to one per table, the UNIQUE constraint allows for multiple instances per table and typically permits NULL values depending on the specific RDBMS implementation.

55. Which SQL command is used to permanently remove all data from a table while retaining the table's schema

definition and associated indexes?

A. DROP TABLE

B. DELETE FROM

C. ALTER TABLE

D. TRUNCATE TABLE

Correct Answer: D

Rationale / Explanation: The TRUNCATE command is a DDL operation that removes all rows from a table much faster than DELETE because it does not log individual row deletions. DROP TABLE removes the entire structure, while DELETE is a DML operation that allows for conditional row removal using a WHERE clause.

56. In database security, what is the primary function of the 'GRANT' command?

A. To remove existing access privileges from a user or role. B. To create a new user account within the database system. C. To provide specific permissions to a user or role for database objects. D. To audit all successful and failed login attempts.

Correct Answer: C

Rationale / Explanation: The GRANT command is used in SQL to assign specific privileges (such as SELECT, INSERT, UPDATE, or DELETE) to database users or roles. It is a fundamental component of Discretionary Access Control (DAC), whereas REVOKE is used to remove those previously granted permissions.

57. Which type of join returns only the rows where there is a match in both participating tables based on the join

condition?

A. LEFT OUTER JOIN

B. INNER JOIN

C. RIGHT OUTER JOIN

D. FULL OUTER JOIN

Correct Answer: B

Rationale / Explanation: An INNER JOIN returns only the rows that satisfy the join predicate in both tables. Outer joins (Left, Right, and Full) are designed to include non-matching rows from one or both tables, filling missing values with NULL, which distinguishes them from the intersection-based logic of an INNER JOIN.

58. What is the primary objective of the 'Durability' property in the ACID model for database transactions?

A. Guaranteeing that once a transaction is committed, it remains permanent even in the event of a system crash. B. Ensuring that transactions occur in isolation from one another. C. Maintaining the integrity of data constraints during concurrent updates. D. Allowing the database to recover to a consistent state after a partial transaction failure.

Correct Answer: A

Rationale / Explanation: Durability ensures that once a transaction is committed, the changes are written to non-volatile storage and will survive subsequent system failures. This is typically achieved through transaction logs or write-ahead logging mechanisms, distinguishing it from Atomicity, which handles the 'all-or-nothing' nature of the transaction execution.

59. Which normal form is achieved when a table is in 3NF and every determinant is a candidate key?

A. First Normal Form (1NF) B. Boyce-Codd Normal Form (BCNF) C. Second Normal Form (2NF) D. Fourth Normal Form (4NF)

Correct Answer: B

Rationale / Explanation: BCNF is a stricter version of 3NF. While 3NF addresses transitive dependencies, BCNF specifically requires that for every non-trivial functional dependency X -> Y, X must be a superkey. This eliminates anomalies that can still exist in 3NF when a table has multiple overlapping candidate keys.

60. What is the primary purpose of a 'Clustered Index' in a relational database?

A. To create a separate structure that points to the actual data rows. B. To enforce uniqueness across multiple tables. C. To optimize queries that do not involve the primary key. D. To store the data rows themselves in the order of the index key.

Correct Answer: D

Rationale / Explanation: A clustered index determines the physical order of data in a table. Because the data rows are stored in the leaf nodes of the index, there can be only one clustered index per table. Non-clustered indexes, by contrast, are separate structures that contain pointers to the actual data rows.