INSERT STATEMENT

ü  INSERT INTO statement is used to insert data into table.
ü  It can be used to insert one or more row in a table.
ü  There are two formats of INSERT INTO statement.
ü  First statement is without column name
Syntax:
INSERT INTO table_name VALUES (val1, val2, val3)
Example:

ü  Second statement is specifying column names

Syntax:
INSERT INTO table_name (col1, col2, col3) VALUES (val1, val2, val3)
Example:

Note:
·         First is used to insert into all the columns in of a table.
·         Second is used to insert into table for few columns.
·         For second statement number of columns must be equal to values provided in second section.
INSERT STATEMENT INSERT STATEMENT Reviewed by kamal kumar das on January 20, 2012 Rating: 5

No comments:

ads 728x90 B
Powered by Blogger.