SQL Introduction
SQL — Structured Query Language — is the standard language for working with databases.
What is SQL?
SQL stands for Structured Query Language. It is used to communicate with and manipulate databases. SQL is the standard language for Relational Database Management Systems (RDBMS) such as MySQL, PostgreSQL, SQLite, MS SQL Server, and Oracle.
With SQL you can:
- Create, read, update, and delete data (CRUD)
- Create and modify database tables and structure
- Set permissions on tables, procedures, and views
- Query large amounts of data quickly and efficiently
💡 Did You Know?
SQL is the most widely used language for data professionals, data analysts, and backend developers. It is used by companies like Google, Facebook, Amazon, and Netflix every day.
SQL vs. Other Languages
SQL is a declarative language — you tell the database what you want, not how to get it.
Example — Your first SQL query
SELECT * FROM customers;
This query retrieves all rows from the customers table. That's it!
SQL Syntax Rules
Some important rules to know:
| Rule | Example |
|---|---|
| SQL keywords are case-insensitive | select = SELECT |
Statements end with a semicolon ; | SELECT * FROM table; |
String values use single quotes '...' | WHERE name = 'Alice' |
Comments use -- or /* */ | -- This is a comment |
Sample Database Used in This Tutorial
Throughout this SQL tutorial, we'll use a sample Customers table:
| CustomerID | Name | City | Country | Age |
|---|---|---|---|---|
| 1 | Alice Johnson | New York | USA | 28 |
| 2 | Bob Smith | London | UK | 35 |
| 3 | Carlos Rivera | Madrid | Spain | 42 |
| 4 | Priya Sharma | Mumbai | India | 31 |
| 5 | Yuki Tanaka | Tokyo | Japan | 25 |
📝 Note
The SQL Playground comes pre-loaded with this sample data. Click ▶ Try it on any example to open it instantly!