如果我设计错了,请纠正我。我需要设计3张表如下:
s_name
这里有要求:有学生,每个学生都有章节,每个部分都有时间表。
从学生到部门的关系,课程表是1对多sections
可以有多个节
=========这里是我的桌子:=====
- id --> primary and auto increment
- name- id --> primary and auto increment
- student\_id --> foreign key reference to id of students table
- s\_name- id --> primary and auto increment
- section\_id --> foreign key reference to id of sections table
- c\_name我非常感谢您的帮助和感谢。
发布于 2021-01-17 17:52:24
是的,您的模式似乎是标准化的,但它并不能满足所有给定的要求。我会改变一些东西,使它更直观。
2. Sections Table:
section_id -> primary, auto increment
student_id -> Foreign Key to students.id说明:部门ID是一对一的学生,但学生是一对多的部分。
3. SectionNames Table:
section_id -> primary and foreign key, from section table.
section_name -> String, name of section.说明:如果您需要存储s_name,就像您现在所做的那样,您可以添加这些内容。
4. Schedule Table:
class_id -> Primary, auto increment key
section_id -> Foreign key, sections table.说明:进度表的(班级)一对一与节有关,第一节对多节与班级有关。
5. ScheduleName Table:
class_id -> Primary, and foreign key to schedule table.
class_name -> String说明:按照表模式存储c_name。
https://stackoverflow.com/questions/65763790
复制相似问题