| Lesson 6 || Using INSERT |
| Objective || Insert new rows into a database table. |
SQL Insert Statement
The UPDATE statement is used to change existing rows in a table. In this lesson, you will see how new rows are added.
The INSERT statement adds a new row into a specified table. To use the INSERT statement you generally specify the data fields and their corresponding values for the row to insert.
However, if values for every field are being provided then it is not necessary to specify the data fields. In this case, the values are added to the fields from left to right, beginning with the first field. If values for only some fields are being provided then the data fields are specified, unless the values are to go into the first fields as they appear in the row.
The syntax for the INSERT statement is illustrated in the following SlideShow:
SQL Insert Statement - Exercise
Click the Exercise link below to practice adding a row to the VirtualBookShelf.com BookTable.
SQL Insert Exercise