Explain the full syntax of Select Statement with examples.
SELECT is used to select a specific or ALL columns / rows from a table.Syntax:
SELECT list_columns FROM table_name
List_columns are the columns to be selected to retrieve the rows. While table_name is the table from which these columns needs to be selected. Many clauses can be added to this SELECT statement.Example 1:
Displays rows with customers balance between 10 and 10000
SELECT first_name FROM Customer WHERE cust_bal BETEEN 10 and 10000;Example 2:
Sort the names in an ascending order
SELECT first_name FROM Customer ORDER BY first_name