human
Schema:
item (i_id, title)
review (a_id, u_id, i_id, rating, rank)
useracct (u_id, name)
trust (source_u_id, target_u_id, trust)
Please answer with SQL.
assistant
Sure, I understand.
human
What is the used id 1? | Do you mean what is the name of the user with id 1? | yes
assistant
SELECT name FROM useracct WHERE u_id = 1;
human
What is the name of user id 3?
assistant
SELECT name FROM useracct WHERE u_id = 3;
human
What is the rank of user id 3?
assistant
SELECT T2.rank FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id WHERE T2.u_id = 3;
human
What is the average rating of reviews of user id1?
assistant
SELECT AVG ( T2.rating ) FROM useracct WHERE T2.u_id = 1 AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id ;