I have a database design for a survey.
I have a Table USERS with user_id PK and name.
QUESTION with question_id and question_text.
POSSIBLE_ANSWER with answer_id PK ,value, text.
Also, I have USER_ANSWERS with user_id from users , Question_id , answer_id .
Also some 3 other tables not relevant to my question.
What I need is select avg(value) for all users where name like’m%’.
Hope this is clear thanks.
try the following: