input
stringlengths 193
2.69k
| output
stringlengths 24
744
|
|---|---|
[INST] Here is a database schema:
customers :
customerNumber [ INTEGER ] primary_key
customerName [ TEXT ]
contactLastName [ TEXT ]
contactFirstName [ TEXT ]
phone [ TEXT ]
addressLine1 [ TEXT ]
addressLine2 [ TEXT ]
city [ TEXT ]
state [ TEXT ]
postalCode [ TEXT ]
country [ TEXT ]
salesRepEmployeeNumber [ INTEGER ] customers.salesRepEmployeeNumber = employees.employeeNumber
creditLimit [ REAL ]
orders :
orderNumber [ INTEGER ] primary_key
orderDate [ DATE ]
requiredDate [ DATE ]
shippedDate [ DATE ]
status [ TEXT ]
comments [ TEXT ]
customerNumber [ INTEGER ] orders.customerNumber = customers.customerNumber
products :
productCode [ TEXT ] primary_key
productName [ TEXT ]
productLine [ TEXT ] products.productLine = productlines.productLine
productScale [ TEXT ]
productVendor [ TEXT ]
productDescription [ TEXT ]
quantityInStock [ INTEGER ]
buyPrice [ REAL ]
MSRP [ REAL ]
orderdetails :
orderNumber [ INTEGER ]
productCode [ TEXT ]
quantityOrdered [ INTEGER ]
priceEach [ REAL ]
orderLineNumber [ INTEGER ]
Please write me a SQL statement that answers the following question: For Which order was the most profitable, please list the customer name of the order and the profit of the order. [/INST]
|
SELECT t3.customerName, (t1.priceEach - t4.buyPrice) * t1.quantityOrdered FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN customers AS t3 ON t2.customerNumber = t3.customerNumber INNER JOIN products AS t4 ON t1.productCode = t4.productCode GROUP BY t3.customerName, t1.priceEach, t4.buyPrice, t1.quantityOrdered ORDER BY (t1.priceEach - t4.buyPrice) * t1.quantityOrdered DESC LIMIT 1;
|
[INST] Here is a database schema:
payments :
customerNumber [ INTEGER ] payments.customerNumber = customers.customerNumber
checkNumber [ TEXT ]
paymentDate [ DATE ]
amount [ REAL ]
Please write me a SQL statement that answers the following question: How many transactions payment made by customer that is lower than 10000. Group the result by year. [/INST]
|
SELECT STRFTIME('%Y', t1.paymentDate), COUNT(t1.customerNumber) FROM payments AS t1 WHERE t1.amount < 10000 GROUP BY STRFTIME('%Y', t1.paymentDate);
|
[INST] Here is a database schema:
orders :
orderNumber [ INTEGER ] primary_key
orderDate [ DATE ]
requiredDate [ DATE ]
shippedDate [ DATE ]
status [ TEXT ]
comments [ TEXT ]
customerNumber [ INTEGER ] orders.customerNumber = customers.customerNumber
products :
productCode [ TEXT ] primary_key
productName [ TEXT ]
productLine [ TEXT ] products.productLine = productlines.productLine
productScale [ TEXT ]
productVendor [ TEXT ]
productDescription [ TEXT ]
quantityInStock [ INTEGER ]
buyPrice [ REAL ]
MSRP [ REAL ]
orderdetails :
orderNumber [ INTEGER ]
productCode [ TEXT ]
quantityOrdered [ INTEGER ]
priceEach [ REAL ]
orderLineNumber [ INTEGER ]
Please write me a SQL statement that answers the following question: List out 3 best seller products during year 2003 with their total quantity sold during 2003. [/INST]
|
SELECT t3.productName, SUM(t2.quantityOrdered) FROM orders AS t1 INNER JOIN orderdetails AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN products AS t3 ON t2.productCode = t3.productCode WHERE STRFTIME('%Y', t1.orderDate) = '2003' GROUP BY t3.productName ORDER BY SUM(t2.quantityOrdered) DESC LIMIT 3;
|
[INST] Here is a database schema:
employees :
employeeNumber [ INTEGER ] primary_key
lastName [ TEXT ]
firstName [ TEXT ]
extension [ TEXT ]
email [ TEXT ]
officeCode [ TEXT ] employees.officeCode = offices.officeCode
reportsTo [ INTEGER ] employees.reportsTo = employees.employeeNumber
jobTitle [ TEXT ]
customers :
customerNumber [ INTEGER ] primary_key
customerName [ TEXT ]
contactLastName [ TEXT ]
contactFirstName [ TEXT ]
phone [ TEXT ]
addressLine1 [ TEXT ]
addressLine2 [ TEXT ]
city [ TEXT ]
state [ TEXT ]
postalCode [ TEXT ]
country [ TEXT ]
salesRepEmployeeNumber [ INTEGER ] customers.salesRepEmployeeNumber = employees.employeeNumber
creditLimit [ REAL ]
orders :
orderNumber [ INTEGER ] primary_key
orderDate [ DATE ]
requiredDate [ DATE ]
shippedDate [ DATE ]
status [ TEXT ]
comments [ TEXT ]
customerNumber [ INTEGER ] orders.customerNumber = customers.customerNumber
products :
productCode [ TEXT ] primary_key
productName [ TEXT ]
productLine [ TEXT ] products.productLine = productlines.productLine
productScale [ TEXT ]
productVendor [ TEXT ]
productDescription [ TEXT ]
quantityInStock [ INTEGER ]
buyPrice [ REAL ]
MSRP [ REAL ]
orderdetails :
orderNumber [ INTEGER ]
productCode [ TEXT ]
quantityOrdered [ INTEGER ]
priceEach [ REAL ]
orderLineNumber [ INTEGER ]
Please write me a SQL statement that answers the following question: List out sale rep that has sold 1969 Harley Davidson Ultimate Chopper. List out their names and quantity sold throughout the year. [/INST]
|
SELECT t5.firstName, t5.lastName, SUM(t2.quantityOrdered) FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode INNER JOIN orders AS t3 ON t2.orderNumber = t3.orderNumber INNER JOIN customers AS t4 ON t3.customerNumber = t4.customerNumber INNER JOIN employees AS t5 ON t4.salesRepEmployeeNumber = t5.employeeNumber WHERE t1.productName = '1969 Harley Davidson Ultimate Chopper' GROUP BY t5.lastName, t5.firstName;
|
[INST] Here is a database schema:
offices :
officeCode [ TEXT ] primary_key
city [ TEXT ]
phone [ TEXT ]
addressLine1 [ TEXT ]
addressLine2 [ TEXT ]
state [ TEXT ]
country [ TEXT ]
postalCode [ TEXT ]
territory [ TEXT ]
employees :
employeeNumber [ INTEGER ] primary_key
lastName [ TEXT ]
firstName [ TEXT ]
extension [ TEXT ]
email [ TEXT ]
officeCode [ TEXT ] employees.officeCode = offices.officeCode
reportsTo [ INTEGER ] employees.reportsTo = employees.employeeNumber
jobTitle [ TEXT ]
Please write me a SQL statement that answers the following question: Who are the sales representatives in New York City? List their full names. [/INST]
|
SELECT t1.lastName, t1.firstName FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t2.city = 'NYC' AND t1.jobTitle = 'Sales Rep';
|
[INST] Here is a database schema:
customers :
customerNumber [ INTEGER ] primary_key
customerName [ TEXT ]
contactLastName [ TEXT ]
contactFirstName [ TEXT ]
phone [ TEXT ]
addressLine1 [ TEXT ]
addressLine2 [ TEXT ]
city [ TEXT ]
state [ TEXT ]
postalCode [ TEXT ]
country [ TEXT ]
salesRepEmployeeNumber [ INTEGER ] customers.salesRepEmployeeNumber = employees.employeeNumber
creditLimit [ REAL ]
payments :
customerNumber [ INTEGER ] payments.customerNumber = customers.customerNumber
checkNumber [ TEXT ]
paymentDate [ DATE ]
amount [ REAL ]
Please write me a SQL statement that answers the following question: Identify the customer and list down the country with the check number GG31455. [/INST]
|
SELECT t2.customerName, t2.country FROM payments AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.checkNumber = 'GG31455';
|
[INST] Here is a database schema:
products :
productCode [ TEXT ] primary_key
productName [ TEXT ]
productLine [ TEXT ] products.productLine = productlines.productLine
productScale [ TEXT ]
productVendor [ TEXT ]
productDescription [ TEXT ]
quantityInStock [ INTEGER ]
buyPrice [ REAL ]
MSRP [ REAL ]
orderdetails :
orderNumber [ INTEGER ]
productCode [ TEXT ]
quantityOrdered [ INTEGER ]
priceEach [ REAL ]
orderLineNumber [ INTEGER ]
Please write me a SQL statement that answers the following question: How many 2001 Ferrari Enzo were ordered? [/INST]
|
SELECT SUM(t1.orderNumber) FROM orderdetails AS t1 INNER JOIN products AS t2 ON t1.productCode = t2.productCode WHERE t2.productName = '2001 Ferrari Enzo';
|
[INST] Here is a database schema:
products :
productCode [ TEXT ] primary_key
productName [ TEXT ]
productLine [ TEXT ] products.productLine = productlines.productLine
productScale [ TEXT ]
productVendor [ TEXT ]
productDescription [ TEXT ]
quantityInStock [ INTEGER ]
buyPrice [ REAL ]
MSRP [ REAL ]
orderdetails :
orderNumber [ INTEGER ]
productCode [ TEXT ]
quantityOrdered [ INTEGER ]
priceEach [ REAL ]
orderLineNumber [ INTEGER ]
Please write me a SQL statement that answers the following question: Which 5 products has the lowest amount of orders? List the product names. [/INST]
|
SELECT t2.productName FROM orderdetails AS t1 INNER JOIN products AS t2 ON t1.productCode = t2.productCode GROUP BY t2.productName ORDER BY SUM(t1.quantityOrdered) ASC LIMIT 5;
|
[INST] Here is a database schema:
customers :
customerNumber [ INTEGER ] primary_key
customerName [ TEXT ]
contactLastName [ TEXT ]
contactFirstName [ TEXT ]
phone [ TEXT ]
addressLine1 [ TEXT ]
addressLine2 [ TEXT ]
city [ TEXT ]
state [ TEXT ]
postalCode [ TEXT ]
country [ TEXT ]
salesRepEmployeeNumber [ INTEGER ] customers.salesRepEmployeeNumber = employees.employeeNumber
creditLimit [ REAL ]
orders :
orderNumber [ INTEGER ] primary_key
orderDate [ DATE ]
requiredDate [ DATE ]
shippedDate [ DATE ]
status [ TEXT ]
comments [ TEXT ]
customerNumber [ INTEGER ] orders.customerNumber = customers.customerNumber
Please write me a SQL statement that answers the following question: List down the customer names with a disputed order status. [/INST]
|
SELECT t1.customerName FROM customers AS t1 INNER JOIN orders AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.status = 'Disputed';
|
[INST] Here is a database schema:
customers :
customerNumber [ INTEGER ] primary_key
customerName [ TEXT ]
contactLastName [ TEXT ]
contactFirstName [ TEXT ]
phone [ TEXT ]
addressLine1 [ TEXT ]
addressLine2 [ TEXT ]
city [ TEXT ]
state [ TEXT ]
postalCode [ TEXT ]
country [ TEXT ]
salesRepEmployeeNumber [ INTEGER ] customers.salesRepEmployeeNumber = employees.employeeNumber
creditLimit [ REAL ]
orders :
orderNumber [ INTEGER ] primary_key
orderDate [ DATE ]
requiredDate [ DATE ]
shippedDate [ DATE ]
status [ TEXT ]
comments [ TEXT ]
customerNumber [ INTEGER ] orders.customerNumber = customers.customerNumber
Please write me a SQL statement that answers the following question: How many countries from the USA have an In Process order status? [/INST]
|
SELECT COUNT(t2.orderNumber) FROM customers AS t1 INNER JOIN orders AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.status = 'On Hold' AND t1.country = 'USA';
|
[INST] Here is a database schema:
customers :
customerNumber [ INTEGER ] primary_key
customerName [ TEXT ]
contactLastName [ TEXT ]
contactFirstName [ TEXT ]
phone [ TEXT ]
addressLine1 [ TEXT ]
addressLine2 [ TEXT ]
city [ TEXT ]
state [ TEXT ]
postalCode [ TEXT ]
country [ TEXT ]
salesRepEmployeeNumber [ INTEGER ] customers.salesRepEmployeeNumber = employees.employeeNumber
creditLimit [ REAL ]
orders :
orderNumber [ INTEGER ] primary_key
orderDate [ DATE ]
requiredDate [ DATE ]
shippedDate [ DATE ]
status [ TEXT ]
comments [ TEXT ]
customerNumber [ INTEGER ] orders.customerNumber = customers.customerNumber
products :
productCode [ TEXT ] primary_key
productName [ TEXT ]
productLine [ TEXT ] products.productLine = productlines.productLine
productScale [ TEXT ]
productVendor [ TEXT ]
productDescription [ TEXT ]
quantityInStock [ INTEGER ]
buyPrice [ REAL ]
MSRP [ REAL ]
orderdetails :
orderNumber [ INTEGER ]
productCode [ TEXT ]
quantityOrdered [ INTEGER ]
priceEach [ REAL ]
orderLineNumber [ INTEGER ]
Please write me a SQL statement that answers the following question: Calculate the total price of shipped orders belonging to Land of Toys Inc. under the classic car line of products. [/INST]
|
SELECT SUM(t3.priceEach * t3.quantityOrdered) FROM customers AS t1 INNER JOIN orders AS t2 ON t1.customerNumber = t2.customerNumber INNER JOIN orderdetails AS t3 ON t2.orderNumber = t3.orderNumber INNER JOIN products AS t4 ON t3.productCode = t4.productCode WHERE t4.productLine = 'Classic Cars' AND t1.customerName = 'Land of Toys Inc.' AND t2.status = 'Shipped';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: How many restaurants have not obtained a minimum of 3 in their reviews? [/INST]
|
SELECT COUNT(id_restaurant) FROM generalinfo WHERE review < 3;
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: What types of food are served at the 4 top-reviewed restaurants? [/INST]
|
SELECT food_type FROM generalinfo WHERE review = ( SELECT MAX(review) FROM generalinfo ) LIMIT 4;
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: How many restaurants in the city of Richmond serve Mediterranean food? [/INST]
|
SELECT COUNT(id_restaurant) FROM generalinfo WHERE food_type = 'mediterranean' AND city = 'richmond';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
Please write me a SQL statement that answers the following question: List all the cities in Sonoma County. [/INST]
|
SELECT city FROM geographic WHERE county = 'sonoma county';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
Please write me a SQL statement that answers the following question: What counties are not in the Bay Area Region? [/INST]
|
SELECT DISTINCT county FROM geographic WHERE region != 'bay area';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
Please write me a SQL statement that answers the following question: List all cities in the Northern California Region. [/INST]
|
SELECT city FROM geographic WHERE region = 'northern california';
|
[INST] Here is a database schema:
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: List by its ID number all restaurants on 11th Street in Oakland. [/INST]
|
SELECT id_restaurant FROM location WHERE city = 'oakland' AND street_name = '11th street';
|
[INST] Here is a database schema:
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: How many restaurants can we find at number 871 on its street? [/INST]
|
SELECT COUNT(id_restaurant) FROM location WHERE street_num = 871;
|
[INST] Here is a database schema:
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: At what numbers on 9th Avenue of San Francisco there are restaurants? [/INST]
|
SELECT id_restaurant FROM location WHERE City = 'san francisco' AND street_name = '9th avenue';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: What type of food is there in the restaurants on Adeline Street in Berkeley city? [/INST]
|
SELECT T1.food_type FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_name = 'adeline st' AND T2.city = 'berkeley';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: In which regions are there no African food restaurants? [/INST]
|
SELECT DISTINCT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.food_type != 'african';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: In which counties are there A&W Root Beer Restaurants? [/INST]
|
SELECT DISTINCT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label = 'a & w root beer';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Indicate street and number of the Adelitas Taqueria Restaurants. [/INST]
|
SELECT T1.street_name, T1.street_num FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.label = 'adelitas taqueria';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: What type of food is served at the restaurant located at 3140, Alpine Road at San Mateo County? [/INST]
|
SELECT T2.food_type FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant INNER JOIN geographic AS T3 ON T2.city = T3.city WHERE T3.County = 'san mateo county' AND T1.street_name = 'alpine rd' AND T1.street_num = 3140;
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: In which streets of the city of San Francisco are there restaurants that serve seafood? [/INST]
|
SELECT T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T2.food_type = 'seafood' AND street_name IS NOT NULL;
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: List all counties where there is no Bakers Square Restaurant & Pie Shop. [/INST]
|
SELECT DISTINCT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label != 'bakers square restaurant & pie shop';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: In how many counties is there a street called Appian Way? [/INST]
|
SELECT COUNT(DISTINCT T2.county) FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.street_name = 'appian way';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: What is the rating of each restaurant reviews on Atlantic Ave? [/INST]
|
SELECT T1.review FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_name = 'atlantic ave';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Identify all restaurants in Contra Costa County by id. [/INST]
|
SELECT T1.id_restaurant FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'contra costa county';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: Identify all the restaurants in Yolo County by their label. [/INST]
|
SELECT T1.id_restaurant, T1.label FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'yolo county';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: What restaurant on Drive Street in San Rafael doesn't serve American food? [/INST]
|
SELECT T1.label FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_name = 'drive' AND T1.food_type != 'american' AND T2.city = 'san rafael';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: On which streets in the city of San Francisco are there restaurants with a review of 1.7? [/INST]
|
SELECT T2.street_name FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.review = 1.7;
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Which restaurant on the street Alameda de las Pulgas in the city of Menlo Park is the worst rated? [/INST]
|
SELECT T2.label FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_name = 'avenida de las pulgas' AND T2.city = 'menlo park' ORDER BY review LIMIT 1;
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: On what street in Tuolumne County is Good Heavens restaurant located? [/INST]
|
SELECT T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant INNER JOIN geographic AS T3 ON T2.city = T3.city WHERE T2.label = 'good heavens' AND T3.county = 'tuolumne county';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Indicate the street numbers where Aux Delices Vietnamese Restaurant are located. [/INST]
|
SELECT DISTINCT T1.street_num FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.label = 'aux delices vietnamese restaurant';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: Identify all the restaurants in Marin County by their id. [/INST]
|
SELECT T1.id_restaurant FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'marin county';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: In which regions are there no pizza restaurants? [/INST]
|
SELECT DISTINCT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.food_type = 'pizza' AND T2.region != 'unknown';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: Calculate the average rating of reviews for restaurants in Santa Cruz County. [/INST]
|
SELECT AVG(T2.review) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.county = 'santa cruz county';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: What percentage of restaurants in Monterey County have Mexican food? [/INST]
|
SELECT CAST(SUM(IIF(T2.food_type = 'mexican', 1, 0)) AS REAL) * 100 / COUNT(T2.id_restaurant) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.county = 'monterey county';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: What percentage of streets named 11th Street are in Alameda County? [/INST]
|
SELECT CAST(SUM(IIF(T1.street_name = '11th st', 1, 0)) AS REAL) * 100 / COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.County = 'alameda county';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: Please list all of the restaurants that serve European food. [/INST]
|
SELECT label FROM generalinfo WHERE food_type = 'european';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
Please write me a SQL statement that answers the following question: What cities are located in Northern California? [/INST]
|
SELECT city FROM geographic WHERE region = 'northern california';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: What does the one and only 24-hour diner's name? [/INST]
|
SELECT label FROM generalinfo WHERE food_type = '24 hour diner';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
Please write me a SQL statement that answers the following question: Please list any five cities that have an unidentified county and region. [/INST]
|
SELECT city FROM geographic WHERE county = 'unknown' AND region = 'unknown' LIMIT 5;
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
Please write me a SQL statement that answers the following question: What is the county and region of Davis City? [/INST]
|
SELECT county, region FROM geographic WHERE city = 'Davis';
|
[INST] Here is a database schema:
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Please list all of the street names in Clayton City. [/INST]
|
SELECT street_name FROM location WHERE city = 'Clayton';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: What are the most popular restaurants in San Francisco among diners? [/INST]
|
SELECT id_restaurant, label FROM generalinfo WHERE city = 'San Francisco' AND review = ( SELECT MAX(review) FROM generalinfo WHERE city = 'San Francisco' );
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: How many American food restaurants are unpopular in Carmel? [/INST]
|
SELECT COUNT(id_restaurant) FROM generalinfo WHERE food_type = 'american' AND city = 'carmel' AND review = ( SELECT MIN(review) FROM generalinfo WHERE food_type = 'american' AND city = 'carmel' );
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: What is the percentage of restaurants that serve American food in Dublin city? [/INST]
|
SELECT CAST(SUM(IIF(food_type = 'american food', 1, 0)) AS REAL) * 100 / COUNT(id_restaurant) FROM generalinfo WHERE city = 'dublin';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: What is the full address of Albert's Café? [/INST]
|
SELECT T2.street_num, T2.street_name, T1.city FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.label = 'Albert''s Café';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: What are the restaurants that are located at "19th St. Oakland"? [/INST]
|
SELECT T1.id_restaurant FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'Oakland' AND T2.street_name = '19th St';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: What kind of restaurants can be found at "106 E 25th Ave"? [/INST]
|
SELECT T1.food_type FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_num = 106 AND T2.street_name = 'e 25th ave';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Please name any three restaurants that have an unidentified region. [/INST]
|
SELECT T2.label FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant INNER JOIN geographic AS T3 ON T2.city = T3.city WHERE T3.region = 'unknown' LIMIT 3;
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: What is the name of the Chinese restaurant that can be found at 104 San Tomas Aquino Road, Campbell? [/INST]
|
SELECT T1.label FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_num = 104 AND T1.city = 'campbell' AND T2.street_name = 'san tomas aquino road';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: How many Thai restaurants can be found in San Pablo Ave, Albany? [/INST]
|
SELECT COUNT(T1.id_restaurant) FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.food_type = 'thai' AND T1.city = 'albany' AND T2.street_name = 'san pablo ave';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: What is the county and region of Plearn-Thai Cuisine restaurant? [/INST]
|
SELECT T1.county, T1.region, T2.label FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.label = 'plearn-thai cuisine';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: What is the name of the restaurant that is located in El Dorado County, Lake Tahoe region? [/INST]
|
SELECT T2.label FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.region = 'lake tahoe' AND T1.county = 'el dorado county';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Which county and region does the street E. El Camino Real belong to? [/INST]
|
SELECT DISTINCT T2.county, T2.region FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.street_name = 'E. El Camino Real';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: What is the name of the least popular Indian restaurant on Shattuck Avenue in Berkeley? [/INST]
|
SELECT T1.id_restaurant FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'berkeley' AND T2.street_name = 'shattuck ave' AND T1.food_type = 'Indian restaurant' ORDER BY T1.review LIMIT 1;
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: What is the percentage of restaurants in the Bay Area region that scored over 4 for the review rating? [/INST]
|
SELECT CAST(SUM(IIF(T2.review > 4, 1, 0)) AS REAL) * 100 / COUNT(T2.id_restaurant) FROM geographic AS T1 RIGHT JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.region = 'bay area';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
Please write me a SQL statement that answers the following question: List every city in San Mateo County. [/INST]
|
SELECT city FROM geographic WHERE county = 'san mateo county';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: How many restaurants have more than 4 star reviews? [/INST]
|
SELECT COUNT(id_restaurant) AS cnt FROM generalinfo WHERE review > 4;
|
[INST] Here is a database schema:
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Which street has the most restaurants? [/INST]
|
SELECT street_name FROM location GROUP BY street_name ORDER BY COUNT(street_name) DESC LIMIT 1;
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: Which chicken restaurant has the highest review? [/INST]
|
SELECT label FROM generalinfo WHERE food_type = 'chicken' ORDER BY review DESC LIMIT 1;
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
Please write me a SQL statement that answers the following question: Which county is El Cerrito from? [/INST]
|
SELECT county FROM geographic WHERE city = 'el cerrito';
|
[INST] Here is a database schema:
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: How many restaurants are on Irving Street? [/INST]
|
SELECT COUNT(id_restaurant) FROM location WHERE street_name = 'irving';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: Provide a list of restaurants from Marin county. [/INST]
|
SELECT T1.label FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'marin county';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: What is the address of the Peking Duck restaurant? [/INST]
|
SELECT T2.street_name FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.label = 'peking duck restaurant';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: List all the streets with more than 10 restaurants in Alameda county. [/INST]
|
SELECT T2.street_name FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.county = 'alameda county' GROUP BY T2.street_name HAVING COUNT(T2.id_restaurant) > 10;
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: What are the regions with Greek restaurants? [/INST]
|
SELECT DISTINCT T1.region FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.food_type = 'greek';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: List all of the restaurant addresses from an unknown region. [/INST]
|
SELECT T2.street_name FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.region = 'unknown';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: What is the review of the restaurant at 8440 Murray Ave? [/INST]
|
SELECT T2.review FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_name = 'murray ave' AND T1.street_num = 8440;
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: What type of restaurant is most common in Monterey county? [/INST]
|
SELECT T2.food_type FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.county = 'Monterey' GROUP BY T2.food_type ORDER BY COUNT(T2.food_type) DESC LIMIT 1;
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Which street in San Francisco has the most burger restaurants? [/INST]
|
SELECT T2.street_name FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.food_type = 'burgers' GROUP BY T2.street_name ORDER BY COUNT(T2.id_restaurant) DESC LIMIT 1;
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: What is the region of 1149 El Camino Real? [/INST]
|
SELECT T2.region FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.street_num = 1149 AND T1.street_name = 'el camino real';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: What is the county of the Sankee restaurant? [/INST]
|
SELECT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label = 'sankee';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: How many streets with restaurants are there in the Northern California region? [/INST]
|
SELECT COUNT(T1.city) FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.region = 'northern california';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: List all of the restaurants on Park St. [/INST]
|
SELECT T2.label FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_name = 'park st';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: What percentage of restaurants are from the Bay Area? [/INST]
|
SELECT CAST(SUM(IIF(T1.region = 'bay area', 1, 0)) AS REAL) * 100 / COUNT(T2.id_restaurant) FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city;
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: List all the average reviews of Chinese restaurants for each county from highest to lowest. [/INST]
|
SELECT AVG(T1.review) FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.food_type = 'chinese' GROUP BY T1.id_restaurant ORDER BY AVG(T1.review) DESC;
|
[INST] Here is a database schema:
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: List street names in San Francisco city. [/INST]
|
SELECT street_name FROM location WHERE city = 'San Francisco';
|
[INST] Here is a database schema:
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: List restaurant ids located in Danville city. [/INST]
|
SELECT id_restaurant FROM location WHERE city = 'Danville';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
Please write me a SQL statement that answers the following question: How many cities are located in the Bay Area? [/INST]
|
SELECT COUNT(city) FROM geographic WHERE region = 'bay area';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: How many labels of the restaurant have an unknown country? [/INST]
|
SELECT COUNT(T1.label) FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'unknown';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Please indicate the street names of restaurants with food type is American. [/INST]
|
SELECT T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.food_type = 'American';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: Please indicate which labels have the city located in Santa Cruz. [/INST]
|
SELECT T1.label FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'Santa Cruz county';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Give the review of the restaurant at 430, Broadway. [/INST]
|
SELECT T1.review FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_name = 'Broadway' AND T2.street_num = 430;
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Indicate the address of the restaurant with the most popular reviews. [/INST]
|
SELECT T2.street_num, T2.street_name FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant ORDER BY T1.review DESC LIMIT 1;
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: Which country has the most restaurants with Italian food? [/INST]
|
SELECT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.food_type = 'Italian' GROUP BY T2.county ORDER BY COUNT(T1.id_restaurant) DESC LIMIT 1;
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
Please write me a SQL statement that answers the following question: Find the percentage of restaurant in Napa Valley. [/INST]
|
SELECT CAST(SUM(IIF(region = 'Napa Valley', 1, 0)) AS REAL) * 100 / COUNT(region) FROM geographic;
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
Please write me a SQL statement that answers the following question: How many of the cities are in a Bay Area? [/INST]
|
SELECT COUNT(city) FROM geographic WHERE region = 'bay area';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
Please write me a SQL statement that answers the following question: List down the cities with unknown country. [/INST]
|
SELECT city FROM geographic WHERE county = 'unknown';
|
[INST] Here is a database schema:
geographic :
city [ TEXT ] primary_key
county [ TEXT ]
region [ TEXT ]
Please write me a SQL statement that answers the following question: What is the city located in Bay Area of Santa Clara? [/INST]
|
SELECT city FROM geographic WHERE region = 'bay area' AND county = 'santa clara county';
|
[INST] Here is a database schema:
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: List down the restaurant ID of restaurants located in Sunnyvale. [/INST]
|
SELECT id_restaurant FROM location WHERE city = 'sunnyvale';
|
[INST] Here is a database schema:
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Among the restaurants on street number below 1000, how many of them are in Railroad St.? [/INST]
|
SELECT COUNT(city) FROM location WHERE street_name = 'railroad' AND street_num < 1000;
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
Please write me a SQL statement that answers the following question: What is the name of the 24 hour diner at San Francisco? [/INST]
|
SELECT label FROM generalinfo WHERE food_type = '24 hour diner' AND city = 'san francisco';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Give the review of the restaurant located in Ocean St., Santa Cruz. [/INST]
|
SELECT T2.review FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.city = 'santa cruz' AND T1.street_name = 'ocean st';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Give the street number of a bar in Oakland with a 2.7 review. [/INST]
|
SELECT T2.street_num FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.review = 2.7 AND T2.city = 'oakland' AND T1.food_type = 'bar';
|
[INST] Here is a database schema:
generalinfo :
id_restaurant [ INTEGER ] primary_key
label [ TEXT ]
food_type [ TEXT ]
city [ TEXT ] generalinfo.city = geographic.city
review [ REAL ]
location :
id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant
street_num [ INTEGER ]
street_name [ TEXT ]
city [ TEXT ] location.city = geographic.city
Please write me a SQL statement that answers the following question: Among the bakeries, what is total number of bakery located at University Avenue, Palo Alto? [/INST]
|
SELECT COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.food_type = 'bakery' AND T2.city = 'palo alto' AND T1.street_name = 'university ave.';
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.