0% found this document useful (0 votes)
43 views11 pages

1.select First - Name, Department - Id From Employees Where Last - Name 'De Haan'

The document contains 21 SQL queries that select data from the employees and departments tables. The queries filter on various columns like last_name, department_id, salary and hire_date. They use operators like =, <, >, BETWEEN, IN, IS NULL, LIKE and OR to select matching rows and optionally sort the results.

Uploaded by

NIZAR MOHAMMED
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views11 pages

1.select First - Name, Department - Id From Employees Where Last - Name 'De Haan'

The document contains 21 SQL queries that select data from the employees and departments tables. The queries filter on various columns like last_name, department_id, salary and hire_date. They use operators like =, <, >, BETWEEN, IN, IS NULL, LIKE and OR to select matching rows and optionally sort the results.

Uploaded by

NIZAR MOHAMMED
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

1.

select first_name,department_id from employees where last_name='De Haan';

Select*from employees

2.select* from departments where department_name='Sales';


3.select first_name,last_name,department_id,salary from employees where salary>9700;

4.select first_name,last_name,hire_date from employees where (hire_date)<'01-jan-92';


5.select first_name,last_name,department_id,job_id from employees where (department_id) not in
(20,60,80);

6.select first_name,last_name,department_id,job_id from employees where (department_id) in


(20,60,80);
7.select first_name,last_name,phone_number,salary,manager_id from employees where (manager_id)
in (100,102,103);

8.select first_name,salary from employees where (first_name) like('%e');


9.select last_name,department_id from employees where (last_name) like('_i%');

10.select*from employees where last_name like '%l%'

or last_name like '%j%'

or last_name like '%h%'

order by salary desc;


11.select first_name,hire_date,salary,department_id from employees where first_name not like('%a')
order by department_id asc;

12.select*from employees

where department_id is null;


13.select first_name||','||last_name as full_name,salary from employees where salary not between
7000 and 150000 order by first_name,last_name asc;

14.select first_name||','||last_name as full_name,phone_number||','||email as contacts,salary as sal


from employees where salary between 5000 and 10000;
15.select*from employees where salary between 6000 and 8000 and commission_pct is not null or
department_id not in( 80,90,100) and hire_date < '01-jan-1990';

16.select last_name,job_id,hire_date from employees where (hire_date)in('12-dec-1995') and


(hire_date)in('17-apr-1998');

17.select first_name,last_name,hire_date,phone_number,salary,commission_pct from employees


where salary > 10000 or phone_number = ('__5%') order by first_name desc;
18.select last_name,salary from employees where salary>'12000'
19. Select last_name,department_id from employees where department_id in (50) or department_id in
(80);

20.select first_name,last_name,commission_pct from employees where commission_pct is null;


21.select first_name,last_name,manager_id from employees where manager_id is not null;

You might also like