Hello! I am a MCSA SQL Server 2014 certified professional, with more than 10 years of experience in SQL related projects and tasks. I am a near-native English speaker, currently available. I have read your project brief and I can have the routine - in form of a scheduled SQL Stored Procedure (and using a SQL Stored Function to obtain the SMA) - in 4 full working days (32 full working hours) at most. I would do the following:
- Use BULK INSERT to insert the data from the CSV file, to a Staging Table in SQL Server. This table would have to be cleared everyday before the loading process.
- Then, use the data in the STG table to add the additional columns. The main routine contents (the calculation of the additional columns) would be enclosed in a stored procedure. Finally the main routine would insert the data in a results table (or return a resultset, that can be discussed later).
- Regarding the SMA calculation: I have in my mind creating a stored function that receives 2 parameters (team, number of games) and have it calculate and return the results. In my mind, I think the function will use WHERE, ORDER BY, and TOP N statements to get the SMAs in a clear and simple way - the function would have no more than 30 rows, I estimate. Also, this function can be reusable for any SMA needs in the future.
Finally! Is important to mention that providing me an Excel file with previous results would absolutely help me. I have done and delivered similar projects before.