多对一 + 一对多 实际上还是 多对一 + 一对一 + 一对多,只不过省了中间表,而去直接关联比如某个人在工商银行开了户,他开了办了多个卡,那么 card 对 person 就是多对一 而一个人可以在多个地点用卡, person 对 city 就是一对多cardNum person 111 a 222 a person city a sh a bj
难道这样 UserTable UserID int UserName nvchar(50)UserGroupTable GroupID int GroupName nvchar(50)在写个中间表? UserID int GroupID int 那岂不是这个中间表长度是 UserTable中记录数量*UserGourpTable中记录数量
ID name
T2
ID NameT3
ID,T1ID,T2ID
表2(id2)
表3(id1,id2) 表3是中间表或关系表,里面放表1和表2的主键
而一个人可以在多个地点用卡, person 对 city 就是一对多cardNum person
111 a
222 a
person city
a sh
a bj
UserTable
UserID int
UserName nvchar(50)UserGroupTable
GroupID int
GroupName nvchar(50)在写个中间表?
UserID int
GroupID int 那岂不是这个中间表长度是 UserTable中记录数量*UserGourpTable中记录数量