DML – Data Manipulation Language
Insert :– To insert a new records.
Update :– Modifies records in table.
Delete :– To delete records from table.
1. INSERT :- To Insert Records Into Table
Syntax:
SQL> INSERT INTO <TABLE_NAME> VALUES(VALUE1,
VALUE2,VALUE3)
VALUE2,VALUE3)
2 ;
SQL> INSERT INTO <TABLE_NAME>(COLUMN1’,’
COLUMN2’,’COLUMN3’)
COLUMN2’,’COLUMN3’)
2 VALUES(‘VALUE1’,’VALUE2’,’VALUE3’);
Example:
SQL> INSERT INTO EMPLOYEE VALUES(‘&EMP_NO’,
’&EMP_NAME’,’&ADD’);
’&EMP_NAME’,’&ADD’);
Enter value for emp_no: X X X
Enter value for emp_name: XXX XXX XXXX
Enter value for emp_address: X/X XXX XXXXXX, XXX-XXXXXX
SQL> INSERT INTO EMPLOYEE(‘EMP_NO’,’EMP_NAME’,’ADD’)
2 VALUES(‘4567’,’NIKHIL’,’MOSHI’)
3 ;
2. UPDATE :- Modify Existing Records In Table
Syntax:
SQL> UPDATE <TABLE_NAME>
2 SET <COLUMN_NAME> = ‘NEW_VALUE’
3 WHERE <CONDITION>
4 ;
Example:
SQL> UPDATE EMPLOYEE
2 SET ADDRESS = ‘ALANDI’
3 WHERE EMP_NO = 4567
4 ;
3. DELETE :- Delete Record From Table
Syntax:
SQL> DELETE FROM <TABLE_NAME>
2 WHERE <CONDITION>
3 ;
Example:
SQL> DELETE FROM EMPLOYEE
2 WHERE EMP_NO = ‘4567’
3 ;
1 row deleted.
No comments:
Post a Comment