At my work, I've been asked to teach a short half-hour to an hour course about "select and joins". I'm also thinking about discussing unions, sub queries and temp tables in this course. Are there any core concepts that relate to the topic of "select and joins" that I could include to expand the length of said course?


Sure, start with my Learn SQL with the Stack Overflow Database.

It's designed for you to demo with the Stack Overflow public data dump. (I just updated it today, coincidentally.)

|improve this answer|||||
  • And the terms of use on this DB is accepted for a company training? – waterguard Jan 26 '17 at 19:21
  • @waterguard yep, absolutely, it's released under Creative Commons, so you just need to explain where you got it from. – Brent Ozar Jan 26 '17 at 21:08

In addition to what Brent suggested, I would encourage your staff to look over Aaron Bertrand's list of T-SQL bad habits.

|improve this answer|||||

Show them making an 'un-normalised' database as 'how not to do it' to show them the reason for joins and splitting up data into entities.

|improve this answer|||||
  • Thanks! good idea actually. For a lot of the work we do, we pull our data down form an IBM mainframe into SQL (long story), it does demonstrate (for the most part) great normalization. – waterguard Jan 27 '17 at 17:46

If you only have half an hour and "Select" is actually part of the request, I have to assume you are teaching people brand new to SQL.

I'd be very surprised if you can get past Select Col1 from MyTable, and then move to Joins (innner, left right, etc.).

If they are beginners, this should be example heavy and you should already have your tables for the demo created.

Hope this helps

|improve this answer|||||
  • 1
    Yes it does, I'm going to be doing the presentation while a co-worker goes some examples. – waterguard Jan 27 '17 at 19:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.