Practical 4 21ss02it056
Practical 4 21ss02it056
Practical 4 21ss02it056
Practical – 4
2) Count the total number of employees who live in the ‘United States of America’ and
‘Germany’.
Query: select count(*) from countrymaster3 WHERE COUNTRY_NAME ='united states of
america' OR COUNTRY_NAME='germany';
Output:
1|Page
JASH SABHAYA 21ss02it056 c7
2|Page
JASH SABHAYA 21ss02it056 c7
3|Page
JASH SABHAYA 21ss02it056 c7
4|Page
JASH SABHAYA 21ss02it056 c7
9) Find all the employees who are earning salary greater than
5000 rupees and sort themas per their hiring date.
Query: select * from EmployeeMaster1 where SALARY>5000 order by
HIRE_DATE ASC;
Output
5|Page
JASH SABHAYA 21ss02it056 c7
11) Double the salary of all the employees who are working as
‘Senior Clerk’ in the company.
Query: select salary*2, job_id from EmployeeMaster1 where job_id in
'ST_CLERK';
Output
6|Page
JASH SABHAYA 21ss02it056 c7
7|Page
JASH SABHAYA 21ss02it056 c7
8|Page
JASH SABHAYA 21ss02it056 c7
13) Find all the job titles whose minimum earning between 6000
to 10000 rupees and arrange them in descending order as per
their maximum salary.
Query: select JOB_TITLE from JobMaster where MIN_SALARY between
'6000' and '10000' order by MAX_SALARY DESC;
Output
15) List out all the rows where job_id starts from ‘AD_’ to ‘ST_’.
9|Page
JASH SABHAYA 21ss02it056 c7
16) Count the all employees who live in the postal_code starting
with ‘9’ and ‘O’.
Query: select COUNT(*) from locationmaster where POSTAL_CODE like
'9%' or POSTAL_CODE like'0%';
Output
10 | P a g e