INSERT


INSERT:
This command is used to insert the records in the table using this command we can insert the data into the table in two methods.
             i) Explicit method.  
            ii) Implicit method.

i)Explicit Method:
In this method user need to enter all the values into the columns without left any column data.
Syntax:
insert into <table name> values(value1,value2,....,valuen);
EX:
SQL>insert into emp values(1001,'SCOTT',10);
SQL>insert into employee('1002,'netlojava@netlojava.com');
Note:
We can use && in front of any column. By placing like this the use is – “It takes particular column values as default for remaining all values.


Syntax to insert the records into the table using i nsertion operation:
insert into <table name> values(&column1,&column2,.....,&column_n);
EX:
SQL>insert into emp values(&empno,'&ename','&job',&sal);
SQL>insert into employee values(&empno,'&email',&mobileno);


Implicit method:
This method we can enter the values at required columns in the table.
Syntax:
insert into <table name>(column1,column2,.....,column_n);
EX:
SQL>insert into emp(empno,ename) values(1003,'MILLER');
SQL>insert into employee (email,mobileno) values ('netlojava@netlojava' ,9876543210);


Syntax to insert record using & Symbol:
insert into <table name>(column1,column2,.....,column_n) values (&column1,&column2,.....,&column_n);
EX:
SQL>insert into emp(empno,job) values(&empno,'&job') values (1004,'MANAGER');
SQL>insert into employe(ename,sal,deptno) values('&ename',&sal,&deptno);

No comments:

Post a Comment

Dear Visitor your comment make us happy, so don't forget to leave a Comment.