Database System
Database System
TASK 1:
TASK 2:
TASK 3:
Select all the unique jobs from employee table. Name the column as Distinct jobs.
ANSWER:
select unique job as "Distinct jobs" from emp
TASK 4:
Display name, Salary and job of an employee in the following format with column
name as My job information.
ANSWER:
select ename ||' job is '|| job ||' and salary is '|| sal as "My Job Information" from emp;
TASK 5:
TASK 6:
TASK 7:
TASK 9:
Display grade and difference between high and low salary as Difference from
salgrade table.
ANSWER:
select grade,losal,hisal,hisal - losal as difference from salgrade;
TASK 10:
Write a query to display all the data from the Dept table. Separate each
column by a comma , Name the column The_Output as given in image below
ANSWER:
select deptno ||','|| dname ||','|| loc as "OUTPUT" from dept;
TASK 11:
TASK 12:
Name the column headings as Emp#, Employee, Job, and Hire Date. respectively.
Rerun your query
ANSWER:
select empno as "Emp#",ename as "employee", job , hiredate as "hire date" from emp
TASK 13:
Display the name concatenated with the job. Separated by a comma and space,
and name the column Employee and Title.
ANSWER:
select ename ||', '|| job as "Employee and Title" from emp