这里是一个严重的过度简化的紧张设置,我正在工作.table_1
和table_2
都有自动递增的代理主键作为ID.info
是一个包含关于table_1
和table_2
的信息的表.
table_1 (id, field)
table_2 (id, field, field)
info ( ???, field)
I am trying to decided if I should make the primary key of info
a composite of the IDs from table_1
and table_2
. If I were to do this, which of these makes most sense?
( in this example I am combining ID 11209 with ID 437 )
INT(9)
11209437 (i can imagine why this is bad)
VARCHAR (10)
11209-437
DECIMAL (10,4)
11209.437
还是别的什么?
将其用作MYSQL MYISAM数据库的主键可以吗?