Command | Description | SYNTAX | Example |
---|---|---|---|
SELECT | Selects data from a table or multiple tables. | SELECT [ TOP term ] [ DISTINCT | ALL ] selectExpression [,...] FROM tableExpression [,...] [ WHERE expression ] [ GROUP BY expression [,...] ] [ HAVING expression ] [ { UNION [ ALL ] | MINUS | EXCEPT | INTERSECT } select ] [ ORDER BY order [,...] ] [ LIMIT expression [ OFFSET expression ] [ SAMPLE_SIZE rowCountInt ] ] [ FOR UPDATE ] | |
INSERT | Inserts a new row / new rows into a table. | INSERT INTO tableName [ ( columnName [,...] ) ] { VALUES { ( { DEFAULT | expression } [,...] ) } [,...] | [ DIRECT ] [ SORTED ] select } | |
UPDATE | Updates data in a table. | UPDATE tableName [ [ AS ] newTableAlias ] SET { columnName= { DEFAULT | expression } } [,...] [ WHERE expression ] | |
DELETE | Deletes rows form a table. | DELETE FROM tableName [ WHERE expression ] | |
BACKUP | Backs up the database files to a . | BACKUP TO fileNameString | |
CALL | Calculates a simple expression. | CALL expression | |
EXPLAIN | Shows the execution plan for a statement. | EXPLAIN { [ PLAN FOR ] | ANALYZE } { select | insert | update | delete | merge } | |
MERGE | Updates existing rows, and insert rows that don't exist. | MERGE INTO tableName [ ( columnName [,...] ) ] [ KEY ( columnName [,...] ) ] { VALUES { ( { DEFAULT | expression } [,...] ) } [,...] | select } | |
RUNSCRIPT | Runs a SQL script from a file. | RUNSCRIPT FROM fileNameString [ scriptCompression ] [ CIPHER cipher PASSWORD string ] [ CHARSET charsetString ] | |
SCRIPT | Creates a SQL script from the database. | SCRIPT [ SIMPLE ] [ NODATA ] [ NOPASSWORDS ] [ NOSETTINGS ] [ DROP ] [ BLOCKSIZE blockSizeInt ] [ TO fileNameString [ scriptCompression ] [ CIPHER cipher PASSWORD string ] ] [ CHARSET charsetString ] | |
SHOW | Lists the schemas, tables, or the columns of a table. | SHOW { SCHEMAS | TABLES [ FROM schemaName ] | COLUMNS FROM tableName [ FROM schemaName ] } |
SQL basics- complete reference guide - part1 - DML
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment
Your Comment and Question will help to make this blog better...