Updated with SQL for totals

- new files
- new sql statements