I’m creating a program that besides what the program does it also provides statistic information. One thing I wanted to add was number of transactions per day and then have maybe a line chart that shows how the transactions changed by day(within a month), then by month, then by year. I just can’t really figure out how to convert that into a database that the program could pull that data and put it into a chart
Would be it be something like or is there something i’m missing:?
Day table;
(A.I)id, daynumber, dayofweek, numoftrans foreign keys: monthnumber , yearnumber
Month table
(A.I)id, monthnumber, nameofmonth, numoftrans
year table
(A.I)id, yearnumber, numberoftrans
All you need is a table that stores dates and number of transactions.
The number of transactions per month and per year can be done in a query with aggregate functions (SUM()) and a WHERE clause. For the total per month . . .
It often makes sense to create views for the monthly totals and the annual totals.