0% found this document useful (0 votes)
73 views

SQL Examples

Very useful Sql examples

Uploaded by

Shoaib
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)
73 views

SQL Examples

Very useful Sql examples

Uploaded by

Shoaib
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
You are on page 1/ 1

SET VII

1.SUM THE SALARY OF EACH EMPLOYEE FROM THE SALARY TABLE.

2. Sum the salary of each employee and sort it on the sum of basic.

3.do the second question in descending order.

4. display empno, empname and sum(basic) in ascending order.

5.display empno,name, average salary of each employee in ascending order.

6.do the 5th question for employees who have basic greater than 20000.

7.add a new column to the table salary called as department

Display maximum, minimum,average and sum of basic for each department.

1. List employee numbers who earn less than the average salary.
2. Display empnumber, empname from employee where employee is not in marketing
department.
3. Display all the employee names who are in sls department.
4. Display all records from employee table where deduction <300.
5. Display salary table records and employee name of employees who had basic less than average
salary.
6. Delete from employee all records where deduction =150.
7. Create a table saldup which should be duplicate of salary.
8. Create a table saldup2 which should only have the structure of salary table.
9. Put data into saldup2 of employees of sls department.
10. Update saldup2 setting its basic and commission as sum of basic and sum of commission of
employee number1001 of department sls.
11. Display the list of employee names who are also customers.
12. Display all employee names who are not customers.
13. Display the names of all employees and customers.

You might also like