What is SQL?
SQL stands for Structured Query Language. It’s the language you use to interact with relational databases. When you need to retrieve data, add new records, update existing ones, or delete information, you write SQL queries.
You’ll hear people pronounce it two ways. Some say each letter “S-Q-L” and others say “sequel.” Both are correct and widely used.
A SQL query looks like structured English. To get all users from a database, you might write SELECT * FROM users. To find users with a specific email, you’d write SELECT * FROM users WHERE email = '[email protected]'. To add a new user, you’d use INSERT INTO users (email, name) VALUES ('[email protected]', 'John').
SQL is declarative, which means you describe what you want rather than how to get it. You say “give me all users who signed up this month” and the database figures out the most efficient way to find them. This is different from imperative programming where you write step-by-step instructions.
Almost every relational database uses SQL. PostgreSQL, MySQL, SQLite, Microsoft SQL Server, and Oracle all use SQL with slight variations. The core commands are the same across all of them, so once you learn SQL for one database, you can use it with others.
The main SQL operations are SELECT for reading data, INSERT for adding new records, UPDATE for changing existing records, and DELETE for removing records. Beyond these basics, SQL has powerful features for joining data from multiple tables, aggregating results, and complex filtering.
SQL syntax has become so ubiquitous that it’s been adapted to other query languages beyond databases. You’ll see SQL-like syntax in Jira QL for querying issues, NRQL for New Relic monitoring data, SOQL for Salesforce data, and other places where people need a query language.
I’ve used SQL in some form or another for the past 20 years. It’s the standard for relational databases and it’s something that every engineer should know well.