SQL Answers
SQL Answers
2. Write a query to count the number of customers with a customer balance over $500.
sqlite> select count(*) from CUSTOMER where CUS_BALANCE>500;
select * from CUSTOMER where CUS_BALANCE>500;
3. Generate the listing of customer purchases, including the subtotals for each of the invoice line
numbers.
sqlite> select P_CODE,LINE_PRICE from LINE group by INV_NUMBER,LINE_NUMBER;
4. List the balance characteristics of the customers who have made purchases during the
current invoice cycle—that is, for the customers who appear in the INVOICE table.