You are on page 1of 4

(a) List the names and employee number of all employees.

(b)Display all the columns and rows of dept table.

(c) Show all details of the emp table. Create a query to display the employee
number, name, job, hire date for each employee.
(d)Name the above column headings as Emp #, Employee, Job, and Hire Date,
respectively.

(e) Create a query to display unique job names from the emp table.
(f) Display the employee names concatenated with the jobs, separated by a comma
and space, and rename the column as Employee and Title.

(g)Create a query to display all the data from the emp table. Separate each column
by a comma. Replace null values with 0.Name the column THE_OUTPUT.
select
concat(concat(concat(concat(concat(concat(concat(concat(concat(concat(concat(concat(con
cat(concat(concat('',empno),','),ename),','),job),','),COALESCE(mgr,0)),','),hiredate),','),sal),','),
COALESCE(comm,0)),','),deptno) as The_Output from emp;

(h)Display name, salary, annual compensation of employees. It calculates the


annual compensation as monthly salary plus a monthly bonus of 100, multiplied by 12.
(i) Display name, salary, annual compensation of employees. It calculates the
annual compensation as 12 multiplied by monthly salary plus one time bonus of 100.

(j) Display name, salary, annual compensation of employees. It calculates the annual
compensation as monthly salary multiplied by 12 and then add commission to it.

You might also like