- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
oracle实验内2(共40题)
Part 1
Write a query to display the current date. Label the column Date.
select to_char(sysdate,year-mon-day) “Date”
from dual
2. The HR department needs a report to display the employee number, last name, salary, and salary increased by 15.5% (expressed as a whole number) for each employee. Label the column New Salary. Place your SQL statement in a text file named lab_03_02.sql.
select employee_id,last_name,salary,salary*1.155 new_salary
from employees
3. Run your query in the file lab_03_02.sql.
4. Modify your query lab_03_02.sql to add a column that subtracts the old salary from the new salary. Label the column Increase. Save the contents of the file as lab_03_04.sql. Run the revised query.
select employee_id,last_name,salary,salary*1.155 new_salary,salary*0.155 increase
from employees
厖
Write a query that displays the last name (with the first letter uppercase and all other letters lowercase) and the length of the last name for all employees whose name starts with the letters J, A, or M. Give each column an appropriate label. Sort the results by the employees’ last names.
select last_name,length(last_name) length
from employees
where last_name like A% or last_name like J%or last_name like M%
order by last_name
Rewrite the query so that the user is prompted to enter a letter that starts the last name. For example, if the user enters H when prompted for a letter, then the output should show all employees whose last name starts with the letter H.
6. The HR department wants to find the length of employment for each employee. For each employee, display the last name and calculate the number of months between today and the date on which the employee was hired. Label the column MONTHS_WORKED. Order your results by the number of months employed. Round the number of months up to the closest whole number.
Note: Your results will differ.
select last_name,round(months_between(sysdate,hire_date)) MONTHS_WORKED
from employees
order by hire_date desc
您可能关注的文档
最近下载
- Korn-Ferry-方案-构建成功者画像.pdf VIP
- 铭记抗战历史,弘扬爱国精神——纪念抗日战争胜利八十周年主题班会.pptx VIP
- 扣押决定书文书范本.doc VIP
- 人民大2024现代大学美育 教学课件认识美——万物皆美(第一章 美是什么)(1).pptx VIP
- 人民大2024现代大学美育 教学课件认识美——万物皆美(第二章 何为美育)(1).pptx VIP
- 项目策划培训课件.ppt VIP
- 人民大2024现代大学美育 教学课件艺术美——美美与共(第十一章造型艺术美)(陈琳、刘晓晓).pptx VIP
- 大学美育课件:中国艺术美-音乐美.pptx VIP
- 文化旅游项目策划报告.pptx VIP
- 大学美育课件:中国艺术美-绘画美.pptx VIP
文档评论(0)