Write a postgre SQL statement to change the job ID of the employee which ID is 118 to SH_CLERK if the employee belongs to a department which ID is 30 and the existing job ID does not start with SH
- Postgre SQL
- 2021-09-29
- mhanasmh00489829403
الأجوبة
UPDATE employees SET JOB_ID= 'SH_CLERK'
WHERE employee_id=118
AND department_id=30
AND NOT JOB_ID LIKE 'SH%';
Output:
See the result. Only the effected rows have been displayed.
postgres=# SELECT * FROM employees
WHERE employee_id=118
AND department_id=30
AND JOB_ID LIKE 'SH%';
employee_id | first_name | last_name | email | phone_number | hire_date | job_id | salary | commission_pct | manager_id | department_id
-------------+------------+-----------+---------+--------------+------------+----------+---------+----------------+------------+---------------
118 | Guy | Himuro | GHIMURO | 515.127.4565 | 1987-07-05 | SH_CLERK | 2600.00 | 0.00 | 114 | 30
(1 row)أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال
معلومات ذات صلة