My assignment asked me to find out \"how many invoices are written for each date?\"
I was a little stuck and asked my professor for help. She emailed me a query that
You can find more detail about GROUPING SET, CUBE, ROLL UP. TL;DR they just expand GROUP BY + UNION ALL in some ways to get aggregation :)
https://technet.microsoft.com/en-us/library/bb510427(v=sql.105).aspx