Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lmxdev's avatar

Database design choice

I want to do a school management system, but I have a problem concerning the types of Users in my application. here's the design so far: http://www.laravelsd.com/share/a21Xmh

Here's my struggle, Users have a Group (student, teacher or admin) I don't know wether i need a Teacher table because it's basically a User too. A Course has a teacher.. Can I only use one User model?

EDIT: i guess this would work.. http://www.laravelsd.com/share/a21Xmh removed Teachers table and referenced user_id foreign key in Courses

0 likes
3 replies
jontyjago's avatar
Level 2

I don't see what advantage having a separate Teacher table would bring you, beyond unnecessary duplication. Use the user_id as the teacher_id and you've got everything you need.

SapporoGuy's avatar

Yes and No. It all depends on what kind of information you are planning to store. You could just go with groups or even an extra column in the user table like "user_type".

My gut feeling on this particular case is to don't use an extra teacher's table and just use the user_id / teacher_id situation like @jontyjago suggested.

Please or to participate in this conversation.