SQL client for macOS
Write, debug, and improve SQL faster. Connect to MySQL, explore results, manage data workflows, and use AI assistance to explain errors, suggest fixes, and get from idea to query faster.
Product
SELECT
u.country,
COUNT(*) AS n,
SUM(o.total) AS total_volume
FROM users u
JOIN orders o ON o.user_id = u.id
WHERE u.created_at > NOW() - INTERVAL 7 DAY
GROUP BY u.country; | # | country | n | total_volume |
|---|---|---|---|
| 1 | US | 1245 | 45230.00 |
| 2 | UK | 892 | 28115.50 |
| 3 | DE | 634 | 19402.10 |
| 4 | FR | 412 | 15208.25 |
| 5 | CA | 298 | 9876.40 |
| 6 | AU | 267 | 11234.00 |
| 7 | JP | 521 | 20450.75 |
| 8 | BR | 389 | 8750.20 |
| 9 | IN | 756 | 18900.00 |
| 10 | NL | 198 | 7650.30 |
| 11 | SE | 156 | 5432.10 |
| 12 | ES | 334 | 12340.55 |
FAQ