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 items were ranked?
assistant
SELECT DISTINCT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id;
human
How many have a rank that is greater than 3?
assistant
SELECT COUNT( DISTINCT T1.title ) FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rank > 3;
human
List the names of these items.
assistant
SELECT DISTINCT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rank > 3 ;