Hi,
question 12: why is box D. "SELECT OBJECT(o) FROM Order o checked" ?
Normally, this query means "finds all orders". I understand that it may also mean "orders with lineItems" because conceptually, what does mean an order without lineitems? Nothing interesting...
But in the same book, p.418, we have also an example of one-to-many relationship between a Director(1) and Movies(n), and here, the query:
SELECT DISTINCT OBJECT (d)
FROM DirectorSchema d
WHERE d.movies IS EMPTY
makes apperently sense to the authors: "this query returns only those directors who have not madde any movies" or "Just show me the losers who haven't made any movies..."
Can't we imagine also that it may exist "loser orders which haven't any lineitems?".
More seriously, it seems that the relationship one-to-many doesn't necessary imply a conclusion about this kind of question. Because it tells us only about maximal cardinality and not minimal cardinality.
So the relationship between a Director and movies may be of type (1,1) -> (0,n) whereas relationship between an order and lineitems would be rather of type (1,1) -> (1,n).
Which means also that a Director without movies is conceptually conceivable whereas an Order without Lineitems is not.
Which means also that query
SELECT DISTINCT OBJECT (d) (or (o))
FROM DirectorSchema d (or Order o)
doesn't mean exactly the same thing...
Regards,
Cyril.