Advertisement
Georgi_Benchev

Untitled

Dec 19th, 2024
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.31 KB | None | 0 0
  1. /* 23 Write a SQL query that outputs the town with most employees.*/
  2. SELECT t.name AS town_name, COUNT(e.employee_id) AS num_employees
  3. FROM employees e
  4.          JOIN addresses a ON e.address_id = a.address_id
  5.          JOIN towns t ON a.town_id = t.town_id
  6. GROUP BY t.name
  7. ORDER BY num_employees DESC
  8. LIMIT 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement