Infolinks

Saturday 12 May 2012

SQL-USING DML


USING DML

USING UPDATE

This can be used to modify the table data.

Syntax:
     Update <table_name> set <col1> = value1, <col2> = value2 where <condition>;

Ex:
     SQL> update student set marks = 500;
     If you are not specifying any condition this will update entire table.

     SQL> update student set marks = 500 where no = 2;
     SQL> update student set marks = 500, name = 'Venu' where no = 1;

USING DELETE

This can be used to delete the table data temporarily.

Syntax:
    Delete <table_name> where <condition>;

Ex:
     SQL> delete student;
     If you are not specifying any condition this will delete entire table.

     SQL> delete student where no = 2;

No comments:

Post a Comment