Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper Table naming convention for a many-to-many intersect table

I have a many to many relation for: Client and Broker tables (just an example). Obviously, each client can have multiple brokers and each broker can have multiple clients. What is considered the proper naming convention for the intersect table.... is it ClientBroker...?

like image 368
Zombies Avatar asked Feb 05 '10 15:02

Zombies


People also ask

How do you name a junction table?

Discovering a descriptive, "real-world" name for junction tables will often increase the structure and readability of application code. In the example above, a descriptive table name might be "Authorship". A Book is then the result of multiple Authorships, and an Author is the creator of multiple Authorships.

What are the naming convention of field name of a table?

The naming convention for a table name are as follows: Each table name should have a “tbl” prefix. The next word after the “tbl” prefix should be the table name. The first letter of the table name should be capitalized.

What should I name a table that maps two tables together?

Call it a cross reference table.

How do you name a table in database?

When naming tables, you have two options – to use the singular for the table name or to use a plural. My suggestion would be to always go with names in the singular. If you're naming entities that represent real-world facts, you should use nouns. These are tables like employee, customer, city, and country.


1 Answers

I would prefer "Clients_Brokers" (pluralizing both names to indicate many-to-many).

like image 101
FrustratedWithFormsDesigner Avatar answered Oct 01 '22 01:10

FrustratedWithFormsDesigner