joins

  • Hello,

    how many types of joins and briefly explain them.

    Regards,

    sathish.

  • [font="Verdana"]

    1] Inner Join: Returns the matching records from both the tables

    2] Outer Join

    2.1] Left Outer Join: Returns the matching records from both the tables + rest the records from Left side table

    2.2] Right Outer Join: Returns the matching records from both the tables + rest the records from Right side table

    2.3] Full Outer Join:

    3] Self Join: Means a table joined to itself. It returns the records from that table.

    4] Cross Join: Returns the Cartesian product.

    Mahesh

    [/font]

    MH-09-AM-8694

  • This is the kind of information you can get out of the Books Online as well as a gazillion third party books and web sites. Do a little basic research first and then if you get stuck, start posting the questions and people will help out. Fundamental stuff like this can't be adequately covered in small posts like above (as clear, concise, and accurate as it is).

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Was this an interview question, or something on an exam? Are you looking for some specific data about joins, or just looking for someone to answer an interview question for you?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • can you plz explain cross join

  • [font="Verdana"]Refer BOL for more information

    Mahesh[/font]

    MH-09-AM-8694

  • tabishghazi (3/10/2010)


    can you plz explain cross join

    Try this: CROSS JOIN

  • Nice explanation about the joins,

    I found this blog post [http://slackerdba.blogspot.com/] that gives good details about the basic joins with good examples.

    Hope that helps.

  • This is one another nice simple-english visual-representative article on Baiscs of Joins from Pinal Dave; click on the link to follow it:

    sql-server-introduction-to-joins-basic-of-joins : Pinal Dave[/url]

    C'est Pras!!

  • This site provides good explanations for SQL joins with lots of useful examples;

    http://www.codesnout.com

    http://www.codesnout.com/SQLSample/SQL-INNER-JOIN.php

  • Gsquare, excellent signature :hehe:

    _____________________________________________________
    Microsoft Certified Master: SQL Server 2008
    XDetails Addin - for SQL Developers
    blog.sqlxdetails.com - Transaction log myths
  • Cross join results cartesian product of two or more than two tables.

    Cross join matches each record from table1 to table2

    Eg. if table1 contains 5 records and table2 contains 4 records then our result is 20 records.

  • I am looking for some good video tutorials on joins.

    Found some good ones here

    http://sqlserver2012tutorial.com/

    http://blog.sqlauthority.com

    Could anybody suggest some more?

    Thanks

Viewing 13 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic. Login to reply