Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views1 page

Lab Assesment

Uploaded by

marufhasan7702
Copyright
© © All Rights Reserved
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% found this document useful (0 votes)
6 views1 page

Lab Assesment

Uploaded by

marufhasan7702
Copyright
© © All Rights Reserved
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
You are on page 1/ 1

--1.

Write a query to display the name of the employee, their hiredate and last date
combined and label it as working days.

SELECT ename, CONCAT(hiredate, ROUND(hiredate,'YEAR')) AS "WORKING DAYS"

FROM emp

--2. Write a query to show the names, ID, where id is between 7566 and 7839 whose
commission is null

SELECT ename, mgr,comm

FROM emp

WHERE mgr BETWEEN 7566 AND 7839 AND comm IS NULL

--3. Write a query to show ename, job, and total salary[commission+salary] where
commission is null

SELECT ename,job, NVL2(comm,comm+sal,sal)

FROM emp

WHERE comm IS NULL

--4. Write a query to show the name, job, sal and increase the salary of manager ,
clerk, salesman by 1.3, 1.5, 1.7 times in order

SELECT ename, job, sal,


DECODE(job,'MANAGER',sal*1.3,'CLERK',sal*1.5,'SALESMAN',sal*1.7) AS "NEW SALARY"

FROM emp

--5. Write a query to show the salary of the employee as character

SELECT ename || ' earns ' || TO_CHAR(sal,'$99,999.00')

FROM emp

You might also like