Referential integrity cannot be set for _______________ relationships. A. One-To-One B. Indeterminate C. One-To-Many D. Many-To-Many

One-To-One
Indeterminate
One-To-Many
Many-To-Many

The correct answer is: D. Many-To-Many

Referential integrity is a database constraint that ensures that the data in one table is consistent with the data in another table. It is typically used to prevent orphaned records, which are records in one table that have no corresponding record in another table.

Referential integrity can be set for one-to-one and one-to-many relationships, but it cannot be set for many-to-many relationships. This is because a many-to-many relationship is a relationship between two tables in which each row in one table can be related to multiple rows in the other table. This makes it impossible to enforce referential integrity, as there is no way to ensure that each row in the first table has a corresponding row in the second table.

For example, let’s say you have a table of customers and a table of orders. Each customer can have multiple orders, and each order can have multiple items. In this case, you could set referential integrity to ensure that each customer has a corresponding order, and that each order has a corresponding customer. However, you could not set referential integrity to ensure that each item in an order has a corresponding customer, as it is possible for an item to be ordered by multiple customers.

Here is a more detailed explanation of each option:

  • A. One-To-One

A one-to-one relationship is a relationship between two tables in which each row in one table can be related to at most one row in the other table. For example, a customer can have at most one account. In this case, you could set referential integrity to ensure that each customer has a corresponding account, and that each account has a corresponding customer.

  • B. Indeterminate

This option is not correct. Referential integrity can be set for one-to-one and one-to-many relationships, but it cannot be set for many-to-many relationships.

  • C. One-To-Many

A one-to-many relationship is a relationship between two tables in which each row in one table can be related to multiple rows in the other table. For example, a customer can have multiple orders. In this case, you could set referential integrity to ensure that each customer has a corresponding order, and that each order has a corresponding customer.

  • D. Many-To-Many

A many-to-many relationship is a relationship between two tables in which each row in one table can be related to multiple rows in the other table. For example, a customer can have multiple orders, and an order can have multiple items. In this case, you could not set referential integrity to ensure that each item in an order has a corresponding customer, as it is possible for an item to be ordered by multiple customers.