The SQL files included in this repository showcase the use of common T-SQL techniques for extracting insight from data.
You can find all the database files here (download All Code Files): https://www.wiley.com/en-ca/Data+Analysis+Using+SQL+and+Excel%2C+2nd+Edition-p-9781119021438. It accompanies the book "Data Analysis Using SQL and Excel, 2nd Edition" , by Gordon S. Linoff.
To set up the database in SQL Server, you need to create an empty database (name it SQLBook), run the LoadSQLServer.sql script and modify line 11 to point to your data folder.
A snapshot of the database diagram is available in the Database data model.jpg file.
The queries created based on this database are original (not included in the book mentioned above). They are queries meant to walk through concepts ranging from filtering, grouping, sorting, joining, pivoting, applying various types of functions (aggregate, window functions, date functions etc.), to using table expressions and stored procedures.