Solution

ID: past-exam-of-the-computer-science-course-of-the-university-of-oxford/2015/databases/1/a/ii/solution

Construct the required models and the actual customer–model purchases using relational projection and a natural join:
The Cartesian product lists every obligation: every customer paired with every model present in Car. The relational difference consists of unfulfilled obligations. Remove the customer identifiers occurring in this database relation and only then recover names:
This is an explicit relational division construction with all customers as the candidate universe. If there are no models, there are no missing obligations, so every customer qualifies. A version starting solely from customers occurring in would incorrectly omit customers with no purchases in that empty-model case.
The quantified object here is the model database attribute, so two makes sharing a model value contribute one required value. If a different application identified a model by the pair (make, model), both the required and purchased relational projections would use that pair. Also, Car contains unsold cars: a model available only in unsold inventory is still a required model, and then nobody qualifies. Testing identifiers before names prevents different customers with the same name from pooling their purchases.

New to topics? Read the docs here!