this post was submitted on 01 Jul 2024
328 points (92.1% liked)
LinkedinLunatics
3580 readers
62 users here now
A place to post ridiculous posts from linkedIn.com
(Full transparency.. a mod for this sub happens to work there.. but that doesn't influence his moderation or laughter at a lot of posts.)
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Yeah, that's how many to many relationships work. Especially if you care at all about normalization which I assume we do since we're debating the best way to model a SQL joke on a tee shirt lol. I thought this might be common knowledge but I've included a few links in case you're curious. Many-to-many relationships
Also, a table having a many-to-many relationship with itself isn't terribly special. It's just not necessarily the most common thing ever. We can even express love triangles (as in unrequited love) using this approach. Proper couples could have two entries but unrequited ones would only have one entry on the junction table.
Yes! Absolutely! You could have a column that describes the type of the relationship. Having extra information on junction tables.