Please write queries based on the following requirements usi
Please write queries based on the following requirements using Premier Database.
List the total number of transactions made by members in each state. Show your results in descending order on state abbreviations.
database: https://onedrive.live.com/redir?resid=A1E5259BDD065B48!4478&authkey=!AH3fj0xU0Jv_Jyc&ithint=file%2caccdb
Solution
# this query for state wise total transactions count
SELECT Location_1,count(TransactionID_2) total_transactions FROM TRANSACTIONS group by Location_1 order by Location_1 desc
column Location_1 has values Online with no state name, if you don\'t want that in results, then use following query
SELECT Location_1,count(TransactionID_2) total_transactions FROM TRANSACTIONS where Location_1<>\'Online\' group by Location_1 order by Location_1 desc
