SQL Query – Cheat Sheet

SELECT statement. The inner select statement has been given the alias data and becomes the data source of the outer select statement SELECT first_name, salary FROM (SELECT * FROM table_name WHERE salary > 500000) as set; Sub-queries can be used in the FROM clause. In this case an alias must always be assigned. SELECT DISTINCT(region) FROM table ... ................
................