suppose I have two table one Emp and other is dpt.
Emp table has a field ,dept id,name ,sal and dpt table has a
field dept id,dept name.
Now I want to find out the emplyee list whose sal is between
2000-3000 from dept x.

Answer Posted / abhishekjaiswal

select e.department_id,e.last_name,e.salary,d.department_name from employees e,
departments d 
where e.department_id=d.department_id and 
e.salary between 2000 and 10000 
and lower(d.department_name)='finance'
/
Out put
DEPARTMENT_ID LAST_NAME                     SALARY DEPARTMENT_NAME
------------- ------------------------- ---------- --------------------
          100 Faviet                          9000 Finance
          100 Chen                            8200 Finance
          100 Sciarra                         7700 Finance
          100 Urman                           7800 Finance

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we write ddl statements in functions?

559


what is isam? : Sql dba

568


How many types of index are there?

541


What are triggers and its types?

547


explain the difference between bool, tinyint and bit. : Sql dba

517






What is the difference between drop and truncate commands?

478


Write an sql query to select all records from the table?

551


What is sql partition?

546


What is a database event trigger?

581


What does pragma mean?

499


What type of database is sql?

613


which command using query analyzer will give you the version of sql server and operating system? : Sql dba

517


Is json a nosql?

533


Are there any features that are decommissioned in 11g that are not present in 11g?

1583


Does execute immediate commit?

688