SQL Examples
SQL Examples
2. Sum the salary of each employee and sort it on the sum of basic.
6.do the 5th question for employees who have basic greater than 20000.
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.