0% found this document useful (0 votes)
42 views2 pages

ER/CORP/CRS/DB07/004 Version No. 1.1 10 10

1. The document describes creating two database tables, EMP and DEPT, to store employee and department data for a company. 2. It provides the column names and data types for each table, along with sample data to populate the tables. 3. The document then lists 18 queries to perform on the new tables to retrieve various summaries of employees, departments, salaries and other information.

Uploaded by

vaibhavbdx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views2 pages

ER/CORP/CRS/DB07/004 Version No. 1.1 10 10

1. The document describes creating two database tables, EMP and DEPT, to store employee and department data for a company. 2. It provides the column names and data types for each table, along with sample data to populate the tables. 3. The document then lists 18 queries to perform on the new tables to retrieve various summaries of employees, departments, salaries and other information.

Uploaded by

vaibhavbdx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Create a database called COMPANY consisting of two tables - EMP & DEPT

EMP
Column name Data type Description

EMPNO Number Employee number


ENAME Varchar Employee name
JOB Char Designation
MGR Number Manager’s Emp. number
HIREDATE Date Date of joining
SAL Number Basic Salary
COMM Number Commission
DEPTNO Number Department Number

DEPT
Column name Data type Description

DEPTNO Number Department number


DNAME Varchar Department name
LOC Varchar Location of department

Data for EMP


7369 Smith Clerk 7902 17/12/80 800 20
7499 Allen Salesman 7698 20/2/81 1600 300 30
7521 Ward Salesman 7698 22/2/81 1250 500 30
7566 Jones Manager 7839 2/4/81 2975 20
7654 Martin Salesman 7698 28/9/81 1250 1400 30
7698 Blake Manager 7839 1/5/81 2850 30
7782 Clark Manager 7839 9/6/81 2450 10
7788 Scott Analyst 7566 9/12/82 3000 20
7839 King President 17/11/81 5000 10
7844 Turner Salesman 7698 8/9/81 1500 0 30
7876 Adams Clerk 7788 12/1/83 1100 20
7900 James Clerk 7698 3/12/81 950 30
7902 Ford Analyst 7566 4/12/81 3000 20
7934 Miller Clerk 7782 23/1/82 1300 10

Data for DEPT table


10 Accounting New York
20 Research Dallas
30 Sales Chicago
40 Operations Boston

ER/CORP/CRS/DB07/004 Version No. 1.1 10


10
2. Perform the following queries on the tables just created :

1. List the names of analysts and salesmen.


2. List details of employees who have joined before 30 Sep 81.
3. List names of employees who are not managers.
4. List the names of employees whose employee numbers are 7369, 7521, 7839,
7934, 7788.
5. List employees not belonging to department 30, 40, or 10.
6. List employee names for those who have joined between 30 June and 31 Dec. ‘81.
7. List the different designations in the company.
8. List the names of employees who are not eligible for commission.
9. List the name and designation of the employee who does not report to anybody.
10. List the employees not assigned to any department.
11. List the employees who are eligible for commission.
12. List employees hose names either start or end with “S”.
13. List names of employees whose names have “i” as the second character.
14. List the number of employees working with the company.
15. List the number of designations available in the EMP table.
16. List the total salaries paid to the employees.
17. List the maximum, minimum and average salary in the company.
18. List the maximum salary paid to a salesman.
.

ER/CORP/CRS/DB07/004 Version No. 1.1 11


11

You might also like