Skip to content

Commit f44575e

Browse files
authored
Create invoices-per-country.sql
1 parent d8b7a00 commit f44575e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

invoices-per-country.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SELECT co.country_name, count(*), AVG(i.total_price)
2+
FROM country co, city ci, customer cu, invoice i
3+
WHERE co.id = ci.country_id AND ci.id = cu.city_id AND cu.id = i.customer_id
4+
GROUP BY co.country name
5+
HAVING AVG(i.total_price) > (SELECT AVG(total price))

0 commit comments

Comments
 (0)