SQL Keywords
Introduction
SQL keywords are predefined words that give a statement its action and grammatical structure. Words such as SELECT, FROM, WHERE, INSERT, UPDATE, CREATE, JOIN, and ORDER BY tell the database how the surrounding names, values, and expressions should be interpreted.
Keywords form SQL's command vocabulary, but they are not learned effectively as one alphabetical list. They work in families. Query keywords retrieve and shape rows, data-manipulation keywords change records, definition keywords create database objects, transaction keywords control atomic work, and permission keywords control access. Understanding those relationships is more useful than memorizing hundreds of isolated words.
SQL statement
-> keywords define action and structure
-> identifiers name database objects
-> expressions and values define the work
Keywords, Identifiers, and Values
Consider a simple query:
SELECT employee_name
FROM employees
WHERE status = 'ACTIVE';
SELECT, FROM, and WHERE are keywords. employee_name, employees, and status are identifiers chosen by the schema designer. 'ACTIVE' is a string literal value. The database parser understands each token according to its position and the grammar established by the keywords.
In application code, external values should normally be represented by parameters rather than literals assembled into SQL text. Keywords and identifiers remain controlled statement structure; runtime data is bound through the database API.
Reserved and Non-Reserved Keywords
A reserved keyword cannot normally be used as an unquoted table, column, or other identifier because the parser must recognize it as part of SQL grammar. A non-reserved keyword has a predefined meaning only in specific contexts and may be permitted as an identifier elsewhere.
The distinction is product- and version-dependent. The PostgreSQL keyword appendix classifies words according to PostgreSQL and multiple SQL standards. MySQL, SQL Server, Oracle, and SQLite maintain their own lists and restrictions. A word that works as an unquoted column today can become reserved after an upgrade.
Avoid keyword-like object names such as order, group, select, user, and table. Quoting may make such names legal, but it introduces dialect-specific delimiters, case behavior, and permanent quoting requirements. Descriptive names such as customer_order or user_account are clearer and more portable.
Keyword Categories at a Glance
| Category | Common keywords | Purpose |
|---|---|---|
| Query | SELECT, FROM, WHERE | Retrieve and filter rows |
| Grouping and sorting | GROUP BY, HAVING, ORDER BY | Summarize and arrange results |
| Joins | JOIN, ON, LEFT, INNER | Combine related sources |
| DML | INSERT, UPDATE, DELETE | Change table data |
| DDL | CREATE, ALTER, DROP | Define database objects |
| Constraints | PRIMARY KEY, FOREIGN KEY, CHECK | Protect data integrity |
| Transactions | BEGIN, COMMIT, ROLLBACK | Control units of work |
| Permissions | GRANT, REVOKE | Control access |
| Advanced queries | WITH, EXISTS, CASE, OVER | Compose complex results |
SELECT, FROM, and WHERE
SELECT defines the expressions or columns returned by a query. FROM identifies row sources, including tables, views, subqueries, common table expressions, and product-specific functions. WHERE keeps only individual source rows whose condition evaluates to true.
SELECT employee_id, employee_name, salary
FROM employees
WHERE salary > 50000;
These three keywords establish the basic query pattern: choose the output, identify its source, and filter the source rows. The written order is fixed even though the logical processing model begins with FROM and applies WHERE before producing the select list.
DISTINCT and AS
DISTINCT removes duplicate output rows after selected expressions are formed. It applies to the entire selected combination, not only the first column. AS introduces a column or table alias and makes the result easier to read.
SELECT DISTINCT
department_id AS department
FROM employees;
Do not use DISTINCT to hide a faulty join. Determine whether duplicate rows represent legitimate relationships, duplicate data, or an incorrect query. Aliases should be concise but meaningful; single-letter aliases are useful in short joins but can become cryptic in long queries.
ORDER BY, ASC, and DESC
ORDER BY sorts the final result. ASC requests ascending order and is usually the default. DESC requests descending order. Later expressions break ties from earlier expressions.
SELECT employee_id, employee_name, salary
FROM employees
ORDER BY salary DESC, employee_id ASC;
Without ORDER BY, a result has no guaranteed sequence. A stable top-N query or paginated result should include a unique tie-breaker so equal values do not move unpredictably between executions.
GROUP BY and HAVING
GROUP BY gathers rows sharing the same grouping values. Aggregate functions then calculate one result per group. HAVING filters those group results.
SELECT
department_id,
COUNT(*) AS employee_count
FROM employees
WHERE employment_status = 'ACTIVE'
GROUP BY department_id
HAVING COUNT(*) >= 5;
WHERE filters employees before groups exist, while HAVING filters departments after grouping. Confusing those phases is a common source of aggregate-query errors.
INSERT, INTO, and VALUES
INSERT requests creation of new rows, INTO identifies the target, and VALUES supplies one or more rows of data.
INSERT INTO employees (
employee_id,
employee_name,
department_id
)
VALUES (
:employee_id,
:employee_name,
:department_id
);
Always listing target columns makes the mapping explicit and avoids dependence on physical table-column order. Many products also support INSERT ... SELECT, while returning generated values and handling duplicates use vendor-specific extensions.
UPDATE and SET
UPDATE identifies rows to modify, while SET defines new column expressions. A WHERE condition usually limits the target.
UPDATE employees
SET salary = salary * 1.05,
updated_at = CURRENT_TIMESTAMP
WHERE department_id = :department_id;
An update without WHERE targets every row. That may be intentional, but it should never be accidental. Preview the predicate with SELECT, verify the environment, use an appropriate transaction, and inspect the affected-row count.
DELETE, DROP, and TRUNCATE Are Different
DELETE removes rows and can use WHERE. DROP removes an object such as a table, including its definition. TRUNCATE requests removal of all table rows while keeping the table, but its transaction, logging, trigger, identity, foreign-key, and permission behavior varies across database products.
DELETE FROM audit_events
WHERE created_at < :retention_cutoff;
DROP TABLE obsolete_stage_data;
TRUNCATE TABLE temporary_import_rows;
These keywords are not interchangeable. Treat DROP and TRUNCATE as controlled schema or maintenance operations and verify recovery requirements first.
CREATE, TABLE, DATABASE, and SCHEMA
CREATE builds a database object. The next keyword identifies the object type, such as TABLE, VIEW, INDEX, SCHEMA, DATABASE, FUNCTION, or PROCEDURE. Support and syntax differ among products.
CREATE TABLE departments (
department_id INTEGER PRIMARY KEY,
department_name VARCHAR(100) NOT NULL
);
A schema is a namespace for objects. A database is a higher-level container whose exact meaning varies by DBMS. For example, cross-database references and transaction boundaries do not behave identically in PostgreSQL, MySQL, SQL Server, Oracle, and SQLite.
ALTER, ADD, and DROP
ALTER changes an existing object. Within ALTER TABLE, ADD can add a column or constraint, while DROP can remove one.
ALTER TABLE employees
ADD COLUMN preferred_name VARCHAR(100);
ALTER TABLE employees
ADD CONSTRAINT ck_employees_salary
CHECK (salary >= 0);
DDL can lock or rewrite large tables and may interact with transactions differently by product. Deploy changes through tested, versioned migrations rather than unreviewed production sessions.
JOIN and ON
JOIN combines row sources. ON supplies the matching condition for most explicit joins. INNER JOIN keeps matching combinations, while LEFT JOIN preserves every left-side row and uses nulls where no right-side row matches.
SELECT
c.customer_name,
o.order_id,
o.order_total
FROM customers AS c
LEFT JOIN orders AS o
ON o.customer_id = c.customer_id;
RIGHT JOIN preserves the right source and FULL JOIN preserves both sides, although not every DBMS supports every join form. CROSS JOIN deliberately produces all row combinations. A missing relationship condition can produce a large accidental Cartesian result.
AND, OR, and NOT
AND requires both conditions to be true, OR requires at least one, and NOT negates a condition. Operator precedence usually evaluates NOT before AND, and AND before OR.
SELECT product_id, product_name
FROM products
WHERE is_active = TRUE
AND (stock_quantity > 0 OR backorder_allowed = TRUE);
Parentheses make intended logic explicit. SQL conditions can also evaluate to unknown because of nulls, so logical reasoning must account for three-valued logic rather than ordinary two-valued Boolean rules alone.
IN, NOT IN, BETWEEN, and LIKE
IN compares a value with a list or subquery result. BETWEEN represents an inclusive range. LIKE performs pattern matching, commonly with % for any sequence and _ for one character.
SELECT customer_id, customer_name
FROM customers
WHERE status IN ('ACTIVE', 'PENDING')
AND created_at BETWEEN :start_date AND :end_date
AND customer_name LIKE :name_pattern;
NOT IN requires care when its set can contain null because the comparison may become unknown. NOT EXISTS is often clearer for anti-match logic. Date ranges also deserve care: inclusive BETWEEN can be inconvenient for timestamps, where a half-open interval is often safer.
IS NULL and IS NOT NULL
NULL represents missing or unknown information. It is not equal to itself under ordinary comparison rules, so phone = NULL is not the correct test.
SELECT customer_id
FROM customers
WHERE phone IS NULL
AND deleted_at IS NOT NULL;
IS NULL and IS NOT NULL are dedicated null predicates. Products may provide additional null-safe comparison operators, but those are not universally portable.
EXISTS and NOT EXISTS
EXISTS is true when its subquery returns at least one row. It expresses existence directly and is commonly used for related-record checks. NOT EXISTS expresses the absence of a matching row.
SELECT c.customer_id, c.customer_name
FROM customers AS c
WHERE EXISTS (
SELECT 1
FROM orders AS o
WHERE o.customer_id = c.customer_id
AND o.order_status = 'OPEN'
);
The selected expression inside an EXISTS subquery is not the point; row existence is. The optimizer may implement existence logic with a semi-join or another equivalent plan.
ALL, ANY, and SOME
ANY and its synonym SOME compare a value with at least one value from a set. ALL requires the comparison to hold for every value.
SELECT employee_id, salary
FROM employees
WHERE salary > ALL (
SELECT salary
FROM employees
WHERE department_id = :department_id
);
Empty sets and null values affect quantified comparisons, so test boundary cases. Many everyday requirements are more clearly expressed with an aggregate or EXISTS, but these keywords remain useful when the quantified meaning is exact.
UNION, INTERSECT, and EXCEPT
Set-operation keywords combine compatible query results. UNION removes duplicate rows, while UNION ALL keeps them and avoids duplicate-elimination work. INTERSECT returns rows present in both inputs. EXCEPT, called MINUS in Oracle, returns rows from the first input not present in the second.
SELECT customer_id FROM online_customers
UNION
SELECT customer_id FROM store_customers;
Inputs must have compatible column counts and types. An ORDER BY for the combined result belongs at the end unless a dialect-specific nested query requires otherwise.
CASE, WHEN, THEN, ELSE, and END
These keywords form a conditional expression. WHEN defines conditions, THEN defines corresponding values, ELSE provides a fallback, and END closes the expression.
SELECT
employee_name,
CASE
WHEN salary >= 100000 THEN 'HIGH'
WHEN salary >= 60000 THEN 'MEDIUM'
ELSE 'STANDARD'
END AS salary_band
FROM employees;
CASE returns a value, so it can appear in a select list, sort expression, aggregate argument, update assignment, or other compatible expression context. Returned branches should have compatible types.
WITH and RECURSIVE
WITH introduces common table expressions used by the following statement. It gives intermediate query logic a name and can make complex transformations easier to read.
WITH active_employees AS (
SELECT employee_id, department_id, salary
FROM employees
WHERE employment_status = 'ACTIVE'
)
SELECT department_id, AVG(salary) AS average_salary
FROM active_employees
GROUP BY department_id;
RECURSIVE enables a CTE to reference itself through an anchor query and a recursive query. It can traverse hierarchies and graphs, but termination and cycle behavior must be designed carefully. Syntax details vary.
OVER, PARTITION BY, ROWS, and RANGE
OVER turns a supported function into a window calculation. PARTITION BY divides result rows into independent windows without collapsing them like GROUP BY. An ORDER BY inside the window defines sequence, and ROWS or RANGE defines the frame considered for each row.
SELECT
employee_id,
department_id,
salary,
AVG(salary) OVER (
PARTITION BY department_id
) AS department_average
FROM employees;
ROWS counts physical row positions within the window order. RANGE groups peers according to ordering values and can behave differently around ties. Always specify the intended frame for running or moving calculations.
Constraint Keywords
PRIMARY KEY uniquely identifies each row and rejects null key values. FOREIGN KEY and REFERENCES enforce relationships. UNIQUE prevents duplicate key combinations, NOT NULL requires a value, CHECK enforces a condition, and DEFAULT supplies a value when an insert omits the column.
CREATE TABLE orders (
order_id INTEGER PRIMARY KEY,
customer_id INTEGER NOT NULL,
order_status VARCHAR(20) DEFAULT 'NEW',
order_total DECIMAL(12, 2) CHECK (order_total >= 0),
CONSTRAINT fk_orders_customer
FOREIGN KEY (customer_id)
REFERENCES customers (customer_id)
);
CONSTRAINT assigns a stable name, improving migration scripts and error diagnosis. Constraints belong in the database because every writer should obey the same integrity rules.
INDEX, VIEW, PROCEDURE, FUNCTION, and TRIGGER
These object-type keywords commonly follow CREATE, ALTER, or DROP. An INDEX provides an access structure, a VIEW stores a query definition, a PROCEDURE or FUNCTION defines database-side program logic, and a TRIGGER responds to specified database events.
BEFORE and AFTER often specify trigger timing, while product-specific options define statement-level or row-level behavior. These words are not implemented identically across products. Review transaction, privilege, recursion, and deployment implications before relying on database-side automation.
BEGIN, COMMIT, ROLLBACK, and SAVEPOINT
Transaction keywords control related work. BEGIN or a product-specific equivalent starts an explicit transaction. COMMIT makes successful changes durable, while ROLLBACK abandons uncommitted changes. SAVEPOINT creates a marker for partial rollback.
BEGIN;
UPDATE accounts
SET balance = balance - :amount
WHERE account_id = :source_id;
SAVEPOINT debit_complete;
UPDATE accounts
SET balance = balance + :amount
WHERE account_id = :target_id;
COMMIT;
Transaction-start syntax, auto-commit, DDL behavior, isolation, and savepoint support vary. A transaction must also validate affected rows and business rules; keywords alone do not make a transfer correct.
GRANT and REVOKE
GRANT provides privileges or role membership, and REVOKE removes them. Exact privilege names and inheritance rules differ by product.
GRANT SELECT ON customer_summary TO reporting_role;
REVOKE DELETE ON orders FROM reporting_role;
Apply least privilege. Application, reporting, migration, and administrative identities should not share one powerful account. Test both allowed and forbidden operations so permission drift is detected.
NULL, TRUE, FALSE, and Current Values
NULL represents missing or unknown information, not an empty string or zero. TRUE and FALSE represent Boolean values where the database supports an SQL Boolean type. CURRENT_DATE and CURRENT_TIMESTAMP return values associated with the current database session or statement according to product semantics.
INSERT INTO audit_events (
event_type,
occurred_at,
processed
)
VALUES (
:event_type,
CURRENT_TIMESTAMP,
FALSE
);
Do not assume current-time functions have identical transaction stability, time-zone type, or precision across databases. Store and compare times under a documented policy.
FETCH, OFFSET, LIMIT, and TOP
These keywords limit or page results, but their syntax is highly dialect-dependent. PostgreSQL, MySQL, and SQLite commonly support LIMIT. SQL Server supports TOP and OFFSET ... FETCH. Oracle and several other systems support standard-style FETCH.
SELECT order_id, created_at
FROM orders
ORDER BY created_at DESC, order_id DESC
OFFSET 20 ROWS
FETCH NEXT 20 ROWS ONLY;
Pagination requires deterministic ORDER BY. Large offsets can become inefficient or unstable under concurrent changes, so keyset pagination may be preferable for deep or continuously changing result sets.
Standard and Vendor-Specific Keywords
Core words such as SELECT, FROM, WHERE, JOIN, GROUP BY, INSERT, UPDATE, and DELETE are broadly recognizable. Products extend SQL with their own grammar and may reserve words for implemented or future features.
| Database family | Common product-specific or distinctive constructs |
|---|---|
| MySQL | AUTO_INCREMENT, SHOW, DESCRIBE, LIMIT |
| PostgreSQL | RETURNING, ILIKE, SERIAL, DO |
| SQL Server | TOP, MERGE, IDENTITY, OUTPUT |
| Oracle | MINUS, CONNECT BY, ROWNUM, DUAL |
| SQLite | PRAGMA, conflict clauses, and SQLite-specific type behavior |
This table illustrates differences, not a complete or exclusive list. Some constructs exist in more than one product or have changed over time. Always check the documentation for the actual version rather than assuming a keyword list is universal.
Keyword Case and Formatting
SQL keywords are generally case-insensitive, so select, SELECT, and Select usually identify the same keyword. Uppercase keywords remain a useful convention because they visually separate language structure from lowercase identifiers and values.
SELECT
o.order_id,
c.customer_name
FROM orders AS o
JOIN customers AS c
ON c.customer_id = o.customer_id
WHERE o.order_status = 'OPEN'
ORDER BY o.created_at DESC;
Formatting does not change the grammar outside quoted values and identifiers, but consistent line breaks and indentation make incorrect keyword order, missing conditions, and faulty joins easier to detect during review.
Quoting a Reserved Identifier
Delimited identifiers can permit a reserved word or otherwise unusual name. Standard SQL and PostgreSQL use double quotes, MySQL commonly uses backticks, and SQL Server supports brackets as well as configured quoted identifiers.
SELECT "order"
FROM "group";
This example is intentionally awkward. Quoting solves a parser conflict but creates a long-term portability and maintenance burden. Renaming objects to ordinary descriptive identifiers is usually the better design.
SQL Keywords and Client Commands
Not every word accepted by a database tool is an SQL keyword. PostgreSQL psql commands such as \dt, SQLite shell commands such as .tables, and the SQL Server tooling batch separator GO are interpreted by clients. They may never be sent to the database as SQL.
Distinguishing language from client behavior matters when moving scripts into an application, migration framework, CI job, or different GUI. A script that works in one console can fail elsewhere because its client directives are not portable.
How Keywords Work Together
A useful query flow is:
SELECT output
FROM source
JOIN related_source ON relationship
WHERE row_condition
GROUP BY grouping_columns
HAVING group_condition
ORDER BY sorting_columns;
A data-change flow uses INSERT INTO ... VALUES, UPDATE ... SET ... WHERE, or DELETE FROM ... WHERE. A schema flow uses CREATE, ALTER, and DROP. A transaction flow surrounds related work with BEGIN, then COMMIT or ROLLBACK. Learning these patterns builds recall through purpose.
Keyword Order and Logical Availability
Keywords cannot be arranged freely. The grammar defines a written clause order, while the logical processing model explains when names and intermediate results become available. A simplified retrieval sequence is FROM and joins, followed by WHERE, GROUP BY, HAVING, SELECT, duplicate elimination, ORDER BY, and row limiting.
SELECT
department_id,
AVG(salary) AS average_salary
FROM employees
WHERE employment_status = 'ACTIVE'
GROUP BY department_id
HAVING AVG(salary) > 60000
ORDER BY average_salary DESC;
The alias average_salary is introduced by SELECT. It is normally available to ORDER BY, which occurs later in logical processing, but not to WHERE, which evaluates source rows earlier. Product extensions can change particular alias rules, so portable statements should follow the standard mental model.
This order also explains the difference between WHERE and HAVING. The former cannot filter a group aggregate that does not yet exist. The latter works after grouping and can therefore test COUNT, SUM, or AVG results. Learning keyword order is consequently part of understanding data flow, not merely passing syntax validation.
How the Parser Recognizes Keywords
Keywords and ordinary identifiers can have the same lexical appearance. The parser uses grammar and context to decide what a token means. In SELECT name FROM employees, the positions of SELECT and FROM identify language structure, while name and employees fill identifier positions.
Reserved status protects places where interpretation would otherwise be ambiguous. A database may still permit a reserved word as a delimited identifier because quotes tell the parser to treat the token as a name. Non-reserved keywords require more contextual analysis: the same token can act as language vocabulary in one location and an identifier in another.
After parsing, semantic analysis verifies that identifiers resolve, expressions have compatible types, the user has permission, and functions or operators exist. Therefore an error near a keyword does not always mean the keyword itself is wrong. A missing comma, unclosed parenthesis, badly quoted string, or earlier clause can shift the parser and make a later keyword appear to be the failure point.
When debugging syntax, simplify the statement from the outside inward. Confirm the opening command, match parentheses, check commas and quotes, verify the documented clause order, and then add optional sections one at a time. This approach is more reliable than changing keywords randomly in response to an error position.
Keywords, Functions, Types, and Operators
Not every familiar SQL word has the same grammatical category. SELECT is clearly a keyword, while COUNT is commonly used as an aggregate function name. INTEGER can identify a data type, and symbols such as + or >= are operators. Database documentation may still include some of these words in keyword lists because the parser gives them special treatment.
SELECT
COUNT(*) AS employee_count,
CAST(AVG(salary) AS DECIMAL(12, 2)) AS average_salary
FROM employees;
Here SELECT, AS, and FROM establish structure. COUNT, CAST, and AVG perform computations, while DECIMAL names a target type. For learning, these distinctions explain syntax. For naming database objects, the practical rule remains broader: avoid words that the target product treats specially, even when they are not strictly reserved.
Version Changes and Forward Compatibility
Keyword classifications can change as a database introduces features. An identifier accepted without quotes in one release may conflict with a newly reserved word in a later release. This is one reason database upgrade testing must include schema migration, application queries, stored programs, generated SQL, and administrative scripts.
The MySQL keyword documentation, for example, marks reserved words and discusses version changes. Microsoft likewise publishes a Transact-SQL reserved-keyword list. Consult documentation for both the current and target versions during an upgrade rather than depending on a generic SQL list.
Schema naming conventions provide inexpensive protection. Use domain-focused names such as order_status, account_role, or group_name instead of bare language terms. Static analysis and migration validation can also scan object names and statements against the target version before deployment.
Common Keyword Mistakes
- Using a reserved keyword as an unquoted table or column name.
- Writing clauses in an invalid order, such as
ORDER BYbeforeWHERE. - Using
HAVINGfor ordinary row filtering or aggregates inWHERE. - Confusing
DELETE,TRUNCATE, andDROP. - Testing null with
=instead ofIS NULL. - Using
NOT INwithout considering nulls in the set. - Omitting
WHEREfrom an update or deletion unintentionally. - Treating a client command as portable SQL.
- Assuming one DBMS keyword list applies to every product and version.
- Using keyword capitalization as a substitute for correct grammar.
Learning SQL Keywords Efficiently
Begin with SELECT, FROM, and WHERE. Add ORDER BY, DISTINCT, and aliases. Then learn joins with JOIN and ON, aggregation with GROUP BY and HAVING, and data changes with INSERT, UPDATE, and DELETE.
Next study schema and integrity keywords such as CREATE, ALTER, PRIMARY KEY, FOREIGN KEY, UNIQUE, and CHECK. Add transaction and permission keywords before progressing to CTEs, set operations, recursion, and windows. Write a small valid statement for every family and explain what each keyword contributes.
Quick Keyword Reference
| Keyword | Memory cue | Typical pattern |
|---|---|---|
SELECT | Read or calculate | SELECT columns |
FROM | Identify source | FROM table |
WHERE | Filter rows | WHERE condition |
JOIN | Combine sources | JOIN table ON condition |
GROUP BY | Group rows | GROUP BY columns |
HAVING | Filter groups | HAVING aggregate_condition |
ORDER BY | Sort output | ORDER BY expression |
INSERT | Add rows | INSERT INTO ... VALUES ... |
UPDATE | Change rows | UPDATE ... SET ... WHERE ... |
DELETE | Remove rows | DELETE FROM ... WHERE ... |
CREATE | Build object | CREATE TABLE ... |
ALTER | Change object structure | ALTER TABLE ... |
DROP | Remove object | DROP TABLE ... |
Interview Questions and Answers
What is an SQL keyword? It is a predefined word recognized by SQL grammar that defines an operation, clause, option, object type, condition, or structural relationship.
What is the difference between a keyword and an identifier? A keyword belongs to the language, while an identifier is a name chosen for a database object, alias, or other named element.
Are all SQL keywords reserved? No. Products distinguish reserved and non-reserved words, and their classifications differ by product and version.
Are SQL keywords case-sensitive? They are generally case-insensitive, but identifier and string comparison behavior is a separate question controlled by quoting, collation, and DBMS rules.
What is the difference between WHERE and HAVING? WHERE filters individual rows before grouping; HAVING filters grouped results after aggregation.
What is the difference between DELETE and DROP? DELETE removes table rows, optionally using a condition. DROP removes the database object definition itself.
Why should keyword names be avoided for columns? They can require permanent quoting, create ambiguity, break portability, and become invalid after a database upgrade.
Key Takeaway
SQL keywords are the command and structure words that tell a database what to do. Learn them in working groups rather than as a disconnected dictionary: query, filter, join, group, change data, define objects, protect integrity, control transactions, and manage access.
SELECT - read
INSERT - add
UPDATE - change
DELETE - remove rows
CREATE - build an object
ALTER - change an object
DROP - remove an object
WHERE - filter rows
JOIN - combine sources
GROUP BY - form groups
ORDER BY - sort results
The exact reserved-word list is not universal. Use descriptive identifiers, consult the target database and version, and let keywords remain visible as the grammar of each statement. Once their roles and combinations are clear, SQL becomes easier to read, write, review, and debug.