Baking SQL: Perfecting the elements
This blog covers some of the concepts as well as applications of the SQL queries and clauses. I will keep on updating the blog as and when I get more time or I learn newer concepts.
- SELECT — The result of a SELECT statement is another table known as result set. It can retrieve either rows or columns from a table. The clauses in the SELECT statement must be written in the syntactical order below:
GROUP BY expression
ORDER BY expression
- WHERE — It defines one or more conditions that limit the selected rows. It specifies a boolean expression.
- DISTINCT — It can be used only once in a SELECT list and it must precede all column names in that list. When there is more than one column in the SELECT list, the DISTINCT clause displays all rows where the combination of columns is distinct.
- Boolean Operations — Priority: NOT>AND>OR.
- IN — It allows the specification of two or more expressions to be used for a query search. An IN operator is equivalent to a series of conditions, connected with one or more OR operators.
- BETWEEN — It specifies a range of values which determine the upper and lower bounds of the qualifying value. Note that the bounds are inclusive.