• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Doubt regarding joins in SQL...

 
Ranch Hand
Posts: 165
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two tables company and employee in my database. Emp_id is the only primary_key inside employee table and company_id is the only primary key inside company table. Both company and employee tables have relationship such that Emp_id of employee table acts as a foreign key inside company table. Now my question is what kind of join is below in oracle:-


Secondly how many joins are there in oracle? I know about following:-
Join (or, inner join)
Left join (or, Left outer join)
Right join (or, Right outer join)
Full join


Are these joins differ when it comes out to be other databases like mysql or sql server in terms of its number or same, only the terminology is different?

I used to apply such joins(shown above) everywhere but never knew in which category it belongs to? What I think is that it does not belongs to left and right joins and not sure about full join. I think may be it belongs to inner join because it will return records if at least there is match on both tables else will not. If I'm right here (means it does belong to inner join) then I have read the syntax on http://www.w3schools.com that following is the syntax for inner join which different what I'm applying like shown above:-



Please clear my doubts about all joins by explaining these with simple example.



 
Marshal
Posts: 25207
64
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my opinion Wikipedia is technically superior to w3schools; here's their article about Join (SQL).
 
Vinod Vijay
Ranch Hand
Posts: 165
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:In my opinion Wikipedia is technically superior to w3schools; here's their article about Join (SQL).



what about my question especially about syntax which I have used ? Please explain that.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The article linked by Paul has plenty of examples. If you don't understand something there, feel free to ask a specific question.

As per your question: the join you has shown us in the first example is the inner join.

More resources on joins:
http://docs.oracle.com/cd/B19306_01/server.102/b14200/queries006.htm
http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_10002.htm#i2080416
Discussion on AskTom site


 
This tiny ad is guaranteed to be gluten free.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!