我正在研究一项有两种用户、教师和学生的申请。
教师和学生都有第一、最后的名称、独一无二的电子邮件和独一无二的用户名(通过独一无二的字眼也意味着教师与学生有相同的用户名/电子邮件)。
Besides these common fields students will have 4 more fields: A, B, C and D.
教师将有E、F和G。
为此设计一个数据库的最佳方式是什么? 如果我使用2个表格(学生1个,教师1个,所有领域各1个)或3个表格(用户表格),用于用户名称和电子邮件等共同领域,然后与学生和教师表格有一对一的关系,这些表格只包含特定领域。
This database will be used in a system where students/teachers will have to login. I guess it s better to look for credentials in just one table, than to have 2 different login points in the application, each querying a different table.
Actually I ll be using hibernate to generate the tables from java classes, so from an object-oriented point of view using 3 tables sounds better.
I m looking forward to seeing other opinions on this.
感谢