Glossary
Databases

SQL

SQL (Structured Query Language) is the standard language used to communicate with relational databases. It lets you create, read, update, and delete data stored in tables.

Basic operations

  • SELECT — Retrieve data from one or more tables.
  • INSERT — Add new rows to a table.
  • UPDATE — Modify existing rows.
  • DELETE — Remove rows.

Example

SELECT name, revenue
FROM customers
WHERE revenue > 10000
ORDER BY revenue DESC
LIMIT 10;

This query returns the top 10 customers by revenue who have spent more than $10,000.

SQL and Sequel

Sequel lets you write queries in plain English and generates the SQL for you. You can always inspect the generated SQL to learn or verify what's running against your database.

Related terms