SQL

SQL ALIASES COLUMN ALIASES are used to make column headings in your result set easier to read. column_name [AS] alias_name

SELECT dept_id, COUNT(*) AS total FROM employees GROUP BY dept_id;
ANDselect * from table name WHERE condition1 AND condition2″
AND & OR“WHERE condition1 AND condition2 OR condition_n;”
BETWEEN“SELECT * FROM suppliers WHERE supplier_id BETWEEN 300 AND 600;”
COMPARISON OPERATORS Insert“INSERT INTO table (column1, column2, … ) VALUES (expression1, expression2, … );”
Update“UPDATE table1 SET column1 = (SELECT expression1  FROM table2               WHERE conditions) [WHERE conditions];”
DELETE“DELETE FROM table [WHERE conditions];”
DISTINCTDELETE FROM table name;
DELETE FROM table name where column = value;
TRUNCATETRUNCATE TABLE table name;
EXCEPT“EXCEPT operator in SQL Server (Transact-SQL) that returns one field with the same data type.
SELECT product_id FROM products EXCEPT

SELECT product_id FROM inventory;”
EXISTS“EXISTS operator returns true if the subquery returns one or more records.

SELECT column_name(s) FROM table_name WHERE EXISTS (SELECT column_name FROM table_name WHERE condition);”
GROUP BY“aggregate functions (AVG, COUNT, MAX, MIN, SUM) 

SELECT column_name(s) FROM table_name WHERE condition GROUP BY column_name(s) ORDER BY column_name(s);”