Database Design and Normalization
- 67Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is the general progression from a conceptual relation toward a database implementation?
What is the general progression from a conceptual relation toward a database implementation?
67 questions
- 1
What is the general progression from a conceptual relation toward a database implementation?
- A
Create a table immediately, infer its relation afterward, then omit the entity representation
- B
Normalize the relation, remove its attributes, then convert the remaining keys into an entity
- C
Choose SQL queries, create foreign keys, then decide which entities the relation represents
- D
Describe the relation, represent it as an entity, then specify the details needed to implement it as a table
Correct answer
DDescribe the relation, represent it as an entity, then specify the details needed to implement it as a table
Explanation
A relation can first be represented as an entity in an entity-relationship model. Additional implementation decisions, such as data types and column properties, are then needed before creating a real database table.
- A
- 2
In a parenthetical description of a relation, what does underlining an attribute indicate?
- A
The attribute is a foreign key
- B
The attribute is a primary key
- C
The attribute permits null values
- D
The attribute has a default value
Correct answer
BThe attribute is a primary key
Explanation
In the relation notation described, an underlined attribute, such as itemId, indicates the primary key.
- A
- 3
Why is representing a relation as an entity not, by itself, enough to implement it in a database?
- A
An entity cannot have attributes until it has been converted into a query
- B
Entity diagrams specify constraints but cannot represent primary keys
- C
Implementation also requires decisions such as data types and column properties
- D
A relation must be stored as a single column before it can become a table
Correct answer
CImplementation also requires decisions such as data types and column properties
Explanation
An entity representation helps describe the data model, but implementation also requires choices such as each attribute's data type, null status, default value, and constraints.
- A
- 4
What is the first table-creation step when implementing a data model?
- A
Create an intersection table for every pair of entities
- B
Combine all entities into a single table
- C
Create a table only for entities that have foreign keys
- D
Create a table for each entity in the data model
Correct answer
DCreate a table for each entity in the data model
Explanation
The described implementation process begins by creating a table for each entity in the data model.
- A
- 5
Which set lists column properties that should be considered when implementing a table?
- A
Entity name, diagram position, relation name, and query order
- B
Data type, null status, default value, and constraints
- C
Join method, table alias, result format, and query frequency
- D
Candidate key, normalization level, table count, and index color
Correct answer
BData type, null status, default value, and constraints
Explanation
Column properties include its data type, whether null values are allowed, any default value, and constraints used to preserve data integrity.
- A
- 6
A column must contain a value between a specified minimum and maximum. Which design feature expresses this rule?
- A
A table alias
- B
A default value
- C
A foreign key
- D
A range constraint
Correct answer
DA range constraint
Explanation
A range constraint restricts column values to a specified minimum and maximum.
- A
- 7
A column should accept only values from a predefined list. What should the designer specify?
- A
A nullable status that permits any value
- B
A default value that replaces every supplied value
- C
A constraint defining the acceptable set of values
- D
A primary key that joins the column to another table
Correct answer
CA constraint defining the acceptable set of values
Explanation
A designer can impose a constraint that limits a column to a predefined set of acceptable values.
- A
- 8
Why might a designer reconsider a table's structure after specifying its columns and properties?
- A
A table cannot retain its primary key after constraints are added
- B
Normalization or performance needs may call for a different table structure
- C
Column properties determine that all entities must share one table
- D
Every table must be denormalized once its data types are selected
Correct answer
BNormalization or performance needs may call for a different table structure
Explanation
After the initial table design, the designer may reassess normalization. For example, a performance-driven decision to denormalize could require changing the table structure.
- A
- 9
What is a modification anomaly?
- A
A restriction that prevents a query from returning null values
- B
A mismatch between an entity diagram and its table name
- C
A problem that can arise when inserting, updating, or deleting data in a table
- D
A delay that occurs whenever a database joins two tables
Correct answer
CA problem that can arise when inserting, updating, or deleting data in a table
Explanation
Modification anomalies are problems that arise during data changes. The three types described are insertion, update, and deletion anomalies.
- A
- 10
A user deletes a customer's row, and that deletion also removes the only record that a certain car model exists. What kind of anomaly is this?
- A
A functional dependency
- B
An insertion anomaly
- C
A deletion anomaly
- D
An update anomaly
Correct answer
CA deletion anomaly
Explanation
This is a deletion anomaly because deleting one piece of data unintentionally removes other information that may need to be preserved.
- A
- 11
A new customer has no car, but the table stores customers and cars together, leaving missing car information in the new row. What problem does this illustrate?
- A
A deletion anomaly
- B
A transitive dependency
- C
An update anomaly
- D
An insertion anomaly
Correct answer
DAn insertion anomaly
Explanation
This is an insertion anomaly: adding a customer is awkward or produces missing values because customer and car information are stored together.
- A
- 12
A customer is added with a car model that already appears in the table, but the model name is entered with a spelling error. Which anomaly does this example illustrate?
- A
An insertion anomaly
- B
A partial dependency
- C
A deletion anomaly
- D
An update anomaly
Correct answer
AAn insertion anomaly
Explanation
The example describes an insertion anomaly: entering a repeated car-model value inconsistently while adding a new customer and car row.
- A
- 13
Changing a car ID for one customer's car requires changing the same car ID in another customer's row. What kind of anomaly is present?
- A
An insertion anomaly
- B
A candidate key
- C
A deletion anomaly
- D
An update anomaly
Correct answer
DAn update anomaly
Explanation
This is an update anomaly because the same fact is stored in multiple rows, so changing it in only one row leaves inconsistent data.
- A
- 14
What normalization strategy is used to reduce modification anomalies?
- A
Break a large table into smaller tables until it is no longer susceptible to those anomalies
- B
Replace all primary keys with default values
- C
Copy every non-key value into additional rows in the same table
- D
Combine related tables so each query reads only one table
Correct answer
ABreak a large table into smaller tables until it is no longer susceptible to those anomalies
Explanation
Normalization breaks tables apart into smaller tables until the design is no longer susceptible to the described modification anomalies.
- A
- 15
Why can storing customer and car information in one list lead to anomalies?
- A
A single table cannot be used to represent a relation
- B
The list combines information about two distinct business concepts
- C
Customer and car information must always have different data types
- D
A list cannot contain a primary key and non-key attributes together
Correct answer
BThe list combines information about two distinct business concepts
Explanation
The example combines two business themes, customers and cars, in one list. Separating them into customer and car tables avoids the associated modification anomalies.
- A
- 16
What is the expected benefit of separating customer data from car data in the example?
- A
Data can be added, updated, or deleted without introducing the illustrated anomalies
- B
Every query will avoid using keys to relate the tables
- C
Car information will no longer need to be stored in the database
- D
All customers will have to own a car before they can be recorded
Correct answer
AData can be added, updated, or deleted without introducing the illustrated anomalies
Explanation
Separating the two business concepts into customer and car tables gives a design that allows data to be added, updated, or deleted without the illustrated anomalies.
- A
- 17
How are properly normalized tables related to insertion, update, and deletion anomalies?
- A
They prevent updates but make insertions more difficult
- B
They help avoid all three types of modification anomalies
- C
They eliminate only deletion anomalies
- D
They have no effect on modification anomalies
Correct answer
BThey help avoid all three types of modification anomalies
Explanation
Proper normalization helps avoid insertion, update, and deletion anomalies.
- A
- 18
What does it mean for one attribute to be functionally dependent on another?
- A
The two attributes must always have identical values
- B
The two attributes must be stored in separate relations
- C
The first attribute must be the primary key of a different table
- D
The value of one attribute can be determined from the value of the other
Correct answer
DThe value of one attribute can be determined from the value of the other
Explanation
A functional dependency exists when the value of one attribute can be used to find or identify the value of another attribute or set of attributes.
- A
- 19
In a functional dependency, what is a determinant?
- A
A set of rows that cannot be changed after insertion
- B
An attribute that records a default value for the entire table
- C
An attribute whose value can determine values of other attributes in the table
- D
An attribute that is always allowed to contain null values
Correct answer
CAn attribute whose value can determine values of other attributes in the table
Explanation
A determinant is an attribute that can be used to determine the values of other attributes within a table.
- A
- 20
What characterizes a candidate key, according to the definition in the content?
- A
It determines only one non-key attribute in each related table
- B
Its values can determine every other non-key attribute in a row
- C
It is an attribute that is always a foreign key
- D
It must be made from two or more attributes
Correct answer
BIts values can determine every other non-key attribute in a row
Explanation
A candidate key is an attribute whose values can be used to find the value of every other non-key attribute within a row.
- A
- 21
How does a simple candidate key differ from a composite candidate key?
- A
A simple candidate key identifies a table; a composite candidate key identifies a database
- B
A simple candidate key uses one attribute; a composite candidate key uses two or more
- C
A simple candidate key uses foreign keys; a composite candidate key uses only non-key attributes
- D
A simple candidate key permits duplicates; a composite candidate key never does
Correct answer
BA simple candidate key uses one attribute; a composite candidate key uses two or more
Explanation
A simple candidate key consists of one attribute. A composite candidate key gets its uniqueness from combining the values of two or more attributes.
- A
- 22
What is true of a relation that satisfies the definition of a relation?
- A
It is, by definition, in First Normal Form
- B
It must have a composite candidate key
- C
It must have no functional dependencies
- D
It is, by definition, in Third Normal Form
Correct answer
AIt is, by definition, in First Normal Form
Explanation
The content states that every relation is, by definition, in First Normal Form.
- A
- 23
What change moves a First Normal Form table into Second Normal Form, as described?
- A
Remove partial dependencies
- B
Ensure every determinant is a candidate key
- C
Remove transitive dependencies
- D
Add an intersection table
Correct answer
ARemove partial dependencies
Explanation
Removing partial dependencies from a table in First Normal Form gives a table that meets the definition of Second Normal Form.
- A
- 24
What change moves a Second Normal Form table into Third Normal Form, as described?
- A
Remove transitive dependencies
- B
Remove partial dependencies a second time
- C
Add a surrogate key to every relation
- D
Combine every foreign key with its parent primary key
Correct answer
ARemove transitive dependencies
Explanation
Removing transitive dependencies from a table in Second Normal Form gives a table that meets the definition of Third Normal Form.
- A
- 25
What condition defines Boyce-Codd Normal Form in the content?
- A
Every determinant in the table is also a candidate key
- B
Every non-key attribute is a foreign key
- C
Every table contains only one attribute
- D
Every relation contains a transitive dependency
Correct answer
AEvery determinant in the table is also a candidate key
Explanation
A table meets Boyce-Codd Normal Form when every determinant within it is also a candidate key.
- A
- 26
How is Boyce-Codd Normal Form characterized in relation to Third Normal Form?
- A
It is slightly more stringent and is sometimes called 3.5 Normal Form
- B
It applies only to tables with composite primary keys
- C
It is less stringent and is sometimes called 2.5 Normal Form
- D
It is identical to First Normal Form under another name
Correct answer
AIt is slightly more stringent and is sometimes called 3.5 Normal Form
Explanation
Boyce-Codd Normal Form is described as a slightly more stringent version of Third Normal Form, which is why it is sometimes called 3.5 Normal Form.
- A
- 27
Which normalization level is treated as the practical definition of normalized for the purposes described?
- A
Boyce-Codd Normal Form, where every determinant is a candidate key
- B
Sixth Normal Form, where no relations remain
- C
Second Normal Form, where every table has one foreign key
- D
First Normal Form, where every attribute is a primary key
Correct answer
ABoyce-Codd Normal Form, where every determinant is a candidate key
Explanation
For the purposes described, a relation is considered normalized when every determinant is a candidate key, which is Boyce-Codd Normal Form.
- A
- 28
What conclusion is drawn about designs normalized to Third Normal Form or above?
- A
They are generally not susceptible to the described modification anomalies and are usually sufficient for business data problems
- B
They necessarily require denormalization before they can support business data
- C
They prevent all joins and therefore eliminate query costs
- D
They can represent only one business concept per database
Correct answer
AThey are generally not susceptible to the described modification anomalies and are usually sufficient for business data problems
Explanation
The content states that designs in Third Normal Form or above are generally not susceptible to the described modification anomalies and are almost always sufficient for business data problems.
- A
- 29
In the customer-accountant example, why is the original customer table not normalized?
- A
Some attributes depend on zip code or accountant ID rather than only on customer ID
- B
Accountant ID is necessarily a composite primary key
- C
Customer ID cannot identify the customer name or address
- D
The table contains too few attributes to form a relation
Correct answer
ASome attributes depend on zip code or accountant ID rather than only on customer ID
Explanation
In the original table, zip code determines city and state, while accountant ID determines accountant name and phone number. Thus, not all attributes are determined only by customer ID.
- A
- 30
Which functional dependency is used in the customer-accountant example to justify a separate zip code table?
- A
Accountant phone determines customer address
- B
Zip code determines city and state
- C
Customer name determines zip code and accountant phone
- D
City determines customer ID and accountant ID
Correct answer
BZip code determines city and state
Explanation
The example explains that knowing a zip code determines the corresponding city and state, so those attributes belong with zip code in a separate table.
- A
- 31
Which attributes are placed in the separate accountant table in the normalized example?
- A
Accountant ID, accountant name, and accountant phone
- B
Customer name, state, and accountant ID
- C
Zip code, city, and accountant name
- D
Customer ID, customer address, and accountant phone
Correct answer
AAccountant ID, accountant name, and accountant phone
Explanation
The accountant table uses accountant ID as its primary key and includes accountant name and accountant phone as non-key attributes.
- A
- 32
After normalizing the customer-accountant example, what role do zip code and accountant ID play in the customer table?
- A
They are removed because normalized tables cannot contain foreign keys
- B
They become default values for customer name and address
- C
They serve as foreign-key links to their respective tables
- D
They replace customer ID as a combined primary key
Correct answer
CThey serve as foreign-key links to their respective tables
Explanation
The normalized customer table retains zip code and accountant ID as foreign-key links to the zip code and accountant tables.
- A
- 33
What is denormalization?
- A
Replacing foreign keys with repeated copies of primary keys
- B
Removing all non-key attributes from a database
- C
Splitting every table until each attribute has its own relation
- D
Combining two or more tables when there is a business justification for doing so
Correct answer
DCombining two or more tables when there is a business justification for doing so
Explanation
Denormalization is the opposite of normalization: it combines tables when a business need or justification supports that choice.
- A
- 34
Which pair gives common reasons for denormalizing tables?
- A
Preventing the use of SQL and eliminating foreign keys
- B
Increasing data repetition and requiring more joins
- C
Avoiding all constraints and removing primary keys
- D
Simplicity of design and faster querying
Correct answer
DSimplicity of design and faster querying
Explanation
Simplicity of design and query speed are identified as common reasons for denormalization.
- A
- 35
Why might combining the zip code and customer tables make address queries faster?
- A
The combination turns the address into a primary key
- B
A customer's city and state can be retrieved without joining the zip code table
- C
The database can avoid reading any customer rows
- D
The combined table no longer needs to store customer addresses
Correct answer
BA customer's city and state can be retrieved without joining the zip code table
Explanation
With city and state stored in the customer table alongside the zip code, an address can be retrieved without a join to the zip code table.
- A
- 36
What performance trade-off is associated with joining tables in a relational database?
- A
Joins automatically remove repeated values from the database
- B
Joins reduce the number of rows stored in each table
- C
Joins require computational work and time, which can slow query performance
- D
Joins always prevent constraints from being applied
Correct answer
CJoins require computational work and time, which can slow query performance
Explanation
The content describes joins as computationally and temporally expensive operations that can slow query performance.
- A
- 37
What data-quality risk increases when city and state are repeated in many customer rows?
- A
The database will be unable to store more than one customer
- B
Every address will automatically become a null value
- C
Different customers may enter the same city or state inconsistently
- D
The customer table will lose its primary key
Correct answer
CDifferent customers may enter the same city or state inconsistently
Explanation
Repeated city and state values can be entered in inconsistent forms, such as spelling out a state, abbreviating it, or using different capitalization.
- A
- 38
What is the main cost of denormalizing the customer and zip code tables in the example?
- A
The design becomes susceptible to repeated data and modification anomalies
- B
The design can no longer retrieve customer addresses
- C
The design prevents customers from sharing a zip code
- D
The design must contain more tables than before
Correct answer
AThe design becomes susceptible to repeated data and modification anomalies
Explanation
Denormalization can introduce repetitive data and increase the possibility of modification anomalies, including inconsistent entries.
- A
- 39
When should a designer denormalize a database design?
- A
Whenever constraints or validity checks are available
- B
Whenever a database contains more than one entity
- C
Whenever two tables share any attribute, regardless of consequences
- D
Only when there is a defensible business reason, while considering the risks and added overhead
Correct answer
DOnly when there is a defensible business reason, while considering the risks and added overhead
Explanation
The content advises denormalizing only for a defensible business reason. Constraints and software validity checks may reduce risks, but they add overhead and may offset gains in simplicity.
- A
- 40
How is a relationship between two database tables typically implemented?
- A
By copying every row from one table into the other
- B
By linking a primary key to a foreign key
- C
By giving both tables the same name
- D
By removing the primary key from both tables
Correct answer
BBy linking a primary key to a foreign key
Explanation
The described strategy for relationships between tables is to create a link between a primary key and a foreign key.
- A
- 41
In a one-to-one relationship where both sides are optional, where can the foreign key be placed?
- A
In neither table, because optional relationships cannot use foreign keys
- B
In either table, based on which placement makes more conceptual sense
- C
Only in the table with the larger number of attributes
- D
Only in the table whose primary key has the shorter name
Correct answer
BIn either table, based on which placement makes more conceptual sense
Explanation
If both sides of a one-to-one relationship have minimum cardinality zero, the foreign key can go in either table; the designer can choose the more intuitive placement.
- A
- 42
In a one-to-one relationship where one side is optional and the other is mandatory, where should the foreign key usually go?
- A
In the table on the mandatory side
- B
In a new intersection table in every case
- C
In both tables to make the relationship bidirectional
- D
In the table on the optional side
Correct answer
DIn the table on the optional side
Explanation
When one side is optional and the other has minimum cardinality one, the usual strategy is to place the foreign key in the table on the optional side.
- A
- 43
In the employee-locker example, both sides may participate in zero relationships. What does that imply for foreign-key placement?
- A
The foreign key must be placed in the employee table
- B
The relationship cannot be represented with a foreign key
- C
The foreign key must be placed in the locker table
- D
The foreign key may be placed in either the employee table or the locker table
Correct answer
DThe foreign key may be placed in either the employee table or the locker table
Explanation
Because the employee-locker relationship is optional in both directions, either table can hold the foreign key, depending on the designer's conceptual preference.
- A
- 44
In the patient-bed example, every patient has exactly one bed, while a bed may be empty. Where should Bed ID be stored as a foreign key?
- A
In the Bed table
- B
In the Patient table
- C
In both the Patient and Bed tables
- D
In a separate intersection table in every case
Correct answer
BIn the Patient table
Explanation
The bed side is optional because a bed can be empty, while a patient must have a bed. The foreign key therefore goes on the optional side: Bed ID is stored in the Patient table.
- A
- 45
When joining two tables in a one-to-one relationship, what determines which key values are matched?
- A
The table with fewer rows determines which attribute is matched
- B
The tables must be joined on their names rather than their keys
- C
The foreign-key placement determines which primary and foreign key values are joined
- D
The join always matches the tables' first listed attributes
Correct answer
CThe foreign-key placement determines which primary and foreign key values are joined
Explanation
The join matches the relevant key values. For example, if Locker ID is the foreign key in Employee, the join matches Locker IDs; if Employee ID is in Locker, it matches Employee IDs.
- A
- 46
Where does the foreign key belong in a one-to-many relationship?
- A
In both tables, regardless of the design
- B
At the one side of the relationship
- C
In neither table if the relationship is binary
- D
At the many side of the relationship
Correct answer
DAt the many side of the relationship
Explanation
In a one-to-many relationship, the foreign key belongs in the table at the many end.
- A
- 47
In a one-to-many relationship, how are the one-side and many-side tables commonly described?
- A
Both sides are called parents
- B
The one side is the child; the many side is the parent
- C
The one side is the parent; the many side is the child
- D
Both sides are called children
Correct answer
CThe one side is the parent; the many side is the child
Explanation
The one side of a one-to-many relationship is commonly called the parent table, and the many side is called the child table.
- A
- 48
In a design where a team has many players and each player belongs to one team, where should Team ID be stored as a foreign key?
- A
In both tables as a foreign key
- B
In the Player table
- C
In a separate intersection table
- D
In the Team table only
Correct answer
BIn the Player table
Explanation
Player is on the many side of the relationship, so Team ID, the primary key of Team, is placed in Player as a foreign key.
- A
- 49
How can a one-to-many relationship be joined in an SQL query, according to the content?
- A
Only by placing the foreign key in the GROUP BY clause
- B
Only by listing the tables in the SELECT clause
- C
By avoiding a key match and joining on table names
- D
Using a join in the WHERE clause or using the JOIN keyword in the FROM clause
Correct answer
DUsing a join in the WHERE clause or using the JOIN keyword in the FROM clause
Explanation
The example performs the join in the WHERE clause, but the same relationship can also be joined in the FROM clause using the JOIN keyword.
- A
- 50
Why is an intersection table needed to implement a many-to-many relationship?
- A
It changes the relationship into two unrelated tables
- B
It removes the need for primary keys in the parent tables
- C
It stores all attributes from both parent tables in one row
- D
It provides a table that links the two parent tables
Correct answer
DIt provides a table that links the two parent tables
Explanation
A many-to-many relationship cannot be implemented directly in the described relational design, so an intersection table is created to link the parent tables.
- A
- 51
What is the typical primary key design for an intersection table?
- A
A copy of only the first parent's primary key
- B
A composite key made from the primary keys of the parent tables
- C
A key made from the non-key attributes of both parents
- D
No primary key, because the table is only a lookup
Correct answer
BA composite key made from the primary keys of the parent tables
Explanation
The typical strategy is to make a composite primary key from the primary keys of the two parent tables.
- A
- 52
In a composite-key intersection table, what additional role does each component of the key serve?
- A
Each component also acts as a non-key attribute in the parent table
- B
Each component also acts as a default value for the other parent
- C
Each component also acts as an alias for the intersection table
- D
Each component also acts as a foreign key to its parent table
Correct answer
DEach component also acts as a foreign key to its parent table
Explanation
Each parent primary key in the composite key is also a foreign key linking the intersection table back to that parent.
- A
- 53
To list students and all classes they have taken, why must a query involve the Student_Class table?
- A
It replaces the need to match any key values
- B
It links student IDs to class numbers so the student and class tables can be connected
- C
It turns the many-to-many relationship into a one-to-one relationship
- D
It stores the only copies of student names and class names
Correct answer
BIt links student IDs to class numbers so the student and class tables can be connected
Explanation
The query joins Student to Student_Class by student ID and Student_Class to Class by class number. The intersection table provides the links needed to assemble the results.
- A
- 54
What is an associative entity?
- A
A table that contains only a surrogate key
- B
A foreign key that appears in two unrelated tables
- C
An intersection table that also contains non-key attributes
- D
A parent table that has no primary key
Correct answer
CAn intersection table that also contains non-key attributes
Explanation
An associative entity is an intersection table with additional non-key attributes.
- A
- 55
In the student-class example, what does the Grade attribute represent?
- A
Information about a particular student's relationship to a particular class
- B
Information about the foreign-key link to the student table only
- C
Information about the class table's primary key
- D
Information about a student's relationship to every class in general
Correct answer
AInformation about a particular student's relationship to a particular class
Explanation
Grade records the student's performance in a specific class, so it describes the relationship between that student and that class.
- A
- 56
What limitation follows from using the two parent keys together as a composite primary key in an associative entity?
- A
Each parent-key value can appear only once in the entire table
- B
The associative entity cannot contain non-key attributes
- C
The parent keys can no longer serve as foreign keys
- D
Each matched pair of parent-key values can appear at most once
Correct answer
DEach matched pair of parent-key values can appear at most once
Explanation
Because the pair forms the primary key, the same combination of parent-key values cannot occur more than once.
- A
- 57
What can happen if an associative entity uses a surrogate primary key and the parent keys are only foreign keys?
- A
The same matched pair becomes impossible to store
- B
The table can no longer store relationship attributes
- C
The foreign keys automatically become a composite primary key
- D
The same matched pair of parent-key values can occur multiple times
Correct answer
DThe same matched pair of parent-key values can occur multiple times
Explanation
With a surrogate key, the parent keys are no longer part of the primary key. The same customer-product pair, for example, can therefore appear multiple times unless other rules prevent it.
- A
- 58
What practical difference can the two rating-table designs make?
- A
A composite key allows repeated ratings, while a surrogate key permits only one
- B
Both designs necessarily permit exactly one rating per customer
- C
Neither design can associate a rating with a customer or product
- D
A composite key permits one rating per customer-product pair, while a surrogate key can allow repeated ratings for that pair
Correct answer
DA composite key permits one rating per customer-product pair, while a surrogate key can allow repeated ratings for that pair
Explanation
With Customer ID and Product ID as a composite primary key, a customer can rate a product only once. With a surrogate Rating ID, the same customer-product combination can potentially be stored many times.
- A
- 59
What is a recursive relationship?
- A
A relationship that connects exactly three unrelated tables
- B
A relationship that has no foreign key
- C
A relationship in which a table is related to itself
- D
A relationship that exists only between a parent and a child table
Correct answer
CA relationship in which a table is related to itself
Explanation
A recursive relationship is one in which a table is connected to or related to itself.
- A
- 60
How are one-to-one and one-to-many recursive relationships typically implemented?
- A
With a foreign-key link within the same table
- B
By duplicating the table and removing its primary key
- C
By storing the relationship only in an SQL query
- D
With a separate intersection table in every case
Correct answer
AWith a foreign-key link within the same table
Explanation
For one-to-one and one-to-many recursive relationships, a foreign key within the same table is sufficient to track the relationship.
- A
- 61
How is a many-to-many recursive relationship implemented?
- A
By making every attribute in the table a primary key
- B
With a foreign key in the table and no other structure
- C
By copying the table's rows into a second parent table
- D
With an intersection table linking records in the table to one another
Correct answer
DWith an intersection table linking records in the table to one another
Explanation
A many-to-many recursive relationship requires an intersection table that links records in the table to other records in that same table.
- A
- 62
In the sponsorship example, what does the one-to-one cardinality mean for each person?
- A
A person must both sponsor and be sponsored by someone
- B
A person may be sponsored by zero or one other person
- C
A person may be sponsored by many other people
- D
A person must sponsor exactly one other person
Correct answer
BA person may be sponsored by zero or one other person
Explanation
The example states that each person is sponsored by zero to one other person, so sponsorship is optional and limited to at most one sponsor.
- A
- 63
In the one-to-one sponsorship relationship, which foreign-key interpretation can a designer choose?
- A
Record whom each person sponsored or record who sponsored each person
- B
Record only the person who has the largest number of sponsors
- C
Record both interpretations only in separate databases
- D
Record neither interpretation because a recursive key is not allowed
Correct answer
ARecord whom each person sponsored or record who sponsored each person
Explanation
The same sponsorship relationship can be represented by recording the person each individual sponsored or by recording that individual's sponsor.
- A
- 64
How does an SQL query retrieve information from a one-to-one recursive relationship?
- A
It creates a new table each time the query runs
- B
It joins the table to itself using two different aliases
- C
It reads the table only once and ignores the foreign key
- D
It joins the table to an unrelated parent table
Correct answer
BIt joins the table to itself using two different aliases
Explanation
The query refers to the same table twice, giving each instance a different alias, and joins those instances to each other.
- A
- 65
In the referral example, what cardinality applies to customers who refer others and to each referred customer?
- A
A customer may refer at most one other, while each customer is referred by many others
- B
Each customer must refer exactly one other and be referred by exactly one
- C
Customers cannot be referred by other customers
- D
A customer may refer many others, while each customer is referred by at most one other customer
Correct answer
DA customer may refer many others, while each customer is referred by at most one other customer
Explanation
The referral relationship is one-to-many: a customer might refer many others, while each customer is referred to by a maximum of one other customer.
- A
- 66
How can a query find the customers referred by a chosen customer in a one-to-many recursive relationship?
- A
Create an intersection table for every one-to-many recursive query
- B
Use only the customer table's primary key and ignore the referral link
- C
Join two aliased instances of the customer table using the referral foreign key
- D
Join the customer table to itself without aliases or a key match
Correct answer
CJoin two aliased instances of the customer table using the referral foreign key
Explanation
The query uses the same table twice, with different aliases, and matches the referral foreign key to identify customers referred by the chosen customer.
- A
- 67
How is a many-to-many recursive relationship between doctors represented and queried?
- A
Create two unrelated doctor tables and join them by doctor name
- B
Store one foreign key in Doctor and query a single instance of that table
- C
Store all treated doctors as repeated text in one Doctor attribute
- D
Use a doctor intersection table, then join it to two aliased instances of the Doctor table
Correct answer
DUse a doctor intersection table, then join it to two aliased instances of the Doctor table
Explanation
The many-to-many doctor relationship uses an intersection table. A query selects from two uniquely aliased instances of Doctor and from the intersection table, then joins them to identify which doctors treat which others.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.