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