Write the SQL query questions from (i) to (iv) and write the output of SQL command for questions from (v) to (vii) given below:
| EMPID | FIRST NAME | LAST NAME | ADDRESS | CITY |
| 010 | George | Smith | 83 First Street | Howard |
| 105 | Mary | Jones | 842 Vine Ave. | Losantiville |
| 152 | Sam | Tones | 33 Elm St. | Paris |
| 215 | Sarah | Ackerman | 440 U.S. 110 | Upton |
| 244 | Manila | Sengupta | 24 Friends Street | New Delhi |
| 300 | Robert | Samuel | 9 Fifth Cross | Washington |
| 335 | Henry | Williams | 12 Moore Street | Boston |
| 400 | Rachel | Lee | 121 Harrison St. | New York |
| 441 | Peter | Thompson | 11 Red Road | Paris |
Table: EMPSalary
| EMPID | SALARY | BENEFITS | DESIGNATION |
| 010 | 75000 | 15000 | Manager |
| 105 | 65000 | 15000 | Manager |
| 152 | 80000 | 25000 | Director |
| 215 | 75000 | 12500 | Manager |
| 244 | 50000 | 12000 | Clerk |
| 300 | 45000 | 10000 | Clerk |
| 355 | 40000 | 10000 | Clerk |
| 4000 | 32000 | 7500 | Salesman |
| 441 | 28000 | 7500 | Salesman |
Write the SQL commands for the following :
(i) To show firstname, lastname, address and city of all employees living in paris.
(ii) To display the content of Employees table in ascending order of Firstname.
(iii) To display the firstname,lastname and total salary of all managers from the tables employee and empsalary, where total salary is calculated as
salary+benefits.
(iv) To display the maximum salary among managers and clerks from the table Empsalary.
Give the Output of following SQL commands:
(v) Select firstname, salary from employees, empsalary where designation = ‘Salesman’ and Employees.
empid=Empsalary.empid;
(vi) Select count(distinct designation) from empsalary;
(vii) Select designation, sum(salary) from empsalary group by designation having count(*) >2;
