CREATE TABLE type_of_restaurant (resid DECIMAL, restypeid DECIMAL)
CREATE TABLE restaurant (resid DECIMAL, resname TEXT, address TEXT, rating DECIMAL)
CREATE TABLE restaurant_type (restypeid DECIMAL, restypename TEXT, restypedescription TEXT)
CREATE TABLE visits_restaurant (stuid DECIMAL, resid DECIMAL, time TIME, spent DECIMAL)
CREATE TABLE student (stuid DECIMAL, lname TEXT, fname TEXT, age DECIMAL, sex TEXT, major DECIMAL, advisor DECIMAL, city_code TEXT)

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 "Subway" = "restaurant"."resname" AND "restaurant"."resid" = "visits_restaurant"."resid" WHERE "Linda" = "student"."fname" AND "Smith" = "student"."lname"