ImageVerifierCode 换一换
格式:DOCX , 页数:21 ,大小:386.43KB ,
资源ID:3637725      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-3637725.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Oracle数据库习题Practice311Word下载.docx)为本站会员(b****1)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

Oracle数据库习题Practice311Word下载.docx

1、5. 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.Rewrite

2、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. Practice 4 Determine the validity of the following three statements. C

3、ircle either True or False.1.Group functions work across many rows to produce one result per group.True/False2.Group functions include nulls in calculations. True/False3.The WHERE clause restricts rows before inclusion in a group calculation.The HR department needs the following reports:4. Find the

4、highest, lowest, sum, and average salary of all employees. Label the columns Maximum, Minimum, Sum, and Average, respectively. Round your results to the nearest whole number. Place your SQL statement in a text file named lab_04_04.sql.5. Modify the query in lab_04_04.sql to display the minimum, maxi

5、mum, sum, and average salary for each job type. Resave lab_04_04.sql as lab_04_05.sql. Run the statement in lab_04_05.sql. 6、Write a query to display the number of people with the same job.Save the script to a file named lab_04_06.sql.7. Determine the number of managers without listing them. Label t

6、he column Number of Managers. Hint: Use the MANAGER_ID column to determine the number of managers.8. Find the difference between the highest and lowest salaries. Label the column DIFFERENCE.If you have time, complete the following exercises:9. Create a report to display the manager number and the sa

7、lary of the lowest-paid employee for that manager. Exclude anyone whose manager is not known. Exclude any groups where the minimum salary is $6,000 or less. Sort the output in descending order of salary. If you want an extra challenge, complete the following exercises:10. Create a query to display t

8、he total number of employees and, of that total, the number of employees hired in 1995, 1996, 1997, and 1998. Create appropriate column headings.11. Create a matrix query to display the job, the salary for that job based on department number, and the total salary for that job, for departments 20, 50

9、, 80, and 90, giving each column an appropriate heading. Practice 5 1、Write a query for the HR department to produce the addresses of all the departments. Use the LOCATIONS and COUNTRIES tables. Show the location ID, street address, city, state or province, and country in the output. Use a NATURAL J

10、OIN to produce the results.2、The HR department needs a report of all employees. Write a query to display the last name, department number, and department name for all employees.3、The HR department needs a report of employees in Toronto. Display the last name, job, department number, and department n

11、ame for all employees who work in Toronto.4、Create a report to display employees last name and employee number along with their managers last name and manager number. Label the columns Employee, Emp#, Manager, and Mgr#, respectively. Place your SQL statement in a text file named lab_05_04.sql.5、Modi

12、fy lab_05_04.sql to display all employees including King, who has no manager. Order the results by the employee number. Place your SQL statement in a text file named lab_05_05.sql. Run the query in lab_05_05.sql.6、numbers, and all the employees who work in the same department as a given employee. Gi

13、ve each column an appropriate label. Save the script to a file named lab_05_06.sql.7、The HR department needs a report on job grades and salaries. To familiarize yourself with the JOB_GRADES table, first show the structure of the JOB_GRADES table. Then create a query that displays the name, job, depa

14、rtment name, salary, and grade for all employees.8. The HR department wants to determine the names of all employees who were hired after Davies. Create a query to display the name and hire date of any employee hired after employee Davies. 9、The HR department needs to find the names and hire dates fo

15、r all employees who were hired before their managers, along with their managers names and hire dates. Save the script to a file named lab5_09.sql.Practice 61. The HR department needs a query that prompts the user for an employee last name. The query then displays the last name and hire date of any e

16、mployee in the same department as the employee whose name they supply (excluding that employee). For example, if the user enters Zlotkey, find all employees who work with Zlotkey (excluding Zlotkey).2. Create a report that displays the employee number, last name, and salary of all employees who earn

17、 more than the average salary. Sort the results in order of ascending salary.3. Write a query that displays the employee number and last name of all employees who work in a department with any employee whose last name contains a u. Place your SQL statement in a text file named lab_06_03.sql. Run you

18、r query.4. The HR department needs a report that displays the last name, department number, and job ID of all employees whose department location ID is 1700.Modify the query so that the user is prompted for a location ID. Save this to a file named lab_06_04.sql.5. Create a report for HR that display

19、s the last name and salary of every employee who reports to King.6、 Create a report for HR that displays the department number, last name, and job ID for every employee in the Executive department.If you have time, complete the following exercise:7. Modify the query in lab_06_03.sql to display the e

20、mployee number, last name, and salary of all employees who earn more than the average salary and who work in a department with any employee whose last name contains a u. Resave lab_06_03.sql as lab_06_07.sql. Run the statement in lab_06_07.sql. Practice 71.The HR department needs a list of departmen

21、t IDs for departments that do not contain the job ID ST_CLERK. Use set operators to create this report.2. The HR department needs a list of countries that have no departments located in them. Display the country ID and the name of the countries. Use set operators to create this report.3. Produce a l

22、ist of jobs for departments 10, 50, and 20, in that order. Display job ID and department ID using set operators.4. Create a report that lists the employee IDs and job IDs of those employees who currently have a job title that is the same as their job title when they were initially hired by the compa

23、ny (that is, they changed jobs but have now gone back to doing their original job).5. The HR department needs a report with the following specifications:-Last name and department ID of all the employees from the EMPLOYEES table, regardless of whether or not they belong to a department-Department ID

24、and department name of all the departments from the DEPARTMENTS table, regardless of whether or not they have employees working in themWrite a compound query to accomplish this.Practice 8The HR department wants you to create SQL statements to insert, update, and delete employee data. As a prototype,

25、 you use the MY_EMPLOYEE table, before giving the statements to the HR department.Insert data into the MY_EMPLOYEE table.1. Run the statement in the lab_08_01.sql script to build the MY_EMPLOYEE table to be used for the lab.2. Describe the structure of the MY_EMPLOYEE table to identify the column na

26、mes.2.Create an INSERT statement to add the first row of data to the MY_EMPLOYEE table from the following sample data. Do not list the columns in the INSERT clause. Do not enter all rows yet.4. Populate the MY_EMPLOYEE table with the second row of sample data from the preceding list. This time, list

27、 the columns explicitly in the INSERT clause.5. Confirm your addition to the table.6. Write an insert statement in a dynamic reusable script file named loademp.sql to load rows into the MY_EMPLOYEE table. Concatenate the first letter of the first name and the first seven characters of the last name

28、to produce the user ID. Save this script to a file named lab_08_06.sql.7. Populate the table with the next two rows of sample data listed in step 3 by running the insert statement in the script that you created.8. Confirm your additions to the table.9. Make the data additions permanent.Update and de

29、lete data in the MY_EMPLOYEE table.10. Change the last name of employee 3 to Drexler.11. Change the salary to $1,000 for all employees who have a salary less than $900.12. Verify your changes to the table.13. Delete Betty Dancs from the MY_EMPLOYEE table.14. Confirm your changes to the table. Practi

30、ce 9 1.Create the DEPT table based on the following table instance chart. Place thesyntax in a script called lab_09_01.sql, and then execute the statement in the script to create the table. Confirm that the table is created.2. Populate the DEPT table with data from the DEPARTMENTS table. Include only columns that you need.3. Create the EMP table

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2