Thursday, 3 May 2012

Sql Server material 4


Updating data present in the tables: if we want to Update the data existing in the table we use 
Update Statement:
Syntax:
            -UPDATE <TNAME> SET <CNAME>=<VALUE> [, …..] [CONDITIONS]

Note: We can modify a single column or multiple columns using the update statement all the rows that satisfy the condition gets affected.

            -UPDATE BANK SET CNAME=’RAMESH’ WHERE CUSTID=104
            -UPDATE BANK SET CNAME=’RAJESH’, BAL=3000 WHERE CUSTID=105

Deleting data present in the tables: if we want to delete rows of data present in the table we use
Delete Statement:
Syntax:
            -DELETE FROM <TNAME> [CONDITIONS]

            -DELETE FROM BANK WHERE CUSTID=105
            -DELETE FROM BANK


<<< Previous                                                                                                                          Next >>>

No comments:

Post a Comment