|
In its most basic form the INSERT INTO command adds a tuple to an
existing table.
The syntax is:
INSERT INTO
<Tablename> (<Attribute list>)VALUES
(<Valuelist>);
Please note that the attribute list can be omitted if a complete
tuple is inserted.
With the INSERT command shown above, new tuples are inserted into the database.
Often, the values to be inserted are the result of a request. For this situation the command can be changed as follows:
INSERT INTO <Tablename> (<Attribute list>)
SELECT ...
(normal request)
VALUES is replaced by an SQL request. The result of this request is inserted into specified table.
If the request returns a complete tuple in the correct order the attribute list does not need to be stated here either.