Data Manipulation Language (DML)
Select
Select is our main tool for interrogating our database and extracting information. The syntax for SELECT
As you can see there is a lot of options here. The SQL SELECT allows you to create sophisticated queries on the data in the database
A simple implementation of select statement might be
A slightly more advanced implementation of this might be
Note that this selects the student id, first name and last name of the student who has the student id of 1. Notice the comma at the end of each column definition to separate the definitions
Having looked at a simple example of select statements, we will now look at a more complex example. In this next example we have a student database consisting of 2 tables, 1 containing contact details and other being the table we just gave an example of.
As you can see, the above example displays the student id, first name, last name and address of the student who has the same student id on both the students and contact tables.