The this tutorial we will talk about the insert statement which is statement is used to insert new records in a table.
We will use the Test table which has the following structure:
Name (of the column) Type(type of data the column has)
------------------- ----------------------------------
ID NUMBER(38)
NAME varchar(20)
EMAIL varchar(20)
INSERT INTO
VALUES (value1, value2, value3);
Sql:>Insert into test values (1,'Eve','[email protected]');
INSERT INTO
(column1, column2, column3) VALUES (value1, value2, value3)
Sql:>Insert into test (id, name) values (1,'Eve');
Sql:>insert into test(email) values('[email protected]');
Insert into test values (1,'john');
Error: insufficient values;
Insert into test values (1,'john','[email protected]');
Insert into test(id, name)
values (1,'Eve','[email protected]');
Error: to many values;
Insert into test(id, name) values (1,'Eve');