CREATE TABLE Student (Id VARCHAR2)
CREATE TABLE Restaurant (Id VARCHAR2)
CREATE TABLE Visits_Restaurant (Id VARCHAR2)

How many times has the student Linda Smith visited Subway?
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"
SELECT COUNT(*) FROM "Student" JOIN "Visits_Restaurant" ON "Student"."StuID" = "Visits_Restaurant"."StuID" JOIN "Restaurant" ON "Restaurant"."ResID" = "Visits_Restaurant"."ResID" AND "Restaurant"."ResName" = "Subway" WHERE "Linda" = "Student"."Fname" AND "Smith" = "Student"."Lname"