Database Design and Data Modeling MCQs

What is a primary key in a database table?

A) A key that uniquely identifies each row in a table
B) A key that refers to the primary user
C) A key used to encrypt the database
D) A key used to define table relationships
Answer: A
What is a foreign key in a database table?

A) A key that uniquely identifies each row in its own table
B) A key that uniquely identifies each row in another table
C) A key used for encryption
D) A key used to define table relationships
Answer: B
Which of the following is not a type of database model?

A) Hierarchical
B) Network
C) Relational
D) Distributed
Answer: D
What is an entity in the context of database design?

A) A table in a database
B) A row in a table
C) A column in a table
D) An object that exists and is distinguishable from other objects
Answer: D
What is an attribute in the context of database design?

A) A table in a database
B) A row in a table
C) A column in a table
D) A database key
Answer: C
Which of the following is a characteristic of a good primary key?

A) It can be NULL
B) It changes frequently
C) It uniquely identifies each row
D) It can have duplicate values
Answer: C
What does ERD stand for in database design?

A) Entity Relationship Diagram
B) Entity Relationship Data
C) Entity Relationship Design
D) Entity Relationship Development
Answer: A
What is normalization in database design?

A) The process of creating database indexes
B) The process of organizing data to minimize redundancy
C) The process of backing up data
D) The process of creating database users
Answer: B
Which normal form is achieved when there are no repeating groups in a table?

A) First Normal Form (1NF)
B) Second Normal Form (2NF)
C) Third Normal Form (3NF)
D) Boyce-Codd Normal Form (BCNF)
Answer: A
Which normal form is achieved when a table is in 1NF and all non-key attributes are fully functional 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
What is a composite key?

A) A key that uniquely identifies a table
B) A key composed of multiple columns used to identify a row uniquely
C) A key that can have NULL values
D) A key that is used for foreign references
Answer: B
What is a candidate key?

A) A key that uniquely identifies each row in a table
B) A key that refers to another table
C) A key that could be a primary key
D) A key that is used for indexing
Answer: C
What is a surrogate key?

A) A natural key
B) A primary key
C) A system-generated key, often a sequential number
D) A foreign key
Answer: C
What does BCNF stand for in database normalization?

A) Boyce-Codd Normal Form
B) Binary-Coded Normal Form
C) Basic-Coding Normal Form
D) Base-Codd Normal Form
Answer: A
Which normal form is achieved when a table is in 2NF and all non-key attributes are non-transitively 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: C
What is denormalization?

A) The process of creating indexes
B) The process of adding redundancy to improve performance
C) The process of removing redundant data
D) The process of creating database backups
Answer: B
What is a database schema?

A) The actual data stored in the database
B) A collection of database objects, including tables, views, and indexes
C) A user of the database
D) The SQL queries used to interact with the database
Answer: B
What is an index in a database?

A) A table of contents for the database
B) A data structure that improves the speed of data retrieval operations
C) A list of database users
D) A backup of the database
Answer: B
What is a unique constraint in a database?

A) A constraint that ensures all values in a column are unique
B) A constraint that allows duplicate values
C) A constraint that allows NULL values
D) A constraint that refers to another table
Answer: A
Which of the following is not a type of relationship in an ERD?

A) One-to-One
B) One-to-Many
C) Many-to-Many
D) One-to-None
Answer: D
What is a many-to-many relationship in a database?

A) A relationship where a single record in one table is related to multiple records in another table
B) A relationship where multiple records in one table are related to multiple records in another table
C) A relationship where a single record in one table is related to a single record in another table
D) A relationship that cannot exist in a database
Answer: B
What is a one-to-many relationship in a database?

A) A relationship where a single record in one table is related to multiple records in another table
B) A relationship where multiple records in one table are related to a single record in another table
C) A relationship where a single record in one table is related to a single record in another table
D) A relationship where multiple records in one table are related to multiple records in another table
Answer: A
What is a one-to-one relationship in a database?

A) A relationship where a single record in one table is related to a single record in another table
B) A relationship where a single record in one table is related to multiple records in another table
C) A relationship where multiple records in one table are related to a single record in another table
D) A relationship where multiple records in one table are related to multiple records in another table
Answer: A
What is a database transaction?

A) A single operation on the database
B) A sequence of one or more SQL operations treated as a single unit
C) A backup of the database
D) An index on the database
Answer: B
What does ACID stand for in the context of database transactions?

A) Atomicity, Consistency, Isolation, Durability
B) Atomicity, Control, Isolation, Durability
C) Accuracy, Consistency, Isolation, Durability
D) Atomicity, Consistency, Independence, Durability
Answer: A
What is a database trigger?

