Professional Documents
Culture Documents
Syntax:
UPDATE TBL_NAME
SET COLUMN = NEW VALUES
[WHERE CONDITION];
In the syntax:
Tbl_name - Is the name of the table
set column - Is the name of the column in the table to populate
– new_value - Is the corresponding value or subquery for the column
– condition - Identifies the rows to be updated, should apply either
Comparison Condition, Logical Condition or apply a subquery.
Changing Data in a Table cont.
Example: 1 column
UPDATE STUDENTS
SET FIRSTNAME = 'MARVIN'
WHERE USN_ID=502;
• Updating two columns in one UPDATE statement.
– To update to or more columns in one UPDATE statement put a comma (,) after
each column called in the SET clause.
Example:
UPDATE STUDENTS
SET YR_LVL='IRREG', LASTNAME = 'ABIOG'
WHERE USN_ID = 505;
DELETE Statement