mysql - Where would tables that are not normalised be applicable? -
is ever best practise or recommended use table of following?
id, uid, fieldname, fieldvalue 4, 12, gender, male 5, 12, age, 21-30 6, 12, location, 5 7, 13, gender, female 8, 13, age, 31-40 9, 13, location, 5 10, 14, gender, female 11, 14, age, 31-40 12, 14, location, 6 13, 15, gender, male 14, 15, age, 21-30 15, 15, location, 7
it not normalised , cannot specify data type of field.
would following not better
id, uid, gender, age, location 4, 12, male, 21-30, 5 5, 13, female, 31-40, 5 6, 14, female, 31-40, 6 7, 15, male, 21-30, 7
i want know if can ever justify having such table in database, know first method may easier add more fields (instead of altering database) , remove null values.
however 1 cannot specify datatype , have convert string every time want use data.
so there ever scenario first table considered best practice or solution?
working on system uses method make lose sanity. complexity of queries required in order perform basic tasks dreadful, , performance nightmare.
here's 1 man's experience: https://www.simple-talk.com/opinion/opinion-pieces/bad-carma/