CS1103/Labs/Lab5/Q8.sql
2022-10-07 00:48:09 -03:00

8 lines
289 B
SQL

select SUM(LINE_NUM) as `Number of Products purchased`, BRAND_TYPE as `Brand`, CUST_STATE as `State`
from LGCUSTOMER
natural join LGINVOICE
natural join LGLINE
natural join LGPRODUCT
natural join LGBRAND
group by BRAND_TYPE, CUST_STATE
having SUM(LINE_NUM) < 10;