• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt regarding joins in SQL...

 
Ranch Hand
Posts: 165
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic