Database Reference
In-Depth Information
WHERE Product_ID = 1003));
Updating Data
The UPDATE statement is used to modify data of a table. UPDATE can be used
in two ways:
 update few rows in a table
 update all rows in a table
Example: StaffID 105 now has changed his City to Patiala, and so his record needs updat-
ing.
Sol:
UPDATE Staff
SET City= 'Patiala' WHERE StaffID = 105;
Example: Updating multiple columns. Sol:
UPDATE Staff
SET City = 'Patiala', Address = 'H.No. 56 Jaswant Nag' WHERE StaffID = 104;
Example: Update table student_result put value 0 in field Marksobt where Remarks are
'Result Late' Marksobt
Sol:
UPDATE Student_result
SET Marksobt = 0
WHERE Remarks = 'Result Late ';
Deleting Data
The DELETE statement is used to remove row(s) from a table. DELETE can be
used in two ways:
 delete few rows from a table
 delete all rows from a table
Delete command deletes rows only not columns
Example: Delete row from Student where RollNo is 701
Sol:
DELETE FROM Student
WHERE RollNo = 701;
Search WWH ::




Custom Search