I am working on an application that will have 2 kinds of users, teachers and students.
Both the teachers and students have a first and last name, an unique email and an unique username (by unique i also mean that a teacher can't have the same username/email as a student).
Besides these common fields students will have 4 more fields: A, B, C and D.
Teachers will have E, F and G.
What's the best way do design a database for this? Should I use 2 tables (one for students, one for teachers, each with all the fields) or 3 tables(an user table - for the common fields like username and email, and then have a one-to-one relationship with the students and teachers tables that only contain particular fields.
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.
Thanks,