以下语句错误的是()
A: SELECTrank,AVG(salary)FROMpeopleGROUPBYrankHAVINGAVG(salary)>1000
B: SELECTrank,AVG(salary)FROMpeopleHAVINGAVG(salary)>1000GROUPBYrank;
C: SELECTAVG(salary)FROMpeopleGROUPBYrankHAVINGAVG(salary)>1000;
D: SELECTrank,AVG(salary)FROMpeopleGROUPBYrankWHEREAVG(salary)>1000;
A: SELECTrank,AVG(salary)FROMpeopleGROUPBYrankHAVINGAVG(salary)>1000
B: SELECTrank,AVG(salary)FROMpeopleHAVINGAVG(salary)>1000GROUPBYrank;
C: SELECTAVG(salary)FROMpeopleGROUPBYrankHAVINGAVG(salary)>1000;
D: SELECTrank,AVG(salary)FROMpeopleGROUPBYrankWHEREAVG(salary)>1000;
举一反三
- 以下语句错误的是() A: LECT rank, AVG(salary) FROM people HAVING AVG(salary) > 1000 GROUP BY rank; B: SELECT rank, AVG(salary) FROM people GROUP BY rank HAVING AVG(salary) > 1000 C: SELECT rank, AVG(salary) FROM people HAVING AVG(salary) > 1000 GROUP BY rank; D: SELECT AVG(salary) FROM people GROUP BY rank HAVING AVG(salary) > 1000; E: SELECT rank, AVG(salary) FROM people GROUP BY rank WHERE AVG(salary) > 1000;
- 下面哪个语句关于GROUP BY 和HAVING语句的使用是正确的?() A: A.SELECT JOB_ID , DEPARTMENT_ID , AVG(SALARY)FROM EMPLOYEES GROUP BY JOB_IDHAVING AVG(SALARY) > 3000; B: B.SELECT JOB_ID , DEPARTMENT_ID , AVG(SALARY)FROM EMPLOYEES GROUP BY JOB_ID ,DEPARTMENT_IDHAVING AVG(SALARY) > 3000; C: C.SELECT JOB_ID , DEPARTMENT_ID , AVG(SALARY)FROM EMPLOYEES GROUP BY AVG(SALARY)HAVING AVG(SALARY) > 3000; D: D.SELECT JOB_ID , DEPARTMENT_ID , AVG(SALARY)FROM EMPLOYEES GROUP BY JOB_ID , DEPARTMENT_IDHAVING SALARY > 3000;
- 下面哪个语句关于GROUP BY 和HAVING语句的使用是正确的是?() A: SELECT<br/>JOB_ID, DEPARTMENT_ID, AVG(SALARY) FROM EMPLOYEES GROUP BY JOB_ID<br/>HAVING AVG(SALARY) > 3000; B: SELECT<br/>JOB_ID, DEPARTMENT_ID, AVG(SALARY) FROM EMPLOYEES GROUP BY JOB_ID,<br/>DEPARTMENT_ID HAVING AVG(SALARY) > 3000; C: SELECT<br/>JOB_ID, DEPARTMENT_ID, AVG(SALARY) FROM EMPLOYEES GROUP BY<br/>AVG(SALARY) HAVING AVG(SALARY) > 3000; D: FROM<br/>EMPLOYEES GROUP BY JOB_ID, DEPARTMENT_ID HAVING SALARY > 3000;
- 表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
- 设有职工基本表: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=女;