0% found this document useful (0 votes)
0 views

Assignment No - 2

2222

Uploaded by

sammed biraje
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Assignment No - 2

2222

Uploaded by

sammed biraje
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Assignment No -2 Database Technology

Name- Sammed Vijay Biraje

1. Create a query to display the last name and salary of employees earning
more than $12,000.
Query-
select last_name, salary from employees where salary > 12000;
Output-

2. Create a query to display the employee’s last name and department number
for employee number 176.
Query-
select last_name, department_id from employees where employee_id = 176;
Output-
3. display the last name and salary for all employees whose salary is not in the
range of $5,000 and $12,000.
Query-
select last_name, salary from employees where salary not between 5000 and
12000;
Output-

4. Display the employee last name, job ID, and start date of employees hired
between February 20, 1998, and May 1, 2002. Order the query in ascending
order by start date.
Query-

Output-

5. Display the last name and department number of all employees in


departments 20 and 50 in alphabetical order by name.
Query-
select last_name, department_id from employees where department_id in (2,
5) order by last_name asc ;
Output-

6. list the last name and salary of employees who earn between $5,000 and
$12,000, and are in department 20 or 50. Label the columns Employee and
Monthly Salary, respectively.
Query-
select last_name as "Emplyoee", salary as "Montly Salary" from employees
where (salary between 5000 and 12000) and department_id in (2, 5);
Output-

7. Display the last name and hire date of every employee who was hired in
1994.
Query-
select last_name, hire_date from employees where extract(year from
hire_date) = 1994;
Output-

8. Display the last name and job title of all employees who do not have a
manager.
Query-
Output-

9. Display the last name, salary, and commission for all employees who earn
commissions. Sort data in descending order of salary and commissions.
Query-
Output-

10. Display the last names of all employees where the third letter of the name
is an a.
Query-
select last_name from employees where first_name like "__a%";
Output-

11. Display the last name of all employees who have an a and an e in their last
name.
Query-
select last_name from employees where last_name like "%a%e%";
Output-

12. Display the last name, job, and salary for all employees whose job is sales
representative or stock clerk and whose salary is not equal to $2,500, $3,500,
or $7,000.
Query-
Output-

13. display the last name, salary, and commission for all employees whose
commission amount is 20%.
Query-
Output-

14. Display the country names in region id 2.


Query-
select country_name from countries where region_id = 2;
Output-

15. Display the region name of region id 2.


Query-
select * from regions where region_id = 2;
Output-
16. Display all the office addresses those are in US.
Query-
select * from locations where country_id = 'us';
Output-

17. Display the department names which are in location 1700.


Query-
select department_name from departments where location_id = 1700;
Output-

You might also like