Professional Documents
Culture Documents
use cms
-- PMS_MANAGER_DETAILS TABLE
-- PMS_UNIT_DETAILS TABLE
-- PMS_PRODUCT TABLE
DEPARTMENT_ID INT(2));
-- PMS_PRODUCT_UNIT
-- PMS_MANUFACTURING TABLE
UNIT_ID VARCHAR(5) NOT NULL,QUANTITY INT(7) NOT NULL,AVAILABILITY VARCHAR(3) NOT NULL,
--Find the 2nd Highest Salary Earner of all the Managers. In select list we have
Manager_ID,Manager_Name,Job,Salary,Commission,Department_ID
SELECT MAX(SALARY) FROM PMS_MANAGER_DETAILS WHERE SALARY < (SELECT MAX(SALARY) FROM
PMS_MANAGER_DETAILS)
--Find out the Employees whose name has letter A in the 2nd position & are earning more than the
salary whose name starts with V. In select list we have MANAGER_ID, MANAGER_NAME, JOB, and
SALARY
AND SALARY >(SELECT SALARY FROM PMS_MANAGER_DETAILS WHERE MANAGER_NAME LIKE 'V%')
--Add 7.5% of salary as performance bonus for each employee and display the net yearly salary of each
employee. (Do not update the database.). In select list we have MANAGER_ID, MANAGER_NAME, JOB,
and YEARLY_SALARY
--Display the Manufactured products details that are belong to GHEE SECTION. In select list we have
MANFATURE_ID, PRODUCT_NAME, UNIT_ID, QUANTITY, PRODUCT_MANFACTURE_DATE, and
PRODUCT_EXPIRY_DATE.
SELECT
M.MANFATURE_ID,P.PRODUCT_NAME,P.PRODUCT_ID,M.UNIT_ID,M.QUANTITY,M.PRODUCT_MANFAC
TURE_DATE,
--Find the employees with higher salary than the average salary of MANAGER and those are all not
MANAGERS. In select list we have Manager_ID, Manager_Name and their Job details.
WHERE JOB NOT IN ('MANAGER') AND SALARY > (SELECT AVG(SALARY) FROM PMS_MANAGER_DETAILS
WHERE JOB='MANAGER')
--Display the manager details who are drawing the salary more than 20000 Rs/-. And we need to display
the manager name in proper case and order by department wise. In select list we have Manager_ID,
Manager_Name and Department_ID