Professional Documents
Culture Documents
UPDATE <tablename>
SET [ <columnname1> = <value expression>.
<columnname2> = <value expression>
…….
]
[WHERE <condition>]
The columns whose values have to be updated and the expressions to derive these values
are included in the SET clause. The rows to be updated are those that meet the
condition(s) in the WHERE clause.
For example to update the basic salary of the employee,we could use the following
statement
Update EMPLOYEE
SET basic=3000
WHERE e_code=’101’;
This command will change the salary of the employee whose employee code is 101 with
3000.
The output for the UPDATE command is shown in the tables related to project
update STUREPT
SET intmarks=74
where adno=1002;
update STUDATA
SET city='bhilai',religion='christian'
where adno=1002;
Data Definition Language or DDL commands are used to define a database, modify its
structure after it has been created and destroy it after it is no longer needed. The result of
compilation of DDL statements is a set of tables which are stored in a special file called
DATA DICTIONARY. One of the DDL command is ALTER TABLE, which is used
to change the definations of existing languages.
OR
ALTER TABLE<tablename>
ADD <columnname> <datatype> <size>;
For example to alter the size of the employee name field, we could use the following
statement
to add the age field to the table EMPLOYEE, we could use the following statement
The output for the UPDATE command is shown in the tables related to project