SQL Tutorial : DML - UPDATE
Let's learn about next topic: UPDATE
UPDATE:
- used to update the data in the table
- UPDATE EMPLOYEES
SET SALARY =35000,JOB_ID='SA_MAN'
WHERE EMPLOYEE_ID=156
- UPDATE EMPLOYEES
SET SALARY =35000,JOB_ID='SA_MAN'
WHERE DEPARTMENT_ID=30
INTEGRITY CONSTRAINTS:
**************************
PARENT KEY NOT FOUND:
************************
- UPDATE EMPLOYEES
SET DEPARTMENT_ID=340
WHERE DEPARTMENT_ID=30
CHILD RECORDS FOUND:
***********************
- UPDATE DEPARTMENTS
SET DEPARTMENT_ID =340
WHERE DEPARTMENT_ID=20
- UPDATE EMPLOYEES
SET SALARY=26000
WHERE DEPARTMENT_ID =(SELECT DEPARTMENT_ID
FROM DEPARTMENTS
WHERE DEPARTMENT_NAME='Sales')
No comments:
Post a Comment