Difference between join and a subquery?

Answers were Sorted based on User's Feedback



Difference between join and a subquery?..

Answer / kiran

subquery can be used for simple logical queries , to get
required output/condition

but if you want to compare two or more tables and get output
in the way you want it would be lot difficult to manage all
those with subqueries - so we can use the concept of joins

Is This Answer Correct ?    39 Yes 5 No

Difference between join and a subquery?..

Answer / maddy

Subquery is also query which returns one or more values we
can retriew the data based on the where contd="IN,ALL"...
subquery is the query followed by the main query....

join is used to join the two table is used to retriew the
data from 1 or more tables.....

Is This Answer Correct ?    27 Yes 12 No

Difference between join and a subquery?..

Answer / neo devan

A query inside a query or next level query is called
subquery, a subquery can return 1 or more values to the
main query.
Ex: select * from emptable where deptno=(select deptno from
saltable where rownum=1);

A Join is used to query two tables, or views.
Ex: select * from emptable inner join saltable on
emptable.deptno=saltable.deptno;

Is This Answer Correct ?    18 Yes 7 No

Difference between join and a subquery?..

Answer / bhuvana

Joins-
1.Want to combine and fetch data from more than 2 tables.
2.Joins are faster, efficient, easy to understand and better performance.
Subquery-
Want to combine and fetch data from a pair of table.

Is This Answer Correct ?    10 Yes 3 No

Difference between join and a subquery?..

Answer / katty

When data is to be retrieved from one table based on the condition from another table subquery is used 
When the data is to be retrieved from both the tables join is used

Is This Answer Correct ?    10 Yes 5 No

Difference between join and a subquery?..

Answer / diksha bhatia

the given answers is right

Is This Answer Correct ?    7 Yes 3 No

Difference between join and a subquery?..

Answer / ashi

Sub query: The sub query has more than one select
statement,the inner query which executes first and then it
will be the value of the 2nd query.
EX:
select ename from emp where sal>(select avg(sal) from emp);

Joins:
When the data from more than one table in the database,then
a join condition used.Rows in the one table can be joined to
rows in the other table according ro the common values
existing in corresponding columns
EX:
select dname,ename from emp,dept where emp.deptid=dept.deptid;

Is This Answer Correct ?    9 Yes 5 No

Difference between join and a subquery?..

Answer / rajasekhar

sub query: it is a query to get the answer for multiple questions


joins: it is used for getting the data from more then two tables

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More Oracle General Interview Questions

What is the best way to do multi-row insert in oracle?

0 Answers  


How to convert csv to table in oracle?

0 Answers  


How to transfer database(500 gb) of oracle enterprise edition to standard edition downtime is only 1 hour not using exp/imp option ?

3 Answers   Digital Group,


What are the original export and import utilities?

0 Answers  


What would you do with an in-doubt distributed transaction?

0 Answers  






can anyone help me ? an index has been done on the primary key of a table. an update operation was performed on that table. now my question is 1> what abt the performance ? means faster or slower due to indexing ? 2> does the operation affect to the primary key constraint ?

2 Answers   Allfon,


I have my backup RMAN script called backup_rman.sh. I am on the target database. My catalog username/password is rman/rman. My catalog db is called rman. How would you run this shell script from the O/S such that it would run as a background process?

1 Answers  


which is best institue to learn oracle 11i in ameerpet or maithrivanam or sr nagar please help

5 Answers  


What is a deadlock ? Explain .

1 Answers  


How will you identify oracle database software release?

0 Answers  


List out the components of logical database structure of oracle database.

0 Answers  


how do we code triggers , store procedure , Performance tuning and indexing in a Java Project? Pls kindly get me the perfect answer with the code for each....thank you in advance............pls any body kindly help me soon as possible....

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)