What to do if 2 (or more) relationship tables would have the same name?

Posted by primehunter326 on Stack Overflow See other posts from Stack Overflow or by primehunter326
Published on 2010-05-09T22:03:19Z Indexed on 2010/05/09 22:08 UTC
Read the original article Hit count: 126

So I know the convention for naming M-M relationship tables in SQL is to have something like so:

For tables User and Data the relationship table would be called

UserData
User_Data

or something similar (from here)

What happens then if you need to have multiple relationships between User and Data, representing each in its own table? I have a site I'm working on where I have two primary items and multiple independent M-M relationships between them. I know I could just use a single relationship table and have a field which determines the relationship type, but I'm not sure whether this is a good solution. Assuming I don't go that route, what naming convention should I follow to work around my original problem?

© Stack Overflow or respective owner

Related posts about sql

Related posts about database