- 1、本文档共31页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
sql练习(国外英语资料)
sql练习
Second chapters
1. displays all the information for department tables
SELECT *
FROM departments;
2. display department number, department name
SELECT department_id,
Department_name
FROM departments;
3. displays the following field and string connections: employee name, 1 months salary: salary. Such as: Amy 1 months salary: 8000
SELECT first_name||||last_name|| a months salary is:||salary
FROM employees;
4. show the employees name, work time and work
SELECT first_name,
Hire_date,
Job_id
FROM employees emp;
5. display employee name: alias Name, annual salary (13 months monthly salary): alias annual salary. Note: alias case
SELECT first_name Name,
Salary*13 annual salary
FROM employees;
6. display the employees name and job name (job) as a string
SELECT first_name||||last_name||job_id
FROM employees;
7. displays the following field and string connections: employee name,s, job, is, and work name. Such as: Amys, job, is, MANAGER note: single quotation marks need to be displayed
SELECT, first_name||.||last_name||s, job, is||job_id, MANAGER
FROM employees;
8. display the department number, the job name in the employees table, and ask for the duplicate value to be removed
SELECT DISTINCT department_id,
Job_id
FROM employees;
Third chapters
1. show number 10, department name
SELECT department_id,
Department_name
FROM departments
WHERE department_id=10
2. show the name of the employee who participated in the work 82 years ago, the time of work and the name of the work
SELECT first_name,
Last_name,
Hire_date,
Job_id
FROM employees
WHERE hire_date to_date (98,yy);
3. show the employees name of the name Ellen, the time of work and the name of the job
SELECT first_name,
Hire_date,
Job_id
FROM employees
WHERE first_name=Ellen
4. shows the salary of employees between 2000 and 4000, name, salary
SELECT employee_id,
Salary
FROM employees
WHERE salary BETWEEN 2000 AND 4000
5. shows the general managers name
SELECT first_name||||last_name
FROM employees
WHERE manager_id IS NULL
文档评论(0)