De SQL-kommandoer, der anvendes i det daglige, udgør kun en bregrænset andel af det samlede antal kommandoer. Nedenfor er vist en oversigt over alle SQL-kommandoer.
Kommando | Kort betegnelse | | Links |
Data Manipulation  Håndtering af data. |
SELECT | Udtræk data fra tabel |  |
 |
INSERT | Indsætter data i tabel | . |
 |
UPDATE | Erstat data i tabel | . |
 |
DELETE | Sletter data i tabel | . |
 |
CALL | Iværksætter en stored procedure | . |
 |
DO | Udførsel af aktiviteter der ikke returnerer resultater. | . |
 |
LOAD DATA INFILE | Indlæser data rækkevis fra tekstfil til databasetabel | . |
 |
LOAD XML | Indlæser data fra XML-fil til databasetabel. | . |
 |
HANDLER | Anvendes ikke i MySQL | . |
 |
Data Manipulation / Subquery  |
The Subquery as Scalar Operand |
| . |
 |
Comparisons Using Subqueries |
| . |
 |
ANY, IN, or SOME |
| . |
 |
ALL |
| . |
 |
Row Subqueries |
| . |
 |
EXISTS or NOT EXISTS |
| . |
 |
Correlated |
| . |
 |
Subqueries in the FROM Clause |
| . |
 |
Subquery Errors |
| . |
 |
Optimizing Subqueries |
| . |
 |
Rewriting Subqueries as Joins |
| . |
 |
|
UPDATE | UPDATE [LOW_PRIORITY] [IGNORE] table_reference | . |
 |
SQL Syntax for Prepared Statements  |
PREPARE | PREPARE stmt_name FROM preparable_stmt | . |
 |
EXECUTE | EXECUTE stmt_name | . |
 |
DEALLOCATE PREPARE | {DEALLOCATE | DROP} PREPARE stmt_name | . |
 |
Transactional and Locking  |
START TRANSACTION, COMMIT, and ROLLBACK | START TRANSACTION [transaction_characteristic [, transaction_characteristic] ...] | . |
 |
Statements That Cannot Be Rolled Back |
| . |
 |
Statements That Cause an Implicit Commit |
| . |
 |
SAVEPOINT, ROLLBACK TO SAVEPOINT, and RELEASE SAVEPOINT | SAVEPOINT identifier ROLLBACK [WORK] TO [SAVEPOINT] identifier RELEASE SAVEPOINT identifier | . |
 |
LOCK TABLES and UNLOCK TABLES | LOCK TABLES | . |
 |
SET TRANSACTION | SET [GLOBAL | SESSION] TRANSACTION transaction_characteristic [, transaction_characteristic] ... | . |
 |
XA Transactions |
| . |
 |
Data definition  |
Database |
CREATE DATABASE | Opret af database | . |
 |
ALTER DATABASE | Ret database | . |
 |
DROP DATABASE | Slet database | . |
 |
Event
|
CREATE EVENT | Opret event | . |
 |
ALTER EVENT | Ret event | . |
 |
DROP EVENT | Slet event> | . |
 |
Function  |
CREATE FUNCTION | Opret funktion | . |
 |
ALTER FUNCTION | Ret funktion | . |
 |
DROP FUNCTION | Slet funktion | . |
 |
Procedure |
CREATE PROCEDURE | Opret procedure | . |
 |
ALTER PROCEDURE | Ret procedure | . |
 |
DROP PROCEDURE | Slet procedure | . |
 |
Server |
CREATE SERVER | Opret databaseserver | . |
 |
ALTER SERVER | Ret databaseserver | . |
 |
DROP SERVER | Slet databaseserver | . |
 |
Table |
CREATE TABLE | Opret tabel | . |
 |
ALTER TABLE | Ret tabel | . |
 |
RENAME TABLE | Omddøb tabel | . |
 |
TRUNCATE TABLE | Afkort tabel | . |
 |
DROP TABLE | Slet tabel | . |
 |
View  |
CREATE VIEW | Opret view | . |
 |
ALTER VIEW | Ret view | . |
 |
DROP VIEW | Slet view | . |
 |
Index  |
CREATE INDEX | Opret index | . |
 |
DROP INDEX | Slet index | . |
 |
Trigger  |
CREATE TRIGGER | Opret trigger | . |
 |
DROP TRIGGER | Slet trigger | . |
 |
Replication  |
Replication / SQL Statements for Controlling Master Servers  |
PURGE BINARY LOGS | PURGE { BINARY | MASTER } LOGS | . |
 |
RESET MASTER | RESET MASTER | . |
 |
SET sql_log_bin | SET sql_log_bin = {0|1} | . |
 |
Replication / SQL Statements for Controlling Slave Servers  |
CHANGE MASTER TO | CHANGE MASTER TO option [, option] ... | . |
 |
MASTER_POS_WAIT() | SELECT MASTER_POS_WAIT('master_log_file', master_log_pos [, timeout]) | . |
 |
RESET SLAVE | RESET SLAVE [ALL] | . |
 |
SET GLOBAL sql_slave_skip_counter | SET GLOBAL sql_slave_skip_counter = N | . |
 |
