我有两个表所示:我应该在哪张桌子上做FK关系?
-- users
+----+--------+---------------------+----------+--------------------+
| id | name | email | password | cookie |
+----+--------+---------------------+----------+--------------------+
-- user_detail
+---------+-----+-------------------+----------------+
| user_id | age | about | birthday |
+---------+-----+-------------------+----------------+
我需要users(id)
和user_detail(user_id)
列之间的关系。现在我想知道,我是否应该打开user_detail
表,并在user_id
列中创建关系(指users(id)
),反之亦然?
Downvoter请发表评论,并解释这有什么错我的问题? –
什么是FK的*定义? FK约束是什么意思?当你搜索到你的标题时,你发现/了解到......? PS Downvote arrrow mouseover text:“这个问题没有显示任何研究工作; ...”。 PPS关系是一张表,你的意思是关系。 – philipxy
[MySQL中的外键基础知识?](https://stackoverflow.com/questions/757181/basics-of-foreign-keys-in-mysql) – philipxy