SQL Fundamentals
Query any database with confidence: the skill behind every analytics and ops role.
WHAT THIS LESSON COVERS
SQL (Structured Query Language) is the language you use to ask a database questions, and databases are where every serious system keeps its truth: the attendance records, the order book, the candidate pool, the payments. Excel is where you analyse extracts; SQL is how you get the exact data you need, at full scale, straight from the source. This lesson frames what SQL is and where you will meet it.
WHY SQL WHEN YOU ALREADY KNOW EXCEL
Three reasons. Scale: Excel slows down around a few hundred thousand rows; databases query millions in seconds. Truth: an extract is a snapshot, possibly stale or filtered by someone else; querying the database yourself removes the middleman and the guesswork. Repeatability: a query is a recipe you rerun every month with one edit, while a pile of copy-paste is a recipe you rebuild. The concepts transfer perfectly: filtering (WHERE) is filtering, grouping (GROUP BY) is a pivot, joining (JOIN) is a lookup. Everything you learned in spreadsheets reappears here, one syntax different.
WHERE YOU WILL ACTUALLY MEET SQL
Every product runs on a database with SQL beneath it. As an analyst or HR or finance professional you will meet it in three places: reporting tools and dashboards that accept a SQL box (most BI tools do), asking the engineering or data team for data (sending them a precise query gets you better data, faster, than sending a wish), and product databases themselves (PostgreSQL, MySQL, SQL Server, SQLite, and cloud ones like Supabase, all speaking dialects of the same language). Learn standard SQL and the dialect differences are minor: date functions and string functions differ slightly, everything else is shared.
WHAT A DATABASE LOOKS LIKE
A relational database holds tables: employees, attendance, salaries, departments. Each table is a grid of rows (records) and columns (fields), exactly like a clean Excel table: one row per record, one column per field. Tables connect through keys: employee ID in the attendance table matches employee ID in the employees table. That structure, flat tables linked by keys, is the entire model, and it is why your spreadsheet instincts are an asset here rather than baggage.
THE ONE STATEMENT THAT MATTERS MOST
Reading data is SELECT, and it is 80 percent of real-world SQL use. A first query, read aloud:
SELECT name, city FROM employees WHERE city = 'Pune';
"Give me the name and city columns, from the employees table, only where city is Pune." Every query you will write for months is a longer version of that sentence. Writing (INSERT, UPDATE, DELETE) is powerful and dangerous, and lesson 5 teaches it with the safety rules; until then, everything is read-only, which means nothing you do can break anything.
HOW TO PRACTICE WITHOUT A REAL DATABASE
SQLite runs in a single file with no installation; SQL Zoo, SQLite Online and Mode's SQL tutorial offer browsers that need nothing. The exercises in this course can all run on a small practice dataset: an employees table, an attendance table, a salaries table, a departments table. Build that little world once and every lesson has a gym.
THE THINKING SHIFT FROM SPREADSHEET TO QUERY
In Excel you act on what you can see; in SQL you describe what you want and the engine finds it. The mindset is declarative: state the result, not the steps. Beginners compensate by writing tiny queries and staring at full outputs; the professionals' habit is different: write the query for a question, look at row counts first (did I get 6 rows or 60,000?), then look at data. Count first, content second.
WORKED EXAMPLE
An HR analyst needs March attendance for the Pune plant. Excel route: ask IT for an extract, wait a day, receive 40,000 rows, clean, filter, pivot. SQL route: one query against the attendance and employees tables, filtered to March and Pune, returning 980 rows in two seconds, reusable next month by changing one word. The difference is not cleverness; it is that the analyst described the need precisely to the system that holds the data.
THE VOCABULARY MAP FROM EXCEL
Filter = WHERE. Sort = ORDER BY. Pivot = GROUP BY. VLOOKUP = JOIN. Calculated column = SELECT with an expression. COUNTIF = COUNT with WHERE or GROUP BY. Keep this map beside you; each lesson names its spreadsheet cousin, and the familiar shape makes the new syntax fast to learn.
FOUR MISTAKES OF BEGINNERS
1. Running queries against production systems casually; always prefer a reporting copy.
2. Writing big queries first instead of building them stepwise and checking counts at each step.
3. Confusing a query's row count with correctness; check both.
4. Giving up on syntax errors instead of reading them; the error text names the problem more often than not.
PRACTICE
Write, in plain English, five questions you would ask of a company database (any company you know). Then mark which tables each would need. That list is the syllabus your SQL practice should serve.
Loading…
The assessment
10 multiple-choice questions · 50% pass mark · two attempts.
