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
List the names of all users.
assistant
SELECT name FROM useracct;
human
Only show those who gave reviews.
assistant
SELECT DISTINCT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id;
human
Include the ratings given by each of them.
assistant
SELECT T1.name , T2.rating FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id ;