











































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!












































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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.