0% Database Fundamentals - NAT (National Aptitude Test)Database Fundamentals refers to the Computer Science portion of the National Aptitude Test (NAT), a standardised test for admissions in Pakistan. 1 / 50Which of the following is a fundamental data model used to organize data into tables of rows and columns? Network Object-Oriented Hierarchical Relational 2 / 50In a "one-to-many" relationship, a single row in Table A can be related to: Many rows in Table B. Only one row in Table A. Only one row in Table B. Many rows in Table A. 3 / 50What is a database index analogous to? The story in a book. The glossary of a book. The table of contents in a book. The cover of a book. 4 / 50 In a relational database, what is a single, unordered set of attributes within a table called? Column Row Schema Key 5 / 50A database object that automatically executes a set of SQL statements in response to a specific event on a table is a: Stored Procedure View Function Trigger 6 / 50Which command would you use to change the structure of an existing table (e.g., add a new column)? UPDATE MODIFY ALTER CHANGE 7 / 50What is the key difference between the DELETE and TRUNCATE commands? TRUNCATE can be used with a WHERE clause. DELETE is DML and can be rolled back; TRUNCATE is DDL and typically cannot. DELETE is faster than TRUNCATE. TRUNCATE removes specific rows, while DELETE removes all rows. 8 / 50Which type of JOIN returns all rows from both tables, combining them where a match exists and filling with NULLs where it does not? RIGHT JOIN FULL OUTER JOIN INNER JOIN LEFT JOIN 9 / 50What does the CHECK constraint do? Checks the database for errors. Ensures that values in a column satisfy a specific condition. Verifies the connection to the database. Checks if a user has permission to access data. 10 / 50The property that ensures once a transaction is committed, it will persist even in the event of a system failure, is known as: Atomicity Durability Isolation Consistency 11 / 50The overall design of a database, describing tables, columns, relationships, and keys, is called the: Schema Index Catalog Instance 12 / 50Which of the following best describes a database View? A physical copy of a table. A diagram of the table relationships. The initial screen of the database software. A virtual table defined by a query on one or more base tables. 13 / 50 An artificial key created to serve as the primary key when no natural simple key exists is known as a: Surrogate Key Composite Key Foreign Key Alternate Key 14 / 50The process of intentionally introducing redundancy into a table to improve read performance is called: Denormalization Normalization Indexing Optimization 15 / 50A value that represents "unknown" or "not applicable" in a database is represented by: A zero (0) A negative number NULL A blank space 16 / 50A scenario where two transactions are waiting for each other to release locks is called a: Deadlock Timeout Live lock Race condition 17 / 50Which SQL clause is used to filter records based on a specified condition? HAVING WHERE FILTER BY FIND 18 / 50What is the main risk of having low data integrity in a database? Incorrect and unreliable information. Slower performance. Larger database size. Difficulty in backing up data. 19 / 50Which SQL command is used to retrieve data from a database? FETCH RETRIEVE SELECT GET 20 / 50Which SQL command is used to add new rows of data to a table? UPDATE ADD CREATE INSERT 21 / 50Which of the following is the correct order of SQL statement execution for a SELECT query with GROUP BY and HAVING? SELECT -> WHERE -> GROUP BY -> HAVING WHERE -> GROUP BY -> HAVING -> SELECT FROM -> SELECT -> WHERE -> GROUP BY -> HAVING FROM -> WHERE -> GROUP BY -> HAVING -> SELECT 22 / 50A key in one table that references the primary key of another table to link the two is called a: Composite Key Foreign Key Candidate Key Secondary Key 23 / 50What is the main goal of database normalization? To create more tables. To reduce data redundancy and improve data integrity. To increase the speed of all database operations. To improve data security. 24 / 50Which SQL command is used to permanently remove a record from a table? ERASE REMOVE DELETE DROP 25 / 50Which of the following is a DML (Data Manipulation Language) command? ALTER UPDATE GRANT CREATE 26 / 50 The UNIQUE constraint ensures that: All values in a column are different. Values in a column match values in another column A column is the primary key. A column cannot have NULL values. 27 / 50 In a database, a 'record' is a collection of: Databases Fields Tables Files 28 / 50Which normal form requires the elimination of repeating groups and ensures atomicity of values? Third Normal Form (3NF) First Normal Form (1NF) Boyce-Codd Normal Form (BCNF) Second Normal Form (2NF) 29 / 50Referential integrity is violated if: A new index is created. A primary key value is changed without updating the corresponding foreign keys. A view is created on multiple tables. A table is not normalized. 30 / 50The NOT NULL constraint is used to: Ensure a column contains only numbers. Make a column the primary key. Prevent a column from being used as a key. Ensure a column must always contain a value. 31 / 50Which ACID property ensures that concurrent transactions do not interfere with each other? Consistency Durability Isolation Atomicity 32 / 50The property that ensures a database transaction is treated as a single, indivisible unit is known as Isolation Durability Atomicity Consistency 33 / 50Which of the following is NOT a standard relationship type in a relational database? Many-to-Many One-to-Many One-to-One Many-to-One-to-Many 34 / 50What is the purpose of the ORDER BY clause? To define the order of columns in a table. To filter the results in a specific sequence. To order the tables in the database. To sort the result set of a query. 35 / 50The HAVING clause in SQL is typically used in conjunction with which other clause? SELECT GROUP BY WHERE ORDER BY 36 / 50 In 2nd Normal Form (2NF), a table must be in 1NF and all non-key attributes must be: Encrypted for security. Independent of each other. Dependent on the entire primary key. Dependent only on other non-key attributes. 37 / 50A primary key that consists of two or more columns is called a: Surrogate Key Complex Key Foreign Key Composite Key 38 / 50What is the primary purpose of a Primary Key? To establish a backup identifier. To provide a unique identifier for each row in a table. To link two tables together. To speed up data retrieval. 39 / 50Which command is a Data Definition Language (DDL) command? CREATE INSERT SELECT UPDATE 40 / 50What does SQL stand for? Standard Query Logic Simple Query Language Structured Query Language Structured Question Language 41 / 50What does the SQL DISTINCT keyword do? Deletes duplicate rows from a table. Eliminates duplicate values in the result set. Sorts the results. Filters the first row of each group. 42 / 50To resolve a many-to-many relationship between two tables (Students and Courses), the best practice is to Create a new junction table with foreign keys to both tables. Add a foreign key to the Courses table. Use a composite primary key in one of the tables. Add a foreign key to the Students table. 43 / 50Which type of join returns all records from the left table and the matched records from the right table? RIGHT JOIN LEFT JOIN INNER JOIN FULL JOIN 44 / 50What is the role of a database catalog or data dictionary? To serve as the primary backup file. To create logs for database transactions. To store the actual user data. To store metadata about the database structure. 45 / 50Which SQL operator is used to combine the result sets of two or more SELECT statements? UNION JOIN MERGE COMBINE 46 / 50What does DBMS stand for? Database Management System Data Backup Management Service Database Monitoring System Data Basic Management System 47 / 50A precompiled collection of SQL statements stored in the database is called a: Stored Procedure Function View Trigger 48 / 50The 'C' in ACID properties stands for: Control Consistency Concurrency Commitment 49 / 50Which of the following best describes a candidate key? Any attribute or set of attributes that could be chosen as the primary key. A key that is a candidate for deletion. A key that is a candidate for being a foreign key. A key that is used for indexing. 50 / 50 In the context of normalization, a transitive dependency exists when a non-key attribute depends on: The entire composite key. Another non-key attribute. The primary key. A foreign key. Your score isThe average score is 0% 0% Restart quiz