Here we will learn about Insert statement in SQL(Structure Query Language).
As the name suggest INSERT statement is used to add one or more row in database.
General syntax for INSERT statement would be
INSERT INTO <table_name>(<column_name>, <column_name>,<column_name>…) VALUES (<values>, <values>, <values>…) WHERE <condition>
- Name of the table in which row needs to be inserted.
- List of column name in table/view against which values to insert.
- Values for corresponding column name
Note*: Order of column_name and values should be same.
Employee Table :
Inserting a row in employee table for only 3 column.
Insert into employe(name, surName, address) values('Java','Beginners', 'India')
Multiple row Insertion
What if we want to insert multiple row of data in a single SQL command in Oracle. In that case we can use “INSERT ALL” statement can be used. Insert all statement help us to insert multiple record in a single query.
Syntax for INSERT ALL