Created
November 25, 2013 15:03
-
-
Save anonymous/7642550 to your computer and use it in GitHub Desktop.
This file contains 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
Lessons table | |
------------ | |
|id |name | | |
----------- | |
|1 |test | | |
|2 |hello | | |
|3 |world | | |
------------ | |
Sessions table | |
------------ | |
|id |name | | |
------------ | |
|1 |dogs | | |
|2 |cats | | |
|3 |birds | | |
------------ | |
Sessions/lessons junction table | |
---------------------------- | |
|id |session_id |lesson_id | | |
---------------------------- | |
|1 |1 |1 | | |
|2 |1 |2 | | |
|3 |2 |1 | | |
---------------------------- | |
I want to get lessons associated with session 2 | |
------------------------- | |
|lesson id |lesson name | | |
------------------------- | |
|1 |test | | |
------------------------- | |
I also want to get lessons that are NOT associated with session 2 | |
------------------------- | |
|lesson id |lesson name | | |
------------------------- | |
|2 |hello | | |
|3 |world | | |
------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment