Skip to content

Instantly share code, notes, and snippets.

@DigitalEssence
Last active November 16, 2021 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DigitalEssence/31b131823572338d3867083bfed70a4a to your computer and use it in GitHub Desktop.
Save DigitalEssence/31b131823572338d3867083bfed70a4a to your computer and use it in GitHub Desktop.
Database Many to Many Relationship
user
+----+-----------+----------+-------+
| id | firstname | lastname | email |
+----+-----------+----------+-------+
| 1 | Peter | Jones | email |
| 2 | Bob | Smith | email |
| 3 | Sarah | Peters | email |
| 4 | Christine | Hall | email |
+----+-----------+----------+-------+
callout_attendance
+--------+-----------+----------+
| userid | calloutid | status |
+--------+-----------+----------+
| 1 | 1 | A/N/O |
| 2 | 1 | N |
| 3 | 1 | N |
| 4 | 1 | Y |
| 5 | 1 | Y |
| 6 | 1 | N |
| 1 | 2 | N |
| 2 | 2 | Y |
| 3 | 3 | Y |
| 4 | 3 | N |
| 5 | 3 | N |
| 6 | 3 | Y |
+--------+-----------+----------+
callout
+----+------------+
| id | Date |
+----+------------+
| 1 | 01/05/2011 |
| 2 | 03/11/2012 |
| 3 | 09/02/2021 |
| 4 | 10/03/2021 |
+----+------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment