Depending on where you are taking the course, there are three primary ways to access these database initialization scripts. 1. The Official Code with Mosh Platform
USE sql_store; SELECT o.order_id, o.order_date, c.first_name, c.last_name, p.name AS product_name, oi.quantity FROM orders o JOIN customers c ON o.customer_id = c.customer_id JOIN order_items oi ON o.order_id = oi.order_id JOIN products p ON oi.product_id = p.product_id; Use code with caution.
: Separate .sql files for specific databases (like sql_inventory , sql_store , sql_hr , and sql_invoicing ) in case you need to rebuild just one.
A critical component of the course is the downloadable zip file, which contains the necessary scripts to create the databases used in the tutorials. You typically find the download link in the "Getting Started" module. To use the zip file, you just need to: programming with mosh sql zip file top
When you take the Programming with Mosh SQL course, the downloadable resource zip file contains the foundational elements needed for every chapter. Instead of manually typing out hundreds of rows of dummy data, the zip file provides pre-written SQL scripts that build your environment instantly. Typically, the zip file includes:
If you try to run a query and get this error, ensure the top of your script has the line USE sql_store; (or whichever database you are targeting). Alternatively, double-click the database name in the left Schema panel to make it bold (active).
Mosh occasionally hosts public code repositories for his free YouTube tutorials. Check his verified GitHub profile for open-source SQL scripts related to his shorter crash courses. Depending on where you are taking the course,
Refresh your panel on the left side of the screen. You will now see the new databases ready for querying. Troubleshooting Common Script Errors
Because these files are distributed publicly for educational purposes, many students have archived them on GitHub. If you lose the original link, searching GitHub for "programming-with-mosh-sql" will bring up community repositories containing the exact create-databases.sql script required to populate your workspace. Step-by-Step Guide to Setting Up the Files
Mosh's course is designed as a complete package, from installation to advanced concepts. However, learning doesn't have to stop there. Here are some ways to continue your journey. : Separate
SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Text;Database=C:\path\to\unzipped\file.csv', 'SELECT * FROM [file.csv]');
The sample files are specifically built to teach relationships. You can practice:
: A human resources tracking schema. This database includes self-referencing tables, which are crucial for learning how to construct hierarchical queries and self-joins.
SELECT * FROM products;