MySQL
  Home arrow MySQL arrow Page 2 - Understanding SQL Joins
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MYSQL

Understanding SQL Joins
By: The Disenchanted Developer, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 216
    2002-08-20

    Table of Contents:
  • Understanding SQL Joins
  • Meeting The Family
  • Keeping It Simple
  • Crossed Wires
  • Finding Common Ground
  • One Step Left...
  • ...Two Steps Right
  • The Bookworm Turns
  • Up A Tree
  • A Long Goodbye

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Understanding SQL Joins - Meeting The Family


    (Page 2 of 10 )

    Before we begin, I'd like to introduce you to the three tables I'll be using in this tutorial. Say hello to table "a".

    +----+------+ | a1 | a2 | +----+------+ | 10 | u | | 20 | v | | 30 | w | | 40 | x | | 50 | y | | 60 | z | +----+------+ 6 rows in set (0.05 sec)
    Next up, drop by table "b",

    +----+------+ | b1 | b2 | +----+------+ | 10 | p | | 20 | q | +----+------+ 2 rows in set (0.06 sec)
    Finally, last but not least, table "c".

    +-----+------+ | c1 | c2 | +-----+------+ | 90 | m | | 100 | n | | 110 | o | +-----+------+ 3 rows in set (0.05 sec)
    As you can see, I spent a lot of time naming them, so I expect you to be properly appreciative of my efforts.

    These tables have been constructed in MySQL 4.x, a free (and very powerful) open-source RDBMS. Due to differences in capabilities, the techniques outlined in this article may not work on other RDBMS; you should refer to the documentation that comes with each system for accurate syntax.

    I've deliberately kept these tables simple, so that you have as little difficulty as possible understanding the examples. At a later stage, once the basic joins are clear to you, I'll replace these simple tables with more complex, real-world representations, so that you understand some of the more arcane applications of joins.

    More MySQL Articles
    More By The Disenchanted Developer, (c) Melonfire


     

       

    MYSQL ARTICLES

    - MySQL Server Tuning Tips and Tricks
    - MySQL Query Optimizations and Schema Design
    - MySQL Benchmarking Tools and Utilities
    - MySQL Benchmarking Concepts and Strategies
    - Take Some Load off MySQL with MemCached
    - MySQL Table Prefix Changer Tool in PHP
    - Using the SIGNAL Statement for Error Handling
    - Error Handling Examples
    - Error Handling
    - Completing a Search Engine with MySQL and PH...
    - Paginating Result Sets for a Search Engine B...
    - Building a Search Engine with MySQL and PHP 5
    - Using Boolean Operators for Full Text and Bo...
    - PHP, MySQL and the PEAR Database
    - Working with PHP and MySQL





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT