SQL 关键字

常见 SQL 关键字和语法的备忘单。

SELECT
Retrieves data from one or more tables
INSERT
Adds new rows to a table
UPDATE
Modifies existing data in a table
DELETE
Removes rows from a table
CREATE TABLE
Creates a new table
ALTER TABLE
Modifies an existing table structure
DROP TABLE
Deletes a table permanently
WHERE
Filters records based on conditions
JOIN
Combines rows from multiple tables
GROUP BY
Groups rows sharing a property
ORDER BY
Sorts the result set
HAVING
Filters groups after GROUP BY
DISTINCT
Returns unique values only
LIMIT
Restricts the number of returned rows
INDEX
Creates a search index on columns
TRANSACTION
Groups operations into atomic units