property_id, user_id, value(string)
1 (assume age), 1213, 60
2 (gender), 1213, female
or property_id, user_id, value_str, value_int
1 (assume age), 1213, null, 60
2 (gender), 1213, female, null
or have a mapping in the application to get the type of the property. Plenty of ways to handle it. SELECT DISTINCT loyaltyMemberID
from members as m
INNER JOIN properties as p1 on m.id = p1.user_id
INNER JOIN properties as p2 on m.id = p2.user_id
INNER JOIN properties as p3 on m.id = p3.user_id
AND (p1.prop = 'gender' AND p1.value = x)
AND ((p2.prop = 'age' AND p2.value = y) OR (p3.prop = 'censor' AND p3.value = z)) id, name, age, gender
1213, fake, 60, female
they would have property_id, user_id, value
1 (assume age), 1213, 60
2 (gender), 1213, female
This gives them the freedom to add more properties to the user without always having to add a column to the users table. When querying the database you'll have to do unions or joins.
Remote: Yes and preferred
Willing to relocate: No
Technologies: Backend Engineer with experience in Golang, Java, and PHP.
Résumé/CV: https://www.linkedin.com/in/alejandrolanderos/
Email: [email protected]