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;