Database Design – Does an Empty Entity Make Sense in ERD?

database-designerd

I have an entity that has nothing else than a surrogate key as a primary key. I use it as an element made of a group of other elements
For example :

TABLE SchoolClass (classNumber INTEGER PRIMARY KEY)

TABLE Students (SudentName TEXT PRIMARY KEY, studentClass INTEGER
FOREIGN KEY)

Does it make sense ? The School Class entity does not store any information, but it's still used to regroup all the students in the same class.

Best Answer

This is fine as long as all you need is an index for the class, though it may be very difficult to troubleshoot exactly what is meant by a particular record in either future develompent or by a user for any reason at all.

If you want to be able to define anything about the class, say a name or other defining attribute, you'd just want to add this to the table as well.

For example:

TABLE SchoolClass (classNumber INTEGER PRIMARY KEY, classDescription TEXT)