A) A scheduled backup of the database
B) A set of instructions that automatically executes in response to a specific event on a table
C) A user-defined function
D) A primary key constraint
Answer: B
What is a stored procedure in a database?

A) A user-defined function
B) A set of SQL statements that can be stored and executed on the database server
C) A scheduled task
D) An index on a table
Answer: B
What is data integrity in the context of database design?

A) The process of backing up data
B) The accuracy and consistency of data stored in a database
C) The speed of data retrieval operations
D) The organization of data in tables
Answer: BWhat is referential integrity in a database?

A) Ensures that foreign key values always reference an existing row in another table
B) Ensures that primary key values are unique
C) Ensures that all data is stored in a structured format
D) Ensures that all database operations are secure
Answer: A
What is cardinality in the context of database relationships?

A) The size of a database table
B) The number of rows in a database
C) The number of attributes in a database table
D) The relationship between rows in different tables
Answer: D
Which of the following is not a valid cardinality in database relationships?

A) One-to-One
B) One-to-Many
C) Many-to-One
D) Many-to-None
Answer: D
What is a data warehouse?

A) A database used for online transaction processing (OLTP)
B) A database used for storing historical and aggregated data from multiple sources
C) A database used for data modeling
D) A database used for data mining
Answer: B
What is the purpose of data modeling in database design?

A) To create graphical representations of data
B) To create a blueprint for how data will be stored and accessed in a database
C) To create indexes on tables
D) To optimize SQL queries
Answer: B
What is an ERD (Entity-Relationship Diagram)?

A) A diagram that shows the structure of a database, including tables and columns
B) A diagram that shows the relationships between database users
C) A diagram that shows the relationships between entities in a database
D) A diagram that shows the indexes on database tables
Answer: C
What is a surrogate key in database design?

A) A natural key
B) A primary key
C) A system-generated key, often a sequential number
D) A foreign key
Answer: C
Which of the following is an example of a weak entity in an ERD?

A) Customer with attributes: CustomerID, Name, Email
B) Order with attributes: OrderID, Date, TotalAmount
C) Address with attributes: Street, City, State
D) Line Item with attributes: LineItemID, Quantity, Price
Answer: D
In database normalization, what is the process of removing redundant data called?

A) Denormalization
B) Normalization
C) Optimization
D) Compression
Answer: B
Which of the following is a disadvantage of denormalization in database design?

A) Improved data integrity
B) Reduced storage space
C) Increased data redundancy
D) Simplified data retrieval
Answer: C
What is the purpose of a database index?

A) To ensure data integrity
B) To store database backups
C) To improve the speed of data retrieval operations
D) To enforce referential integrity
Answer: C
Which SQL command is used to create an index in a database?

A) CREATE INDEX
B) ADD INDEX
C) INSERT INDEX
D) INDEX TABLE
Answer: A
Which of the following is a benefit of using stored procedures in a database?

A) Reduced network traffic
B) Improved data redundancy
C) Increased data integrity
D) Simplified data modeling
Answer: A
What does the acronym CRUD stand for in database operations?

A) Create, Retrieve, Update, Delete
B) Collect, Return, Update, Delete
C) Create, Remove, Update, Duplicate
D) Compute, Replace, Undo, Delete
Answer: A
Which of the following is not a type of SQL constraint?

A) UNIQUE
B) CHECK
C) LIMIT
D) FOREIGN KEY
Answer: C
What is a view in a database?

A) A virtual table based on the result-set of a SQL query
B) A physical table in a database
C) A temporary table used for data storage
D) A table with encrypted data
Answer: A
Which of the following is a benefit of using views in a database?

A) Improved data redundancy
B) Simplified data manipulation
C) Increased database security
D) Enhanced data integrity
Answer: B
Which SQL command is used to define a relationship between tables?

A) JOIN
B) RELATE
C) CONNECT
D) LINK
Answer: A
In an ERD, what symbol is used to represent an entity?

A) Square
B) Circle
C) Rectangle
D) Diamond
Answer: C
In an ERD, what symbol is used to represent a relationship between entities?

A) Square
B) Circle
C) Rectangle
D) Diamond
Answer: D
Which of the following is an example of a one-to-many relationship?

A) One customer can place multiple orders
B) One customer can have multiple addresses
C) One order can have multiple line items
D) All of the above
Answer: D
What is the purpose of database normalization?

A) To organize data into tables
B) To remove duplicate data
C) To reduce data redundancy
D) All of the above
Answer: D