START SLAVE | START SLAVE [thread_types] [until_option] [connection_options] | . |
 |
STOP SLAVE | STOP SLAVE [thread_types] | . |
 |
Compound-Statement  |
BEGIN ... END | [begin_label:] BEGIN [statement_list] END [end_label] | . |
 |
Statement Label |
| . |
 |
DECLARE |
| . |
 |
Variables in Stored Programs |
| . |
 |
Compound Statements / Flow Control  |
CASE | CASE case_value WHEN when_value THEN statement_list [WHEN when_value THEN statement_list] ... [ELSE statement_list] END CASE | . |
 |
IF | IF search_condition THEN statement_list [ELSEIF search_condition THEN statement_list] ... [ELSE statement_list] END IF | . |
 |
ITERATE | ITERATE label | . |
 |
LEAVE | LEAVE label | . |
 |
LOOP | [begin_label:] LOOP statement_list END LOOP [end_label] | . |
 |
REPEAT | [begin_label:] REPEAT statement_list UNTIL search_condition END REPEAT [end_label] | . |
 |
RETURN | RETURN expr | . |
 |
WHILE | [begin_label:] WHILE search_condition DO statement_list END WHILE [end_label] | . |
 |
Compound-Statement / Cursors  |
CLOSE | CLOSE cursor_name | . |
 |
DECLARE | DECLARE cursor_name CURSOR FOR select_statement | . |
 |
FETCH | FETCH [[NEXT] FROM] cursor_name INTO var_name [, var_name] ... | . |
 |
OPEN | OPEN cursor_name | . |
 |
Compound-Statement / Condition Handling  |
DECLARE ... CONDITION | DECLARE condition_name CONDITION FOR condition_value | . |
 |
DECLARE ... HANDLER | DECLARE handler_action HANDLER FOR condition_value [, condition_value] ... statement | . |
 |
GET DIAGNOSTICS | GET [CURRENT | STACKED] DIAGNOSTICS | . |
 |
RESIGNAL | RESIGNAL [condition_value] [SET signal_information_item [, signal_information_item] ...] | . |
 |
SIGNAL | SIGNAL condition_value [SET signal_information_item [, signal_information_item] ...] | . |
 |
Scope Rules for Handlers |
| . |
 |
Diagnostics |
| . |
 |
Database Administration  |
Database Administration / Account Management  |
ALTER USER | ALTER USER user_specification [, user_specification] ...
| . |
 |
CREATE USER | CREATE USER user_specification [, user_specification] .. | . |
 |
DROP USER | DROP USER user [, user] ... | . |
 |
GRANT | GRANT | . |
 |
RENAME USER | RENAME USER old_user TO new_user [, old_user TO new_user] ... | . |
 |
REVOKE | REVOKE ... | . |
 |
SET PASSWORD | SET PASSWORD [FOR user] = { PASSWORD('cleartext password') | OLD_PASSWORD('cleartext password') | 'encrypted password' } | . |
 |
Database Administration / Table Maintenance  |
ANALYZE TABLE | ANALYZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [, tbl_name] ... | . |
 |
CHECK TABLE | CHECK TABLE tbl_name [, tbl_name] ... [option] ... option = {FOR UPGRADE | QUICK | FAST | MEDIUM | EXTENDED | CHANGED} | . |
 |
CHECKSUM TABLE | CHECKSUM TABLE tbl_name [, tbl_name] ... [ QUICK | EXTENDED ] | . |
 |
OPTIMIZE TABLE | OPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE>br />tbl_name [, tbl_name] ... | . |
 |
REPAIR TABLE | REPAIR [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [, tbl_name] ... [QUICK] [EXTENDED] [USE_FRM] | . |
 |
Database Administration / Plugin and User-Defined Function  |
CREATE FUNCTION | CREATE [AGGREGATE] FUNCTION function_name RETURNS {STRING|INTEGER|REAL|DECIMAL} SONAME shared_library_name | . |
 |
DROP FUNCTION | DROP FUNCTION function_name | . |
 |
INSTALL PLUGIN | INSTALL PLUGIN plugin_name SONAME 'shared_library_name' | . |
 |
UNINSTALL PLUGIN | UNINSTALL PLUGIN plugin_name | . |
 |
|
SET | SET variable_assignment [, variable_assignment] ... | . |
 |
SHOW |
| . |
 |
Database Administration / Other Administrative Statements  |
BINLOG | BINLOG 'str' | . |
 |
CACHE INDEX | CACHE INDEX | . |
 |
FLUSH | FLUSH [NO_WRITE_TO_BINLOG | LOCAL] flush_option [, flush_option] ... | . |
 |
KILL | KILL [CONNECTION | QUERY] thread_id | . |
 |
LOAD INDEX INTO CACHE | LOAD INDEX INTO CACHE tbl_index_list [, tbl_index_list] ... | . |
 |
RESET | RESET reset_option [, reset_option] ... | . |
 |
Utility Statements  |
DESCRIBE |
| . |
 |
EXPLAIN | {EXPLAIN | DESCRIBE | DESC} tbl_name [col_name | wild] | . |
 |
HELP | HELP 'search_string' | . |
 |
USE | USE db_name | . |
 |