Understanding INNER join in detail

  • While this article was not what I needed it does open the idea of Joins and the SQL engine behind the scene.


    Thanks,

    Scott Champion

  • Steve, aren't you editing this stuff? Great article, but three grammar errors in the first paragraph? I want to encourage Susantha to continue to write, and keep practicing her English writing skills.

  • Excelent Article :D,

    The pictures are very well!

    How it would be using LEFT JOIN or RIGHT JOIN?

    I had hope to read about what is doing the SQL SERVER ENGINE (Memory, Processor) within each query?

  • Apologies for the spelling/grammar mistakes. I worked with the author to make changes, but I must have released the wrong version. I see spelling mistakes that I remember correcting, so those are my fault.

    I have corrected some of the typos and grammar and contacted the author to apologize as well.

    I do ask that you understand we try not to rewrite articles for authors. We work with them, do some spell checking and editing, but our intention is to make sure their voice is still there and not my or anyone else's voice instead. So the English at times might not read as professionally as you would like.

  • Grammar/spelling aside, and really, I don't mind that so much, as what the author has to say is more important than problems they have in saying it, as long as the idea gets across accurately, esp. so if they are not a native English speaker. I don't speak any language very well except English, so why should I expect someone else to be very good at it who comes from a different linguistic background? True, I don't presume to submit articles to, for example, a Hindi-language web site, nonetheless it takes guts to seek publication in one's non-native language and for that I say "huzzah!"

    But aside from spelling/grammar issues, I just want to say I expected a bit more from the article. Perhaps it is a presumption on my part but most people reading this site are familiar with Cartesian products already and pretty much already know about what the author was writing about. What I was expecting was a technical discussion of how the join is optimized and executed behind the scenes.

  • Finally, someone who puts his money with his mouth. Thank you Mark Weaver. No one disputes that all things being equal a well written and thoroughly checked article is preferred. But you are the first to offer assistance rather than criticism. I applaud your offer to the author.

    To any SSC readers who got their feathers ruffled, we should all look to this participant for an example of how colleagues in the larger arena ought to behave.

    The original author provided an opportunity that many of us have chosen to use to expand this dialogue regarding Joins.

    I personally have struggled with the finer points of Joins and using a simple example of all possible iterations is instructive. I noted that someone is going to use it as an example for his juniors. This is an excellent use of this information.

    I do not consider myself a SQL expert nor a novice. Sometimes the articles are over my head but there is no cause for me to whine about it. Likewise, sometimes the articles seem more a snack than a meal but again, it's the nature of this forum.

    I notice the tide of responses is moving away from grammar and toward content. This is as it should be. Again, we have the original author to thank for spurring this conversation.

  • I do ask that you understand we try not to rewrite articles for authors. We work with them, do some spell checking and editing, but our intention is to make sure their voice is still there and not my or anyone else's voice instead. So the English at times might not read as professionally as you would like.

    How many of those posters that criticized the spelling and grammar have sent an e-mail to Steve offering to help edit future articles?

    SSC provides some great resources for learning on all levels. Why not help to make it a better community rather than simply complaining?

  • I have two stories that might be applicable.

    1. In my (much) earlier days, I worked with a bunch of engineers. Their writing was atrocious, but they were hired for their ability to design nuclear reactors. I foolishly equated their writing skill with their abilities, but now I realize that I would rather have them spell poorly than design poorly.

    2. I have had the privilege of using SAS and MS Access, and I monitored the online newsgroups for these products. I noted that the high level of professionalism in the SAS list made it very easy to both read and converse. Conversely, there was a high level of noise in the Access list. It seemed that there were endless "me too!" or "you're an ignoramus" or "your mother says 'hi!'" posts that detracted from the information contained. Make no mistake; both forums contained valuable information, but the character of those groups was entirely different.

    The philosophy of a forum is to test, share, and acknowledge information and foster a community. What information is gained by posting complaints about spelling? What community is built? Instead, send a message off to the author or editor.

    My point? The ball is in our court. We can have a professional forum, or we can have flame-wars. The tone is OUR responsibility.

    Kevin

    --
    Please upgrade to .sig 2.0

  • Bravo Susantha. Forget about errors, the article article was good. It is good for beginners.

    Congrats Steve for giving chance to new authors to write despite of language problem.

    🙂

  • The output of Q4 and Q5 are correct.

    The only mistake is column headers should be interchanged in the result set shown in the article.

    (InnerJoinTest2_PK, InnerJoinTest1_PK)

    Use the order by statement as follows, so that you will see it clearly.

    Q4)

    SELECT a.*,b.* FROM #InnerJoinTest1 a INNER JOIN #InnerJoinTest2 b ON a.InnerJoinTest1_PK<b.InnerJoinTest2_PK

    order by a.InnerJoinTest1_PK

    Q5)

    SELECT a.*,b.* FROM #InnerJoinTest1 a INNER JOIN #InnerJoinTest2 b ON a.InnerJoinTest1_PK<=b.InnerJoinTest2_PK

    order by a.InnerJoinTest1_PK

    Susantha

  • The Web that is today was once envisioned as an “information super-highway” when in fact, it is much closer to an information garbage dump rather than any super-highway. Not only is the Web choked with misinformation, those who cannot write well and don’t take the time to edit and proof their postings just add to the garbage heap and more importantly, tarnish their own image in whatever they are presenting.

    Those upset about the grammar in this article ARE correct and though SSC might be held somewhat liable for not editing content, it’s really up to the author who in this case, should have gotten his/her posting proofed first.

    It is totally ridiculous to make statements like "...try posting on a web site not in your native language..." – the people making that comment miss the point – this author chose to post on SSC and thus he/she was placing something in the public arena for consumption by English readers, and therefore they should have taken the time to get it proofed and by not doing so, whether the content was good or not, they come off looking lazy to English readers, and distracting from the very content they are presenting.

    As for the explanation of Inner Joins themselves, the article is very basic and though for some that might be helpful, it was not very "real world" and did more to explain the uses of operators ( = ) than Inner Joins. Those of us doing lots of SQL day to day with multiple Inner Joins could have benefitted much more from a slightly more advanced discussion than this beginner’s level stuff. Though the author should be credited that he/she did a fair presentation of Inner Joins 101 - the operators and their effects - the content presented in that vein seemed to me to be more along the lines of something someone would learn on Day 1 of a beginners SQL class. I suppose there is value in that for some, but I have found so much great content on SSC that this post seemed almost out of place – just a little beyond someone pointing out that you need a computer and MS SQL to do SQL. Oh, and don’t forget, electricity too!

    SSC is one of the best sites for SQL on the Web – I commend the site! But, imagine if every posting on the SSC was poorly worded or lacked proper grammar, and the content was mere “fluff”. THAT would not be a good thing.

    Hence, presentation matters, content matters. The Web will be what we make it – garbage dump, or information super-highway.

    There's no such thing as dumb questions, only poorly thought-out answers...
  • blandry (7/8/2008)


    ...As for the explanation of Inner Joins themselves, the article is very basic and though for some that might be helpful, it was not very "real world" and did more to explain the uses of operators ( = ) than Inner Joins. Those of us doing lots of SQL day to day with multiple Inner Joins could have benefitted much more from a slightly more advanced discussion than this beginner’s level stuff. ...

    There are individuals that use this site at every level, from the newbie to the highly experienced. If this particular article was to basic for you, I am sure that there are others that probably were helped by the article; bad gammer and all. They also probably would from the discussion as well, once they got past all the complaining, and got more into a discussion of the topic itself. This is where questions could be asked where understanding was vague and get answers from others more experienced.

    You are correct, we will make of this what we will. Professionals will aid, both those who read and those who write, rather than just whine and complain. We work in a profession where other people's problems are our opportunities; take the opportunity and help build up others rather than tear them down.

    😎

  • I was really disappointed in this article. It's obviously for SQL users with little experience, so I was wondering how the definition for table 2 could be wrong right out of the starting gate:

    CREATE TABLE #InnerJoinTest2

    ( InnerJoinTest2_PK )

    GO

    It obviously needs a data type, and you would lose credibility with anyone trying to learn from you if you have a mistake as basic as this.

    The grammar was also less than professional, as has already been stated. The surprise to me is that this article was linked in the emails I receive from SqlServerCentral, and that's why I feel this negative feedback is warranted.

    -MD

  • It is a presumption that everyone here knows these basics. New people come to the site every day, and to SQL Server for that matter. We want to serve all the audiences and try to get beginner as well as advanced articles.

  • Steve Jones - Editor (7/8/2008)


    It is a presumption that everyone here knows these basics. New people come to the site every day, and to SQL Server for that matter. We want to serve all the audiences and try to get beginner as well as advanced articles.

    Maybe it would help if the writers or the editor as part of their guideline put a comment such as this at the beginning of their article

    Target Audience: Beginner/Novice

    or at least maybe the writer should include an objective that includes information on their target audience at the beging of the article. This might help set the tone a bit more in the future.

Viewing 15 posts - 46 through 60 (of 134 total)

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