How many visits did Subway receive?
select count(*) from visits_restaurant join restaurant on visits_restaurant.resid = restaurant.resid where restaurant.resname = "Subway";
Give the student ids for these visits.
select stuid from visits_restaurant join restaurant on visits_restaurant.resid = restaurant.resid where restaurant.resname = "Subway";
Do any of these correspond to the student Linda Smith? How many?
select count(*) from student join visits_restaurant on student.stuid = visits_restaurant.stuid join restaurant on visits_restaurant.resid = restaurant.resid where student.fname = "Linda" and student.lname = "Smith" and restaurant.resname = "Subway";