SQL is designed to maniplulate databases. By this I mean search, add and update data. As well as changing the structure of the database. I will not go into too much detail in this tutorial, because even though SQL complies in general to a standard, some proprietry database vendors have made there own implementations of particular SQL functionality.
Therefore I will simply give a overview of the main SQL statements.
Will select all columns the asterix (*) indicates all columns should be selected but also because there is no WHERE clause the statement will also select all rows from the People table.
To restrict the amount of data returned something similar to the following can be done.
The where clause indicates that only people with the name "tom" should be returned.
You can of course do selects using integers
This selects all people with a age equal to or greater than 23.
You can also use logical operators such as AND or OR.
This will return people whose age is equal to or greater than 23, the LIKE operator is used to do a partial match so in this case it will return any names that match the first part of the string and then anything after the wild card. So names like matt, mathew would all be returned.
Of course if you used a operator such as OR instead of AND it would return rows were the name or the age matched.
The above statement will set all names in the table People to be Rob.
Like the Select statement a WHERE clause can be used to restrict what the statement is applied to.
The above statement inserts Dom into the name column and 25 into the age column. The values in the first set of brackets are the columns to insert into, and the values in the bracket after the values keyword are the values to put into the columns specified in the first set of brackets in the exact order.