Вы находитесь на странице: 1из 3

TABLE: EMP

EMPNO

ENAME

JOB

MGR

HIREDAT
E

7369

SMITH

CLERK

7902

17-DEC80

800

7499

ALLEN

SALESMAN

7698

20-FEB-81

1600

7521

WARD

SALESMAN

7698

22-FEB-81

7566

JONES

MANAGER

7839

02-APR-81

2975

7654

MARTIN

SALESMAN

7698

28-SEP-81

1250

7698

BLAKE

MANAGER

7839

01-MAY-81

2850

30

7782

CLARK

MANAGER

7839

09-JUN-81

2450

10

7788

SCOTT

ANALYST

7566

19-APR-87

3000

20

7839

KING

PRESIDEN
T

17-NOV81

5000

10

7844

TURNER

SALESMAN

7698

08-SEP-81

1500

7876

ADAMS

CLERK

7788

23-MAY-87

1100

20

7900

JAMES

CLERK

7698

03-DEC81

950

30

7902

FORD

ANALYST

7566

03-DEC81

3000

20

7934

MILLER

CLERK

7782

23-JAN-82

1300

10

Table: DEPT
DEPTNO

DNAME

LOC

10

ACCOUNTING

NEW YORK

20

RESEARCH

DALLAS

30

SALES

CHICAGO

40

OPERATIONS

BOSTON

SAL

1250

COMM

DEPTNO

20

300
500

30
30
20

1400

30

30

(a) To display the name, hiredate of all employees hired after Jan 10th 1980.
1
(b)
1
(c)
1
(d)
1
(e)
1

To display the department no., highest and lowest salary for each department.
To display the name of the employees whose job is in Clerk, Salesman, President.
To display the name and department name of all employees.
To display the name and salary of all the employees in the alphabetical order of name.

(a) To display the employee name, department name and department number.
(b) To display the ename, dname and loc of all employee who earn commission.
(c) To display the ename and dname of all the employees whose name starts with A.
(d) To display the name, department number for all employees who work as Clerks and
earns a salary more than 1000
(a) Write a Query to display the name of employee who is having L as any
alphabet of the name.
(b) Write a query to display the current system date.
(c) Create a query that produces display in the following format
<employee name> Earns $<salary> Monthly and working as <Job >
(d) Write a query to display the EName and DeptNo and DName for all
employees using tables Emp and Dept.
(e) Write a Query to display employee name, department name and location
of all employees who have manager number between 7500 and 7900.

1
1
1

1
1
1
1
1

(a) Display all the records (all columns) from table Emp.
1
(b) Display employee name and department name of all employees.
1
(c) Display Ename, Sal and Sal added with Comm from table Emp.
1
(d) Display EName joined with Job with heading Employee, Sal*12 as Total Salary from
table Emp.
1
(e) Display distinct Sal of employees from table Emp
(e)To display the employee number and employee name in the descending order of salary
(a) Write a Query to display name, job, salary, and HireDate of employees
who are hired between Jan-Feb. 20, 1981, and May 1, 1981. Order the
query in ascending order of HireDate.
(b) Write a Query to display the name and hire date of all employees who
were hired in 1982
1
(c) Write a Query to display the name, job title and salary of employee who do
not have manager.
1
(d) Write a Query to display the name of employee whose name contains A

as third alphabet.
(e) Write a Query to display employee name, department name and location
of all employees who have manager number between 7500 and 7900.

a) Write a Query to Display the employee names in descending order


1
(b) Write a Query to Display location and number of employees at each location
(c) Write a Query to Display the Sum, Average, Highest and Lowest salary of
the employees grouped by department number and sub-grouped by job.
(d) Write a query to display the difference of Highest and lowest salary of
each department having salary > 2000.
1
(e) Write a query to display employee name and salary of those who either
work in department 10 or have salary greater than 1200
1

1
1

Вам также может понравиться