0% found this document useful (0 votes)
84 views37 pages

Database Question Based On Curriculum - 075613

The document contains a series of review questions related to databases, covering topics such as database definitions, DBMS functions, SQL commands, database design, and various database models. It also addresses concepts like normalization, indexing, and the ACID properties of transactions. Overall, it serves as a comprehensive review tool for students in a computer science program focusing on databases.

Uploaded by

gosadereje57
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views37 pages

Database Question Based On Curriculum - 075613

The document contains a series of review questions related to databases, covering topics such as database definitions, DBMS functions, SQL commands, database design, and various database models. It also addresses concepts like normalization, indexing, and the ACID properties of transactions. Overall, it serves as a comprehensive review tool for students in a computer science program focusing on databases.

Uploaded by

gosadereje57
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

RIFT AVLLEY UNIVERSITY

SHASHEMENE CAMPUS
Department of Computer Science
Fundamentals and Advanced Database Review Questions
1. What is a database?
A. A collection of files C. A single table of data
B. A collection of interrelated data D. A collection of unrelated data
2. What does DBMS stand for?
A. Database Management Software C. Database Management System
B. Data Backup Management System D. Data Business Management System
3. Which of the following is NOT a function of a DBMS?
A. Data storage C. Network communication
B. query execution D. Data retrieval
4. Which of these is an example of a relational database?
A. MongoDB C. Redis
B. MySQL D. Neo4j
5. What is a primary disadvantage of file-based systems?
A. High initial cost C. High query performance
B. High data redundancy D. Complex data relationships
6. In a database system, what ensures data consistency and accuracy?
A. Backup C. Redundancy
B. Constraints D. File systems
7. Which of the following is an advantage of database systems over file systems?
A. Reduced hardware costs C. Enhanced security features
B. Easier manual data handling D. Increased redundancy
8. Which approach is most prone to errors when dealing with large datasets?
A. Database approach C. File-based approach
B. Manual approach D. Automated approach
9. Which approach minimizes data redundancy?
A. Manual approach C. Database approach
B. File-based approach D. Spreadsheet approach
10. What is the first step in database design?
A. Logical design C. Requirement analysis
B. Physical design D. Data indexing
11. Which database model uses tables to represent data?
A. Relational model C. Network model
B. Hierarchical model D. Object-oriented model
12. What is the goal of normalization?
A. Increase redundancy C. Improve indexing
B. Reduce redundancy D. Enhance constraints
13. Which normal form eliminates transitive dependencies?
A. 1NF C. 3NF
B. 2NF D. BCNF
14. If A → B and B → C, then A → C is an example of?
A. Partial dependency C. Functional dependency
B. Transitive dependency D. Reflexive dependency
15. Which SQL keyword is used to retrieve data from a database?
A. SELECT C. DELETE
B. UPDATE D. INSERT
16. What is a primary key?
A. A unique identifier for a table record
B. A foreign key
C. A duplicate attribute
D. An index for performance improvement
17. Which file organization is best for sequential access?
A. Indexed C. Sequential
B. Direct D. Random
18. What is the purpose of an index in a database?
A. Increase redundancy C. Improve query performance
B. Enhance security D. Simplify relationships
19. Which relational algebra operation is used to combine rows from two tables?
A. Select C. Union
B. Project D. Join
20. What does the symbol π represent in relational algebra?
A. Select C. Union
B. Project D. Difference
21. Which of the following is used to represent relationships in an ER diagram?
A. Oval C. Diamond
B. Rectangle D. Triangle
22. In a database schema, an attribute that can be divided into smaller sub-parts is called?
A. Composite attribute C. Single-valued attribute
B. Derived attribute D. Multivalued attribute
23. In an ER diagram, what is a weak entity?
A. An entity without attributes
B. An entity that cannot exist without a related strong entity
C. An entity with composite attributes
D. An entity with no relationships
24. What is the Cartesian product in relational algebra?
A. A set of all common tuples from two tables
B. A set of all possible combinations of tuples from two tables
C. The union of two tables
D. The difference between two tables
25. A foreign key in a table:
A. Must reference a primary key in another table
B. Can have duplicate values
C. Cannot be null
D. Is always unique
26. Which SQL command is used to modify an existing record in a table?
A. INSERT C. DELETE
B. UPDATE D. SELECT
27. What does the SQL command DROP do?
A. Removes rows from a table C. Updates table data
B. Deletes an entire table structure D. Removes duplicate rows
28. What does the GROUP BY clause do in SQL?
A. Filters rows by a condition C. Orders rows in ascending order
B. Groups rows with similar values D. Combines data from multiple tables
29. Which function is used in SQL to return the total number of rows in a table?
A. SUM() C. TOTAL()
B. COUNT() D. LENGTH ()
30. Which index is suitable for range queries?
A. Hash index C. Bitmap index
B. B-tree index D. Sparse index
31. What is the main advantage of using secondary indexing?
A. Reduces disk usage
B. Speeds up queries for non-primary key attributes
C. Increases data redundancy
D. Simplifies data relationships
32. What does the relational algebra operation σ (sigma) signify?
A. Select rows C. Combine tables
B. Select columns D. Remove duplicates
33. What is the result of the projection operation π in relational algebra?
A. A subset of columns C. All columns and rows
B. A subset of rows D. Cartesian product of two tables
34. In Tuple Relational Calculus, what does {t | t ∈ Table} represent?
A. All columns from the table C. Specific columns with a condition
B. All tuples from the table D. Specific rows with a condition
35. Which property ensures that all transactions are completed or none are applied?
A. Consistency C. Atomicity
B. Durability D. Isolation
36. What does the durability property of a transaction ensure?
A. No partial transactions occur
B. Data remains consistent after a failure
C. Concurrent transactions do not conflict
D. Changes made by a transaction persist permanently
37. In an e-commerce system, which of the following is an example of a relationship?
A. Orders and Products C. Products only
B. Customers only D. Data backups
38. What is the most appropriate database model for a social media application?
A. Hierarchical model C. Graph model
B. Relational model D. Network model
39. Which of the following is not a database language?
A. SQL C. HTML
B. DML D. DDL
40. Which type of database stores data in a distributed manner across multiple locations?
A. Centralized database C. Flat-file database
B. Distributed database D. In-memory database
41. What is a multivalued dependency in database design?
A. When one attribute determines another non-key attribute
B. When an attribute determines multiple independent attributes
C. When one key attribute determines another key attribute
D. When a foreign key refers to a primary key
42. A table in BCNF (Boyce-Codd Normal Form) must also be in:
A. 1NF only C. 3NF
B. 2NF only D. 4NF
43. What is the primary goal of denormalization in database design?
A. Reduce redundancy C. Remove anomalies
B. Improve query performance D. Minimize functional dependencies
44. Which of the following is a dependency anomaly?
A. Insert anomaly C. Delete anomaly
B. Update anomaly D. All of the above
45. Which SQL clause is used to filter records after grouping them?
A. WHERE C. ORDER BY
B. HAVING D. GROUP BY
46. What is the purpose of the JOIN operation in SQL?
A. Combine columns from multiple tables
B. Combine rows based on a related column
C. Remove duplicate rows
D. Create a new table
47. Which SQL command creates a new index on a table?
A. CREATE INDEX C. ADD INDEX
B. ALTER TABLE D. MODIFY INDEX
48. What does the DISTINCT keyword do in SQL?
A. Sorts rows in ascending order
B. Eliminates duplicate rows from the results
C. Groups rows into categories
D. Filters rows based on a condition
49. Which SQL function returns the current date?
A. GETDATE() C. CURRENT_DATE()
B. SYSDATE() D. TODAY()
50. Which type of index is created automatically on a primary key?
A. Clustered index B. Non-clustered index
C. Unique index D. Hash index
51. What is a sparse index?
A. An index on every record in the table C. An index that uses hash values
B. An index on selected records in the table D. An index optimized for B-trees
52. Which of the following is a concurrency control mechanism?
A. Locking C. query optimization
B. Indexing D. Replication
53. Which type of lock allows both read and write operations?
A. Shared lock C. Deadlock
B. Exclusive lock D. Optimistic lock
54. What is a deadlock in a database system?
A. When a transaction is rolled back
B. When two transactions wait indefinitely for each other
C. When a database crashes
D. When a query is Slow
55. Which of the following is a key challenge in distributed databases?
A. Data redundancy C. Data consistency
B. query optimization D. User authentication
56. What is a horizontal partition in distributed databases?
A. Dividing rows across multiple tables C. Replicating entire tables
B. Dividing columns across multiple tables D. Storing data at a single location
57. Which of the following is NOT a characteristic of NoSQL databases?
A. Schema-less design C. Complex relationships
B. Horizontal scalability D. Support for unstructured data
58. Which type of NoSQL database is best for storing hierarchical data?
A. Document-based
B. Key-value store
C. Column-family store
D. Graph-based
59. In a hospital database, which is an example of a many-to-many relationship?
A. Patients and doctors C. Rooms and beds
B. Doctors and specializations D. Patients and billing
60. Which of the following best describes a star schema in a data warehouse?
A. A single large table with no relationships
B. A central fact table connected to multiple dimension tables
C. A collection of normalized tables
D. A graph-like database schema
61. Which of the following is an example of a domain constraint?
A. Ensuring a value is unique
B. Restricting an attribute to a specific data type
C. Ensuring a foreign key matches a primary key
D. Preventing null values in a column
62. What does the entity integrity constraint ensure?
A. Foreign keys are valid C. Attributes have correct data types
B. Primary keys are unique and not null D. Referential integrity is maintained
63. Referential integrity ensures that:
A. All foreign keys match a valid primary key
B. Data in a column matches a specific pattern
C. All rows in a table are unique
D. Indexes are automatically updated
64. Which constraint prevents null values in a column?
A. UNIUE C. CHECK
B. NOT NULL D. DEFAULT
65. A ternary relationship in an ER diagram involves how many entities?
A. Two C. One
B. Three D. Unlimited
66. Specialization in an ER diagram means:
A. Breaking a general entity into more specific entities
B. Merging multiple entities into one
C. Defining unique keys for an entity
D. Simplifying complex relationships
67. Generalization is the reverse process of:
A. Aggregation C. Normalization
B. Specialization D. Denormalization
68. What is the difference between a subquery and a correlated subquery?
A. Subqueries run once for the entire query, while correlated subqueries run for each row
B. Subqueries are always faster
C. Correlated subqueries can only return one row
D. Subqueries use joins
69. Which SQL command is used to define a trigger?
A. CREATE TRIGGER C. EXECUTE TRIGGER
B. DEFINE TRIGGER D. SET TRIGGER
70. What is the purpose of a SQL trigger?
A. Automate actions in response to database events
B. Improve query performance
C. Replace stored procedures
D. Generate indexes
71. Which SQL keyword is used in a correlated subquery to compare each row?
A. EXISTS C. ALL
B. IN D. ANY
72. What is role-based access control (RBAC)?
A. Assigning permissions to individual users
B. Assigning permissions to predefined roles
C. Encrypting database files
D. Enforcing referential integrity
73. Which database security feature protects data in transit?
A. Access control C. Data masking
B. Data encryption D. SQL injection prevention
74. Which technique hides sensitive data in a database?
A. Encryption C. Compression
B. Data masking D. Shading
75. In a banking database, which table would likely have a composite primary key?
A. Customers C. Branches
B. Transactions D. Loans
76. In an e-commerce system, the relationship between products and orders is:
A. One-to-one C. Many-to-many
B. One-to-many D. Recursive
77. Which schema design is most suitable for a university management system?
A. Flat schema C. Relational schema
B. Star schema D. Graph schema
Answer: C
78. Which data structure is commonly used in relational database indexes?
A. Hash table C. Linked list
B. B-tree D. Stack
79. What is sharding in a distributed database?
A. Partitioning data into smaller, more manageable pieces
B. Storing entire copies of the database on multiple servers
C. Encrypting sensitive data
D. Combining data from multiple tables
80. What is the ACID property of isolation?
A. Ensures transactions are completed entirely or not at all
B. Maintains data consistency during transactions
C. Prevents interference between concurrent transactions
D. Ensures data remains permanently after a transaction
81. What is query optimization in databases?
A. Adding more storage to the database
B. Enhancing the performance of a query
C. Writing SQL queries manually
D. Removing duplicate rows from a query result
82. Which of the following improves database performance the most?
A. Normalization C. Data encryption
B. Indexing D. Increasing table size
83. What is a materialized view in database optimization?
A. A view stored in memory temporarily
B. A physical copy of query results stored as a table
C. A dynamic query stored for execution
D. A compiled stored procedure
84. Which of these is NOT a method of query optimization?
A. Using indexes C. Writing complex queries
B. Reducing subqueries D. Partitioning tables
85. What is the CAP theorem in distributed systems?
A. Consistency, Availability, Partition Tolerance
B. Centralization, Accuracy, Performance
C. Clarity, Availability, Partitioning
D. Concurrency, Atomicity, Persistence
86. Which type of NoSQL database uses key-value pairs to store data?
A. Graph database C. Key-value store
B. Column-family database D. Document database
87. Hadoop is an example of which type of database system?
A. Relational database C. Distributed file system
B. NoSQL database D. Data warehouse
88. Which NoSQL database is best suited for social networks?
A. Column-family database C. Graph database
B. Key-value database D. Document database
89. Which of the following is a benefit of distributed databases?
A. Single point of failure C. Scalability and availability
B. Improved data security D. Reduced network latency
90. What is the main advantage of a centralized database?
A. High availability C. Data redundancy
B. Easier management D. Fault tolerance
91. In distributed databases, replication improves:
A. query performance C. Availability and fault tolerance
B. Data consistency D. Normalization
92. What is a blockchain database?
A. A distributed database with immutable records
B. A centralized database with encryption
C. A relational database optimized for speed
D. A data warehouse with real-time updates
93. Which of the following is a feature of in-memory databases?
A. Data is stored permanently on disk
B. Data is stored in RAM for fast access
C. Data is stored on SSDs for better reliability
D. Queries are optimized for distributed systems
94. What is the main advantage of columnar databases in analytics?
A. Reduced data redundancy C. Simpler normalization
B. Faster aggregation queries D. Improved concurrency control
95. What is the role of artificial intelligence in modern database systems?
A. Managing transactions C. Normalizing schemas
B. Automating query optimization D. Storing data on the cloud
96. Which database architecture is best for a global e-commerce platform?
A. Centralized database C. Single-node NoSQL database
B. Distributed database with replication D. In-memory relational database
97. In a hospital management system, which relationship type connects doctors to
departments?
A. One-to-one C. Many-to-many
B. One-to-many D. Recursive
98. What is the primary benefit of using a data warehouse in business intelligence?
A. Real-time transaction processing C. Reducing disk usage
B. Historical data analysis and reporting D. Enforcing database normalization
99. In a library database, which attribute is most likely a foreign key?
A. BookID in the Books table C. ISBN in the Books table
B. MemberID in the Borrow table D. AuthorName in the Authors table
100. Which technology is best suited for storing and querying time-series data?
A) Relational databases C) Time-series databases (e.g., InfluxDB)
B) Document databases D) Column-family databases
101. Which of the following is a primary characteristic of a database system?
a) It organizes data into flat files.
b) It allows for easy data manipulation and retrieval through a central system.
c) It stores data in a hierarchical structure.
d) It only handles textual data.
102. What is the main advantage of using a database approach over a file-based system?
a) More memory usage c) Reduced need for data validation
b) Better control over data security d) Easier data backup
103. The database approach typically involves:
a) Storing data in flat files across multiple servers.
b) Organizing data into tables and maintaining relationships between them.
c) Using multiple copies of data with no centralized control.
d) Storing data in a fixed schema without change.
104. Which of the following best describes file organization versus database approach?
a) A database approach is Slower and less flexible than file organization.
b) A database allows for simultaneous querying and updating, unlike file organization.
c) File organization only stores data in rows, while databases store data in columns.
d) File organization does not allow for data integrity constraints.
105.Who are the users of a database system?
a) Only database administrators
b) End-users, application developers, and administrators
c) Only data analysts
d) Only software developers
106. Which of the following is NOT a characteristic of the database approach?
a) Redundancy reduction c) Data consistency
b) Data isolation d) Data security
107. Which of the following actors are typically involved in a database system?
a) Database administrators and users c) Only software developers
b) Data engineers and customers d) only system hardware engineers
108. The term "Database System Architecture" refers to:
a) The physical storage of data in a database.
b) The structural design of how data is stored, accessed, and managed in a system.
c) The user interface of a database system.
d) The network connectivity between multiple databases.
109. Schemas in the context of databases refer to:
a) A detailed specification of database tables and relationships.
b) A set of stored procedures.
c) A type of query used in database operations.
d) The physical storage format of data.
110. Data independence in database systems means:
a) The ability to share data across multiple platforms.
b) The ability to change data structure without affecting application programs.
c) The ability to store data in multiple formats.
d) The independence of data from external systems.
111. Data models define:
a) The visual design of a database.
b) The structure, relationships, and constraints on data.
c) The rules for data replication.
d) The security protocols for accessing data.
112. The relational model is best described as:
a) A model based on hierarchical data storage.
b) A model that uses tables to represent data and relationships between data.
c) A model that uses graphs for data representation.
d) A model designed for managing large unstructured data sets.
113. In a three-level architecture of a database system, which level is responsible for
describing how data is stored and manipulated physically?
a) Internal level c) External level
b) Conceptual level d) Logical level
114. Which of the following is true about data independence in a database system?
a) Data independence is not a concern in modern DBMS.
b) Data independence allows for changes in the schema without affecting the database user
interface.
c) Data independence means that data storage is independent of the application programming.
d) Data independence ensures that no data can be shared between systems.
115. Database languages include:
a) Programming languages like C and Java.
b) Structured query Language (SQL) and Data Definition Language (DDL).
c) Only high-level programming languages.
d) Machine languages for hardware interaction.
116. Data Definition Language (DDL) is primarily used to:
a) Manipulate data in the database.
b) Define the structure of database objects such as tables.
c) Write the business logic of an application.
d) Perform database transactions.
117. A DBMS with high data independence allows:
a) Database applications to access data without knowing the underlying storage details.
b) Changes in storage format to affect the users directly.
c) Direct access to raw data files without using queries.
d) Data storage to be static and unchangeable.
118. The Database System Environment typically includes:
a) A collection of hardware and software resources, users, and applications.
b) Only the DBMS software.
c) Only database users and their access rights.
d) Only the physical storage of data.
119. The Object-Oriented Data Model is best used for:
a) Handling large-scale relational databases.
b) Storing unstructured data in a table format.
c) Managing complex data with objects, inheritance, and relationships.
d) Only handling simple text data.
120. Classification of DBMS is done based on:
a) The number of users. c) The type of programming languages used.
b) The model of data and architecture. d) The amount of data stored.
121. An external schema in the context of a three-level architecture represents:
a) The physical storage structure of data.
b) The data structure at the conceptual level.
c) How the data is presented to the users.
d) The way data is replicated in a distributed database.
122. The conceptual schema defines:
a) The internal structure and storage of data.
b) The user-specific view of the data.
c) The logical structure of the entire database, independent of physical storage.
d) The physical location of each piece of data.
123. Which of the following is NOT an example of a data model?
a) Hierarchical model c) Network model
b) Relational model d) Programming language model
124. Normalization in relational databases is used to:
a) Group data into large tables.
b) Reduce redundancy and improve data integrity.
c) Demoralize data for faster access.
d) Add more constraints to data relationships.
125. The Data Manipulation Language (DML) is used for:
a) Defining the structure of database tables.
b) Specifying the rules for data storage.
c) Querying and modifying data in the database.
d) Backing up and restoring data.
126. SQL is an example of a:
a) High-level programming language c) Data Manipulation Language (DML)
b) Data Definition Language (DDL) d) Both DDL and DML
127. In the hierarchical data model, data is organized:
a) In tables with columns and rows.
b) In a tree-like structure with parent-child relationships.
c) In a set of interconnected records.
d) As a series of objects and their attributes.
128. Entity-Relationship (ER) diagrams are used to:
a) Visualize relational database designs.
b) Represent physical storage structures.
c) Define how data is distributed across multiple sites.
d) Programmatically manipulate data in the database.
129. Which of the following is an example of a DBMS classification based on data model?
a) Network DBMS c) Hierarchical DBMS
b) Centralized DBMS d) both a and c
130. The Object-Relational Data Model combines features from:
a) Relational model and hierarchical model.
b) Relational model and object-oriented programming.
c) Network model and object-oriented programming.
d) None of the above.
131. In a relational database, a primary key is used to:
a) Store the data in a column.
b) Ensure data integrity by uniquely identifying each record in a table.
c) Create a relationship between two tables.
d) Represent foreign data from other systems.
132. The data independence feature of a DBMS means that:
a) Users can independently define their views of the database without affecting the underlying
structure.
b) Users can directly interact with the storage system of the database.
c) The database can store data independently of the operating system.
d) The data is always stored in a single file on the server.
133. In a relational database, which of the following is used to ensure that data is consistent
across all instances of a relationship?
a) Index c) Trigger
b) Constraint d) View
134. The conceptual schema in a database system:
a) Describes how data is physically stored in the system.
b) Describes the structure of data in a way independent of physical storage.
c) Describes how users interact with the database.
d) Defines access rights and security rules for the database.
135. Normalization is primarily concerned with:
a) Organizing data to avoid redundancy and improve consistency.
b) Speeding up query processing through denormalization.
c) Structuring data for easy reporting.
d) Encrypting sensitive data.
136. A foreign key in a relational database is used to:
a) Link one table to another by referring to the primary key in the referenced table.
b) Store the data type of a column.
c) Prevent unauthorized users from accessing data.
d) Speed up query performance.
137. In distributed databases, data fragmentation refers to:
a) Dividing data into smaller pieces for better performance.
b) Replicating the same data across multiple sites for fault tolerance.
c) Organizing data into tables. d) Encrypting data for security.
138.The data manipulation language (DML) in a DBMS is used for:
a) Defining data structures like tables and views.
b) Retrieving, updating, and deleting data from the database.
c) Creating the physical storage structure of the database.
d) Granting and revoking user permissions.
139. Which of the following is NOT part of the three-level architecture of a DBMS?
a) Internal schema c) Data dictionary
b) External schema d) Conceptual schema
140. A view in a database is:
a) A physical copy of the data in a table.
b) A virtual table that represents a specific subset of the data.
c) A tool for optimizing query execution.
d) A method for creating backup copies of data.
141. In object-oriented databases, an object is:
a) A record in a table
b) An instance of a class that encapsulates both data and methods
c) A unique identifier for a piece of data
d) A relational table
142. Object identity in object-oriented databases refers to:
a) The ability of an object to inherit properties from another object
b) The unique identifier that distinguishes one object from another
c) The method by which objects are ordered
d) The way in which an object is stored in memory
143. The object structure in an object-oriented database refers to:
a) The methods that an object can perform
b) The way objects are physically stored
c) The set of attributes and relationships that define the object
d) The object’s access control mechanisms
144. In object-oriented databases, type constructors are used to:
a) Define the structure of the database
b) Define the operations that can be performed on an object
c) Create new types by combining existing types
d) Specify access control rules for objects
145. Encapsulation in object-oriented databases refers to:
a) The ability of objects to communicate with each other
b) The hiding of an object’s internal structure and exposing only necessary methods
c) The process of creating a database schema
d) The inheritance of attributes from other objects
146. Persistence in an object-oriented database refers to:
a) The duration for which an object exists in memory
b) The ability to retrieve and store objects in permanent storage
c) The process of creating objects
d) The ability to modify objects without affecting other database objects
Answer: b) The ability to retrieve and store objects in permanent storage
147. Inheritance in object-oriented databases allows:
a) Objects to be copied into other objects
b) New objects to be created from existing objects, inheriting attributes and methods
c) Objects to be linked together through shared attributes
d) Objects to store data persistently
148. The type hierarchy in an object-oriented database is:
a) A method of organizing classes into a tree structure based on inheritance
b) A system for indexing data efficiently
c) A list of objects and their attributes
d) A way to store data in multiple tables
149. The process of translating SQL queries into relational algebra is used to:
a) Store SQL queries in a different format
b) Optimize the execution of SQL queries
c) Convert SQL queries into a more abstract form for further processing
d) Allow SQL queries to be processed by different DBMS engines
150. Which of the following is a basic algorithm used for executing query operations in
relational databases?
a) Merge Sort c) Tree traversal
b) Hash Join d) Bubble Sort
151. Heuristic query optimization relies on:
a) Analyzing the data stored in the database
b) Using predefined rules to simplify query execution
c) Comparing execution times of different queries
d) Scanning the database for patterns
152. In query optimization, selectivity refers to:
a) The process of selecting indexes for tables
b) The number of distinct values in a column
c) The percentage of rows that match a query condition
d) The cost of performing a query
153. Cost estimates in query optimization are used to:
a) Predict the time it will take to execute a query
b) Determine the size of the database
c) Identify potential errors in a query
d) Store intermediate results during query execution
154. Semantic query optimization aims to:
a) Analyze the query syntax to find errors
b) Modify the query structure based on the meaning of the data
c) Break the query into smaller parts for faster execution
d) Increase the size of intermediate results
155. Selectivity estimation in query optimization typically depends on:
a) The physical storage method used by the DBMS
b) The cardinality of the result set for a query
c) The execution time of the query
d) The type of data in the database
156. Which of the following is an example of a type constructor in object-oriented databases?
a) Integer
b) Set
c) Method
d) Attribute
157. The encapsulation of operations in object-oriented databases refers to:
a) Making methods accessible to all users
b) Hiding the implementation details of methods while exposing only necessary operations
c) Storing methods in separate files
d) Restricting access to object attributes only
158. Inheritance in object-oriented databases allows:
a) Objects to be copied across databases
b) A new class to automatically inherit attributes and methods from a parent class
c) A class to be assigned multiple identities
d) Direct mapping of object attributes to relational database columns
159. The object-oriented database model is best suited for:
a) Simple applications with minimal data complexity
b) Managing complex data structures like multimedia, CAD, or engineering data
c) Storing relational data with predefined structures
d) Storing large amounts of unstructured text
160. Which of the following best describes the semantic query optimization technique?
a) Optimizing based on table structures
b) Optimizing based on statistical information like cardinality
c) Optimizing queries using the meaning and logic of data
d) Optimizing queries using heuristic rules only
161. Which of the following is an example of an object identity in an object-oriented database?
a) The class of an object
b) A unique identifier for each object that distinguishes it from other objects
c) The method of an object
d) The attributes of an object
162. In object-oriented databases, polymorphism allows:
a) Methods in an object to be executed in parallel
b) Different objects to be treated as instances of the same class
c) Different methods to have the same name but perform different tasks
d) Objects to be inherited from multiple classes
163. The method in an object-oriented database:
a) Defines how data is organized in the database
b) Refers to the physical storage of an object
c) Defines an operation that can be performed on an object
d) Represents the unique identity of an object
164. Object structure in object-oriented databases consists of:
a) The object’s internal algorithms and methods
b) The data that the object stores and its relationships to other objects
c) The type of storage used for the object
d) The names of the object’s methods
165. In object-oriented databases, encapsulation provides:
a) A method to store objects persistently
b) A way to represent hierarchical relationships between objects
c) A mechanism for protecting an object’s internal state by hiding its data
d) A method for querying objects based on their attributes
166. Inheritance in object-oriented databases leads to:
a) A simpler way to store objects
b) A mechanism to share data across multiple objects
c) Reusable classes that can inherit attributes and methods from other classes
d) A mechanism for protecting data from unauthorized access
167. Persistence in object-oriented databases refers to:
a) The ability of an object to store its data permanently in the database
b) The ability of objects to be accessed without any loss of data
c) The process of sending objects to temporary memory
d) The relationship between objects
168. In query optimization, selectivity refers to:
a) The likelihood that a query will return all rows from the database
b) The number of distinct values a column can have
c) The fraction of records that satisfy the query’s conditions
d) The cost of performing the query
169. In query optimization, the cost estimate for a query plan is based on:
a) The number of joins in the query
b) The size of the result set
c) The number of database users
d) The resources (e.g., CPU, I/O) required to execute the plan
170. Semantic query optimization involves:
a) Optimizing queries based on statistical analysis
b) Rewriting queries to take advantage of domain-specific knowledge
c) Applying heuristic rules to improve query performance
d) Using index structures to speed up query execution
171. The query execution plan generated by a DBMS:
a) Describes how to store data in the database
b) Specifies the sequence of operations and methods for executing a query
c) Defines the structure of the database schema
d) Includes all possible combinations of index access
172. Heuristic query optimization relies on:
a) Analyzing query performance by trial and error
b) Using predefined rules or strategies based on common query patterns
c) Rewriting SQL queries into machine code
d) Using only the most efficient index available
173. Cost-based query optimization involves:
a) Using predefined rules to optimize queries
b) Estimating the cost of different execution strategies and choosing the least expensive one
c) Using indexes to optimize query speed
d) Rewriting the query using a different language
174. The join operation in relational databases can be optimized using:
a) The merge join algorithm
b) The aggregate function
c) The count function
d) The order by clause
175. A view in the context of semantic query optimization is:
a) A virtual table that can be queried like a regular table
b) A stored procedure that encapsulates a query
c) A physical representation of a query
d) A method of optimizing database access
176. query rewriting as part of semantic query optimization is used to:
a) Change the SQL syntax to improve query speed
b) Alter the logic of a query to reduce computational cost
c) Use heuristic rules to improve query readability
d) Ensure that queries return correct results
177. A hash join in query optimization works by:
a) Sorting both tables and then performing a sequential scan
b) Dividing one table into smaller partitions based on hash values
c) Merging rows from two tables based on a common key
d) Storing the intermediate results in a temporary table
178. Indexing can improve query performance by:
a) Sorting data in a sequential order
b) Storing frequently accessed data in memory
c) Providing fast access paths to data
d) Reducing the size of the database
179. The selectivity factor of a query is primarily used in query optimization to:
a) Determine the query execution time
b) Estimate the number of rows to be returned by a query
c) Calculate the total cost of query execution
d) Identify potential database errors
180. In object-oriented databases, type constructors are used to:
a) Define the schema of an object
b) Define the attributes of an object
c) Specify the type of an object or its operations
d) Define the inheritance structure of classes
181. Which of the following properties ensures that a transaction's changes persist even after a
system failure?
a) Atomicity
b) Consistency
c) Isolation
d) Durability
182. What is the main advantage of schedules that are serializable?
a) They improve system performance.
b) They maintain the database in a consistent state.
c) They avoid all deadlocks.
d) They do not require locks.
183. Deferred update is primarily characterized by:
a) Immediate application of updates to the database.
b) Logging updates after they are written to the database.
c) Applying updates only after a transaction commits.
d) Using shadow paging for recovery.
184. Which of the following is NOT a concurrency control mechanism?
a) Locking
b) Timestamp ordering
c) Deadlock
d) Multi-versioning
185. What is the purpose of the two-phase locking protocol?
a) To prevent cascading aborts.
b) To ensure serializability.
c) To reduce the number of locks required.
d) To eliminate all deadlocks.
186. Multi-version concurrency control (MVCC) is particularly effective for:
a) Write-intensive workloads.
b) Enforcing strict serializability.
c) Read-intensive workloads.
d) Preventing deadlocks.
187. Which recovery technique uses a shadow copy of the database?
a) Immediate update
b) Deferred update
c) ARIES
d) Shadow paging
188. In ARIES recovery, what is the first phase of recovery?
a) Redo
b) Undo
c) Analysis
d) Rollback
189. The principle of "No read-up" is part of which security model?
a) Bell-LaPadula
b) DAC
c) MAC
d) Statistical Security
190. Which of the following helps prevent SQL injection attacks?
a) Using prepared statements
b) granting excessive privileges
c) Avoiding backups
d) using a low isolation level
191. What does location transparency in a distributed database mean?
a) Users know the physical location of data.
b) Users do not need to know where data is stored.
c) Data is always replicated across all sites.
d) Data is stored in a central location.
192. Horizontal fragmentation divides a table into:
a) Columns based on usage.
b) Rows based on specific conditions.
c) Entire copies stored at different sites.
d) A combination of rows and columns.
193. Semi-joins in query processing help to:
a) Increase data transfer between sites.
b) Reduce the size of data transferred.
c) Perform full table scans.
d) Combine unrelated tables.
194. What is a cascading abort?
a) When a transaction aborts and does not affect others.
b) When the failure of one transaction causes multiple others to abort.
c) When all transactions are aborted after a deadlock.
d) When a transaction is rolled back multiple times.
195. In a transaction, isolation ensures:
a) Transactions are serialized.
b) Transactions are completed atomically.
c) Concurrent transactions do not interfere with each other.
d) Changes persist after commit.
196. A serial schedule is:
a) One where transactions execute concurrently.
b) One where all transactions execute in a pre-defined order without overlap.
c) A schedule that requires locks.
d) One that prioritizes write operations.
197. Which of the following ensures that committed transactions remain permanent?
a) Write-Ahead Logging
b) Deadlock Avoidance
c) Deferred Update
d) Concurrency Control
198. Immediate updates require:
a) No logging.
b) Only redo operations during recovery.
c) Both undo and redo operations during recovery.
d) Shadow paging.
199. Which of the following is a drawback of shadow paging?
a) High computational cost for undo operations.
b) Excessive logging requirements.
c) High storage requirements.
d) Difficult implementation in a distributed environment.
200. Which type of failure does ARIES primarily address?
a) Disk failure
b) User errors
c) Transaction failures and system crashes
d) Power outages
201. Which of the following is an optimistic concurrency control technique?
a) Two-phase locking
b) Validation phase
c) Timestamp ordering
d) Read-write locks
202. Timestamp ordering ensures:
a) Deadlocks are prevented.
b) Transactions are serialized based on timestamps.
c) All transactions are committed in the order they were started.
d) Locks are not required for read operations.
203. Granularity locking is used to:
a) Avoid deadlocks in distributed systems.
b) Control access at different levels of data (e.g., tables, rows).
c) Prevent cascading aborts.
d) Optimize memory usage during locking.
204. Deadlocks can be avoided by:
a) Using strict two-phase locking.
b) Ordering resources and acquiring them in a pre-defined sequence.
c) Allowing pre-emptive lock releases.
d) Using only read locks.
205. Multi-version concurrency control (MVCC) prevents:
a) Read anomalies by using timestamps.
b) Deadlocks through validation.
c) Write anomalies through locks.
d) Dirty reads through cascading aborts.
206. In the ARIES recovery algorithm, the "Redo" phase:
a) Reapplies changes made by all transactions.
b) Reapplies changes made only by committed transactions.
c) Reverts changes made by uncommitted transactions.
d) Identifies active transactions during the crash
207. What is the primary purpose of a checkpoint?
a) To undo changes during recovery.
b) To reduce recovery time by saving the current database state.
c) To detect and resolve deadlocks.
d) To provide security for sensitive data.
208. Which of the following scenarios requires the use of the Undo operation?
a) Recovery of committed transactions.
b) Rolling back uncommitted transactions.
c) Applying changes in shadow paging.
d) Reapplying logs for deferred updates.
Answer: b) Rolling back uncommitted transactions.
209. Which recovery mechanism is best suited for distributed databases?
a) Shadow paging
b) Two-Phase Commit Protocol
c) Deferred Update
d) Immediate Update
210. Which technique prevents inference attacks in statistical databases?
a) Write-ahead logging
b) query restriction
c) Shadow paging
d) Semi-joins
211. Discretionary Access Control (DAC) in SQL is primarily implemented using:
a) Encryption mechanisms.
b) Grant and Revoke statements.
c) Role-based access.
d) Security clearance levels.
212. What does Mandatory Access Control (MAC) enforce?
a) Users define their own access policies.
b) Permissions are determined based on fixed security classifications.
c) All access is unrestricted.
d) Security is based on statistical queries.
213. Which security technique is used to prevent unauthorized inference in statistical databases?
a) Multilevel encryption
b) Data masking
c) Noise addition
d) Shadow paging
214. A role-based access control system provides access:
a) Based on the user's job function within an organization.
b) Based on the security clearance of a user.
c) Dynamically calculated for each transaction.
d) Randomly assigned to all users.
215. SQL Injection attacks exploit:
a) Incorrect use of transactions.
b) Poor query optimization.
c) Vulnerabilities in input handling for SQL queries.
d) Outdated database versions.
216. Which type of distributed database system is designed to support diverse DBMSs?
a) Homogeneous
b) Heterogeneous
c) Federated
d) Cloud-based
217. Data replication improves:
a) Storage efficiency.
b) Query response time and fault tolerance.
c) Transaction processing speed.
d) Data encryption.
Answer: b) query response time and fault tolerance.
Explanation: Replication ensures high availability and better performance by storing multiple
copies of data.
218. Which fragmentation technique is best suited for queries targeting specific rows based on
conditions?
a) Vertical fragmentation
b) Horizontal fragmentation
c) Hybrid fragmentation
d) Data allocation
219. What is the primary objective of query optimization in distributed databases?
a) Maximizing the number of transactions per second.
b) Minimizing the cost of executing queries across sites.
c) Ensuring complete data replication.
d) Reducing the size of the database.
220. What is the main purpose of a semi-join in distributed databases?
a) To replicate data across sites.
b) To reduce data transmission during join operations.
c) To increase query execution speed on a single site.
d) To enforce security restrictions.
221. Which of the following is a requirement for a transaction to be recoverable?
a) Every transaction reads only committed data.
b) It must acquire exclusive locks.
c) All transactions must complete simultaneously.
d) Data must always be replicated.
222. Which schedule type ensures conflict-serializability?
a) Non-conflicting schedule
b) Pre-emptive schedule
c) Two-phase schedule
d) Conflict-equivalent schedule
223. What is the primary benefit of using the Write-Ahead Logging (WAL) protocol?
a) Faster query processing.
b) Guaranteed rollback for all transactions.
c) Ensures that logs are written before database changes.
d) Reduces disk space usage.
224. Two-phase locking requires that:
a) Transactions must only read after committing.
b) Locks must be acquired and released in separate phases.
c) Read locks are used exclusively.
d) Deadlocks are resolved automatically.
225. Timestamp-based concurrency control assigns timestamps to:
a) Each table involved in a transaction.
b) Each transaction at the time of its creation.
c) Every read operation.
d) Database backups for recovery.
226. Optimistic concurrency control assumes:
a) Conflicts between transactions are rare.
b) Transactions will always conflict.
c) Locks must be held during the validation phase.
d) Commit operations are unnecessary.
227. Which type of lock allows multiple transactions to read a data item but prevents writing?
a) Shared lock
b) Exclusive lock
c) Deadlock lock
d) Pessimistic lock
228. Which of the following statements about deadlocks is true?
a) Deadlocks only occur with timestamp-based protocols.
b) Deadlocks can be completely avoided by two-phase locking.
c) Deadlocks occur when transactions wait on each other in a circular chain.
d) Deadlocks are caused by high data replication.
229. In validation concurrency control, a transaction is checked for conflicts:
a) Before it starts execution.
b) During its execution.
c) At the commit phase.
d) After it is aborted.
230. Multiple granularity locking allows:
a) Locking of only the database level.
b) Locking at different levels such as database, table, or row.
c) Simultaneous read and write locks on the same data.
d) No lock escalation or de-escalation.
231. Which recovery concept allows transactions to proceed without waiting for updates to be
flushed to disk?
a) Deferred update
b) immediate update
c) Shadow paging
d) Write-ahead logging
232. Shadow paging differs from ARIES in that it:
a) Does not require logging.
b) Does not allow concurrent transactions.
c) Uses a copy-on-write mechanism for pages.
d) Requires manual checkpoints.
233. In ARIES, the Undo phase:
a) Reverts changes made by committed transactions.
b) Reverts changes made by uncommitted transactions.
c) Reapplies logs to ensure durability.
d) Identifies dirty pages in memory.
234. What is the purpose of deferred updates in recovery?
a) To write changes directly to the database.
b) To avoid undo operations.
c) To apply updates only after a transaction commits.
d) To provide immediate durability.
235. Which security model enforces the principle of “No write-down”?
a) Bell-LaPadula
b) Biba
c) DAC
d) MAC
236. Statistical database security is concerned with:
a) Preventing unauthorized access to raw data.
b) Allowing access to sensitive information.
c) Securing encrypted databases.
d) Ensuring faster query execution.
237. What is the main challenge of multilevel security in databases?
a) Maintaining query optimization.
b) Handling simultaneous user access.
c) Preventing inference attacks.
d) Supporting discretionary access control.
238. Which of the following is an example of data masking?
a) Encrypting data during transmission.
b) Replacing sensitive data with fake, realistic data.
c) Adding noise to query results.
d) Restricting user access to rows of a table.
239. Fine-grained access control in SQL is achieved through:
a) GRANT statements.
b) Views and row-level policies.
c) Role-based access control.
d) Full-database encryption.
240. Homogeneous distributed databases are characterized by:
a) Using the same DBMS across all nodes.
b) Supporting multiple types of databases.
c) Always replicating data.
d) Allowing only centralized query processing.
Answer: a) Using the same DBMS across all nodes.
Explanation: Homogeneous systems use the same DBMS, making them easier to manage and
query.
241. In a distributed database, allocation refers to:
a) Distributing queries among users.
b) Deciding where to place data fragments.
c) Replicating data for backup.
d) Merging fragments across sites.
242. Which query optimization strategy minimizes data movement?
a) Centralized execution
b) Semi-join strategy
c) Fragment replication
d) Full vertical fragmentation
243. A federated database system is:
a) A type of homogeneous database system.
b) A loosely integrated system of heterogeneous databases.
c) Always cloud-based.
d) Independent of schemas.
244. A transaction T1 is said to be "recoverable" if:
a) It executes without any errors.
b) It can be rolled back at any point during execution.
c) It reads only committed data.
d) It can read and write to the same data item.
245. Cascading rollback is a problem that arises when:
a) Multiple transactions commit without the required locks.
b) A transaction fails and causes multiple dependent transactions to fail as well.
c) A transaction does not acquire an exclusive lock.
d) All transactions are in a deadlock state.
246. The write-ahead logging protocol (WAL) ensures that:
a) All data writes happen in the log before being written to disk.
b) Only data from committed transactions is logged.
c) Only read operations are logged.
d) Data is stored in memory, not on disk.
247. A dirty page refers to:
a) A page that is read but not updated.
b) A page that has been modified but not yet written back to disk.
c) A page that contains uncommitted transactions.
d) A page that is permanently locked for a transaction.
248. In multi-version concurrency control (MVCC), multiple versions of a data item are
maintained:
a) To allow for faster write operations.
b) To enable parallel execution of conflicting transactions.
c) To guarantee transaction atomicity.
d) To prevent transaction rollback.
249. Timestamp ordering ensures:
a) Transactions are executed based on the order they are written.
b) Transactions are executed in the order of their timestamps.
c) Transactions always read the most recent data.
d) Transactions execute sequentially.
250. The deadlock detection method in transaction management typically involves:
a) Using timestamps to check for cyclic dependencies.
b) Holding locks for a fixed time interval.
c) Rolling back transactions randomly.
d) Automatically releasing locks.
251. Which of the following is a pessimistic concurrency control technique?
a) Two-phase locking
b) Optimistic concurrency control
c) Timestamp ordering
d) Validation concurrency control
252. Which of the following is a valid schedule for a set of transactions?
a) A schedule where one transaction executes all of its actions after another transaction has
completed.
b) A schedule where transactions are interleaved and conflict with each other.
c) A schedule that respects the precedence constraints of transactions.
d) A schedule that randomly interleaves operations without considering dependencies.
253. Incremental backups:
a) Backup the entire database every time.
b) Backup only the data that has changed since the last full or incremental backup.
c) Backup data only when the database is idle.
d) Backup data at specific intervals regardless of changes.

