LUCENT GRID
Data Engineering Lab Β· JOINs Under Pressure
Loading company_db β€” 5 undocumented tables...
πŸ–₯️
SQL Terminal
πŸ—ΊοΈ
Schema Map
❓
Questions
πŸ“Œ BUSINESS QUESTIONS
β—‹INNER JOIN: orders + customers
β—‹LEFT JOIN: find unassigned orders
β—‹3-table JOIN: reps + regions + orders
β—‹Answer: North region reps > Β£10k
β—‹RIGHT JOIN: all products + sales
β—‹Final answer submitted
0 / 6 complete
SQL TERMINAL β€” company_db (5 tables)
MySQL 8.0 β€” company_db loaded Tables: orders, customers, reps, regions, products ⚠ No documentation found. Map the relationships yourself. Hint: use DESCRIBE <table> to inspect foreign keys ──────────────────────────────────────────────
mysql>
RELATIONSHIP MAP β€” company_db
regions
⚿ id
name
←1:Nβ†’
reps
⚿ id
full_name
⚷ region_id
hire_date
←1:Nβ†’
orders
⚿ id
⚷ rep_id
⚷ customer_id
⚷ product_id
amount_gbp
order_date
←N:1β†’
customers
⚿ id
company_name
country
←N:1β†’
products
⚿ id
name
category
price_gbp
BUSINESS QUESTIONS
FROM THE SALES DIRECTOR
You have five tables and no documentation. Answer these questions using JOINs:
Q1. Show each order with the customer name. (INNER JOIN)
Q2. Which orders have no assigned rep? (LEFT JOIN)
Q3. Show rep name, region, and total orders value. (3-table JOIN)
Q4 (KEY). Which reps in the North region sold more than Β£10,000 last quarter?
Q5. Show all products and their sales (include products with no sales). (RIGHT JOIN)
☰ BRIEF
πŸ–₯ Terminal
πŸ—ΊοΈ Schema
❓ Questions
MISSION BRIEF

MISSION BRIEFING

JOIN ANALYSIS β€” VANTAGE DISTRIBUTION

SCENARIO

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.

JOIN SYNTAX

  • INNER JOIN β€” only matching rows in both tables
  • LEFT JOIN β€” all left rows, NULLs for no match on right
  • RIGHT JOIN β€” all right rows, NULLs for no match on left
  • Syntax: FROM tableA a JOIN tableB b ON a.id = b.a_id

KEY QUERY TEMPLATE

SELECT 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;

TIP

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.

Display Mode
LAB COMPLETE
πŸ†
QUESTIONS ANSWERED
JOINs Under Pressure β€” Vantage Distribution
⚑
+50 XP
EXPERIENCE EARNED
⬆ LEVEL UP β€” Level
β†’ Return to Labs