Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««678910

SQL & the JOIN Operator Expand / Collapse
Author
Message
Posted Sunday, February 27, 2011 7:33 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 9:21 PM
Points: 11,192, Visits: 11,090
Jeff Moden (2/27/2011)
Isn't this a bit like the article you wrote on designing databases? While I agree with all the things you've stated, entire books have been written on how to join and all the caveates that occur when dupes are present, etc, ad infinitum. This article is a good introduction to joins... it's not the final word just like your introduction to designing databases isn't and wasn't intended to be the final word. Think about it...

The parallels weren't lost on me, no. That's no reason not to comment though, is it?




Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #1070261
Posted Monday, February 28, 2011 3:47 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, July 18, 2014 8:23 AM
Points: 29, Visits: 219
SQLkiwi (2/27/2011)
Jeff Moden (2/27/2011)
Isn't this a bit like the article you wrote on designing databases? While I agree with all the things you've stated, entire books have been written on how to join and all the caveates that occur when dupes are present, etc, ad infinitum. This article is a good introduction to joins... it's not the final word just like your introduction to designing databases isn't and wasn't intended to be the final word. Think about it...

The parallels weren't lost on me, no. That's no reason not to comment though, is it?



Well, Paul, I agree with most of your observations, but Jeff is right: the purpose of this article is to introduce the newbie to a new world, SQL Joins.

If we were talking about motor vehicles instead of SQL, the articles could focus on strollers as well as in Ferraris. I'm focusing on stroller drivers here and I think it would be pointless for this audience to hear some many important details at this moment.

Post #1070398
Posted Monday, February 28, 2011 5:42 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 9:21 PM
Points: 11,192, Visits: 11,090
wagner crivelini (2/28/2011)
Well, Paul, I agree with most of your observations, but Jeff is right: the purpose of this article is to introduce the newbie to a new world, SQL Joins.

Ok, I hope the criticisms were taken in the constructive spirit they were intended.




Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #1070440
Posted Monday, February 28, 2011 6:17 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, October 5, 2011 7:45 AM
Points: 5, Visits: 24
I was just going over this in my class, but you explain it much better! Great work! Out of curiosity, I have been hammered on calling it a 'relation' instead of a 'table'. I know the terms are somewhat interchangeable but is there a hard-fast rule for what we call them?

Thanks in advance.
Post #1070460
Posted Monday, February 28, 2011 6:23 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, July 18, 2014 8:23 AM
Points: 29, Visits: 219
rob

relation is a term we generally use in academic environment and I guess this was the word Ed Codd used when he define the basics for relational modeling.

in day-top-day business, we assume the word TABLE describing the same (or roughly the same) concept.
Post #1070463
Posted Monday, February 28, 2011 6:26 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, October 5, 2011 7:45 AM
Points: 5, Visits: 24
Gotcha! So more of an Ivory Tower nomenclature. Thanks for the speedy clarification.
Post #1070465
Posted Monday, February 28, 2011 7:36 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 2:50 PM
Points: 36,711, Visits: 31,159
SQLkiwi (2/27/2011)
Jeff Moden (2/27/2011)
Isn't this a bit like the article you wrote on designing databases? While I agree with all the things you've stated, entire books have been written on how to join and all the caveates that occur when dupes are present, etc, ad infinitum. This article is a good introduction to joins... it's not the final word just like your introduction to designing databases isn't and wasn't intended to be the final word. Think about it...

The parallels weren't lost on me, no. That's no reason not to comment though, is it?


Heh... you're absolutely correct. I read more into it and you were a whole lot nicer about it than that other fellow. Thanks, Paul.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1070523
Posted Wednesday, March 2, 2011 1:59 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 12:36 PM
Points: 215, Visits: 547
Excellent job, Wagner!

This reminds me of the first truly useful article on SQL that I found back in 199...7, I think. It was a beautifully detailed article describing normalization techniques to 3NF. This would have been a grand companion to it (all those years ago...) when I first started in the field. I plan to use this article when I explain these concepts to friends and coworkers who want to understand how JOINs work.

Bravo!

---Mike<G>
Post #1072194
Posted Saturday, March 26, 2011 8:24 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, April 8, 2014 3:05 PM
Points: 4, Visits: 46
A real world application of cross join is to generate the results of applying databased rules to the row occurrences they apply to. For example, I have an application that tracks the set up of standard AD Groups for database schemas. I have the rules for these groups modeled in tables, and then cross join the rules with the schemas to generate a result set that applies each rule to each schema. I output this result set to a tracking table so I can track the set up of all these AD groups. This of course is only effective because there are a small number (less than 100) of schemas for which to manage a small number of AD groups (around 8 per schema).
Post #1084441
« Prev Topic | Next Topic »

Add to briefcase «««678910

Permissions Expand / Collapse