Note that there are some explanatory texts on larger screens.

plurals
  1. POPerforming joins
    primarykey
    data
    text
    <p>So this my first run into mysql databases, </p> <p>I got a lot of help from my first question : <a href="https://stackoverflow.com/questions/14774071/mysql-first-database-structure-help-please">MYSQL - First Database Structure help Please</a></p> <p>and built my database as pitchinnate recommended</p> <p>I have :</p> <p>Table structure for table club</p> <pre><code>Column Type Null Default id int(11) No clubname varchar(100) No address longtext No phone varchar(12) No website varchar(255) No email varchar(100) No </code></pre> <p>Table structure for table club_county</p> <pre><code>Column Type Null Default club_id int(11) No county_id int(11) No </code></pre> <p>Table structure for table county</p> <pre><code>Column Type Null Default id int(11) No state_id tinyint(4) No name varchar(50) No </code></pre> <p>Table structure for table states</p> <pre><code>Column Type Null Default id tinyint(4) No longstate varchar(20) No shortstate char(2) No </code></pre> <p>I set up foreign key relationships for everything above that looks that way.... states.id -> county.state_id for example</p> <p>What I tried to run :</p> <pre><code>SELECT * FROM club JOIN states JOIN county ON county.state_id=states.id JOIN club_county ON club_county.club_id=club.id club_county.county_id=county.id </code></pre> <p>This didn't work... I'm sure the reason is obvious to those of you who know what SHOULD be done.</p> <p>What I'm trying to do is </p> <p>get a listing of all clubs, with their associated state and county(ies)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload