【发布时间】:2013-03-09 12:25:50
【问题描述】:
我要创建一个注册系统,我的数据库中有以下表格:
Subject //Primary key: Subj_no
Student //Primary key: Stdnt_no
Subject_Student //Primary key: Subj_Stdnt_no
Subject_Student 与 Subject 和 Student 的主键相关(索引)。
现在我的问题是: 如何防止数据库再次建立相同的关系? 示例> 例如,我在 Subject_Student 中有以下行:
Subj_Stdnt_no | Subject | Student
1 | 1 | 2
2 | 1 | 6
3 | 1 | 2 <------How can I prevent that? It's redundant.
【问题讨论】:
标签: php html database phpmyadmin redundancy