Last active
April 29, 2018 04:48
-
-
Save MostlyFocusedMike/a1c832732a81f0ce273affb7fb7184c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT cats.name AS cat, owners.name AS owner |P | SELECT * | |
FROM owners |R | FROM owners | |
INNER JOIN cats_owners |E | INNER JOIN cats_owners | |
ON owners.id = cats_owners.owner_id |V | ON owners.id = cats_owners.owner_id; | |
INNER JOIN cats |I | | |
ON cats_owners.cat_id = cats.id; |O | # which returned: | |
|U | | |
# returns this: |S ->| id name cat_id owner_id | |
| | ---------- ---------- ---------- ---------- | |
cat owner |L | 2 Sophie 3 2 | |
---------- ---------- |A | 3 Penny 3 3 | |
Grumpy Cat Sophie |Y | 2 Sophie 1 2 | |
Grumpy Cat Penny |E | | |
Maru Sophie |R | | |
| | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment