problem
stringlengths
121
422
db_id
stringclasses
69 values
solution
stringlengths
23
804
Write SQL query to solve given problem: Who is the sales representitive of Muscle Machine Inc? Please give the employee's full name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT t2.firstName, t2.lastName FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t1.customerName = 'Muscle Machine Inc'
Write SQL query to solve given problem: If I'm from the Muscle Machine Inc, to which e-mail adress should I write a letter if I want to reach the superior of my sales representitive?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT t2.email FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t1.customerName = 'Muscle Machine Inc'
Write SQL query to solve given problem: Please list all the customers that have Steve Patterson as their sales representitive.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT t1.customerName FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t2.firstName = 'Steve' AND t2.lastName = 'Patterson'
Write SQL query to solve given problem: How many customers have an employee who reports to William Patterson as their sales representitive?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT COUNT(t1.customerNumber) FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t2.firstName = 'William' AND t2.lastName = 'Patterson'
Write SQL query to solve given problem: Please list the phone numbers of the top 3 customers that have the highest credit limit and have Leslie Jennings as their sales representitive.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT t1.phone FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t2.firstName = 'Leslie' AND t2.lastName = 'Jennings' ORDER BY t1.creditLimit DESC LIMIT 3
Write SQL query to solve given problem: How many sales representitives are based in the offices in the USA?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT COUNT(t1.employeeNumber) FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t2.country = 'USA' AND t1.jobTitle = 'Sales Rep'
Write SQL query to solve given problem: Where can I find the office of the President of the company?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT t2.addressLine1, t2.addressLine2 FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t1.jobTitle = 'President'
Write SQL query to solve given problem: What's the postal code of the office the VP Sales is at?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT t2.postalCode FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t1.jobTitle = 'VP Sales'
Write SQL query to solve given problem: What is the total price of the order made by Cruz & Sons Co. on 2003/3/3?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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'
Write SQL query to solve given problem: Which product did Cruz & Sons Co. order on 2003/3/3?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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'
Write SQL query to solve given problem: Which product did Cruz & Sons Co. ask for the biggest amount in a single order?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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
Write SQL query to solve given problem: When were the products ordered by Cruz & Sons Co. on 2003-03-03 shipped?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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'
Write SQL query to solve given problem: What is the amount of customers of 1957 Chevy Pickup by customers in a month?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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' )
Write SQL query to solve given problem: Name the product from the 'Classic Cars' production line that has the greatest expected profit.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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
Write SQL query to solve given problem: List all the name of customers who have orders that are still processing.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT t2.customerName FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.status = 'In Process'
Write SQL query to solve given problem: Among all orders shipped, calculate the percentage of orders shipped at least 3 days before the required date.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT COUNT(CASE WHEN JULIANDAY(t1.shippeddate) - JULIANDAY(t1.requireddate) > 3 THEN T1.customerNumber ELSE NULL END) FROM orders AS T1 INNER JOIN orderdetails AS T2 ON T1.orderNumber = T2.orderNumber WHERE T1.status = 'Shipped'
Write SQL query to solve given problem: Find the customer who made the highest payment in 2005.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT t2.customerName FROM payments AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE STRFTIME('%Y', t1.paymentDate) = '2005' GROUP BY t2.customerNumber, t2.customerName ORDER BY SUM(t1.amount) DESC LIMIT 1
Write SQL query to solve given problem: Which is the most ordered quantity product? What is its expected profit margin per piece?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT productName, MSRP - buyPrice FROM products WHERE productCode = ( SELECT productCode FROM orderdetails ORDER BY quantityOrdered DESC LIMIT 1 )
Write SQL query to solve given problem: For the order has the most product ordered, name the customer who placed the order.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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 )
Write SQL query to solve given problem: List all customer names with orders that are disputed.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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'
Write SQL query to solve given problem: What is the percentage of employees are in Paris office?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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
Write SQL query to solve given problem: Name the Sales Manager of Europe, Middle East, and Africa region. In which office does he/she report to?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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)'
Write SQL query to solve given problem: List the name of employees in Japan office and who are they reporting to.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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'
Write SQL query to solve given problem: Which customer ordered 1939 'Chevrolet Deluxe Coupe' at the highest price?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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
Write SQL query to solve given problem: What is the percentage of the payment amount in 2004 was made by Atelier graphique?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT SUM(CASE WHEN t1.customerName = 'Atelier graphique' THEN t2.amount ELSE 0 END) * 100 / SUM(t2.amount) FROM customers AS t1 INNER JOIN payments AS t2 ON t1.customerNumber = t2.customerNumber WHERE STRFTIME('%Y', t2.paymentDate) = '2004'
Write SQL query to solve given problem: Calculate the actual profit for order number 10100.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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'
Write SQL query to solve given problem: How much did customer 103 pay in total?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT SUM(t.amount) FROM payments t WHERE t.customerNumber = '103'
Write SQL query to solve given problem: What is the total price of the order 10100?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT SUM(t.priceEach * t.quantityOrdered) FROM orderdetails t WHERE t.orderNumber = '10100'
Write SQL query to solve given problem: Please list the top three product names with the highest unit price.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT t1.productName FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode ORDER BY t2.priceEach DESC LIMIT 3
Write SQL query to solve given problem: Among the customers of empolyee 1370, who has the highest credit limit?Please list the full name of the contact person.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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
Write SQL query to solve given problem: How many 2003 Harley-Davidson Eagle Drag Bikes were ordered?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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'
Write SQL query to solve given problem: When was the product with the highest unit price shipped?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT t1.shippedDate FROM orders AS t1 INNER JOIN orderdetails AS t2 ON t1.orderNumber = t2.orderNumber ORDER BY t2.priceEach DESC LIMIT 1
Write SQL query to solve given problem: How many motorcycles have been ordered in 2004?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT 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 t3.productLine = 'motorcycles' AND STRFTIME('%Y', t1.orderDate) = '2004'
Write SQL query to solve given problem: Please list the order number of the customer whose credit card has a limit of 45300.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT t1.orderNumber FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.creditLimit = 45300
Write SQL query to solve given problem: For Which order was the most profitable, please list the customer name of the order and the profit of the order.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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
Write SQL query to solve given problem: How many transactions payment made by customer that is lower than 10000. Group the result by year.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT STRFTIME('%Y', t1.paymentDate), COUNT(t1.customerNumber) FROM payments AS t1 WHERE t1.amount < 10000 GROUP BY STRFTIME('%Y', t1.paymentDate)
Write SQL query to solve given problem: List out 3 best seller products during year 2003 with their total quantity sold during 2003.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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
Write SQL query to solve given problem: List out sale rep that has sold 1969 Harley Davidson Ultimate Chopper. List out their names and quantity sold throughout the year.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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
Write SQL query to solve given problem: Who are the sales representatives in New York City? List their full names.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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'
Write SQL query to solve given problem: Identify the customer and list down the country with the check number GG31455.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT t2.customerName, t2.country FROM payments AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.checkNumber = 'GG31455'
Write SQL query to solve given problem: How many 2001 Ferrari Enzo were ordered?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT SUM(t1.orderNumber) FROM orderdetails AS t1 INNER JOIN products AS t2 ON t1.productCode = t2.productCode WHERE t2.productName = '2001 Ferrari Enzo'
Write SQL query to solve given problem: Which 5 products has the lowest amount of orders? List the product names.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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
Write SQL query to solve given problem: List down the customer names with a disputed order status.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
SELECT t1.customerName FROM customers AS t1 INNER JOIN orders AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.status = 'Disputed'
Write SQL query to solve given problem: How many countries from the USA have an In Process order status?. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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'
Write SQL query to solve given problem: Calculate the total price of shipped orders belonging to Land of Toys Inc. under the classic car line of products.. Keep the solution inside sql tag ```sql [SQL-Query] ```
car_retails
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'
Write SQL query to solve given problem: How many restaurants have not obtained a minimum of 3 in their reviews?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT COUNT(id_restaurant) FROM generalinfo WHERE review < 3
Write SQL query to solve given problem: What types of food are served at the 4 top-reviewed restaurants?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT food_type FROM generalinfo WHERE review = ( SELECT MAX(review) FROM generalinfo ) LIMIT 4
Write SQL query to solve given problem: How many restaurants in the city of Richmond serve Mediterranean food?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT COUNT(id_restaurant) FROM generalinfo WHERE food_type = 'mediterranean' AND city = 'richmond'
Write SQL query to solve given problem: List all the cities in Sonoma County.. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT city FROM geographic WHERE county = 'sonoma county'
Write SQL query to solve given problem: What counties are not in the Bay Area Region?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT DISTINCT county FROM geographic WHERE region != 'bay area'
Write SQL query to solve given problem: List all cities in the Northern California Region.. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT city FROM geographic WHERE region = 'northern california'
Write SQL query to solve given problem: List by its ID number all restaurants on 11th Street in Oakland.. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT id_restaurant FROM location WHERE city = 'oakland' AND street_name = '11th street'
Write SQL query to solve given problem: How many restaurants can we find at number 871 on its street?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT COUNT(id_restaurant) FROM location WHERE street_num = 871
Write SQL query to solve given problem: At what numbers on 9th Avenue of San Francisco there are restaurants?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT id_restaurant FROM location WHERE City = 'san francisco' AND street_name = '9th avenue'
Write SQL query to solve given problem: What type of food is there in the restaurants on Adeline Street in Berkeley city?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: In which regions are there no African food restaurants?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT DISTINCT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.food_type != 'african'
Write SQL query to solve given problem: In which counties are there A&W Root Beer Restaurants?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: Indicate street and number of the Adelitas Taqueria Restaurants.. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: What type of food is served at the restaurant located at 3140, Alpine Road at San Mateo County?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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
Write SQL query to solve given problem: In which streets of the city of San Francisco are there restaurants that serve seafood?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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
Write SQL query to solve given problem: List all counties where there is no Bakers Square Restaurant & Pie Shop.. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: In how many counties is there a street called Appian Way?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: What is the rating of each restaurant reviews on Atlantic Ave?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: Identify all restaurants in Contra Costa County by id.. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT T1.id_restaurant FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'contra costa county'
Write SQL query to solve given problem: Identify all the restaurants in Yolo County by their label.. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: What restaurant on Drive Street in San Rafael doesn't serve American food?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: On which streets in the city of San Francisco are there restaurants with a review of 1.7?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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
Write SQL query to solve given problem: Which restaurant on the street Alameda de las Pulgas in the city of Menlo Park is the worst rated?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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
Write SQL query to solve given problem: On what street in Tuolumne County is Good Heavens restaurant located?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: Indicate the street numbers where Aux Delices Vietnamese Restaurant are located.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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'
Write SQL query to solve given problem: Identify all the restaurants in Marin County by their id.. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT T1.id_restaurant FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'marin county'
Write SQL query to solve given problem: In which regions are there no pizza restaurants?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: Calculate the average rating of reviews for restaurants in Santa Cruz County.. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT AVG(T2.review) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.county = 'santa cruz county'
Write SQL query to solve given problem: What percentage of restaurants in Monterey County have Mexican food?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: What percentage of streets named 11th Street are in Alameda County?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: Please list all of the restaurants that serve European food.. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT label FROM generalinfo WHERE food_type = 'european'
Write SQL query to solve given problem: What cities are located in Northern California?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT city FROM geographic WHERE region = 'northern california'
Write SQL query to solve given problem: What does the one and only 24-hour diner's name?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT label FROM generalinfo WHERE food_type = '24 hour diner'
Write SQL query to solve given problem: Please list any five cities that have an unidentified county and region.. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT city FROM geographic WHERE county = 'unknown' AND region = 'unknown' LIMIT 5
Write SQL query to solve given problem: What is the county and region of Davis City?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT county, region FROM geographic WHERE city = 'Davis'
Write SQL query to solve given problem: Please list all of the street names in Clayton City.. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT street_name FROM location WHERE city = 'Clayton'
Write SQL query to solve given problem: What are the most popular restaurants in San Francisco among diners?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT id_restaurant, label FROM generalinfo WHERE city = 'San Francisco' AND review = ( SELECT MAX(review) FROM generalinfo WHERE city = 'San Francisco' )
Write SQL query to solve given problem: How many American food restaurants are unpopular in Carmel?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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' )
Write SQL query to solve given problem: What is the percentage of restaurants that serve American food in Dublin city?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT CAST(SUM(IIF(food_type = 'american food', 1, 0)) AS REAL) * 100 / COUNT(id_restaurant) FROM generalinfo WHERE city = 'dublin'
Write SQL query to solve given problem: What is the full address of Albert's Café?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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é'
Write SQL query to solve given problem: What are the restaurants that are located at "19th St. Oakland"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: What kind of restaurants can be found at "106 E 25th Ave"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: Please name any three restaurants that have an unidentified region.. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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
Write SQL query to solve given problem: What is the name of the Chinese restaurant that can be found at 104 San Tomas Aquino Road, Campbell?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: How many Thai restaurants can be found in San Pablo Ave, Albany?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: What is the county and region of Plearn-Thai Cuisine restaurant?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: What is the name of the restaurant that is located in El Dorado County, Lake Tahoe region?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: Which county and region does the street E. El Camino Real belong to?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: What is the name of the least popular Indian restaurant on Shattuck Avenue in Berkeley?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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
Write SQL query to solve given problem: What is the percentage of restaurants in the Bay Area region that scored over 4 for the review rating?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
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'
Write SQL query to solve given problem: List every city in San Mateo County.. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT city FROM geographic WHERE county = 'san mateo county'
Write SQL query to solve given problem: How many restaurants have more than 4 star reviews?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT COUNT(id_restaurant) AS cnt FROM generalinfo WHERE review > 4
Write SQL query to solve given problem: Which street has the most restaurants?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT street_name FROM location GROUP BY street_name ORDER BY COUNT(street_name) DESC LIMIT 1
Write SQL query to solve given problem: Which chicken restaurant has the highest review?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT label FROM generalinfo WHERE food_type = 'chicken' ORDER BY review DESC LIMIT 1
Write SQL query to solve given problem: Which county is El Cerrito from?. Keep the solution inside sql tag ```sql [SQL-Query] ```
restaurant
SELECT county FROM geographic WHERE city = 'el cerrito'