I have one table [Users] and another table [Administrators] linked 1:0..1 . Is it best practice to merge these tables? I have read a lot of answers on SO stating splitting tables is only necessary for one-to-many relationships.
My reasoning for separating them is so I can reference administrators with AdministratorId rather than the general UserId. In other tables I have fields which should only ever contain an administrator so it acts as a referential check.
I think the best option is to have two tables for the two different entities,
UsersandAdministrators, possibly with the samePrimary Key.This way, as you mention, other tables can reference the
AdministratorId:Benefits:
NULLdata.any query that needs a
JOINtoAdministratortable will have to look up only a few rows, compared to the (possibly huge) number of rows of theUsertable. If you have only one table, you’ll end up with code like:WHERE User.admin = Truewhich may not be easily optimized.