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

GROUPBY Assignment

The document outlines an assignment to create an EMP table with specified attributes and constraints for employee data. It includes a series of SQL queries to perform various operations on the table, such as displaying employee details, filtering by department, job roles, and salary conditions. The assignment emphasizes mandatory fields and unique entries for employee IDs.

Uploaded by

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

GROUPBY Assignment

The document outlines an assignment to create an EMP table with specified attributes and constraints for employee data. It includes a series of SQL queries to perform various operations on the table, such as displaying employee details, filtering by department, job roles, and salary conditions. The assignment emphasizes mandatory fields and unique entries for employee IDs.

Uploaded by

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

ASSIGNMENT

Create table EMP with the attributes Emp_ID, Emp_Name, job, Manager,
Hire_Date, Salary, Commission, and Dept. It is mandatory to enter employee ID
and the same can not be repeated. Every employee must have a name then only
their details can be entered in the table. Similarly, salary component can not be
left blank for any employee. Each employee belongs to either dept 10, 20, or 30.
Enter the records in the table as shown below:

Using the above table write the following queries:


A. Display the content of the table.

B. Display the hiring dates of dept 20 or 30.

C. Display all the analyst information from the table.

D. Display the unique jobs in the table.

E. Display the id and salary of all employees whose name has the letter ‘e’ and
‘l’.
F. Display the employees details whose commission data is unknown.

G. Display the highest and lowest salary of the table.

H. Display the Emp_ID, Emp_name and Salary for salesman only.

I. Display the the details of the employee who is getting minimum salary.

J. Display the details of the employee who works under the manager 7698 and
getting highest commission.

K. Display the total salary of the employees working under 7839.

L. Display the dept and avg salary of the employees in dept wise manner.

M. Display the dept and avg salary of the employees in dept wise manner only
when avg salary > 2000.

N. Display the dept and avg salary of only those employees whose salary > 2000
in dept wise manner.

O. Display the dept and avg salary of only those employees whose salary > 2000
in dept wise manner only when avg salary < 3000.

You might also like