Database Reference
In-Depth Information
INSERT INTO MANAGER
SELECT *
FROM EMPLOYEE
WHERE EmployeeCode = 'MGR'
Modifying Data
SQL Command
UPDATE
Function
Change values in one or more columns of specified rows by replacing current
values with supplied constants or with results of calculations.
Examples
1. Change last name in a specified row in EMPLOYEE table with supplied value.
UPDATE EMPLOYEE
SET LastName = 'Raj'
WHERE EmployeeNo = 1234
2. Increase the salary of all managers by 5%.
UPDATE EMPLOYEE
SET Salary = Salary * 1.05
WHERE EmployeeCode = 'MGR'
3. Modify multiple columns in a specified row in EMPLOYEE table with
supplied values.
UPDATE EMPLOYEE
SET EmployeePosition = 'Asst. Supervisor', Salary = 60000, EmployeeCode
= 'SPR'
WHERE EmployeeNo = 3344
Deleting Data
SQL Command
DELETE
Function
Delete one or more specified rows from a table.
Examples
1. Delete all rows from the MANAGER table.
DELETE FROM MANAGER
Search WWH ::




Custom Search