Comment on How does this pic show that Elon Musk doesnt know SQL?
DahGangalang@infosec.pub 1 week agoThis sounds like a reasonable argument.
Can you pass any resources with examples on when having duplicate values would be useful/best practices?
jacksilver@lemmy.world 1 week ago
Sure, 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…