A MySQL table named 'employees' was created to store employee details including ID, name, designation, and salary components. Five employees were inserted into the table, and their salary components were calculated based on their basic pay. Queries were executed to count total employees, find those with gross salaries between 5,000 and 15,000, and determine the maximum gross salary.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
6 views2 pages
Assignment 2
A MySQL table named 'employees' was created to store employee details including ID, name, designation, and salary components. Five employees were inserted into the table, and their salary components were calculated based on their basic pay. Queries were executed to count total employees, find those with gross salaries between 5,000 and 15,000, and determine the maximum gross salary.
-> FROM employees; +-----------------+ | total_employees | +-----------------+ | 5 | +-----------------+ 1 row in set (0.00 sec)
mysql> SELECT COUNT(*) AS employees_between_5k_and_15k
-> FROM employees -> WHERE GROSS BETWEEN 5000 AND 15000; +------------------------------+ | employees_between_5k_and_15k | +------------------------------+ | 2 | +------------------------------+ 1 row in set (0.00 sec)
mysql> SELECT MAX(GROSS) AS max_gross_salary
-> FROM employees; +------------------+ | max_gross_salary | +------------------+ | 22800.00 | +------------------+ 1 row in set (0.00 sec)