I need a query created which copies a few columns from an existing table, then creates a new table with that data and adds a further 166 columns. The data in these columns will be created through the query. The data it will be analysing can also be copied to the new table or look it up from an existing table.
The new columns are mostly relatively simple calculations such as averages over different date periods, averages between nth tournaments and scores, lowest x percent over date periods, sample size counts of the same data and a few lookups of data from other tables.
The query should initially create the table but also have the ability to append new rows between a specific date range (from another table).
If successful I will want further queries/tables created in the future. In addition, I would also be happy for you to help me with optimisation of other queries I have.
I have attached an excel spreadsheet which shows how to calculate the data I need in excel formulas (which will need to be replicated in sql). The full dataset is currently about 1m rows but I've reduced that in this example to get it under 10mb.
Please look through the attached file before submitting your proposal.