Question: Find the distinct last names of all the students who have president votes and whose advisor is 8741.
Schema: create table student (lname varchar, president_vote varchar, advisor varchar, PRIMARY KEY (lname)); create table student (lname varchar, stuid varchar, PRIMARY KEY (lname)); create table voting_record (id varchar, PRIMARY KEY (id))
SQL: select distinct t1.lname from student as t1 join voting_record as t2 on t1.stuid = president_vote intersect select distinct lname from student where advisor = "8741"