




下載本文檔
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、第一天練習(xí)1.查詢工資大于 12000 的員工select last_name, salary from employeeswhere salary 12000和工資2.查詢員工號(hào)為 176 的員工的select last_name, department_id from employeeswhere employee_id = 176和部門號(hào)3.選擇工資不在 5000 到 12000 的員工的select last_name, salary from employeeswhere salary not betn 5000 and 12000和工資4.選擇雇用時(shí)間在 1998-02-01 到
2、1998-05-01 之間的員工,job_id和雇用時(shí)間select last_name, job_id, hire_date from employeeswhere hire_date betn 1-2 月 -1998 and 1-5 月 -19985.選擇在 20 或 50 號(hào)部門工作的員工select last_name, department_id from employeeswhere department_id in (20, 50)和部門號(hào)6.選擇在 1994 年雇用的員工的select last_name, hire_date from employeeswhere hire_
3、daike % -94和雇用時(shí)間7.選擇公司中沒(méi)有管理者的員工select last_name, job_id from employeeswhere manager_id is null及 job_id8.選擇公司中有獎(jiǎng)金的員工,工資和獎(jiǎng)金級(jí)別select last_name, salary, commis_pctfrom employeeswhere commis_pct is not null9.選擇員工select last_name from employees的第三個(gè)字母是 a 的員工where last_name like a%10. 選擇中有字母 a 和 e 的員工select
4、 last_name from employeeswhere last_name like %a% and last_name like %e%11. 顯示系統(tǒng)時(shí)間select to_char(sysdate, yyyy-mm-dd hh:mi:ss) from dual;12. 查詢員工號(hào),工資,以及工資提高百分之 20%后的結(jié)果(newsalary)select employee_id, last_name, salary, salary * 1.2 new salary from employees;13. 將員工的按首字母排序,并寫(xiě)出的長(zhǎng)度(length)select last_nam
5、e, length(last_name) from employeesorder by last_name14. 查詢各員工的,并顯示出各員工在公司工作的月份數(shù)(worked_month)。select last_name, months_betn(sysdate, hire_date) worked_month from employees15. 查詢員工的,以及在公司工作的月份數(shù)(worked_month),并按月份數(shù)降序排列select last_name, months_betn(sysdate, hire_date) worked_month from employeesorder
6、by worked_month desc16. 做一個(gè)查詢,產(chǎn)生下面的結(jié)果 earns monthly but wants select last_name | earns | salary | monthly but wants | salary* 3from employees17. 使用 decode 函數(shù),按照下面的條件:jobgradeAD_PRESAST_MANBIT_PROGCSA_REPDST_CLERKEOthersF產(chǎn)生下面的結(jié)果select last_name, job_id, decode(job_id, AD_PRES, A,ST_MAN, B,IT_PROG, C,
7、SA_REP, D,ST_CLERK, E,F) GRADEfrom employees18. 將第 7 題的查詢用 case 函數(shù)再寫(xiě)一遍。select last_name, job_id, case job_id when AD_PRES then Awhen ST_MAN then Bwhen IT_PROG then Cwhen SA_REP then Dwhen ST_CLERK then Eelse FLast_nameJob_idGradekingAD_PRESADream SalaryKing earns $24000 monthly but wants $72000endfr
8、om employees19. 查詢公司員工工資的最大值,最小值,平均值,總和Select max(salary), min(salary), avg(salary), sum(salary)From employees20. 查詢各 job_id 的員工工資的最大值,最小值,平均值,總和Select job_id, max(salary), min(salary), avg(salary), sum(salary)From employeesGroup by job_id21. 選擇具有各個(gè) job_id 的員工人數(shù)Select job_id, count(employee_id)From
9、employeesGroup by job_id;22. 查詢員工最高工資和最低工資的差距(DIFFERENCE)Select max(salary) min(salary) differenceFrom employees23. 查詢各個(gè)管理者手下員工的最低工資,其中最低工資不能低于6000,沒(méi)有管理者的員工不計(jì)算在內(nèi)Select manager_id, min(salary)From employeesWhere manager_id is not nullGroup by manager_idHaving min(salary) = 600024. 查詢所有部門的名字,location_id,員工數(shù)量和工資平均值Select department_name, location_
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度教育機(jī)構(gòu)講師團(tuán)隊(duì)合作協(xié)議
- 公司文員勞動(dòng)協(xié)議
- 全球環(huán)境治理項(xiàng)目資金捐贈(zèng)協(xié)議
- 中國(guó)地理讀后感
- 《數(shù)學(xué)競(jìng)賽題庫(kù)設(shè)計(jì)與復(fù)習(xí)教學(xué)教案》
- 大宗商品貿(mào)易管理流程手冊(cè)
- 委托貸款借款合同
- 農(nóng)產(chǎn)品質(zhì)量安全追溯手冊(cè)
- 互聯(lián)網(wǎng)軟件開(kāi)發(fā)合同協(xié)議
- 綠化工程承包合同協(xié)議
- 成人手術(shù)后疼痛評(píng)估與護(hù)理團(tuán)體標(biāo)準(zhǔn)
- 2025年中考數(shù)學(xué)二輪專題復(fù)習(xí) 題型四-二次函數(shù)圖象與性質(zhì)綜合題
- 【數(shù)學(xué)】一元一次方程的應(yīng)用第2課時(shí)盈不足問(wèn)題課件-2024-2025學(xué)年北師大版數(shù)學(xué)七年級(jí)上冊(cè)
- 不說(shuō)臟話課件
- 支氣管哮喘的診療課件
- 上海市黃浦區(qū)2022-2023學(xué)年九年級(jí)上學(xué)期期末化學(xué)試卷(一模)
- 競(jìng)聘運(yùn)營(yíng)主管的未來(lái)規(guī)劃
- 中級(jí)消防設(shè)施操作員練習(xí)題庫(kù)含參考答案
- 河北醫(yī)科大學(xué)第一醫(yī)院招聘醫(yī)療工作人員筆試真題2023
- 職業(yè)衛(wèi)生監(jiān)測(cè)與評(píng)價(jià)作業(yè)指導(dǎo)書(shū)
- 急性創(chuàng)傷的現(xiàn)場(chǎng)急救和評(píng)估
評(píng)論
0/150
提交評(píng)論