Jagan Institue of Management Studies: Sector-5, Rohini, New Delhi

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

JAGAN INSTITUE OF MANAGEMENT STUDIES

SECTOR-5, ROHINI, NEW DELHI

(AFFILIATED TO)

GURU GOBIND SINGH INDRAPRASTHA UNIVERSITY


SECTOR-16C, DWARKA, NEW DELHI

DBMS PRACTICAL
SUBMITTED TO: SUBMITTED BY:
Dr. Suman Madan JAI NARULA MCA (1ST
SHIFT)-1st SEM
INDEX:

sno. Program Page No. Signature


1. Query Sheet 1 1-5

2. Query Sheet 2 6-12

3. Query Sheet 3 13-17

4. Query Sheet 4 18-22

5.

6.

7.

8.

9.

10.

11.

12.

13.

14.

15.

16.

17.

18.

19.

20.
DBMS
PRACTISE QUERY SHEET - 1

1. Display contents of EMP Table

2. Display employee name, job title and salary of all employees.

3. Display details of all employees working in Department 10.


4. Display details of all employees working as Manager.

5. Display all jobs in an organization.

6. Display number of all departments where employees are working


7. Display details of all employees with their annual salary.

8. Display number of all departments where employees are working

9. Display details of employees who are not working in 10 and 20.


10. Display the names and job titles of all employees whose salary is either 1000 or
3000 or 5000.

11. Display employee number, salary, job of all employees of department 20.

12. Display employee number and name of those employees who do not earn
commission.
13. Display details of all those employees who were hired before 1st Jan 1982.
DBMS
PRACTISE QUERY SHEET - 2

1. Display total number of employees working in the department.

2. Display employee number, name of the employees, who do not earn


commission and they are not clerks.
3. Display details of all those employees who were hired in year 1981.

4. Display employee number, salary and department number of all employees,


department wise.
5. Display minimum and maximum salaries in organization.

6. Display maximum salaries department wise.

7. Total number of employees who are not entitled for commissions.

8. Calculate job wise average salary

.
9. Display names, employee number of all employees whose name starts with
letter ‘J’ and ends with ‘S’; and were hired before ‘1st-January-1982’.

10.Display employee number and department number of all employees who are
earning more than 1000 and whose name has second letter as ‘I’ and working
in department 10.

11. Display details of employee earning salary 3000 or 5000 and their name starts
with ‘S’ and ends with ‘T’.
12. Display details of employee who are not managers.

13.Display details of employees who were hired before 1982 and they are not
Managers and President.
14. Display employees earning salaries more than 1000 and less than 5000.

15. Display employees whose 3rd letter is ‘A’ and ends with ‘K’.

16.Display employee name, annual salaries of employees working in department


10 or 20 and their job is not clerk.
17. Display employee whose name contains ‘r’.

18. Display all jobs in department 10.


DBMS
PRACTISE QUERY SHEET - 3

1. For each employee, display the employee number, name, salary, and salary
increased by 15%. Label the column New Salary.
2. Display the employee’s names with the first letter capitalized and all other
letters lowercase, and the length of the names, for all employees whose name
starts with J,A or M. Sort the results by the employees’ names.

2. Display the name, job, department name, salary, and grade for all
employees.
3. Display the employee’s name, job, department name and department number
for all employees who work in NEW YORK.

4. Display details of all employees who are in grade 1.

5.Display employee name, dname and salary grade of all employees whose
name has ‘A’ and ‘N’ in their name.
6. Display employee details with department details of employee who are in
grade 1 or 2.

7. Display details : employee no, name, dname, location, job and grade of all
employees who are earning more than 2500.

8. Display employees who are getting salary equal to the maximum salary.
9. Display number of employees working in each department in descending
order.

DBMS
PRACTISE QUERY SHEET - 4

1. Create a query to display all the data from the EMP table, separate each
column by a comma. Name the column THE_OUTPUT.
2. Display the name concatenated with the job, separated by a comma and a
space, and name the column ‘EMPLOYEE_AND_TITLE’.

3. Display the employee if an employee is a president or a sales representative


and if the employee earns more than 5000.

4. Display the name and salaries of all the employees. Order the result by
Department number and then in decreasing order of salary.
5. Display the last name, salary and commissions of all employees who earn
commissions. Sort data in descending order of commissions.

6. Display the name, job, and salary of all employees whose job is sales
representative or Clerk and whose salary is not equal to 2500, 3500, 7000.
7. Display of average salaries of those departments that have an average salary
greater than 2000.

8. Display the highest, lowest, sum and average salary of all employees, label the
columns maximum, minimum, sum, and average respectively.

9.Write a query to display the number of people with the same job.
10. Determine the number of managers without listing them, label the column
number of managers.
11 .Display the job and total monthly salary for each job with a total payroll
exceeding 2000. Exclude salesman and sort the list by the total monthly salary

You might also like