254. Check pointing in database systems is done to:


a) Guarantee ACID properties.
b) Mark a point where the database state is consistent and recovery can start from.
c) Log transactions in memory.
d) Apply immediate updates to the database.
255. The ARIES recovery algorithm is based on which principle?
a) Immediate updates only.
b) Deferred updates only.
c) Write-ahead logging and the use of a transaction log.
d) Use of shadow paging for recovery.
256. Rollback segment in database recovery refers to:
a) A set of log entries maintained for database recovery.
b) A copy of the database saved for backup purposes.
c) The area where committed transactions are stored.
d) The system that processes rollback actions.
257. Discretionary Access Control (DAC) enables:
a) Users to assign access rights to objects based on their own discretion.
b) Enforcing strict security policies by government agencies.
c) Preventing any form of data access.
d) Defining access policies based on transaction timestamps.
258. The primary goal of role-based access control (RBAC) is to:
a) Grant access rights based on a user's job role.
b) Allow users to assign access rights to themselves.
c) Encrypt sensitive data automatically.
d) Randomly assign access to users based on security clearance.
259. Inference attacks in a statistical database happen when:
a) Users gain unauthorized access to raw data.
b) Users extract sensitive information through legitimate queries .
c) Users are denied access to any data.
d) Data is encrypted and cannot be accessed.
260. Horizontal fragmentation of a database involves:
a) Dividing data into subgroups based on specific columns.
b) Splitting data into separate database tables.
c) Splitting data into subsets of rows based on conditions.
d) Storing identical copies of the data across multiple sites.
261. Which of the following is a benefit of data replication in distributed databases?
a) Reduces the need for transaction isolation.
b) Improves system reliability and availability.
c) Decreases the need for backup operations.
d) Increases the cost of data storage.
262. In distributed query processing, a cost-based optimizer uses:
a) A predefined set of queries .
b) A set of heuristics to determine query execution plans.
c) A cost model to estimate the efficiency of different query plans.
d) Random query plans for each execution.
263. Data fragmentation in distributed databases is used primarily to:
a) Improve query processing by distributing data.
b) Encrypt data across multiple sites.
c) Replicate data for backup purposes.
d) Ensure that all data is stored in a single location.
264. A distributed transaction requires:
a) A single server for execution.
b) All participating systems to adhere to the two-phase commit protocol.
c) No consistency model to be applied.
d) Only one system to be involved.
265. Which of the following is an example of a heterogeneous distributed database?
a) A system where all nodes use the same database software.
b) A system where nodes use different database management systems.
c) A system with a single centralized database.
d) A system using multiple instances of a single DBMS.
266. Distributed deadlock detection involves:
a) A centralized monitor checking for deadlocks.
b) Only the first node detecting deadlocks.
c) Ensuring that no transaction can access more than one site.
d) Using a timestamp protocol to detect dependencies.
267. Distributed query optimization aims to:
a) Ensure all queries are executed sequentially.
b) Minimize the amount of data transferred between sites.
c) Increase the size of the data used for processing.
d) Prevent database fragmentation.
268. Fragmentation in distributed databases helps in:
a) Creating backup copies of data.
b) Ensuring that data is stored at a single site.
c) Enhancing data access and query performance by distributing data.
d) Limiting the number of users accessing data simultaneously.
269. The two-phase commit protocol is used in distributed databases to:
a) Resolve network failures.
b) Ensure the ACID properties of transactions.
c) Merge different versions of data.
d) Optimize query performance across nodes.
270. A federated database:
a) Is a type of centralized database system.
b) Allows integration of heterogeneous systems while keeping their autonomy.
c) Uses only a single database for all operations.
d) Does not support data replication.
271. Which of the following is a feature of multi-database systems?
a) They are always homogeneous systems.
b) They maintain multiple copies of the same database.
c) They integrate multiple databases while maintaining their independence.
d) They perform all transactions on a single database.
272. In a distributed database, data localization means:
a) All data is centralized in one location.
b) Data is stored and processed close to where it is needed.
c) Only read-only data can be localized.
d) Data is fragmented across multiple sites.
273. Replication in distributed databases is useful for:
a) Ensuring all queries are executed simultaneously.
b) Reducing the complexity of data access across multiple sites.
c) Storing data at multiple locations for fault tolerance.
d) Creating backup systems.
274. Distributed concurrency control typically requires:
a) Maintaining global clocks for synchronization.
b) Centralized locks for all nodes.
c) All transactions to execute on a single server.
d) No transaction isolation.
275. Which of the following ensures data consistency in a distributed database?
a) Only using local databases for transactions.
b) Using distributed locking techniques.
c) Storing data at multiple locations without replication.
d) Ignoring transaction isolation.
276. The query distribution approach in distributed databases involves:
a) Distributing queries across multiple sites for processing.
b) Using a single node for all query processing.
c) Localizing all queries to a single database.
d) Preventing queries from being executed remotely.
277. Which of the following describes a horizontal fragmentation strategy?
a) Breaking data into subsets based on related columns.
b) Storing copies of the data in multiple locations.
c) Dividing data into rows and distributing across sites.
d) Encrypting sensitive data at the row level.
278. Distributed databases provide improved performance by:
a) Centralizing data management.
b) Fragmenting data across sites to improve locality.
c) Storing all data in a single, centralized location.
d) Reducing the amount of replication.
279. Distributed transaction management requires:
a) A single server managing all transactions.
b) Ensuring that transactions can be coordinated across multiple nodes.
c) Ignoring transaction isolation levels.
d) Transactions that only involve local databases.

You might also like