Commands





The Update Command
UPDATE is the SQL command that changes or modifies data values in a table. It
consists of an UPDATE clause followed by a SET clause and an optional WHERE clause.
The general format of the command is
UPDATE < table name > SET < column name > = < value >, <
column name > < value >
WHERE <logical expression>;
For example, suppose one of the employees SUDHAKAR in the EMP table is given
promotion to the Project Head and given a 10% raise in salary, then update the
relevant data as
SQL > UPDATE EMP
2 SET JOB = 'PROJHEAD, PAY = 1. 1 *PAY 3 WHERE ENAME = 'SUDHAKAR';
1 row updated.
<b>The Delete Command<b/>
Rows from the tables can be removed using DELETE command. The WHERE clause
is essential to remove only one rows that you intend to delete.
DELETE FROM <table name
Suppose you want to delete Radheeka's record from the ACCOUNTS table since
she has resigned from the organization, enter
SQL > DELETE FROM ACCOUNTS
2 WHERE ENAME = 'Radheeka';
I row deleted.
DELETE will not remove your table from the database; we use DROP to do that.
DELETE permanently removes your rows, depending upon the type of commit processing
you are using.
Domain Name Search
|