Here is an easy example:
SELECT personID, lastname, firstname, birthdate, birthplace FROM tng_people WHERE lastname LIKE "M%" ORDER BY lastname, firstname, birthdatetr;
This SQL statement gives a list of a people having last names starting with "M".
|personID, lastname, firstname, birthdate, birthplace||Names of the data fields we want to see. Each data field gives a column in the resulting table.|
|tng_people||The database table where data coming from.|
|lastname LIKE "M%"||We don't want to see all data – we want only the data according to this condition (last names beginning with "M").|
|lastname, firstname, birthdatetr||the data fields to get the resulting table sorted|
|;||each SQL statement ends with a semicolon.|
Modify this example on our own and see what happens!