Data Manipulating Language (DML)
This sub language is used to manipulating within the table like storing, updating, deleting and modifying.
This Command contains the Four commands.
1: INSERT
2: SELECT
3: UPDATE
4: DELETE
1: SELECT:
This Command is used to retrieve the record from existing table.
* using this command we can retrieve all the record and also retrieve the specific record (using where clause).
Syntax:
Select * from table_name;
2: INSERT:
This command is used to insert record into the existing table:
Using this command we can insert the record into the table by two methods.
1: Explicit Type.
2: Implicit Type.
1: Explicit Type: In this method, if user need to insert all the values in all the column, user cannot left any column.
Syntax:
insert into table_name values (val1, val2,val3…….valn);
Example:
create table student(Roll_no number(10) , Student_name varchar2(20), Dept_name varchar2(5));
Example:
insert into student values(1100,’Jhon’,’cse’);
Last values in table Student inserted;
2:Implicit Type: In this method we can enter the values at the required column.
Syntax:
Insert into table_name (col1,col2…coln) values (val1,val2….valn);
Syntax:
Insert into student(roll_no,dept_name)values(1200,’ME’);
.
Last values in table Student inserted;
Note: If we do not enter any column in the table then column automatically take NULL. NULL means no values and it is not equal to ZERO or SPACE.
3: UPDATE:
This Command is used to modify the data in the table. By using this command we can modify all the record in the table and also some specific record in the table(by using where clause).
Syntax:
update table_name set column name=value;
Example:
update student set student_name='raju';
Update command using where clause;
by using where clause we can update any specific data.
.
Syntax:
update table_name set column_name=value where column_name=value;
Example:
update student set student_name=’jhon’ where roll_no=1003;
If we want to mare column update at a time.
.
Syntax:
update table_name set col1=value,col2=value------coln=value;
Example:
Update student set roll_no=1111,Student_name=’jhon’;
4: DELETE:
This command is used to delete the record in existing table.
By using this command we can delete all the record and any specific record from the table (by using the where clause).
Syntax:
Example: