Test Prep Chapter 3 - ISTN212
Test Prep Chapter 3 - ISTN212
3. What is a superkey?
4. In a table where EmployeeID is a primary key, what can you infer about
EmployeeName and Department?
Answer: B) How the value of one attribute determines the value of another
attribute
True/False Questions
o Answer: True
o Answer: True
3. Composite keys are not necessary if a single attribute can uniquely identify
each record.
o Answer: True
o Answer: False
o Answer: True
5. How does a foreign key enforce referential integrity between two tables?
Fill-in-the-Blanks
o Answer: primary
o Answer: attributes
o Answer: determinant
4. Entity integrity requires that all primary key attributes be ________ and
unique.
o Answer: primary
Essay Questions
Case Studies
Question: Describe how the primary key in Products and Categories tables helps in
linking these tables and maintaining data integrity.
Answer: The primary key ProductID in the Products table ensures that each
product is uniquely identified within the table. The primary key CategoryID in
the Categories table serves a similar purpose for categories. By using CategoryID
as a foreign key in the Products table, a link is established between products
and their categories. This relationship enforces referential integrity, ensuring
that every ProductID corresponds to a valid CategoryID in the Categories table,
thus maintaining consistent and accurate data.
Answer: B) When you need to create a unique identifier from multiple attributes
Answer: B) Ensuring that foreign keys correctly match primary keys in related
tables
True/False Questions
o Answer: False
8. The primary key of a table can contain NULL values if it is not defined
correctly.
o Answer: False
o Answer: True
10. Entity integrity and referential integrity are the same and can be used
interchangeably.
o Answer: False
o Answer: The two main requirements of entity integrity are: (1) All
values in the primary key must be unique, and (2) No primary key
attribute can be NULL.
Fill-in-the-Blanks
6. A ________ key is used to enforce relationships between tables by referencing
the primary key of another table.
o Answer: foreign
o Answer: junction
o Answer: NULL
o Answer: dependent
o Answer: unique
Essay Questions
4. Explain the concept of normalization and its benefits. How does it relate to
functional dependency?
Case Studies
3. Scenario: You are designing a database for a university. The Courses table
includes CourseID, CourseName, and Instructor, while the Enrollments table
includes StudentID, CourseID, and EnrollmentDate. CourseID is a foreign key
in Enrollments that references CourseID in Courses.
Question: Explain how this design maintains data integrity and allows for efficient
querying of course enrollments.
Answer: The design maintains data integrity by ensuring that every CourseID in
the Enrollments table must match a valid CourseID in the Courses table. This
relationship enforces referential integrity, preventing entries in the Enrollments
table that do not correspond to existing courses. It also allows for efficient
querying by enabling joins between the Courses and Enrollments tables. For
example, to find all students enrolled in a specific course, you can join these
tables on CourseID and filter by the desired CourseID, ensuring accurate and
comprehensive results.
4. Scenario: You are working with a table called Projects that includes
ProjectID, ProjectName, and ManagerID. ManagerID is a foreign key
referencing the Managers table with ManagerID and ManagerName. Explain
how this foreign key relationship supports data integrity and what issues
might arise if it is not properly enforced.
Answer: The foreign key relationship between Projects and Managers ensures
that each ManagerID in the Projects table must correspond to an existing
ManagerID in the Managers table. This enforces referential integrity, ensuring
that every project is associated with a valid manager. If this relationship is not
properly enforced, it could lead to issues such as orphaned records in the
Projects table with ManagerIDs that do not match any manager, leading to
inconsistencies and potential data integrity issues. Proper enforcement ensures
that the data remains reliable and that all references are valid.
o a) It is always unique
True/False Questions
Fill-in-the-Blanks
2. _______ integrity is violated when a foreign key does not link to a primary
key in another table.
Essay Questions
Case Study
Scenario:
A university database has two tables: Students and Enrollments. The Students
table has a primary key StudentID, and the Enrollments table has a StudentID
column that acts as a foreign key, linking to the Students table.
• If a new enrollment record is added with a StudentID that does not exist
in the Students table, describe what happens in terms of referential
integrity. How would you resolve this issue?
Application Questions
Answers
True/False Answers
1. False
2. True
3. False
4. False
Fill-in-the-Blanks Answers
1. Primary key
2. Referential
3. Secondary
(Answers will vary; ensure they cover foreign keys, referential integrity, and
redundancy in a coherent manner with relevant examples.)
Essay Question 1
Question:
Discuss the role of foreign keys in ensuring data integrity within relational
databases. Include the importance of referential integrity and examples of how
it is enforced.
Sample Answer:
Foreign keys are essential in relational databases for maintaining data integrity
by establishing relationships between different tables. A foreign key is an
attribute in one table that refers to the primary key of another table, thereby
creating a link between the two tables. For example, in a university database,
the StudentID in the Enrollments table acts as a foreign key that links to the
StudentID primary key in the Students table.
Essay Question 2
Question:
Explain the concept of redundancy in relational databases. When is redundancy
necessary, and when does it become a problem? Provide examples to support
your answer.
Sample Answer:
Necessary redundancy can occur for various reasons, such as to maintain data
integrity or for backup purposes. For example, in a distributed database system,
redundancy is crucial for ensuring data availability and reliability. If one server
fails, data can still be retrieved from another location. Similarly,
denormalization (the process of adding redundancy) might be used to improve
read performance in certain applications where faster data retrieval is critical.
o a) INTERSECT
o b) UNION
o c) JOIN
o d) PROJECT
o a) INTERSECT
o b) DIFFERENCE
o c) DIVIDE
o d) PRODUCT
4. What type of JOIN returns matched pairs from two tables but fills
unmatched values with NULL?
o a) Natural JOIN
o b) Inner JOIN
o c) Theta JOIN
o d) Outer JOIN
True/False Questions
4. UNION and INTERSECT operations must have tables that are UNION
COMPATIBLE.
3. What does the INTERSECT operator do, and when would it be useful?
Fill-in-the-Blanks
1. The __________ operator in relational algebra shows all values for selected
attributes, creating a vertical subset of a table.
3. The __________ operator shows all rows in one table that are not found in
another table and requires the tables to be union compatible.
4. In a __________, matched pairs are retained, and unmatched values are set
to NULL.
5. The __________ operator produces all possible pairs of rows from two
tables and is also known as the Cartesian Product.
Essay Questions
Case Study
Scenario:
A company database contains two tables: Employees and Projects. The
Employees table includes EmployeeID, Name, and Department, while the Projects
table contains ProjectID, EmployeeID, and ProjectName.
Application Questions
1. If a university has a Courses table and a Students table, how would you
use relational operators to:
1. b) UNION
3. a) INTERSECT
4. d) Outer JOIN
True/False Answers
1. True
2. True
3. False
4. True
5. True
1. Union Compatible means that two tables have the same number of
attributes and corresponding attributes have the same data types.
2. Inner JOIN returns only matched rows between two tables, while Outer
JOIN returns all matched rows and fills unmatched rows with NULL.
3. INTERSECT shows rows that are common between two tables. It is useful
when finding commonalities between datasets.
Fill-in-the-Blanks Answers
1. PROJECT
2. UNION
3. DIFFERENCE
4. Outer JOIN
5. PRODUCT
2. The property of closure in relational algebra ensures that the result of any
relational operation on existing tables is also a table. This is vital in
database operations as it allows the results of operations like UNION,
INTERSECT, and PRODUCT to be used as input for subsequent operations.
For example, using UNION to combine query results ensures no duplicates,
while INTERSECT finds common records between tables. The PRODUCT
operator lists all combinations of records, which can then be filtered for
further analysis, maintaining data consistency and integrity.
o a) Data dictionary
o b) System catalog
o c) Data schema
o d) Metadata repository
o a) 1:1
o b) 1
o c) M
o d) 1:0
4. To convert an M
relationship into a 1
relationship, what entity is often introduced?
o a) Composite entity
o b) System catalog
o c) Foreign key
o d) Primary key
o a) Lack of backup
o d) Security vulnerabilities
True/False Questions
1. A data dictionary includes detailed metadata about all tables and their
attributes.
3. An M
5. Foreign keys may cause data redundancy but are necessary for linking
entities across tables.
4. Describe how M
Fill-in-the-Blanks
1. A __________ provides detailed metadata about all tables and attributes
within a database, essentially being a detailed system data dictionary.
, and M
3. To address M
4. __________ is the term used for using different names to describe the
same attribute, leading to confusion.
Essay Questions
1. Discuss the role of the data dictionary and system catalog in managing a
relational database. How do they contribute to the organization and
retrieval of data? Provide examples to illustrate their use.
2. Explain how M
o Define an M
o Explain the concept of a composite entity (bridge entity) and its role
in resolving M
relationships.
Case Study
Scenario:
A library database includes two tables: Books and Authors. The Books table
contains BookID, Title, and AuthorID, while the Authors table includes AuthorID
and AuthorName. The relationship between books and authors is many-to-many,
as multiple books can have the same author and an author can write multiple
books.
relationships.
Application Questions
1. Given a database with tables Customers and Orders, explain how you
would use a data dictionary to track and manage all attributes related to
customer and order information.
2. If you are designing a database schema for a university, how would you
handle the M
relationship between Students and Courses? What composite entity would you
introduce, and what attributes would it include?
Answers
2. b) System catalog
3. c) M
4. a) Composite entity
True/False Answers
1. True
2. True
3. False
4. True
5. True
2. A system catalog contains detailed metadata about all objects within the
database, including tables, views, indexes, and constraints. It helps in
managing and retrieving information about the database structure and
objects.
3. Homonyms are the use of the same name for different attributes, while
synonyms are different names used to describe the same attribute. Both
can cause confusion in database management.
4. M
Fill-in-the-Blanks Answers
1. System catalog
2. Relationships
3. Composite entity
4. Synonyms
5. Data redundancy
2. M
relationships in relational databases are complex and cannot be directly
implemented. To handle this, a composite entity (or bridge entity) is introduced
to convert the M
1. To handle the M
Indexes
2. In a unique index, how many pointer values (rows) can be associated with
each index key?
o a) Multiple
o b) None
o c) Only one
o d) A variable number
3. What does an index key refer to?
o a) Multiple
o b) None
o c) Only one
o d) A few
True/False Questions
3. A unique index allows multiple rows to have the same index key.
5. Why is it important for each index to be associated with only one table?
Fill-in-the-Blanks
2. The __________ is the reference point of an index that points to the data
location identified by the key.
3. A __________ index ensures that the index key can have only one pointer
value associated with it.
Essay Questions
2. Explain the concept of a unique index and how it differs from other types
of indexes. Describe scenarios where a unique index would be essential
and the benefits it provides.
Case Study
Scenario:
A retail database contains a Products table with fields ProductID, ProductName,
and Price. The database administrator wants to improve the performance of
queries that search for products by ProductName.
Application Questions
1. Given a database with a table Employees that includes fields EmployeeID,
Name, and Department, explain how creating an index on the Name field
could impact query performance.
2. If a database requires ensuring that each UserID is unique, how would you
implement a unique index on the UserID field, and what benefits would
this provide?
Answers
2. c) Only one
4. c) Only one
True/False Answers
1. True
2. False
3. False
4. True
5. True
2. An index key is a reference point within the index that points to the
location of data in a table. It allows for quick lookup of rows based on the
values of the indexed column(s).
3. A unique index ensures that each value in the indexed column is unique
and can only have one pointer (row) associated with it. For example, a
unique index on the Email column of a Users table ensures that no two
users can have the same email address.
4. Each index is associated with only one table, meaning that an index
organizes and optimizes access for rows within a specific table and
cannot be used across multiple tables.
5. Associating each index with only one table ensures that the index can
efficiently manage and optimize data retrieval for that particular table
without complications or conflicts arising from multiple table
associations.
Fill-in-the-Blanks Answers
1. Index
2. Index key
3. Unique
4. Index
5. Key
2. A unique index is a type of index that ensures all values in the indexed
column are unique, meaning each key can only point to one row. This
contrasts with non-unique indexes, where duplicate values are allowed.
Unique indexes are essential in scenarios such as ensuring that user
account IDs or email addresses are unique within a system. They prevent
duplicate entries and maintain data integrity. For instance, a unique index
on a SocialSecurityNumber field ensures that no two individuals can have
the same social security number, which is crucial for maintaining
accurate records.
Application Questions
o b) As binary data
o c) As hierarchical nodes
o d) As XML documents
o d) Integrity Independence
o a) User preferences
o b) Database schema
o c) Authority levels
o d) System load
o b) Distribution independence
o c) Nonsubversion
o d) Guaranteed Access
o d) In user documentation
12. What does the Nonsubversion rule ensure regarding low-level data access?
True/False Questions
11. Nonsubversion allows users to bypass integrity rules if they have low-level
access to the data.
2. Explain the Guaranteed Access rule and how it affects data retrieval.
3. What is the Systematic treatment of NULLs rule and why is it important?
5. What does the Comprehensive data sublanguage rule entail for relational
databases?
6. Explain how the View updating rule impacts the updating of database
views.
9. Describe the Integrity Independence rule and its impact on data integrity
constraints.
10. What does Distribution independence mean for database applications and
users?
11. Explain the Nonsubversion rule and its relevance to data integrity.
Fill-in-the-Blanks
6. __________ rule ensures that any updatable view is updated through the
DB system.
10. __________ rule states that applications and end users should be unaware
of the physical data location.
11. The __________ rule ensures that if low-level access is supported, users
cannot bypass the integrity rules of the DB.
Essay Questions
1. Discuss the importance of Codd’s Information rule in the design and
implementation of relational databases. How does this rule contribute to
the effectiveness and efficiency of relational databases?
2. Explain how Codd’s rules on Physical Data Independence and Logical Data
Independence contribute to the robustness of relational databases.
Compare and contrast these two concepts, and describe how they affect
database applications and user interactions.
Case Study
Scenario:
A company is planning to upgrade its database management system. They need
to ensure that the new system complies with Codd’s relational database rules.
1. Analyze how Codd’s Dynamic online catalog rule will affect the transition
to the new database system.
Application Questions
Answers
Multiple Choice Answers
2. b) Every value is accessible using a table name, primary key value, and
column name
7. c) Authority levels
True/False Answers
1. True
2. True
3. False
4. True
5. False
6. False
7. True
8. True
9. False
10. True
11. False
4. Dynamic online catalog rule: Metadata about the database schema must
be managed as ordinary data and made available to authorized users for
transparency and management.
6. View updating rule: Any updatable view must be modified through the
database system to maintain integrity and consistency.
11. Nonsubversion: Low-level data access must still comply with the
database’s integrity rules to prevent bypassing of integrity constraints.
Fill-in-the-Blanks Answers
1. Information
2. Guaranteed Access
6. View updating
9. System catalog
11. Nonsubversion
Essay Answers
1. Information Rule:
2. Nonsubversion:
Application Answers