Slide 11.7: The CREATE TABLE statement Slide 11.9: The SELECT statement Home |
INSERT INTO
Statement
INSERT INTO
statement is used to insert new rows into a table.
The syntax of inserting data into a table is given on the right: |
|
SQL> insert into Persons 2 values ('Hansen', 'Ola', 'Timoteivn 10', 'Sandnes'); 1 row created. SQL> insert into Persons 2 values ('Svendson', 'Tove', 'Borgvn 23', 'Sandnes'); 1 row created. SQL> insert into Persons 2 values ('Pettersen', 'Kari', 'Storgt 20', 'Stavanger'); 1 row created. |
You can also specify the columns for which you want to insert data: |
|
SQL> insert into Persons (LastName, Address) 2 values ('Rasmussen', 'Storgt 67'); 1 row created. |
NULL
.
LastName | FirstName | Address | City |
---|---|---|---|
Hansen | Ola | Timoteivn 10 | Sandnes |
Svendson | Tove | Borgvn 23 | Sandnes |
Pettersen | Kari | Storgt 20 | Stavanger |
Rasmussen | Storgt 67 |