Comment on How does this pic show that Elon Musk doesnt know SQL?
jacksilver@lemmy.world 1 week agoSure, basically any time you have a many-to-many relationship you’ll have to repeat keys multiple times. Think students taking courses. You’d have a students table and a courses table, but the relationship is many students take many courses. So you’d want a third table for lookups where each row is [student_id, course_id].
This stackoverflow post has a similar example with authors and books - stackoverflow.com/…/how-do-i-model-a-many-to-many…