Vantage Distribution's previous analyst left no documentation. You have five tables and a set of business questions from the Sales Director that need answering today. Figure out the relationships and write the JOIN queries to get the answers.
INNER JOIN β only matching rows in both tablesLEFT JOIN β all left rows, NULLs for no match on rightRIGHT JOIN β all right rows, NULLs for no match on leftFROM tableA a JOIN tableB b ON a.id = b.a_idSELECT r.full_name, rg.name AS region, SUM(o.amount_gbp) FROM orders o JOIN reps r ON o.rep_id=r.id JOIN regions rg ON r.region_id=rg.id WHERE rg.name='North' GROUP BY r.full_name HAVING SUM(o.amount_gbp) > 10000;
Open the Schema Map window to see how the foreign keys connect the tables. Start with a simple 2-table JOIN, then add more tables one at a time.