表关系/设计问题 [英] Table relationship/Design problem

查看:82
本文介绍了表关系/设计问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有6张桌子

-tblStudents_info(包括学生姓名,地址等等)

-tblStudent_Classes(包括学生班级和流程)

-tblStudent_Subjects(包括基于特定组合的学生子喷射。)

-tblStudent_Marks(包括各种科目的学生分数)

-tblExam_Name(包括examID,Exam_Name)

-tblExam_Period(包括PeriodID,Period_Name)


问题来自于如何将表格关联(tblStudent_Marks,tblExam_Name和tblExam_Period)在每个时期(3个时期)完成的考试

i have 6 tables
-tblStudents_info( includes students names,address..etc)
-tblStudent_Classes(includes students classes and streams)
-tblStudent_Subjects(includes students subjets based on a certain combination.)
-tblStudent_Marks(includes student marks in various subjects)
-tblExam_Name(includes examID,Exam_Name)
-tblExam_Period(inclues PeriodID,Period_Name)

problem comes in how do i relate the tables (tblStudent_Marks,tblExam_Name and tblExam_Period)in the case where there are 3 Exams done in each period(3 periods)

推荐答案

在不知道如何设置tblStudent_Marks的情况下,很难建议如何关联表格。但是,如果表格设置得像我一样,tblStudent_Marks将是tblStudents_Info和tblExam_Name之间的连接表,这意味着每个学生/考试组合都会有一个单独的记录。由于我无法想到将考试时间直接与学生联系起来的原因,我会将tblExam_Name与tblExam_Period作为一对多关系,将一个Exam_Period外键添加到tblExam_Name,以确定考试在哪个时期发生了。
Without knowing how tblStudent_Marks is setup, it is difficult to suggest how to relate the tables. However, If the tables were setup like I would do it, tblStudent_Marks would be a join table between tblStudents_Info and tblExam_Name meaning that there would be a separate record for each student/exam combination. Since I can''t think of a reason to directly relate the exam period to the student, I would relate tblExam_Name to tblExam_Period as a one-to-many relationship by adding a Exam_Period foreign key to tblExam_Name to identify in which period the exam is taking place.


感谢Seth,我已经在下面的链接中发布了整个设计,以便清楚地了解我的意思。

最受关注的部分是:关系PartB

关系PartB-

thanks Seth, I have posted the whole design in the below links for a clear picture of what i mean.
the part with most concern is:relationship PartB
relationship PartB-

附图像
(35.5 KB,273 views )
Attached Images
(35.5 KB, 273 views)


我看不到图片。请尝试解释图片提供的信息。
I can''t see the pictures. Please try to just explain what information the pictures would provide.


这篇关于表关系/设计问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