0% found this document useful (0 votes)
15 views1 page

Employee Salary Analysis and Sales Summary

The document outlines two tasks involving SQL queries. The first task is to identify employees earning above their department's average salary. The second task is to calculate the total sales amount for each customer who has made at least one purchase, including their names.

Uploaded by

Gaurav jangam
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)
15 views1 page

Employee Salary Analysis and Sales Summary

The document outlines two tasks involving SQL queries. The first task is to identify employees earning above their department's average salary. The second task is to calculate the total sales amount for each customer who has made at least one purchase, including their names.

Uploaded by

Gaurav jangam
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

1) Find the employees who earn more than the average salary in their department.

Tables:

employees

emp_id name salary dept_id


1 Alice 60000 10
2 Bob 75000 10
3 Charlie 50000 20
4 David 80000 20
5 Eva 55000 10

Find the total sales amount for each customer who made at least one purchase. Include the
customer name and total sales.

📋 Tables:

customers

customer_id customer_name

1 Alice

2 Bob

3 Charlie

orders

order_id customer_id amount

101 1 150

102 2 200

103 1 100

104 3 250

You might also like