嗨,我有以下数据库架构。
employee (employee-name, street, city)
works (employee-name, company-name, salary)
company (company-name, city)
manages (employee-name, manager-name)
我需要给 First Bank Corporation 的所有经理加薪 10%,除非薪水超过 100,000 美元;在这种情况下,只加薪 3%。
我已经为上述问题写了以下查询。
UPDATE works w, manages m
SET w.salary += (salary * 0.10)
WHERE w.employee-name = m.manager-name
AND w.company-name = ‘First Bank Corporation’
但从查询中可以看出,我没有检查工资大于 100000 美元的情况。谁能告诉我该怎么做?