Before you can practice SQL queries, you need a real database with real data. This guide walks you through installing the SQLite extension for Visual Studio Code, creating a department and employee table, and loading 25 sample employees across five departments. One of those employees deliberately has no department assigned — you’ll use that record later to practice LEFT JOIN and IS NULL queries.
Prerequisites
You need Visual Studio Code and the following extension:
- SQLite by Alex Covizzi (search for
alexcovizzi.vscode-sqlite in the Extensions panel)
The extension lets you:
- Create and open
.db database files
- Execute SQL scripts directly from the editor
- Browse tables and their schemas
- View and edit records with a graphical interface
Database Schema Diagram
Sample Queries to Try Now
Once your database is set up, practice these queries to make sure everything is working:
Display all employee names:
Display employees from Hyderabad:
Display employees earning more than ₹70,000:
Display employees sorted by salary (highest first):
Join employees with their department names:
Show all employees, including those without a department:
Run the LEFT JOIN query and compare its output to the INNER JOIN. Notice that Gopal Krishna appears in the LEFT JOIN result with NULL for department_name, but is absent from the INNER JOIN result. This is the key difference between the two join types.
What You’ve Accomplished
You have:
- Installed the SQLite extension in Visual Studio Code
- Created a
employee.db SQLite database file
- Defined the
department and employee tables with appropriate constraints and a foreign key relationship
- Inserted 5 departments and 25 employee records (including one with a NULL department)
- Verified the data with count and selection queries
- Run your first JOIN queries
Your database is now ready for all the SQL topics covered in the next chapters — SELECT, WHERE, GROUP BY, HAVING, JOINs, aggregate functions, and window functions.