Employee Management System (EMS) : I. Complete The Following Assignment
Employee Management System (EMS) : I. Complete The Following Assignment
I.
i.
ii.
Insert four rows in Dept table and eight rows in Emp table as per the sample
data provided below.
Emp Table:
Empno
7650
Ename
JAMES
Job
MANAGER
Mgr
7652
7651
SCOTT
CLERK
7656
7652
JOHN
CLERK
7653
STEPHEN
CLERK
7652
7654
7655
SAM
BOB
ANALYST
ANALYST
7657
7656
WILLIAM
MANAGER
7657
7657
TOVE
CLERK
Hiredate
12-121998
11-41990
23-31997
13-32002
8-9-2005
13-52004
13-32002
8-9-2005
MySql CaseStudy
Sal
50000
Comm
1000
Deptno
30
13000
400
20
4000
300
30
3600
1200
10
23000
28000
300
700
10
20
40000
1200
30
3000
300
20
ii.
iii.
Dname
SALES
MARKETING
FINANCE
ADMINISTRATION
Location
DALLAS
NEW YORK
TEXAS
WASHINGTON
III.
Use Emp and Dept table and complete the following assignment:
i.
ii.
iii.
iv.
Display Empno, name, salary, and Deptno in the ascending order of employee
number using the table Emp and Dept.
Display Empno, name, salary, and Deptno in the ascending order of department
number and within department - in descending order of employee number using
the table Emp and Dept.
Display one occurrence of each job from the Emp table.
Display employee number, name, salary, and date of joining for those employees
who have joined after 28th September 1981 using the table Emp and Dept.
IV.
Use table Emp and Dept and complete the following assignment:
i.
ii.
Display employee number, name, salary for those employees with salary
between 1500 and 5000, and whose name contains the string na.
Add a bonus column to your query whose value is 15% of salary for those
drawing less than a salary of 3500.
MySql CaseStudy
iii.
V.
i.
ii.
iii.
iv.
ii.
iii.
Write a query that displays the employee names and commission amounts. If an
employee does not earn any commission, then provide No Commission as the
commission amount. Label the column as COMM.
Write a query to display the number, name, and job of those employees who are
hired between 1981 and 1995.
Write a query to list out the names of the employees who have worked for more
than 20 years.
VII.
i.
ii.
iii.
iv.
iii.
Write a query to display the employee name, department name, location of all
employees who earns commission. Use Emp and Dept table.
Write a query using Emp and Dept table to list the employee names along with
the names of the departments they are working in. The query should select the
names of those departments also, which do not have related records in Emp
table.
Write a query to retrieve the names and hiredates of the employees along with
the names and hiredates of their managers from Emp table.
iii.
MySql CaseStudy