









































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: What is a database? A) A structured collection of data B) A computer virus C) A type of software bug D) A web browser tool Answer: A Explanation: A database is an organized and structured collection of data that can be easily accessed, managed, and updated. Question 2: Which of the following is a primary characteristic of modern databases? A) Data randomness B) Data integrity C) Data inconsistency D) Data redundancy only Answer: B Explanation: Data integrity is key to ensuring that the data stored in a database is accurate and consistent throughout its lifecycle. Question 3: In relational databases, what does the term “table” refer to? A) A graphical user interface B) A collection of rows and columns that store data C) A data backup method D) A type of network connection Answer: B Explanation: In relational databases, a table is a structured format consisting of rows and columns used to store data records. Question 4: What is the function of a primary key in a database table? A) It ensures data encryption B) It uniquely identifies each record in a table C) It sorts the data alphabetically D) It provides data backup Answer: B Explanation: A primary key uniquely identifies each record in a table, ensuring that no two rows have the same key value. Question 5: Which type of database is designed to handle unstructured or semi-structured data? A) Relational Database B) Spreadsheet C) NoSQL Database D) Text File Answer: C Explanation: NoSQL databases are optimized to store unstructured or semi-structured data, offering flexibility compared to traditional relational databases.
Question 6: Which SQL command is used to retrieve data from a database? A) INSERT B) SELECT C) UPDATE D) DELETE Answer: B Explanation: The SELECT command is used to retrieve or query data from a database table. Question 7: What does ACID stand for in the context of transactions? A) Atomicity, Consistency, Isolation, Durability B) Accessibility, Compatibility, Integrity, Distribution C) Accuracy, Concurrency, Isolation, Data-loss prevention D) Atomicity, Compatibility, Isolation, Deployment Answer: A Explanation: ACID stands for Atomicity, Consistency, Isolation, and Durability, which are the key properties ensuring reliable transaction processing. Question 8: What is normalization in database design? A) The process of encrypting data B) The process of organizing data to reduce redundancy C) The process of backing up data D) The process of creating user interfaces Answer: B Explanation: Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity. Question 9: Which normal form ensures that every non-key attribute is fully functionally dependent on the primary key? A) First Normal Form (1NF) B) Second Normal Form (2NF) C) Third Normal Form (3NF) D) Boyce-Codd Normal Form (BCNF) Answer: B Explanation: Second Normal Form (2NF) requires that all non-key attributes are fully functionally dependent on the entire primary key, eliminating partial dependency. Question 10: What is denormalization in the context of databases? A) Increasing the number of tables B) Combining tables to improve query performance C) Splitting tables into smaller ones D) Removing indexes from tables Answer: B Explanation: Denormalization is the process of combining tables to improve query performance at the expense of increased redundancy. Question 11: Which command is used to add a new record in SQL? A) UPDATE
Explanation: The JOIN clause is used to combine rows from two or more tables based on a related column between them. Question 17: Which type of JOIN returns all rows when there is a match in either table? A) INNER JOIN B) LEFT JOIN C) RIGHT JOIN D) FULL OUTER JOIN Answer: D Explanation: A FULL OUTER JOIN returns all rows from both tables when there is a match in either one. Question 18: What is an index in a database? A) A pointer to data in a table B) A database backup C) A graphical report D) A type of SQL function Answer: A Explanation: An index is a database structure that improves the speed of data retrieval by providing quick access to rows in a table. Question 19: Which SQL clause is used to group rows that have the same values in specified columns? A) GROUP BY B) ORDER BY C) HAVING D) DISTINCT Answer: A Explanation: The GROUP BY clause is used to group rows that have the same values in specified columns, often used with aggregate functions. Question 20: What does the HAVING clause do in SQL? A) Filters groups based on a condition B) Sorts the query results C) Deletes groups D) Adds new columns Answer: A Explanation: The HAVING clause is used to filter records after a GROUP BY operation, based on a specified condition. Question 21: Which of the following is an aggregate function in SQL? A) COUNT() B) IF() C) LEN() D) SUBSTRING() Answer: A Explanation: COUNT() is an aggregate function that returns the number of items in a group.
Question 22: In SQL, what is a subquery? A) A query embedded inside another query B) A query that updates data C) A query that deletes data D) A query that creates tables Answer: A Explanation: A subquery is a query nested within another SQL query to further refine data retrieval. Question 23: Which clause is used to remove duplicate records in SQL? A) UNIQUE B) DISTINCT C) DIFFERENT D) SEPARATE Answer: B Explanation: The DISTINCT keyword is used to return only unique (different) values by removing duplicate records from the result set. Question 24: What is referential integrity in a database? A) Ensuring that all data is encrypted B) Ensuring that relationships between tables remain consistent C) Ensuring that data is backed up D) Ensuring that the database runs on multiple servers Answer: B Explanation: Referential integrity ensures that the relationships between tables remain consistent, meaning that foreign keys correctly reference primary keys in related tables. Question 25: Which isolation level prevents dirty reads in transaction processing? A) READ UNCOMMITTED B) READ COMMITTED C) REPEATABLE READ D) SERIALIZABLE Answer: B Explanation: READ COMMITTED isolation level prevents dirty reads by ensuring that any data read is committed at the moment it is read. Question 26: What does the COMMIT statement do in SQL? A) Undoes the last transaction B) Saves all changes made in a transaction C) Deletes a transaction D) Creates a new table Answer: B Explanation: The COMMIT statement is used to save all changes made in the current transaction, making them permanent. Question 27: Which SQL clause is used to filter results based on a range of values? A) LIKE B) BETWEEN
Explanation: Cardinality refers to the numerical relationships between entities, such as one-to-one, one- to-many, or many-to-many relationships. Question 33: Which of the following is a common type of NoSQL database? A) Relational B) Document-based C) Hierarchical D) Flat file Answer: B Explanation: Document-based NoSQL databases store data in document formats like JSON, offering flexibility and scalability. Question 34: What is the primary benefit of cloud databases? A) They require no internet connection B) They offer scalability and cost efficiency C) They eliminate the need for security D) They run exclusively on desktop computers Answer: B Explanation: Cloud databases offer scalability, cost efficiency, and flexibility by providing managed database services accessible over the internet. Question 35: Which of the following is a common feature of distributed databases? A) Centralized storage only B) Single-user access C) Data replication across multiple nodes D) Lack of backup options Answer: C Explanation: Distributed databases replicate data across multiple nodes to ensure high availability and fault tolerance. Question 36: What is sharding in the context of databases? A) Encrypting data B) Partitioning a database into smaller, more manageable pieces C) Merging tables together D) Creating redundant backups Answer: B Explanation: Sharding is the process of partitioning a database into smaller pieces, which improves manageability and performance. Question 37: Which SQL keyword is used to combine the results of two queries? A) JOIN B) UNION C) INTERSECT D) MERGE Answer: B Explanation: The UNION keyword is used to combine the results of two or more SELECT statements into a single result set.
Question 38: What is a composite key? A) A key composed of multiple columns B) A key that encrypts data C) A key that indexes a table D) A key that is automatically generated Answer: A Explanation: A composite key is made up of two or more columns that together uniquely identify a record in a table. Question 39: In database transactions, what does rollback do? A) Permanently saves changes B) Reverses changes made during the transaction C) Splits the transaction into multiple parts D) Optimizes query performance Answer: B Explanation: A rollback undoes all changes made during the current transaction, reverting the database to its previous state. Question 40: Which constraint ensures that a column cannot have a NULL value? A) UNIQUE B) PRIMARY KEY C) NOT NULL D) CHECK Answer: C Explanation: The NOT NULL constraint ensures that a column must always have a value and cannot be left empty. Question 41: What is the purpose of a database trigger? A) To automate responses to specific database events B) To manually back up the database C) To create new tables D) To enforce user authentication Answer: A Explanation: A trigger is a special kind of stored procedure that automatically executes in response to certain events on a table, such as INSERT, UPDATE, or DELETE operations. Question 42: Which of the following is an advantage of using stored procedures? A) They always slow down performance B) They improve performance by reducing client-server communication C) They increase the complexity of the database D) They do not support transactions Answer: B Explanation: Stored procedures can improve performance by reducing the amount of communication between the client and server, as the SQL code is executed directly on the database. Question 43: What is the purpose of a database schema? A) To store data in binary format
D) To permanently delete data Answer: A Explanation: Point-in-time recovery allows a database to be restored to a specific moment in time, which is critical for recovering data after an incident. Question 49: Which recovery model allows for point-in-time recovery in SQL Server? A) Simple Recovery Model B) Full Recovery Model C) Bulk-logged Recovery Model D) Minimal Recovery Model Answer: B Explanation: The Full Recovery Model in SQL Server supports point-in-time recovery by retaining all transaction logs until a backup is performed. Question 50: What is the primary responsibility of a database administrator (DBA)? A) Writing all application code B) Managing and maintaining the database systems C) Designing web interfaces D) Creating operating systems Answer: B Explanation: A DBA is responsible for the installation, configuration, maintenance, and security of database systems, ensuring optimal performance and reliability. Question 51: Which SQL command is used to update existing records in a table? A) UPDATE B) MODIFY C) CHANGE D) SET Answer: A Explanation: The UPDATE command is used to modify existing records in a table based on specified conditions. Question 52: What does the term “data modeling” refer to? A) The process of storing data on physical disks B) The process of designing a database structure C) The process of encrypting data D) The process of writing SQL queries Answer: B Explanation: Data modeling involves designing the structure of a database, including entities, relationships, and constraints, to efficiently store and manage data. Question 53: Which of the following is an example of a document-based NoSQL database? A) MySQL B) MongoDB C) Oracle Database D) PostgreSQL Answer: B
Explanation: MongoDB is a popular document-based NoSQL database that stores data in flexible, JSON- like documents. Question 54: What is the primary function of a query processor in a DBMS? A) To store data permanently B) To parse, optimize, and execute SQL queries C) To create user accounts D) To backup data automatically Answer: B Explanation: The query processor is responsible for parsing SQL queries, optimizing them, and executing the appropriate operations on the database. Question 55: Which of the following best describes ACID properties? A) They ensure that transactions are processed reliably B) They determine the size of the database C) They are used to encrypt database communications D) They define the structure of database tables Answer: A Explanation: ACID properties (Atomicity, Consistency, Isolation, Durability) ensure that transactions are processed reliably, maintaining data integrity. Question 56: What is the function of the CHECK constraint in a database? A) To ensure that a column has only unique values B) To limit the values that can be placed in a column C) To automatically backup the database D) To join two tables together Answer: B Explanation: The CHECK constraint limits the values that can be entered into a column by specifying a condition that must be met. Question 57: In SQL, what is a correlated subquery? A) A subquery that runs independently of the outer query B) A subquery that refers to columns in the outer query C) A subquery that creates indexes D) A subquery that deletes data Answer: B Explanation: A correlated subquery is one that refers to a column from the outer query, making it dependent on the outer query’s data for execution. Question 58: What is the significance of using indexes in a database? A) They guarantee data accuracy B) They enhance data retrieval speed C) They replace the need for backups D) They automate SQL query writing Answer: B Explanation: Indexes improve the performance of data retrieval operations by providing a faster lookup mechanism for rows in a table.
Answer: B Explanation: The DISTINCT keyword is used in SQL to remove duplicate rows from the result set, ensuring that only unique rows are returned. Question 65: What is a benefit of using stored procedures in database applications? A) They eliminate the need for database backups B) They can encapsulate complex logic and improve performance C) They automatically generate ER diagrams D) They require no security measures Answer: B Explanation: Stored procedures encapsulate complex logic, reduce network traffic, and can improve performance by executing precompiled code on the database server. Question 66: Which of the following is an advantage of denormalization? A) It always reduces data redundancy B) It can improve query performance by reducing join operations C) It makes database design more complex D) It enforces stricter data integrity Answer: B Explanation: Denormalization can improve query performance by reducing the need for join operations, although it may introduce some redundancy. Question 67: What is the primary purpose of the GROUP BY clause in SQL? A) To delete duplicate rows B) To aggregate data by grouping rows with common values C) To sort the query result D) To create new tables automatically Answer: B Explanation: The GROUP BY clause aggregates data by grouping rows that share the same value(s), often used with aggregate functions like COUNT or SUM. Question 68: Which SQL statement is used to create a new table? A) CREATE DATABASE B) CREATE TABLE C) INSERT TABLE D) NEW TABLE Answer: B Explanation: The CREATE TABLE statement is used to define and create a new table in a database. Question 69: What does the term “schema design” refer to in database development? A) The process of designing the user interface B) The process of defining the database structure, including tables and relationships C) The process of coding stored procedures D) The process of setting up backup schedules Answer: B
Explanation: Schema design involves defining the structure of a database, including the tables, columns, relationships, and constraints, to efficiently store and manage data. Question 70: Which of the following is a common challenge in managing large datasets? A) Ensuring low latency and high performance B) Creating simple tables C) Reducing data volume to zero D) Removing all indexes Answer: A Explanation: Managing large datasets often involves challenges related to ensuring low latency and high performance, which may require techniques like partitioning or sharding. Question 71: What is the function of a composite index? A) It is an index on a single column B) It is an index on multiple columns to improve query performance C) It compresses data within a table D) It creates backups automatically Answer: B Explanation: A composite index is created on multiple columns, which can significantly improve query performance when filtering on those columns. Question 72: Which of the following best describes a key-value store? A) A type of relational database B) A NoSQL database that stores data as a collection of key-value pairs C) A database that uses SQL exclusively D) A type of document-based database Answer: B Explanation: A key-value store is a type of NoSQL database that uses a simple key-value method to store data, offering high performance and scalability. Question 73: What is the primary advantage of using cloud databases? A) They require complex local installations B) They provide scalability and ease of maintenance C) They are only suitable for small businesses D) They do not support SQL Answer: B Explanation: Cloud databases offer scalability, ease of maintenance, and reduced infrastructure costs by leveraging managed cloud services. Question 74: Which of the following is a method used to secure database backups? A) Storing backups on public servers B) Encrypting backup files C) Disabling access to backup tools D) Merging backups with active data Answer: B Explanation: Encrypting backup files is a crucial security measure to protect sensitive data stored in database backups from unauthorized access.
Question 80: What is the primary benefit of using window functions in SQL? A) They eliminate the need for subqueries B) They provide advanced analytics over partitions of data C) They automatically backup data D) They compress query results Answer: B Explanation: Window functions perform calculations across a set of rows related to the current row, enabling advanced analytics without the need for complex subqueries. Question 81: Which of the following is a characteristic of a well-designed database schema? A) Excessive redundancy B) Clear entity relationships and minimal redundancy C) Unstructured data storage D) Lack of constraints Answer: B Explanation: A well-designed database schema features clear entity relationships, appropriate normalization, and minimal redundancy to ensure data integrity and performance. Question 82: What is the role of an ORM (Object-Relational Mapping) tool? A) To convert relational data into object-oriented code B) To create database backups automatically C) To encrypt database data D) To generate database schemas Answer: A Explanation: ORM tools map database tables to objects in code, simplifying database operations by allowing developers to work with objects rather than SQL queries directly. Question 83: Which of the following is a benefit of using cloud-based managed databases? A) They require manual hardware maintenance B) They offer automatic scaling and managed backups C) They eliminate all security risks D) They only support proprietary languages Answer: B Explanation: Managed cloud databases provide automatic scaling, managed backups, and maintenance, reducing the administrative overhead for database administrators. Question 84: What does the term “big data” typically refer to? A) Data that is stored in a single small table B) Extremely large datasets that require special processing techniques C) Data that is only used for backup D) Data that is stored on a desktop computer Answer: B Explanation: Big data refers to extremely large and complex datasets that often require specialized processing and storage solutions. Question 85: Which of the following best describes a graph database? A) A database that stores data in rows and columns
B) A NoSQL database that represents data as nodes and relationships C) A database used exclusively for financial data D) A database that uses XML exclusively Answer: B Explanation: Graph databases are NoSQL databases that store data as nodes, edges, and properties, making them ideal for representing complex relationships. Question 86: What is the main purpose of data encryption in databases? A) To improve query performance B) To protect data confidentiality and prevent unauthorized access C) To create backups D) To normalize data Answer: B Explanation: Data encryption protects sensitive information by converting it into an unreadable format that can only be accessed with the proper decryption key. Question 87: Which SQL command is used to remove an entire table and its data from a database? A) DELETE TABLE B) DROP TABLE C) REMOVE TABLE D) CLEAR TABLE Answer: B Explanation: The DROP TABLE command permanently deletes an entire table and all of its data from the database. Question 88: What is a common use case for NoSQL databases? A) Handling structured, relational data exclusively B) Managing unstructured or rapidly changing data C) Replacing all relational databases D) Generating static reports Answer: B Explanation: NoSQL databases are often used to manage unstructured, semi-structured, or rapidly changing data that does not fit neatly into a relational model. Question 89: Which of the following is a type of join that returns only matching rows from two tables? A) LEFT JOIN B) RIGHT JOIN C) INNER JOIN D) FULL OUTER JOIN Answer: C Explanation: An INNER JOIN returns only those rows that have matching values in both tables. Question 90: What does SQL stand for? A) Standard Query Language B) Structured Query Language C) Sequential Query Language D) Simple Query Language
Explanation: Database scalability is the capacity of a database to handle a growing amount of work or data volume without compromising performance. Question 96: What is the purpose of the ORDER BY clause in SQL? A) To group data by specific columns B) To filter out duplicates C) To sort the result set in a specified order D) To combine data from multiple tables Answer: C Explanation: The ORDER BY clause is used to sort the result set of a query in either ascending or descending order. Question 97: Which isolation level provides the highest degree of isolation in SQL transactions? A) READ UNCOMMITTED B) READ COMMITTED C) REPEATABLE READ D) SERIALIZABLE Answer: D Explanation: The SERIALIZABLE isolation level provides the highest degree of isolation by ensuring transactions are completely isolated from each other. Question 98: What does the term “data integrity” mean in the context of databases? A) The speed of data retrieval B) The accuracy and consistency of data over its lifecycle C) The volume of data stored D) The complexity of the database schema Answer: B Explanation: Data integrity refers to the accuracy, consistency, and reliability of data stored in a database, ensuring that it remains correct and unaltered during operations. Question 99: Which of the following best describes a full backup? A) A backup of only changed data B) A complete copy of the entire database C) A backup that excludes system tables D) A backup performed daily Answer: B Explanation: A full backup is a complete copy of the entire database, ensuring that all data is available for restoration if needed. Question 100: What is the role of an index in a database? A) To encrypt the data B) To improve the speed of data retrieval C) To backup the database automatically D) To create user accounts Answer: B Explanation: Indexes are used to quickly locate and access data in a table, significantly improving query performance.
Question 101: What is a common challenge when designing a distributed database system? A) Ensuring data consistency across multiple nodes B) Creating a single, centralized data store C) Removing all backups D) Avoiding the use of indexes Answer: A Explanation: Maintaining data consistency across multiple nodes in a distributed database system is a key challenge, requiring robust replication and synchronization strategies. Question 102: Which of the following best describes a graph database’s structure? A) Data is stored in tables and columns B) Data is represented as nodes, edges, and properties C) Data is stored in plain text files D) Data is organized by key-value pairs only Answer: B Explanation: Graph databases represent data as nodes (entities), edges (relationships), and properties (attributes), making them ideal for handling complex relational data. Question 103: What is the purpose of the LIMIT clause in SQL? A) To filter rows by value B) To restrict the number of rows returned by a query C) To sort the query results D) To group data Answer: B Explanation: The LIMIT clause restricts the number of rows returned in a query result, which is useful for pagination and performance optimization. Question 104: Which SQL operator is used to combine the results of two queries and return only common records? A) UNION ALL B) INTERSECT C) EXCEPT D) JOIN Answer: B Explanation: The INTERSECT operator returns only the records that are common to the results of two queries. Question 105: What does the term “query optimization” refer to? A) The process of designing the database schema B) The process of improving the efficiency of SQL queries C) The process of backing up data D) The process of encrypting data Answer: B Explanation: Query optimization involves analyzing and refining SQL queries to improve their execution speed and reduce resource consumption.