Lesson 1

What Is SQL?

Understand SQL as a declarative language for querying and changing relational data.

SQL is a language for working with relational data. Instead of describing every step the database should perform, you describe the result you want: rows from a table, rows that match a filter, rows joined with another table, or summarized rows grouped by a category.

That makes SQL different from ordinary application code. A SELECT statement is closer to a request:

SELECT id, email
FROM users
WHERE status = 'active'
ORDER BY created_at DESC;

You are saying: return the id and email columns from users, keep only active users, and sort the latest accounts first.

Why developers meet SQL

Even if you use an ORM, SQL is still underneath many production behaviors:

  • API endpoints that read and write relational data
  • Admin dashboards and reporting queries
  • Slow query logs and database error messages
  • Migrations, constraints, indexes, and data repair scripts
  • Pull requests where reviewers need to understand data access changes

The practical skill is not memorizing every database feature. It is learning to read query shape, spot risky assumptions, and break a dense statement into understandable parts.

SQL is not one identical language everywhere

SQL has a shared core, but each database has dialect details. PostgreSQL, MySQL, SQLite, SQL Server, and other systems differ in functions, quoting, date handling, JSON support, pagination, and procedural syntax.

When a formatter or parser asks for a dialect, choose the source database when you know it. Generic SQL is useful for simple queries, but real application queries often use vendor-specific syntax.

Key takeaway

Start by reading SQL as structured text: selected columns, source tables, filters, joins, grouping, sorting, and limits. Once that structure is visible, debugging becomes much less mysterious.

Practice by pasting a query into the SQL Formatter and identifying each clause before changing the SQL.

When you want to practice, use the related DevCove tool — optional, not part of this lesson.

Open related tool

Back to course overview