Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1- Write a query to display the names (first_name, last_name) from employees tab

ID: 3588643 • Letter: 1

Question

1- Write a query to display the names (first_name, last_name) from employees table using alias name “First Name", "Last Name"

2- Write a query to display the names (first_name concatenate last_name) from employees table using alias name “Employee Name"

3- Write a query to get unique department ID from employee table

4- Write a query to get all employee details from the employee table

5- Write a query to get the employee ID, first_name, last_name, salary for employees who make more than 15000

6- Write a query to get the employee ID, first_name, last_name, department ID for the employees who don't work in department ID 80

7- Write a query to get all data from the jobs table

8- Write a query to get the employee ID, first_name, last_name, salary for employees who make 6000 and less

**********

9- Write a query to display the first name and hire date of the employees who joined between 2001 and 2007, order by the hire date.

10- Write a query to display first name and hire date of the employees whom job id either ST_CLERK or IT_PROG.

11- Write a query to display first name, last name of employees who joined after 1st January 2005.

12- Write a query to display all details of employee with ID 180 or 120.

13- Write a query to display all details of jobs in the descending order of the job title.

14- Write a query to display employees where the first name or last name starts with J.

15- Write a query to display first name, last name,hire date of employees who joined in the month of January of any year.

16- Write a query to display first name and last name after converting the first letter of each name to upper case and the rest to lower case.

17- Write a query to display first name, last name of employees who joined in the current year (use sysdate) ordered by first name.

18- Insert a new employee into employees with all the required details.

19- Delete department id 20.

20- Change job ID of employee 110 to IT_PROG if the employee belongs to department 10 and the existing job ID does not start with IT.

Explanation / Answer

1.Select first_name “First Name", last_name "Last Name" from employees
2.select first_name || last_name “Employee Name" from employees
3.select distinct departmentID from employees
4.select * from employees
5.select employeeID, first_name, last_name, salary from employees where salary > 15000
6.select employeeID, first_name, last_name, departmentID from employees where departmentID not in (80)
7.select * from jobs
8.select employeeID, first_name, last_name, salary from employees where salary < 6000
9.select first_name,hire_date from employees where to_char(hire_date, 'YYYY') between 2001 and 2007 order by hire_date
10.select first_name,hire_date from employees where job_id in ('ST_CLERK','IT_PROG')
11.select first_name, last_name from employees where hire_date > '1-JAN-2005'
12.select * from employees where employeeID in (180,120)
13.select * from jobs order by job_title desc
14.select * from employees where first_name like 'J%' or last_name like 'J%'
15.select first_name, last_name,hire_date from employees where to_char(hire_date, 'MON')= 'JAN'
16.select initcap(first_name), initcap(last_name) from employees
17.select first_name, last_name from employees where to_char(HIRE_DATE,'YYYY')=to_char(SYSDATE, 'YYYY') order by last_name
18.insert into employees (EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE,JOB_ID, SALARY, DEPARTMENT_ID)
VALUES (158, 'PAUL', 'ALEXANDER','PAUL','508 253 1508', SYSDATE, 'SA_MAN', 77000, 70)
19.delete from departments where departmentID =20
20.update employees set job_id= 'IT_PROG'
where employeeID =110 and departmentID=10 and not job_id like 'IT%'