SQL Syntax

SQL Syntax is unique sets of rules and guidelines. This lesson describes all the basic SQL Syntax.

SQL Syntax Rules

  • SQL statements always start with the keywords.
  • SQL statement ends with a semicolon.
  • SQL is not case sensitive, means the update is the same as UPDATE

SELECT Statement

Syntax:
SELECT column_name(s) FROM table_name

SELECT Statement with WHERE Clause

Syntax:
SELECT [*] FROM [TableName] WHERE [condition1]

SELECT Statement with WHERE AND/OR Clause

Syntax:
SELECT [*] FROM [TableName] WHERE [condition1] [AND [OR]] [condition2]...

SELECT Statement with ORDER BY

Syntax:
SELECT column_name()
FROM table_name
ORDER BY column_name() ASC or DESC

INSERT INTO Statement

Syntax:
INSERT INTO table_name (column, column1, column2, column3, ...)
VALUES (value, value1, value2, value3 ...)

UPDATE Statement

Syntax:
UPDATE table_name
SET column=value, column1=value1,...
WHERE someColumn=someValue

DELETE Statement

Syntax:
DELETE FROM tableName
WHERE someColumn = someValue

Scroll Back to Top