设有职工基本表:EMP(ENO,ENAME,AGE,SEX,SALARY),其属性分别表示职工号、姓名、年龄、性别、工资。为每个工资低于平均工资的女职工加薪200元,以下SQL语句正确的是______。
A: UPDATE EMP SET SALARY=SALARY+200
B: WHERE SALAEY<(SELECT AVG(SALARY)FROM EMP) AND SEX=’女’
C: UPDATE FROM EMP SET SALARY=200
D: WHERE SALAEY<(SELECT SUM(SALARY)FROM EMP)AND SEX=’女’
E: UPDATE EMP SET SALARY=200
F: WHERE SALAEY<(SELECT AVG(SALARY)FROM EMP)AND SEX=’女’
G: UPDATE FROM EMP SET SALARY=SALARY+200
H: WHERE SALAEY<(SELECT SUM(SALARY)FROM EMP)AND SEX=’女’
A: UPDATE EMP SET SALARY=SALARY+200
B: WHERE SALAEY<(SELECT AVG(SALARY)FROM EMP) AND SEX=’女’
C: UPDATE FROM EMP SET SALARY=200
D: WHERE SALAEY<(SELECT SUM(SALARY)FROM EMP)AND SEX=’女’
E: UPDATE EMP SET SALARY=200
F: WHERE SALAEY<(SELECT AVG(SALARY)FROM EMP)AND SEX=’女’
G: UPDATE FROM EMP SET SALARY=SALARY+200
H: WHERE SALAEY<(SELECT SUM(SALARY)FROM EMP)AND SEX=’女’
举一反三
- 设有职工基本表:EMP(ENO,ENAME,AGE,SEX,SALARY),其属性分别表示职工号、姓名、年龄、性别、工资。为每个工资低于1000元的女职工加薪200元,补充这个操作的SQL语句。UPDATE?EMP() A: SET?SALARY=SALARY-200 B: SET?SALARY=SALARY+200 C: WHERE?SALARY>1000?AND?SEX=女; D: WHERE?SALARY<1000?AND?SEX=女;
- 设有职工基本表:EMP(ENO,ENAME,AGE,SEX,SALARY),其属性分别表示职工号、姓名、年龄、性别、工资。为每个工资低于平均工资的女职工加薪200元,以下SQL语句正确的是( )
- 表employees中有字段title表示职务,字段salary表示工资,求各个职务平均工资的T-SQL语句是( )。 A: SELECT AVG(SALARY) FROM EMPLOYEES WHERE TITLE B: SELECT AVG(SALARY) FROM EMPLOYEES GROUP BY TITLE C: SELECT AVG(TITLE) FROM EMPLOYEES GROUP BY SALARY D: SELECT SALARY FROM EMPLOYEES GROUP BY TITLE
- 查询各类别的公司中比该类别最小工资高300元的公司、工资、类别 A: SELECT name, salary, type FROM job AS s1 WHERE salary > (SELECT min(salary) FROM job AS s2 WHERE s1.type = s2.type GROUP BY type) ; B: SELECT name, salary, type FROM job AS s1 WHERE salary > (SELECT min(salary) FROM job AS s2 WHERE s1.type = s2.type ) + 300; C: SELECT name, salary, type FROM job WHERE salary > 300; D: SELECT name, salary, type FROM job AS s1 WHERE salary > (SELECT min(salary) FROM job AS s2 WHERE s1.type = s2.type GROUP BY type) + 300;
- 执行以下查询,表头的显示为:( ) select sal 'Employee Salary' from emp;