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