Meridian Procurement is losing money on late deliveries. The procurement director needs to know which suppliers are performing below average โ but only within their own category. A supplier that takes 8 days in the Electronics category (where the average is 6) is more problematic than one taking 8 days in Heavy Freight (average 12). You need correlated subqueries to answer this correctly.
SELECT AVG(avg_days) FROM suppliers โ scalar resultWHERE id IN (SELECT supplier_id FROM orders WHERE ...)WHERE avg_days > (SELECT AVG(...) FROM suppliers s2 WHERE s2.category = s.category)WHERE NOT EXISTS (SELECT 1 FROM orders WHERE supplier_id = s.id)FROM (SELECT ... GROUP BY ...) AS aliasThe Concepts window has working syntax templates for each subquery type. The terminal recognises the key clauses โ you don't need to type every column name exactly.