I have a table called people and another called people_attributes.
On my site people submit a variety of attributes, like blue eyes, brown hair, thin and I need to return all unique people with the attributes.
Im struggling with my table design. One person in the people table can have many attributes. How should I save each person’s attributes in the people table?
Or should I make a separate table with the type of attribute and the id of the person who has it?
But with this idea, an attribute can have many people, how can I store an attribute with many people attached to it but still only get out unique people? A comma delimitated list? But how would I search that? And how do I only return unique people? I.E if I was searching for blue eyes and brown hair, the category blue eyes would have person 1 in it and so would brown hair. So the query would get back two person 1s.
What about
People(id, name, etc.), Attributes(id, description), People_Attribute(people_id, attribute_id)?