Malik Raheel Ahmad (12349) Data Base
Malik Raheel Ahmad (12349) Data Base
Malik Raheel Ahmad (12349) Data Base
Sap id 12349
Data base lab test
1) Write a query that displays the last name and salary of employees who earn more than
$12,000 salary.
2) Create a query to display the last name and salary for any employee whose
salary is not in the range of $5,000 to $12,000
3 Create a query to display the last name and department number of all
employees in departments 20 or 50 in ascending alphabetical order by name.
select last_name ,department_id from employees where department_id IN
(20,50) order by last_name;
4) Write a query to display the First name, last name, job ID, and start date for
the employees with the last names of Matos and Taylor. Order the query in
ascending order by start date.
5) Write a query to display the last name and job title of all employees who do
not have a manager.
SELECT last_name, job_id FROM employees WHERE manager_id IS NULL;
6) Write a query to display all employee last names in which the third letter of
the name is a
7) Write a query to display the last names of all employees who have both an a
and an e in their last name.
SELECT EMPLOYEE_ID,LAST_NAME,SALARY,SALARY+(SALARY*15.5/100)
NEW_SALARY FROM EMPLOYEES;
9) Write a query to display to display the last name and salary for all employees.
Format the salary to be 15 characters long, left-padded with the $ symbol. Label
the column SALARY
10) Create a report to display the current date. Label the column Date.
Select sysdate "Date" from dual;
11) Write a query to display the average and maximum salary of those
employees who have odd employee number