db_id stringclasses 68 values | question stringlengths 24 325 | evidence stringlengths 0 580 | SQL stringlengths 23 728 |
|---|---|---|---|
car_retails | What's the postal code of the office the VP Sales is at? | VP Sales refers to jobTitle | SELECT t2.postalCode FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t1.jobTitle = 'VP Sales' |
car_retails | What is the total price of the order made by Cruz & Sons Co. on 2003/3/3? | SUM(MULTIPLY(quantityOrdered, priceEach)) where orderDate = '2003-03-03'; customerName = 'Cruz & Sons Co.' | SELECT SUM(t1.priceEach * 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 WHERE t3.customerName = 'Cruz & Sons Co.' AND t2.orderDate = '2003-03-03' |
car_retails | Which product did Cruz & Sons Co. order on 2003/3/3? | Cruz & Sons Co. is name of customer; 2003/3/3 refers to orderDate; | SELECT t4.productName 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 WHERE t3.customerName = 'Cruz & Sons Co.' AND t2.orderDate = '2003-03-03' |
car_retails | Which product did Cruz & Sons Co. ask for the biggest amount in a single order? | Cruz & Sons Co. is name of customer; the biggest amount refers to MAX(quantityOrdered). | SELECT t4.productName 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 WHERE t3.customerName = 'Cruz & Sons Co.' ORDER BY t1.priceEach * t1.quantityOrdered DESC LIMIT 1 |
car_retails | When were the products ordered by Cruz & Sons Co. on 2003-03-03 shipped? | Cruz & Sons Co. is name of customer; ordered on 2003-03-03 refers to orderDate; | SELECT t1.shippedDate FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.customerName = 'Cruz & Sons Co.' AND t1.orderDate = '2003-03-03' |
car_retails | What is the amount of customers of 1957 Chevy Pickup by customers in a month? | SELECT COUNT(T2.customerNumber) FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber WHERE T1.productCode IN ( SELECT productCode FROM products WHERE productName = '1957 Chevy Pickup' ) | |
car_retails | Name the product from the 'Classic Cars' production line that has the greatest expected profit. | The greatest expected profit refers to MAX(SUBTRACT(MSRP, buyPrice); | SELECT t.productName, t.MSRP - t.buyPrice FROM products AS t WHERE t.productLine = 'Classic Cars' ORDER BY t.MSRP - t.buyPrice DESC LIMIT 1 |
car_retails | List all the name of customers who have orders that are still processing. | Still processing refers to status = 'In Process'; | SELECT t2.customerName FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.status = 'In Process' |
car_retails | Which is the most ordered quantity product? What is its expected profit margin per piece? | The most ordered quantity product refers to productName where Max(quantityOrdered); SUBTRACT(MSRP, buyPrice); | SELECT productName, MSRP - buyPrice FROM products WHERE productCode = ( SELECT productCode FROM orderdetails ORDER BY quantityOrdered DESC LIMIT 1 ) |
car_retails | For the order has the most product ordered, name the customer who placed the order. | The largest order in terms of total price refers to MAX(SUM(MULTIPLY(quantityOrdered, priceEach)). | SELECT T2.firstName, T2.lastName FROM offices AS T1 INNER JOIN employees AS T2 ON T1.officeCode = T2.officeCode WHERE T2.employeeNumber = ( SELECT MAX(employeeNumber) FROM employees ) |
car_retails | List all customer names with orders that are disputed. | Orders that are disputed refer to status = 'Disputed'; the sales representative means employees; names refers to firstName, lastName. | SELECT t3.firstName, t3.lastName FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber INNER JOIN employees AS t3 ON t2.salesRepEmployeeNumber = t3.employeeNumber WHERE t1.status = 'Disputed' |
car_retails | What is the percentage of employees are in Paris office? | DIVIDE(COUNT(employeeNumber) when city = 'Paris'), (COUNT(employeeNumber)) as percentage; | SELECT CAST(COUNT(CASE WHEN t1.city = 'Paris' THEN t2.employeeNumber ELSE NULL END) AS REAL) * 100 / COUNT(t2.employeeNumber) FROM offices AS t1 INNER JOIN employees AS t2 ON t1.officeCode = t2.officeCode |
car_retails | Name the Sales Manager of Europe, Middle East, and Africa region. In which office does he/she report to? | Sales Manager refers to jobTitle; Europe, Middle East, and Africa region refers to territory = 'EMEA'; | SELECT t2.firstName, t2.lastName FROM offices AS t1 INNER JOIN employees AS t2 ON t1.officeCode = t2.officeCode WHERE t2.jobTitle = 'Sale Manager (EMEA)' |
car_retails | List the name of employees in Japan office and who are they reporting to. | Japan is the name of the country; 'reportsTO' is the leader of the 'employeeNumber'; | SELECT t2.firstName, t2.lastName, t2.reportsTo FROM offices AS t1 INNER JOIN employees AS t2 ON t1.officeCode = t2.officeCode WHERE t1.country = 'Japan' |
car_retails | Which customer ordered 1939 'Chevrolet Deluxe Coupe' at the highest price? | 1939 'Chevrolet Deluxe Coupe' refers to productName; the highest price refers to MAX(priceEach) | SELECT t4.customerName 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 WHERE t1.productName = '1939 Chevrolet Deluxe Coupe' ORDER BY t2.priceEach DESC LIMIT 1 |
car_retails | Calculate the actual profit for order number 10100. | SUM(MULTIPLY(quantityOrdered (SUBTRACT (priceEach, buyPrice)); | SELECT SUM((t1.priceEach - t2.buyPrice) * t1.quantityOrdered) FROM orderdetails AS t1 INNER JOIN products AS t2 ON t1.productCode = t2.productCode WHERE t1.orderNumber = '10100' |
car_retails | How much did customer 103 pay in total? | Pay in total refers to SUM(amount); | SELECT SUM(t.amount) FROM payments t WHERE t.customerNumber = '103' |
car_retails | What is the total price of the order 10100? | SUM(MULTIPLY(quantityOrdered, priceEach) | SELECT SUM(t.priceEach * t.quantityOrdered) FROM orderdetails t WHERE t.orderNumber = '10100' |
car_retails | Please list the top three product names with the highest unit price. | The highest unit price refers to MAX(priceEach) | SELECT t1.productName FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode ORDER BY t2.priceEach DESC LIMIT 3 |
car_retails | Among the customers of empolyee 1370, who has the highest credit limit?Please list the full name of the contact person. | Employee 1370 refers to employeeNumber = '1370'; | SELECT t2.contactFirstName, t2.contactLastName FROM employees AS t1 INNER JOIN customers AS t2 ON t1.employeeNumber = t2.salesRepEmployeeNumber WHERE t1.employeeNumber = '1370' ORDER BY t2.creditLimit DESC LIMIT 1 |
car_retails | How many 2003 Harley-Davidson Eagle Drag Bikes were ordered? | 2003 Harley-Davidson Eagle Drag Bikes refers to productName; how many ordered refers to COUNT(quantityOrdered); | SELECT SUM(t2.quantityOrdered) FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode WHERE t1.productName = '2003 Harley-Davidson Eagle Drag Bike' |
car_retails | When was the product with the highest unit price shipped? | The highest unit price refers to MAX(priceEach); when shipped refers to shippedDate; | SELECT t1.shippedDate FROM orders AS t1 INNER JOIN orderdetails AS t2 ON t1.orderNumber = t2.orderNumber ORDER BY t2.priceEach DESC LIMIT 1 |
car_retails | Please list the order number of the customer whose credit card has a limit of 45300. | Credit card does not have a limit refers to creditLimit = 45300; | SELECT t1.orderNumber FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.creditLimit = 45300 |
car_retails | For Which order was the most profitable, please list the customer name of the order and the profit of the order. | Most profitable order can be computed as MAX(MULTIPLY(quantityOrdered, SUBTRACT(priceEach, buyPrice)). | 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 |
car_retails | List out sale rep that has sold 1969 Harley Davidson Ultimate Chopper. List out their names and quantity sold throughout the year. | 1969 Harley Davidson Ultimate Chopper refers to the name of the product; sale rep refers to employee; 2003 refers to year(orderDate) = 2003; quantity sold refers to quantityOrdered; their names refer to the name of customers; | 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 |
car_retails | Who are the sales representatives in New York City? List their full names. | New York City refers to city = 'NYC'; sales representative refers to jobTitle = 'Sales Rep'; | 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' |
car_retails | Identify the customer and list down the country with the check number GG31455. | SELECT t2.customerName, t2.country FROM payments AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.checkNumber = 'GG31455' | |
car_retails | How many 2001 Ferrari Enzo were ordered? | 2001 Ferrari Enzo refers to productName; | SELECT SUM(t1.orderNumber) FROM orderdetails AS t1 INNER JOIN products AS t2 ON t1.productCode = t2.productCode WHERE t2.productName = '2001 Ferrari Enzo' |
car_retails | Which 5 products has the lowest amount of orders? List the product names. | The lowest amount of orders refers to MIN(quantityOrdered); | 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 |
car_retails | List down the customer names with a disputed order status. | SELECT t1.customerName FROM customers AS t1 INNER JOIN orders AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.status = 'Disputed' | |
car_retails | How many countries from the USA have an In Process order status? | country = 'USA' | 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' |
car_retails | Calculate the total price of shipped orders belonging to Land of Toys Inc. under the classic car line of products. | SUM(MULTIPLY(quantityOrdered, priceEach)) where productLine = 'Classic Cars'; status = 'Shipped'; customername = 'Land of Toys Inc'; | 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' |
restaurant | How many restaurants have not obtained a minimum of 3 in their reviews? | have not obtained a minimum of 3 in review refers to review < 3 | SELECT COUNT(id_restaurant) FROM generalinfo WHERE review < 3 |
restaurant | What types of food are served at the 4 top-reviewed restaurants? | top-reviewed refers to review = 4; type of food refers to food_type
| SELECT food_type FROM generalinfo WHERE review = ( SELECT MAX(review) FROM generalinfo ) LIMIT 4 |
restaurant | How many restaurants in the city of Richmond serve Mediterranean food? | Mediterranean food refers to food_type = 'mediterranean' | SELECT COUNT(id_restaurant) FROM generalinfo WHERE food_type = 'mediterranean' AND city = 'richmond' |
restaurant | List all the cities in Sonoma County. | SELECT city FROM geographic WHERE county = 'sonoma county' | |
restaurant | What counties are not in the Bay Area Region? | not in the Bay Area region refers to region ! = 'bay area' | SELECT DISTINCT county FROM geographic WHERE region != 'bay area' |
restaurant | List all cities in the Northern California Region. | SELECT city FROM geographic WHERE region = 'northern california' | |
restaurant | How many restaurants can we find at number 871 on its street? | number 871 on its street refers to street_num = 871 | SELECT COUNT(id_restaurant) FROM location WHERE street_num = 871 |
restaurant | At what numbers on 9th Avenue of San Francisco there are restaurants? | 9th Avenue refers to street_name = '9th avenue'; San Francisco refers to City = 'san francisco' | SELECT id_restaurant FROM location WHERE City = 'san francisco' AND street_name = '9th avenue' |
restaurant | What type of food is there in the restaurants on Adeline Street in Berkeley city? | Adeline Street refers to street_name = 'adeline st'; type of food refers to food_type
| 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' |
restaurant | In which regions are there no African food restaurants? | no African food restaurants refers to food_type <> 'african' | SELECT DISTINCT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.food_type != 'african' |
restaurant | In which counties are there A&W Root Beer Restaurants? | A&W Root Beer Restaurant refers to label = 'a & w root beer' | 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' |
restaurant | Indicate street and number of the Adelitas Taqueria Restaurants. | street refers to street_name; number refers to street_num; Adelitas Taqueria Restaurant refers to label = 'adelitas taqueria' | 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' |
restaurant | What type of food is served at the restaurant located at 3140, Alpine Road at San Mateo County? | 3140 Alpine Road at San Mateo County refers to street_num = 3140 AND street_name = 'alpine rd' AND County = 'san mateo county'; type of food refers to food_type | 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 |
restaurant | In which streets of the city of San Francisco are there restaurants that serve seafood? | street refers to street_name; seafood refers to food_type = 'seafood' | 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 |
restaurant | List all counties where there is no Bakers Square Restaurant & Pie Shop. | no Bakers Square Restaurant & Pie Shop refers to label <> 'bakers square restaurant & pie shop' | 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' |
restaurant | In how many counties is there a street called Appian Way? | a street called Appian Way refers to street_name = 'appian way' | 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' |
restaurant | What is the rating of each restaurant reviews on Atlantic Ave? | Atlantic Ave refers to street_name = 'atlantic ave'; rating refers to review | 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' |
restaurant | Identify all restaurants in Contra Costa County by id. | SELECT T1.id_restaurant FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'contra costa county' | |
restaurant | Identify all the restaurants in Yolo County by their label. | 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' | |
restaurant | What restaurant on Drive Street in San Rafael doesn't serve American food? | Drive Street refers to street_name = 'drive'; San Rafael refers to city = 'san rafael'; American food refers to food_type <> 'american' | 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' |
restaurant | On what street in Tuolumne County is Good Heavens restaurant located? | street refers to street_name; Good Heavens restaurant refers to label = 'good heavens' | 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' |
restaurant | Indicate the street numbers where Aux Delices Vietnamese Restaurant are located. | street numbers refers to street_num; Aux Delices Vietnamese Restaurant refers to label = 'aux delices vietnamese restaurant' | 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' |
restaurant | Identify all the restaurants in Marin County by their id. | SELECT T1.id_restaurant FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'marin county' | |
restaurant | In which regions are there no pizza restaurants? | no pizza restaurants refers to food_type = 'pizza' | 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' |
restaurant | Calculate the average rating of reviews for restaurants in Santa Cruz County. | average rating = divide(sum(review where county = 'santa cruz county'), count(id_restaurant where county = 'santa cruz county')) | SELECT AVG(T2.review) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.county = 'santa cruz county' |
restaurant | Please list all of the restaurants that serve European food. | restaurant refers to label; European food refers to food_type = 'european' | SELECT label FROM generalinfo WHERE food_type = 'european' |
restaurant | What cities are located in Northern California? | Northern California refers to region = 'northern california' | SELECT city FROM geographic WHERE region = 'northern california' |
restaurant | What does the one and only 24-hour diner's name? | 24-hour diner refers to food_type = '24 hour diner'; diner name refers to label | SELECT label FROM generalinfo WHERE food_type = '24 hour diner' |
restaurant | Please list any five cities that have an unidentified county and region. | unidentified county and region refers to county = 'unknown' AND region = 'unknown' | SELECT city FROM geographic WHERE county = 'unknown' AND region = 'unknown' LIMIT 5 |
restaurant | How many American food restaurants are unpopular in Carmel? | American Food Restaurant refers to food_type = 'ameraican'; unpopular refers to min(review); Carmel refers to city = 'Carmel' | 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' ) |
restaurant | What kind of restaurants can be found at "106 E 25th Ave"? | kind of restaurant refers to food_type; "106 E 25th Ave" refers to street_name = 'e 25th ave' | 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' |
restaurant | Please name any three restaurants that have an unidentified region. | restaurant name refers to label; unidentified region refers to region = 'unknown' | 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 |
restaurant | How many Thai restaurants can be found in San Pablo Ave, Albany? | Thai restaurant refers to food_type = 'thai'; San Pablo Ave Albany refers to street_name = 'san pablo ave' AND T1.city = 'albany' | 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' |
restaurant | What is the county and region of Plearn-Thai Cuisine restaurant? | Plearn-Thai Cuisine restaurant refers to label = 'plearn-thai cuisine' | 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' |
restaurant | What is the name of the restaurant that is located in El Dorado County, Lake Tahoe region? | restaurant name refers to label | 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' |
restaurant | List every city in San Mateo County. | SELECT city FROM geographic WHERE county = 'san mateo county' | |
restaurant | How many restaurants have more than 4 star reviews? | more than 4 star review refers to review > 4 | SELECT COUNT(id_restaurant) AS cnt FROM generalinfo WHERE review > 4 |
restaurant | Which street has the most restaurants? | street refers to street_name; the most restaurants refers to max(count(street_name)) | SELECT street_name FROM location GROUP BY street_name ORDER BY COUNT(street_name) DESC LIMIT 1 |
restaurant | Which chicken restaurant has the highest review? | chicken restaurant refers to food_type = 'chicken'; the highest review refers to max(review) | SELECT label FROM generalinfo WHERE food_type = 'chicken' ORDER BY review DESC LIMIT 1 |
restaurant | Which county is El Cerrito from? | El Cerrito refers to city = 'el cerrito' | SELECT county FROM geographic WHERE city = 'el cerrito' |
restaurant | How many restaurants are on Irving Street? | Irving Street refers to street_name = 'irving' | SELECT COUNT(id_restaurant) FROM location WHERE street_name = 'irving' |
restaurant | Provide a list of restaurants from Marin county. | restaurant refers to label | SELECT T1.label FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'marin county' |
restaurant | What is the address of the Peking Duck restaurant? | address refers to street_num, street_name; Peking Duck restaurant refers to label = 'peking duck restaurant' | 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' |
restaurant | List all the streets with more than 10 restaurants in Alameda county. | street refers to street_name; more than 10 restaurants refers to count(id_restaurant) > 10 | 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 |
restaurant | What are the regions with Greek restaurants? | Greek restaurant refers to food_type = 'greek' | SELECT DISTINCT T1.region FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.food_type = 'greek' |
restaurant | List all of the restaurant addresses from an unknown region. | restaurant address refers to street_num, street_name; unknown region refers to region = 'unknown' | SELECT T2.street_name FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.region = 'unknown' |
restaurant | What is the review of the restaurant at 8440 Murray Ave? | 8440 Murray Ave refers to street_num = 8440 and street_name = 'murray ave' | 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 |
restaurant | Which street in San Francisco has the most burger restaurants? | street refers to street_name; San Francisco refers to city = 'san francisco'; burger restaurant refers to food_type = 'burgers'; the most burger restaurants refers to max(count(street_name where food_type = 'burgers' and city = 'san francisco')) | 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 |
restaurant | What is the region of 1149 El Camino Real? | 1149 El Camino Real refers to street_num = 1149 and street_name = 'el camino real' | 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' |
restaurant | What is the county of the Sankee restaurant? | Sankee restaurant refers to label = 'sankee' | SELECT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label = 'sankee' |
restaurant | How many streets with restaurants are there in the Northern California region? | SELECT COUNT(T1.city) FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.region = 'northern california' | |
restaurant | List all of the restaurants on Park St. | restaurant refers to label; Park St refers to street_name = 'park st' | 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' |
restaurant | List all the average reviews of Chinese restaurants for each county from highest to lowest. | Chinese restaurant refers to food_type = 'chinese'; average review refers to divide(sum(review), count(review)) | 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 |
restaurant | How many cities are located in the Bay Area? | the Bay Area refers to region = 'bay area' | SELECT COUNT(city) FROM geographic WHERE region = 'bay area' |
restaurant | How many labels of the restaurant have an unknown country? | unknown county refers to county = 'unknown' | SELECT COUNT(T1.label) FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'unknown' |
restaurant | Indicate the address of the restaurant with the most popular reviews. | address refers to street_num, street_name; the most popular review refers to max(review) | 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 |
restaurant | How many of the cities are in a Bay Area? | Bay Area refers to region = 'bay area' | SELECT COUNT(city) FROM geographic WHERE region = 'bay area' |
restaurant | List down the cities with unknown country. | unknown county refers to county = 'unknown' | SELECT city FROM geographic WHERE county = 'unknown' |
restaurant | What is the city located in Bay Area of Santa Clara? | Bay Area refers to region = 'bay area'; Santa Clara refers to county = 'santa clara county' | SELECT city FROM geographic WHERE region = 'bay area' AND county = 'santa clara county' |
restaurant | List down the restaurant ID of restaurants located in Sunnyvale. | Sunnyvale refers to city = 'sunnyvale' | SELECT id_restaurant FROM location WHERE city = 'sunnyvale' |
restaurant | Among the restaurants on street number below 1000, how many of them are in Railroad St.? | street number below 1000 refers to street_num < 1000; Railroad St. refers to street_name = 'railroad' | SELECT COUNT(city) FROM location WHERE street_name = 'railroad' AND street_num < 1000 |
restaurant | What is the name of the 24 hour diner at San Francisco? | name refers to label; 24 hour diner refers to food_type = '24 hour diner'; San Francisco refers to city = 'san francisco' | SELECT label FROM generalinfo WHERE food_type = '24 hour diner' AND city = 'san francisco' |
restaurant | Give the review of the restaurant located in Ocean St., Santa Cruz. | Ocean St. refers to street_name = 'ocean st'; Santa Cruz refers to city = 'santa cruz' | 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' |
restaurant | Among the bakeries, what is total number of bakery located at University Avenue, Palo Alto? | bakery refers to food_type = 'bakery'; University Avenue refers to street_name = 'university ave.'; Palo Alto refers to city = 'palo alto' | 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.' |
restaurant | List the review and label of the restaurants in Mission Blvd., Hayward. | Mission Blvd. refers to street_name = 'mission blvd'; Hayward refers to city = 'hayward' | SELECT T2.review, T2.label FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.city = 'hayward' AND T1.street_name = 'mission blvd' |
restaurant | Among all indian restaurants in Castro St., Mountainview, how many of them is about cookhouse in their label? | indian restaurant refers to food_type = 'indian'; Castro St. refers to street_name = 'castro st'; Mountainview refers to city = 'mountainview'; have the word "Indian" in label refers to label = 'indian' | SELECT COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_name = 'castro st' AND T1.city = 'mountain view' AND T2.food_type = 'indian' AND T2.label LIKE '%cookhouse%' |
restaurant | In restaurants with a review of 2, how many restaurants have a street number below 500? | review of 2 refers to review = 2; street number below 500 refers to street_num < 500 | SELECT COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.review = 2 AND T1.street_num < 500 |
restaurant | Among all asian restaurants in N. Milpitas Blvd., Milpitas, how many of them have restaurant ID greater than 385? | asian restaurant refers to food_type = 'asian'; N. Milpitas Blvd. refers to street_name = 'n milpitas blvd'; Milpitas refers to city = 'milpitas'; restaurant ID greater than 385 refers to id_restaurant > 385 | SELECT COUNT(T1.id_restaurant) AS num FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.city = 'milpitas' AND T2.food_type = 'asian' AND T1.street_name = 'n milpitas blvd' AND T1.id_restaurant > 385 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.