using group by for getting some statistic data from one table with bulk records and puting the results into the second table

As I explained in title I have 2 tables :
1 – “Leaves” with 21000 rec of leaves for about 50 peoples during 20 years
2- “StatisticLeave” which is empty
now i want to use group by for getting some statistic data from table 1 and after doing some calculation (like sum & …) putting the results into the second table.
I wrote below code :

Design Pattern for Custom Fields in Relational Database

I have assigned a task to create (relatively) simple reporting system. In these system, user will be shown a table result of report. A table has some fields and each field give some part of information to user in each record. My problem however is that each report field will not be declared by developer. It must be declared by user of system. So my reports table are dynamic.

ASP.NET Membership/Role providers for MySQL?

I am not at all familiar with ASP.NET membership/roles. This is my first time using it, and my first time trying ASP.NET MVC. When I create my first project for MVC, it gives me a lovely template to create an account. I was excited to see that I did not have to do this manually. However, it failed because it cannot connect to SQL Server. I do not have SQL Server, I have MySQL. Is there any easy way I can get this system to use MySQL instead, or will I have to create my own authentication?