I have a table of
I have a table of Month with the following structure,
1. MonthID (Primary Key)
2. MonthName
I have another Table of Date with the following structure,
1. DateID (Primary Key)
2. Day
3. Month (Foreign Key, references to MonthID in Month Table)
4. Year
Lastly, there's a table with the name of Sales,
1. Date (Foreign key, references to DateID in Date Table)
2. SaleItem
3. SaleAmount
My required query is the Count of Sales done for every month
So, what I want is to get the count of Sales Table rows but group by those counts with the MonthID (that is an attribute in the Date Table) and also extract the Name of the month from the basic Month Table.
The expected outcome would be something similar to this,
| Month | Sales |
|---|---|
| January | 15 |
| February | 0 |
| March | 221 |
| April | 11 |