Oracle enhanced exercise questions

Source: Internet
Author: User

Oracle enhanced exercise questions

Write simple query statements

1. display all information about the department table

Select * from dept;

2. display the Department number and department name

Selectdeptno, dname from dept;

3. display the following fields and the string connection: employee name, "1 month salary:", salary. For example, Amy's one-month salary is 8000.

Select ename | 'monthly salary: '| sal fromemp;

4. Display employee name, participation time, and work

Selectename, hiredate, job from emp;

5. Display employee Name: alias: Name, annual salary (monthly salary of 13 months): alias: annual salary. Note: The alias is case-insensitive.

Select ename "Name", (sal + nvl (comm., 0) * 13 "annualsalary" from emp;

6. display the employee name and job name as a string

Select concat (ename, job) From emp;

7. the following fields and string connections are displayed: employee name, "'s job is", and work name. For example, Amy's job is MANAGER. Note: single quotation marks must be displayed.

Select concat (ename ''s job is '), job) from emp;

8. display the Department number and work name in the employee table. duplicate values must be removed.

Select distinct deptno, job From emp;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.