Skip to content
Learn Netverks

Lesson

Step 2/36 6% through track

what-is-sql

What is SQL?

Last reviewed May 28, 2026 Content v20260528
Track mode
sql_sandbox
Means
SQL sandbox
Reading
~2 min
Level
beginner

This lesson

This lesson teaches What is SQL?: the SQL patterns, schema habits, and query reasoning you need before advancing in SQL.

Teams query What is SQL? on every SQL codebase—skipping it leaves gaps in debugging and data reviews.

You will apply What is SQL? in contexts like: Postgres, MySQL, SQLite, warehouses, and ORMs that still expose SQL.

Copy SQL from each lesson into SQLite (sqlite3), DB Fiddle, or local Postgres—read result grids and row counts. The in-browser SQL lab (sql_sandbox) will run queries when the runner ships; until then, local clients are the practice path.

After basic programming literacy—before ORM-heavy frameworks assume you can read the SQL they generate.

SQL is a declarative language: you describe what data you want, and the database engine decides how to fetch it. It is not a general-purpose language like Python—it specializes in tables, rows, and set operations.

Core characteristics

  • Set-oriented — operations work on whole tables or filtered subsets, not one row at a time in application code
  • Standardized — ANSI SQL defines common syntax; vendors add extensions
  • Four statement classes — DDL (schema), DML (data), DCL (permissions), TCL (transactions)
  • Ubiquitous — Postgres, MySQL, SQLite, SQL Server, Oracle, and cloud warehouses all speak SQL variants

Statement categories

-- DDL: define structure
CREATE TABLE products (id INTEGER PRIMARY KEY, name TEXT);

-- DML: manipulate rows
INSERT INTO products (name) VALUES ('Notebook');
SELECT * FROM products;
UPDATE products SET name = 'Journal' WHERE id = 1;
DELETE FROM products WHERE id = 1;

Practice: Copy SQL into sqlite3 practice.db, DB Fiddle, or a local Postgres session. Compare row counts and column names with the lesson.

SQL vs application code

Application layers (Django ORM, PHP PDO, Python pandas) often generate SQL. Understanding the underlying statements helps you debug slow queries, write migrations, and pass interviews.

Important interview questions and answers

  1. Q: Is SQL a programming language?
    A: It is a database language—declarative for queries and data changes, with limited procedural extensions in some engines.
  2. Q: DDL vs DML?
    A: DDL changes structure (CREATE, ALTER, DROP); DML changes or reads rows (SELECT, INSERT, UPDATE, DELETE).

Self-check

  1. Which statement reads data without modifying it?
  2. Name one DDL and one DML keyword.

Tip: Keep a cheat sheet of DDL vs DML vs TCL—interviews love the classification.

Interview prep

DDL vs DML?

DDL changes schema; DML reads or changes row data.

Is SQL procedural?

Core SQL is declarative—some engines add procedural extensions.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • SQL vs NoSQL when?
  • DDL vs DML?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump