Re: database design suggestion
If the requirement now is for 2 characteristics, it may be 3 or 29 next year, so this might be a start ...
users( uid int unsigned primary key auto_increment, name, ...)
characteristics( cid int unsigned primary key auto_increment, name, ...)
char_attrs(
caid int unsigned primary key auto_increment, name,
cid int unsigned,
name varchar(16),
description varchar(255),
foreign key(cid) references characteristics(cid) on update cascade on delete cascade
)
user_attrs(
uid int unsigned,
caid int unsigned,
primary key(uid,caid),
foreign key(uid) references users(uid) on update cascade on delete cascade,
foreign key(caid) references char_attrs(caid) on update cascade on delete cascade
)
... and to find the chars & attrs of user 7 ...
select u.name, c.name, ca.name
from user_attrs ua
join users u using(uid)
join char_attrs ca using(caid)
join characteristics c using(cid)
where u.uid=7
order by c.name,ca.name;
Then you write all the other queries that can be anticipated, adjusting the data strcturers as you go till every anticipated query question can be answered.