资源描述:
《程序员开发人员试题》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、1、哪一个SQL有错误?A.SELECT*FROMemp_dept_vu;B.SELECTdepartmentid,SUM(salary)FROMempdeptvuGROUPBYdepartment!d;C.SELECTdepartmentid,jobid,AVG(salary)FROMemp_dcpt_vuGROUPBYdepartmentid,jobid;D.SELECTjob_id,SUM(salary)FROMemp_dept_vuWHEREdepartmentidIN(10,20)GROUPBYjob_idHAVINGSUM(
2、salary)>20000;E.没有一个错误,都是对的.2、两张表结构如下:EMPLOYEES(EMPLOYEEIDNUMBERPrimaryKeyFIRSTNAMEVARCHAR2(25)LAST_NAMEVARCIIAR2(25)HIKEDATEDATE)NEW_EMPLOYEES(EMPLOYEE_TDNUMBERPrimaryKeyNAMEVARCHAR2(60))哪一个删除语句是正确的。A.DELETEFROMemployeesWHEREemployee_id=(SELECTemployee_idFROMemployees);
3、B.DELETE*FROMemployeesWHEREemployeeid=(SELECTemployeeidFROMnewemployees);C.DELETEFROMemployeesWHEREemployeeidIN(SELECTemployeeidFROMncw_employeesWHEREname二'Carrey,);D.DELETE*FROMemployeesWHEREemployee_idTN(SELECTemployeeidFROMnewemployeesWHERElast_name=,Carrey,);3、显示每个部门
4、,最高SALARY,最小SALARY,且最小SALARY小于5000,最大SALARY大于15000。A.SELECTdeptid,MIN(salary),MAX(salary)FROMemployeesWHEREMIN(salary)<5000ANDMAX(salary)>15000;B.SELECTdept_id,MIN(salary),MAX(salary)FROMemployeesWHEREMIN(salary)<5000ANDMAX(salary)>15000GROUPBYdeptid;A.SELECTdept_id,MTN(
5、salary),MAX(salary)FROMemployeesHAVINGMIN(salary)<5000ANDMAX(salary)>15000;B.SELECTdeptid,MIN(salary),MAX(salary)FROMemployeesGROUPBYdeptjdHAVINGMIN(salary)<5000ANDMAX(salary)>15000;C.SELECTdept_id,MIN(salary),MAX(salary)FROMemployeesGROUPBYdept_id,salaryHAVINGMTN(salary
6、)<5000ANDMAX(salary)>15000;4、执行SQL:SELECT*FROMordersWHEREcust_id=(SELECTcust_idFROMcustomersWHEREcust_name='Smith');ORDERSORDIDORDDATECUSTIDORDTOTAL10012-JAN-2000151000010109-MAR-200040800010209-MAR-2000351250010315-MAR-2000151200010425-JUN-200015600010518-JUL-2000205000
7、10618-JUL-200035700010721-JUL-200020650010804-AUG.2000108000CUSTOMERSCUSTIDCUSTNAMECITY10SmithLosAngeles15BobSanFrancisco20MartinChicago25MaryNewYork30RinaChicago35SmithNewYork40LindaNewYorkORDIDORDDATECUSTIDORDTOTAL10209-MAR-2000351250010618-JUL-200035700010804-AUG-2000
8、108000ORDIDORDDATECUSTIDORDTOTAL10209-MAR-2000351250010618-JUL-2000357000ORDIDORDDATECUSTIDORDTOTAL1080