作为 MySQL 数据库的多班级、相互关联的学校时间表
我现在已经查看了一些与此相关的其他建议,但我所看到的都不太适合我的需求,所以就这样吧!
我拥有的是多班(澳大利亚中学;7-12 年级)、多日(周一至周五)的学校时间表。我现在想要构建的是一个 MySQL 数据库,其中包含要部署在帐户驱动的网站上的以下信息。
- 主题:
- 运行时间(如“周三第 1 节”、“周五第 2 节”等 - 此列中的多个值)
- 教师(链接到所有教师的单独数据库) ) -- 如果教师生病并被替换,则还需要(暂时)改变;可能是“replacementinstructor”列,当为 NULL 时将被忽略。
- 位置(不同日期的不同但专门分配的房间)--如上所述,当房间更改时临时更改。
- 其他显而易见的内容:课程名称(“Year 7 Health”)、唯一 ID(类似于“7.HEALTH”,而不仅仅是自动递增 INT。)等。
- 教师:
- 名字、姓氏
- 他们参加的课程
- 联系信息
- 其他显而易见的信息:唯一 ID(自动递增 INT)、用户名(fname.lname)、其帐户的密码等。
- 学生:
- 名字、姓氏
- 他们参加的课程(存储为每个学生的单独列表)
- 年级/表格(7年级、11年级等) .)
- 基本个人信息(家庭郊区、电子邮件等)
- 更明显的信息:唯一 ID(与教师相同的设置)、用户名(与教师相同)、密码、等等
任何关于我如何设计这样一个数据结构的见解将不胜感激,我更像是一个 UI 狂热者而不是 MySQL 思想家;-D
提前致谢。
I've looked around for a bit now at other suggestions relating to this, but nothing I've seen has quite suited my needs, so here goes!
What I have is a multi-class (Australian secondary school; Years 7-12), multi-day (Mon-Fri) school timetable. What I now want to build is a MySQL database with the following information to be deployed on an account driven website.
- Subjects:
- Running time (as "Period 1 on Wednesday", "Period 2 on Friday", etc. -- multiple values in this column)
- Instructor (linked to separate database of all teachers) -- This would additionally need to change (temporarily) if a teacher was sick and replaced; perhaps a "replacementinstructor" column to be ignorned when NULL.
- Location (different, but specifically allocated, rooms on different days) -- As above, change temporarily when room altered.
- Other obviousnesses: Course name ("Year 7 Health"), Unique ID (Something like "7.HEALTH", rather than just auto-incrementing INT.), etc.
- Teachers:
- First name, last name
- Courses they take
- Contact info
- Other obviousnesses: Unique ID (Auto-incrementing INT), Username (fname.lname), Password for their account, etc.
- Students:
- First name, last name
- Courses they attend (stored as an individual list for each student)
- Year level / Form (Year 7, Year 11, etc.)
- Basic personal info (Home suburb, email, etc.)
- More obviousnesses: Unique ID (same setup as teachers), Username (same as teachers), password, etc.
Any insight as to how I might design such a data structure would be greatly appreciated, I'm more of a UI fanatic than a MySQL thinker ;-D
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我可以想到在 MySQL 中使用以下表格:
学生
学生信息
教师
教师信息
科目
所有不同的受试者
地点
学校
subject_teachers
每位老师教授哪些科目
subject_students
每个学生选修哪些科目
subject_timetable
主时间表
可以对注释进行整理,然后将其显示为时间表上的脚注。
I can think of the following tables to use in MySQL:
students
Student information
teachers
Teacher information
subjects
All the different subjects
locations
Various locations around the school
subject_teachers
What subjects each teacher teaches
subject_students
Which subjects each student takes
subject_timetable
Main Timetable
The notes could be collated and then displayed as footnotes on the timetable.
显然,您需要一张科目表、一张学生表和一张教师表。
阅读数据库规范化。这将告诉您(除其他外):
此外,如果您在数据库中记录临时更改,则您依赖于人们在特定时间更改相关信息。为了解决这个问题,您可能需要考虑一个表格“课程”,您可以在其中记录
这将允许您提前安排更改(麦卡尼先生在接下来的两周内生病,101 室因重新装修而关闭一个月等)
You will obviously need a table for Subjects, a table for Students and a table for Teachers.
Read up on database normalization. This will tell you (amongst other things):
Additionally, if you record temporary changes in the database, you are dependent on people changing the relevant information at a specific time. To get around this, you might want to consider a table Lessons, where you record
This will allow you to schedule changes in advance (Mr. McCachney is sick for the next two weeks, Room 101 is closed for redecoration for a month, etc.)