SQL is a database inquiry and programming language. Using a statement that defines an SQL command to do a specified action creates a query. The minimum required syntax for an SQL statement is:
SELECT * FROM tableName
which SELECTs all records and fields FROM a given table. The statement can include optional clauses with arguments to set the criteria that the action will carry out.
SELECT * FROM tableName WHERE fieldName=value
ORDER BY fieldName
When the query is run, the provider searches the specified table or tables, extracts the chosen columns, selects rows that meet the criterion, and sorts or groups the resulting rows into the order specified.
NOTE: An SQL statement must be written as a single line without any line breaks; the examples shown here and in the following sections are done so only for readability.