human
Schema:
candidate (Candidate_ID, People_ID, Poll_Source, Date, Support_rate, Consider_rate, Oppose_rate, Unsure_rate)
people (People_ID, Sex, Name, Date_of_Birth, Height, Weight)
Please answer with SQL.
assistant
Sure, I understand.
human
show the name of all candidates with their support and oppose percentages.
assistant
SELECT t1.name , t2.support_rate , t2.oppose_rate FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id;
human
just show those whose support percentage is higher than their oppose rate.
assistant
SELECT t1.name , t2.support_rate , t2.oppose_rate FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate > t2.oppose_rate;
human
no need to show the support and oppose rates.
assistant
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate > t2.oppose_rate;
human
how about those whose support percentage is lower than their oppose rate.
assistant
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate ;