How many Restaurants are there?
select count ( * ) from restaurant
How many of these are sandwich restaurants?
select count ( * ) from restaurant join type_of_restaurant on restaurant.resid = type_of_restaurant.resid join restaurant_type on type_of_restaurant.restypeid = restaurant_type.restypeid group by type_of_restaurant.restypeid having restaurant_type.restypename = 'Sandwich'
What is the name of this restaurant?
select resname from restaurant join type_of_restaurant on restaurant.resid = type_of_restaurant.resid join restaurant_type on type_of_restaurant.restypeid = restaurant_type.restypeid group by type_of_restaurant.restypeid having restaurant_type.restypename = 'Sandwich'
Where is Subway located?
select address from restaurant where resname = 'Subway'
What is Subway's rating?
select rating from restaurant where resname = 'Subway'