This is the Second sub Language in SQL which is used to manipulate the Data within the DataBase.
This Language Contains four Commands:
1.INSERT
2.UPDATE
3.DELETE
4.SELECT
1.INSERT:- Using this command we can Insert the Records into the Table.
SYNTAX:-INSERT INTO <TABLE_NAME> VALUES(VALUE1,VALUE2...VALUEN);
Using this method we can insert data into table in two methods.They are
1.EXPLICIT METHOD:- In this method user need to enter all the values into all the columns in the table without left any column data.
Example: Insert Into EMP values(101,'raj',1000);
Insert the records using INSERTION OPERATOR(&):
Syntax:Insert Into <table_name> values(&col1,&col2,'&col3', ...&coln);
Example: Insert Into Emp values(&empno,'&ename',&sal,&deptno);
IMPLICIT METHOD: In this method user can enter the values at required columns in the table so that the user can Omit/Left some column data.
If the user left any column data then that column takes null.
Null is not Equal to 0 or Space.
Null means NO value.
Syntax:Insert into <table_name> (clol1,col2,..coln) values(value1,value2,...valuen);
Using Insertion Operator(&):
Syntax:Insert into table_name> (col1,col2,..coln) values(&col1,&col2,..&coln);
Example:Insert into emp(empno,ename) values(&empno,'&ename');
Double Ampersand(&&):If we keep double ampersand before any column in the table given for the column same value automatically allotted to succeeding records in the table.
Example:Insert into table_name values(&&empno,'&&ename',&&sal);
This Language Contains four Commands:
1.INSERT
2.UPDATE
3.DELETE
4.SELECT
1.INSERT:- Using this command we can Insert the Records into the Table.
SYNTAX:-INSERT INTO <TABLE_NAME> VALUES(VALUE1,VALUE2...VALUEN);
Using this method we can insert data into table in two methods.They are
1.EXPLICIT METHOD:- In this method user need to enter all the values into all the columns in the table without left any column data.
Example: Insert Into EMP values(101,'raj',1000);
Insert the records using INSERTION OPERATOR(&):
Syntax:Insert Into <table_name> values(&col1,&col2,'&col3', ...&coln);
Example: Insert Into Emp values(&empno,'&ename',&sal,&deptno);
IMPLICIT METHOD: In this method user can enter the values at required columns in the table so that the user can Omit/Left some column data.
If the user left any column data then that column takes null.
Null is not Equal to 0 or Space.
Null means NO value.
Syntax:Insert into <table_name> (clol1,col2,..coln) values(value1,value2,...valuen);
Using Insertion Operator(&):
Syntax:Insert into table_name> (col1,col2,..coln) values(&col1,&col2,..&coln);
Example:Insert into emp(empno,ename) values(&empno,'&ename');
Double Ampersand(&&):If we keep double ampersand before any column in the table given for the column same value automatically allotted to succeeding records in the table.
Example:Insert into table_name values(&&empno,'&&ename',&&sal);
No comments:
Post a Comment
If you Like my blog Spread it and help friends for whom this blog is useful for their career.