The document outlines a series of database queries related to employee data for a lab assignment at the National University of Modern Languages. It includes tasks such as displaying employee names and commission amounts, calculating salary statistics, and using SQL functions like DECODE and CASE. The queries aim to analyze employee job types, salaries, and hiring statistics across different years.
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 ratings0% found this document useful (0 votes)
3 views
Lab11
The document outlines a series of database queries related to employee data for a lab assignment at the National University of Modern Languages. It includes tasks such as displaying employee names and commission amounts, calculating salary statistics, and using SQL functions like DECODE and CASE. The queries aim to analyze employee job types, salaries, and hiring statistics across different years.
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/ 7
NATIONAL UNIVERSITY OF MODERN LANGUAGES
DATA BASE SYSTEM
DEPARTMENT : BS-SE 4TH SEMESTER LAB 11
SUBMITTED BY:
Ahmed Mehmood RCF30145
SUBMITTED TO:
MAM SEHRISH FIRDOUS
1. Create a query that displays the employee’s name and commission amounts. If an employee does not earn commission, put “000”. Label the column COMM.
2 . Using the DECODE function, write a query that displays
the grade of all employees based on the value of the column JOB_ID, as per the following data 3. Display the highest, lowest, sum, and average salary of all employees. Label the column Maximum, Minimum, Sum and Average respectively.
4 .Modify the above query to display maximum, minimum,
sum and average salary for each job type. 5 Rewrite the statement in the preceding question using the CASE syntax.
6. Write a query to display the number of people with the
same job. 7 . Determine the number of managers without listing them. Label the column “Number of Columns”.
8 . Write a query that displays the difference between
highest and lowest salaries. Label the column “Difference” 9 Display the manager number and salary of the lowest paid employee for the manager. Exclude anyone whose manager is not known. Exclude any groups where the minimum salary is less than $6,000. Sort the output in descending order of salary.
10 Create a query that will display the total number of
employees and, of that total, the number of employees hired in 1981, 1982 and 1983. Create appropriate column headings.\ 11 .Create a query that display the job, salary for that job based on department number, and total salary for that job, for department 10, 20, 30 and 40, giving each