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 / sravan
You can also solve it by using sub-query
SELECT DISTINCT NAME FROM EMP E
WHERE SAL>2000 AND SAL<3000
AND E.DEPTID IN (SELECT D.DEPTID FROM DPT D
WHERE DEPTNAME='X');
thanks
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is data abstraction in sql?
How do you create a db file?
Which is faster truncate or drop?
What is an implicit commit?
What is difference sql and mysql?
What are the parts of a sql statement?
What is difference between rank () row_number () and dense_rank () in sql?
Determine if oracle date is on a weekend?
What is partition by in sql?
what is sql server agent? : Sql dba
What is a .db file?
What is trigger in flip flop?
what is a constraint? Tell me about its various levels. : Sql dba
What company owns postgresql?
What type of database is cloud sql?