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 are the names of all users?
assistant
SELECT name FROM useracct;
human
Only show the target users.
assistant
SELECT DISTINCT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id;
human
Order them by increasing trust score.
assistant
SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id ORDER BY trust ;