Created
April 29, 2018 04:32
-
-
Save MostlyFocusedMike/302c083286634098db7c6c45a772af5f 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 * | |
FROM owners | |
INNER JOIN cats_owners | |
ON owners.id = cats_owners.owner_id | |
INNER JOIN cats | |
ON cats_owners.cat_id = cats.id; | |
# returns | |
id name cat_id owner_id id name age breed net_worth | |
---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- | |
2 Sophie 3 2 3 Grumpy Cat 4 Persian 181600 | |
3 Penny 3 3 3 Grumpy Cat 4 Persian 181600 | |
2 Sophie 1 2 1 Maru 3 Scottish 1000000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment