Format of SQL queries
A simple SQL query includes just a few statements.
When you enter SQL statements on the SQL Query panel, you need to know the following items:
- The name of the table from which you want data
- The column names in the table
- The row conditions you want to specify
- The sequence in which you want the data to appear
Many simple SQL queries use the following basic SQL statement:
SELECT columnname FROM tablename WHERE condition ORDER BY columnname
The following figure shows a basic SQL query. This query displays the employee names, years of service, and salaries from the Q.STAFF table.