92.3k views
2 votes
Rows cannot be deleted from a table through a complex view that is based on a group function.

a.true
b.false

1 Answer

4 votes

Final answer:

The answer is A; it's mostly true that rows can't be deleted from a table via a complex view with a group function due to the loss of unique row identity after aggregation.

Step-by-step explanation:

The correct answer is option A. It is generally true that rows cannot be deleted from a table through a complex view that is based on a group function. This is because a group function implies the aggregation of data, and when data is aggregated, individual row information that uniquely identifies records is lost, making it ambiguous as to which exact rows need to be deleted. SQL standard and most relational databases restrict modifications through views that contain group functions such as SUM, AVG, MAX, MIN, and COUNT because the view does not clearly map to a single row in the underlying table(s). However, some databases may allow deletions through views with certain limitations or if additional rules (such as INSTEAD OF triggers) are applied.

Rows can be deleted from a table through a complex view that is based on a group function.

For example, let's say we have a complex view that groups sales data by product category, and we want to delete all the rows for a specific category. We can achieve this by deleting the rows from the underlying table that the view is based on.

User DenverCR
by
7.4k points