-
mysql> select SUM(age) from employee_data;
+----------+
| SUM(age) |
+----------+
| 664 |
+----------+
1 row in set (0.00 sec)
-
mysql> select SUM(yos) from employee_data;
+----------+
| SUM(yos) |
+----------+
| 56 |
+----------+
1 row in set (0.00 sec)
-
mysql> select SUM(salary), AVG(age)
-> from employee_data where
-> title = 'Programmer';
+-------------+----------+
| SUM(salary) | AVG(age) |
+-------------+----------+
| 300000 | 30.5000 |
+-------------+----------+
1 row in set (0.00 sec)
- This displays the percentage of salary that is given as perks to the employees of Bignet.
mysql> select (SUM(perks)/SUM(salary) * 100)
-> from employee_data;
+--------------------------------+
| (SUM(perks)/SUM(salary) * 100) |
+--------------------------------+
| 19.53 |
+--------------------------------+
1 row in set (0.00 sec)