All languages
SQL programming language logo

SQL

The language of databases

SQL (Structured Query Language) is the universal way to ask questions of a relational database. Every web app, analytics dashboard and report ultimately leans on SQL.

Chapters

  1. 1SQL and relational data
  2. 2Create a repeatable SQLite exercise
  3. 3Statements, identifiers and aliases
  4. 4Expressions and query parameters
  5. 5SQLite values, affinity and constraints
  6. 6Filtering, comparison and NULL
  7. 7CASE expressions
  8. 8Set-based updates
  9. 9Built-in scalar functions
  10. 10Aggregates and grouping
  11. 11Searching and transforming text
  12. 12Keys and joins
  13. 13Transactions and rollback
  14. 14Views and common table expressions
  15. 15Insert, update and delete safely
  16. 16Query order, sorting and limits
  17. 17Build a small study report

What this SQL course covers

SQL (Structured Query Language) is the universal way to ask questions of a relational database. Every web app, analytics dashboard and report ultimately leans on SQL. The 17 chapters combine explanations, examples and practice tasks. HTML and CSS use a browser preview; SQL examples target SQLite; console languages use their compiler or runtime. Read each example's prerequisites rather than combining independent snippets into one program.

SQL is how you ask a database questions. This online SQL compiler runs SQLite in your browser, so you can create tables, insert rows and query them without installing a database server — and the result set is printed as a table under the editor.

How to study SQL so it sticks

  1. Read the chapter once without touching the keyboard

    Get the shape of the idea first. Stopping every line to type breaks the explanation into fragments you then have to reassemble.

  2. Retype every example from scratch

    Do not copy and paste. Typing forces you to notice punctuation, indentation and the order things happen in — the three things beginners lose marks and hours on.

  3. Break it on purpose

    Delete a semicolon, misspell a variable, remove a bracket. Read the error carefully. You are building a mental index of error messages, which is most of what practical debugging is.

  4. Write one tiny program of your own

    One idea, five to fifteen lines: a converter, a counter, a grader, a mini quiz. Original code that works teaches more than a hundred lines you followed along with.

  5. Come back the next day and redo it from memory

    Spaced recall is the difference between finishing a course and keeping it. Five minutes of yesterday's example before today's chapter is enough.

Why SQL is worth your time

Almost every application stores its data in a relational database, so SQL is the shared language between developers, analysts and data scientists.

The core syntax barely changes across PostgreSQL, MySQL, SQLite and SQL Server, which makes it one of the most durable skills in software.

Where SQL is used

  • →Querying and reporting on application data
  • →Data analysis and business dashboards
  • →Backend development and schema design
  • →Data engineering and ETL pipelines

Mistakes SQL beginners hit first

no such table: students

Why: The CREATE TABLE statement was not run in the same session.

Fix: Keep the CREATE and INSERT statements above your SELECT in the same script.

misuse of aggregate function COUNT()

Why: An aggregate was used in WHERE.

Fix: Filter aggregates with HAVING, not WHERE.

ambiguous column name: id

Why: Both joined tables have that column.

Fix: Qualify it: s.id or c.id.

SQL course FAQs

What will I be able to build after the SQL course?

Write SQLite queries, filter and group data, join related records, and use transactions in disposable practice databases. Other SQL dialects have different syntax.

Do I need any experience before starting SQL?

No. Chapter one assumes you have never written a line of code. If you have programmed before, skim the first four chapters and start at the loops and functions section instead.

How much time should I spend per SQL chapter?

Around 20 minutes reading and 20 minutes retyping and experimenting. The retyping matters more than the reading, because recall — not recognition — is what you need when you write code yourself.

Can I run the SQL examples without installing anything?

Yes. Every chapter includes an editor with a run button, and there is a dedicated SQL compiler page with tutorials and practice exercises with worked solutions.

Practise SQL while you read