SQL Statement |
Syntax |
AND/OR |
SELECT column_name(s) |
ALTER TABLE |
ALTER TABLE table_name or ALTER TABLE table_name |
AS (alias) |
SELECT column_name AS column_alias or SELECT column_name |
BETWEEN |
SELECT column_name(s) |
CREATE DATABASE |
CREATE DATABASE database_name |
CREATE TABLE |
CREATE TABLE table_name |
CREATE INDEX |
CREATE INDEX index_name or CREATE UNIQUE INDEX index_name |
CREATE VIEW |
CREATE VIEW view_name AS |
DELETE |
DELETE FROM table_name or DELETE FROM table_name |
DROP DATABASE |
DROP DATABASE database_name |
DROP INDEX |
DROP INDEX table_name.index_name (SQL Server) |
DROP TABLE |
DROP TABLE table_name |
EXISTS |
IF EXISTS (SELECT * FROM table_name WHERE id = ?) |
GROUP BY |
SELECT column_name, aggregate_function(column_name) |
HAVING |
SELECT column_name, aggregate_function(column_name) |
IN |
SELECT column_name(s) |
INSERT INTO |
INSERT INTO table_name or INSERT INTO table_name |
INNER JOIN |
SELECT column_name(s) |
LEFT JOIN |
SELECT column_name(s) |
RIGHT JOIN |
SELECT column_name(s) |
FULL JOIN |
SELECT column_name(s) |
LIKE |
SELECT column_name(s) |
ORDER BY |
SELECT column_name(s) |
SELECT |
SELECT column_name(s) |
SELECT * |
SELECT * |
SELECT DISTINCT |
SELECT DISTINCT column_name(s) |
SELECT INTO |
SELECT * or SELECT column_name(s) |
SELECT TOP |
SELECT TOP number|percent column_name(s) |
TURNCATE TABLE |
TRUNCATE TABLE table_name |
UNION |
SELECT column_name(s) FROM table_name1 |
UNION ALL |
SELECT column_name(s) FROM table_name1 |
UPDATE |
UPDATE table_name |
WHERE |
SELECT column_name(s) |