GITTA-Logo
PDF Version of this document Search Help

Lesson Navigation IconStructured Query Language SQL

Unit Navigation IconSQL overview

Unit Navigation IconCreation and modification of tables

Unit Navigation IconBasic database queries

Unit Navigation IconSQL Insert, Delete and Update

LO Navigation IconInserting tuples

LO Navigation IconDeleting tuples

LO Navigation IconUpdating tuples

LO Navigation IconeLSQL Exercise 'Insert, Delete und Update'

Unit Navigation IconUsage of SQL

Unit Navigation IconSummary

Unit Navigation IconRecommended Reading

Unit Navigation IconBibliography

Unit Navigation IconMetadata


GITTA/CartouCHe news:


Go to previous page Go to next page

Inserting tuples

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.

Inserting tuples

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.

Top Go to previous page Go to next page