SQL Tutorial

This sql tutorial consists of examples so you can quickly learn to use SQL commands, functions, querying data, conditional statements, set constraints, data types, views.

SQL DDL Statements (Data Definition Language)

CREATE TABLE
ALTER TABLE
DROP TABLE
TRUNCATE TABLE

SQL DML Statements (Data Manipulation Language)

INSERT
UPDATE
DELETE

SQL Constraints

PRIMARY KEY
FOREIGN KEY
UNIQUE
CHECK

SQL Table Queries

SELECT
DISTINCT
WHERE
AND – OR
BETWEEN
LIKE
ORDER BY
GROUP BY
HAVING
INNER JOIN
LEFT JOIN
RIGHT JOIN
FULL JOIN
CROSS JOIN
SELF JOIN

SQL Aggregate Functions

AVG
COUNT
MAX
MIN
SUM