In legacy code I have examined, I have found an information model that induce boolean fields of relevant characteristics where just one is anticipated to be real. For instance:
create table MyTable ( id int primary key not null, // more fields... has_x bool not null, has_y bool not null );
This really is silly since it enables potentially sporadic data if both are going to true. I am attempting to show technical, but non-developer, customers, although not sure how you can explain WHY it's proper to alter to some 1-to-many relationship to some definition, like below, once the original design "works".
create table Attributes ( -- contains "x" and "y" records. id int primary key not null, name varchar(100) not null ); create table MyTable ( id int primary key not null, // more fields attribute_id int not null foreign key references Attributes(id) );
It is possible to term of these data modeling designs?