What does a view store?
- The query text, run fresh each use
- A frozen copy of the rows
- The passwords of its readers
Which clause tests that no matching rows occur?
- ORDER BY
- NOT EXISTS
- GROUP BY
UNION stacks results that share the same shape.
Circle one: True False
What is the second way to ask the same question?
- LEFT JOIN Orders and keep rows where the order side is NULL
- DELETE all orders first
- UNION customers with orders
Which query lists customers who never ordered?
- SELECT name FROM Customers WHERE id IN (SELECT customer_id FROM Orders)
- SELECT name FROM Orders WHERE total > 0
- SELECT name FROM Customers c WHERE NOT EXISTS (SELECT 1 FROM Orders o WHERE o.customer_id = c.id)
Orders hold one NULL customer id. Which form still answers rightly?
- NOT IN, since NULLs speed it up
- NOT EXISTS, since it skips the NULL trap
- UNION, since it deletes NULLs
A view freezes its rows at creation time.
Circle one: True False
A join version returns one customer three times, the NOT EXISTS version once. Why?
- NOT EXISTS hides paying customers
- UNION ran in secret
- The join multiplies rows on many matches
Asking about rows that are missing W1-mt_SLKUlC-7or-s1
- The query text, run fresh each use · Views name logic, not data.
- NOT EXISTS · NOT EXISTS filters to rows with zero matches.
- True · Set words need matching shapes.
- LEFT JOIN Orders and keep rows where the order side is NULL · Unmatched join rows carry NULLs on the order side.
- SELECT name FROM Customers c WHERE NOT EXISTS (SELECT 1 FROM Orders o WHERE o.customer_id = c.id) · The absence test keeps only unmatched customers.
- NOT EXISTS, since it skips the NULL trap · NOT IN breaks on NULLs; NOT EXISTS stays steady.
- False · Each use runs the stored text against live data.
- The join multiplies rows on many matches · Many matches fan out join rows; the test just checks.