db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
car_retails | select count(t1.customernumber) from customers as t1 inner join orders as t2 on t1.customernumber = t2.customernumber where t2.status = 'cancelled' and t1.creditlimit > 115000 | Question: how many customers with a canceled shipment have a credit limit greater than 115,000? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers ... | how many customers with a canceled shipment have a credit limit greater than 115,000? |
car_retails | select t3.paymentdate from employees as t1 inner join customers as t2 on t1.employeenumber = t2.salesrepemployeenumber inner join payments as t3 on t2.customernumber = t3.customernumber where t1.firstname = 'barry' and t1.lastname = 'jones' and t1.jobtitle = 'sales rep' order by t2.creditlimit asc limit 1 | Question: on what date did the customer with the lowest credit limit serviced by sales representative barry jones make payments for his/her orders? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension... | on what date did the customer with the lowest credit limit serviced by sales representative barry jones make payments for his/her orders? |
car_retails | select t1.reportsto from employees as t1 inner join customers as t2 on t1.employeenumber = t2.salesrepemployeenumber where t2.country = 'france' | Question: to whom does the employee have to inform that is the sales representative of the french customer? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle... | to whom does the employee have to inform that is the sales representative of the french customer? |
car_retails | select t1.addressline1, t1.addressline2 from customers as t1 inner join orders as t2 on t1.customernumber = t2.customernumber where t2.shippeddate = '2005-04-04' and t2.status = 'shipped' | Question: what is the full address of the customer who commented that dhl be used for the order that was shipped on april 4, 2005? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCo... | what is the full address of the customer who commented that dhl be used for the order that was shipped on april 4, 2005? |
car_retails | select t2.addressline1, t2.addressline2 from employees as t1 inner join customers as t2 on t1.employeenumber = t2.salesrepemployeenumber inner join offices as t3 on t1.officecode = t3.officecode where t2.city = 'nyc' and t1.jobtitle = 'sales rep' | Question: what is the full address of the office where the employee who is a sales representative for the customer whose business is located in the city of new york works? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastNa... | what is the full address of the office where the employee who is a sales representative for the customer whose business is located in the city of new york works? |
car_retails | select t1.addressline1, t1.addressline2 from customers as t1 inner join employees as t2 on t1.salesrepemployeenumber = t2.employeenumber where t2.jobtitle = 'sales rep' | Question: what is the full address of the office where 4 people work and one of them is sales representation? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTit... | what is the full address of the office where 4 people work and one of them is sales representation? |
car_retails | select sum(t2.msrp - t2.buyprice) from productlines as t1 inner join products as t2 on t1.productline = t2.productline where t2.productvendor = 'carousel diecast legends' and t1.textdescription like '%perfect holiday or anniversary gift for executives%' | Question: what profit can the seller carousel diecast legends make from the sale of the product described as 'the perfect holiday or anniversary gift for executives'? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, f... | what profit can the seller carousel diecast legends make from the sale of the product described as 'the perfect holiday or anniversary gift for executives'? |
car_retails | select t1.customernumber from customers as t1 inner join payments as t2 on t1.customernumber = t2.customernumber where t1.city = 'boston' group by t1.customernumber order by sum(t2.amount) / count(t2.paymentdate) desc limit 1 | Question: of the clients whose businesses are located in the city of boston, calculate which of them has a higher average amount of payment. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email... | of the clients whose businesses are located in the city of boston, calculate which of them has a higher average amount of payment. |
car_retails | select sum(t2.quantityordered) , sum(t2.quantityordered * t2.priceeach) / sum(t2.quantityordered) from products as t1 inner join orderdetails as t2 on t1.productcode = t2.productcode where t1.productname = '18th century vintage horse carriage' | Question: calculate the total quantity ordered for 18th century vintage horse carriage and the average price. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTit... | calculate the total quantity ordered for 18th century vintage horse carriage and the average price. |
car_retails | select count(t.productcode) from orderdetails t where t.ordernumber = '10252' | Question: how many kinds of products did order no. 10252 contain? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customerNam... | how many kinds of products did order no. 10252 contain? |
car_retails | select t2.firstname, t2.lastname from customers as t1 inner join employees as t2 on t1.salesrepemployeenumber = t2.employeenumber where t1.addressline1 = '25 maiden lane' and t1.addressline2 = 'floor no. 4' | Question: who is the sales representative that made the order which was sent to 25 maiden lane, floor no. 4? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitl... | who is the sales representative that made the order which was sent to 25 maiden lane, floor no. 4? |
car_retails | select t1.addressline1, t1.addressline2 from offices as t1 inner join employees as t2 on t1.officecode = t2.officecode where t2.firstname = 'foon yue' and t2.lastname = 'tseng' | Question: where's foon yue tseng's office located at? give the detailed address. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumb... | where's foon yue tseng's office located at? give the detailed address. |
car_retails | select t2.orderdate from orderdetails as t1 inner join orders as t2 on t1.ordernumber = t2.ordernumber where strftime('%y-%m-%d', t2.orderdate) = '2005-04-08' or strftime('%y-%m-%d', t2.orderdate) = '2005-04-10' order by t1.quantityordered * t1.priceeach desc limit 1 | Question: compared with the orders happened on 2005-04-08 and two days later, which day's order had a higher value? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, ... | compared with the orders happened on 2005-04-08 and two days later, which day's order had a higher value? |
car_retails | select sum(t2.quantityordered) from orderdetails as t2 inner join ( select t1.productcode from products as t1 order by t1.msrp - t1.buyprice desc limit 1 ) as t3 on t2.productcode = t3.productcode | Question: how many products with the highest expected profits were sold in total? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNum... | how many products with the highest expected profits were sold in total? |
car_retails | select t1.amount from payments as t1 inner join customers as t2 on t1.customernumber = t2.customernumber where t2.customername = 'petit auto' and t1.paymentdate = '2004-08-09' | Question: how much did petit auto pay on 2004-08-09? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customerName, contactLas... | how much did petit auto pay on 2004-08-09? |
car_retails | select t2.contactfirstname, t2.contactlastname from payments as t1 inner join customers as t2 on t1.customernumber = t2.customernumber where t1.checknumber = 'nr157385' | Question: what was the contact name for the check 'nr157385'? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customerName, c... | what was the contact name for the check 'nr157385'? |
car_retails | select t2.contactfirstname, t2.contactlastname from orders as t1 inner join customers as t2 on t1.customernumber = t2.customernumber where t1.ordernumber = '10160' | Question: which customer made the order no. 10160? give the contact name. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, cus... | which customer made the order no. 10160? give the contact name. |
car_retails | select t2.addressline1, t2.addressline2 from orders as t1 inner join customers as t2 on t1.customernumber = t2.customernumber where t1.ordernumber = '10383' | Question: where was the order no. 10383 shipped to? show me the address. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, cust... | where was the order no. 10383 shipped to? show me the address. |
car_retails | select t1.textdescription from productlines as t1 inner join products as t2 on t1.productline = t2.productline where t2.productcode = 's18_2949' | Question: for the productline where the product no.s18_2949 was produced, what's the text description for that product line? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, re... | for the productline where the product no.s18_2949 was produced, what's the text description for that product line? |
car_retails | select t2.email from customers as t1 inner join employees as t2 on t1.salesrepemployeenumber = t2.employeenumber where t1.customername = 'dragon souveniers, ltd.' | Question: if dragon souveniers, ltd. aren't satisfied with their order and want to send a complain e-mail, which e-mail address should they send to? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extensio... | if dragon souveniers, ltd. aren't satisfied with their order and want to send a complain e-mail, which e-mail address should they send to? |
car_retails | select count(t1.customernumber) from customers as t1 inner join employees as t2 on t1.salesrepemployeenumber = t2.employeenumber where t1.country = 'france' and t2.firstname = 'gerard' and t2.lastname = 'hernandez' | Question: how many french customers does gerard hernandez take care of? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, custo... | how many french customers does gerard hernandez take care of? |
car_retails | select t3.productname from orderdetails as t1 inner join orders as t2 on t1.ordernumber = t2.ordernumber inner join products as t3 on t1.productcode = t3.productcode where t2.customernumber = '114' order by t2.orderdate desc limit 1 | Question: what was the latest order that customer no.114 made? give the name of the product. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> ... | what was the latest order that customer no.114 made? give the name of the product. |
car_retails | select (t1.msrp - t2.priceeach) / t1.msrp from products as t1 inner join orderdetails as t2 on t1.productcode = t2.productcode where t1.productcode = 's18_3482' and t2.ordernumber = '10108' | Question: for the product no. s18_3482 in the order no.10108, how much discount did the customer have? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. cus... | for the product no. s18_3482 in the order no.10108, how much discount did the customer have? |
car_retails | select t2.firstname, t2.lastname from employees as t1 inner join employees as t2 on t2.employeenumber = t1.reportsto where t1.firstname = 'steve' and t1.lastname = 'patterson' | Question: to whom does steve patterson report? please give his or her full name. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumb... | to whom does steve patterson report? please give his or her full name. |
car_retails | select t.email from employees t where t.jobtitle = 'president' | Question: how do i contact the president of the company? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customerName, contac... | how do i contact the president of the company? |
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' | Question: who is the sales representitive of muscle machine inc? please give the employee's full name. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. cus... | who is the sales representitive of muscle machine inc? please give the employee's full name. |
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' | Question: 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? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, exte... | 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? |
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' | Question: please list all the customers that have steve patterson as their sales representitive. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers... | please list all the customers that have steve patterson as their sales representitive. |
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' | Question: how many customers have an employee who reports to william patterson as their sales representitive? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTit... | how many customers have an employee who reports to william patterson as their sales representitive? |
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 | Question: please list the phone numbers of the top 3 customers that have the highest credit limit and have leslie jennings as their sales representitive. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, ext... | please list the phone numbers of the top 3 customers that have the highest credit limit and have leslie jennings as their sales representitive. |
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' | Question: how many sales representitives are based in the offices in the usa? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber,... | how many sales representitives are based in the offices in the usa? |
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' | Question: where can i find the office of the president of the company? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, custom... | where can i find the office of the president of the company? |
car_retails | select t2.postalcode from employees as t1 inner join offices as t2 on t1.officecode = t2.officecode where t1.jobtitle = 'vp sales' | Question: what's the postal code of the office the vp sales is at? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customerNa... | what's the postal code of the office the vp sales is at? |
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' | Question: what is the total price of the order made by cruz & sons co. on 2003/3/3? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerN... | what is the total price of the order made by cruz & sons co. on 2003/3/3? |
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' | Question: which product did cruz & sons co. order on 2003/3/3? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customerName, ... | which product did cruz & sons co. order on 2003/3/3? |
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 d... | Question: which product did cruz & sons co. ask for the biggest amount in a single order? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> cus... | which product did cruz & sons co. ask for the biggest amount in a single order? |
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' | Question: when were the products ordered by cruz & sons co. on 2003-03-03 shipped? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNu... | when were the products ordered by cruz & sons co. on 2003-03-03 shipped? |
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' ) | Question: what is the amount of customers of 1957 chevy pickup by customers in a month? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> custo... | what is the amount of customers of 1957 chevy pickup by customers in a month? |
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 | Question: name the product from the 'classic cars' production line that has the greatest expected profit. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. ... | name the product from the 'classic cars' production line that has the greatest expected profit. |
car_retails | select t2.customername from orders as t1 inner join customers as t2 on t1.customernumber = t2.customernumber where t1.status = 'in process' | Question: list all the name of customers who have orders that are still processing. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerN... | list all the name of customers who have orders that are still processing. |
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' | Question: among all orders shipped, calculate the percentage of orders shipped at least 3 days before the required date. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, report... | among all orders shipped, calculate the percentage of orders shipped at least 3 days before the required date. |
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 | Question: find the customer who made the highest payment in 2005. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customerNam... | find the customer who made the highest payment in 2005. |
car_retails | select productname, msrp - buyprice from products where productcode = ( select productcode from orderdetails order by quantityordered desc limit 1 ) | Question: which is the most ordered quantity product? what is its expected profit margin per piece? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. custom... | which is the most ordered quantity product? what is its expected profit margin per piece? |
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 ) | Question: for the order has the most product ordered, name the customer who placed the order. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers ->... | for the order has the most product ordered, name the customer who placed the order. |
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' | Question: list all customer names with orders that are disputed. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customerName... | list all customer names with orders that are disputed. |
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 | Question: what is the percentage of employees are in paris office? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customerNa... | what is the percentage of employees are in paris office? |
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)' | Question: name the sales manager of europe, middle east, and africa region. in which office does he/she report to? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, j... | name the sales manager of europe, middle east, and africa region. in which office does he/she report to? |
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' | Question: list the name of employees in japan office and who are they reporting to. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerN... | list the name of employees in japan office and who are they reporting to. |
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... | Question: which customer ordered 1939 'chevrolet deluxe coupe' at the highest price? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customer... | which customer ordered 1939 'chevrolet deluxe coupe' at the highest price? |
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' | Question: what is the percentage of the payment amount in 2004 was made by atelier graphique? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers ->... | what is the percentage of the payment amount in 2004 was made by atelier graphique? |
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' | Question: calculate the actual profit for order number 10100. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customerName, c... | calculate the actual profit for order number 10100. |
car_retails | select sum(t.amount) from payments t where t.customernumber = '103' | Question: how much did customer 103 pay in total? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customerName, contactLastNa... | how much did customer 103 pay in total? |
car_retails | select sum(t.priceeach * t.quantityordered) from orderdetails t where t.ordernumber = '10100' | Question: what is the total price of the order 10100? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customerName, contactLa... | what is the total price of the order 10100? |
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 | Question: please list the top three product names with the highest unit price. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber... | please list the top three product names with the highest unit price. |
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 | Question: among the customers of empolyee 1370, who has the highest credit limit?please list the full name of the contact person. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCod... | among the customers of empolyee 1370, who has the highest credit limit?please list the full name of the contact person. |
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' | Question: how many 2003 harley-davidson eagle drag bikes were ordered? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, custom... | how many 2003 harley-davidson eagle drag bikes were ordered? |
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 | Question: when was the product with the highest unit price shipped? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customerN... | when was the product with the highest unit price shipped? |
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' | Question: how many motorcycles have been ordered in 2004? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customerName, conta... | how many motorcycles have been ordered in 2004? |
car_retails | select t1.ordernumber from orders as t1 inner join customers as t2 on t1.customernumber = t2.customernumber where t2.creditlimit = 45300 | Question: please list the order number of the customer whose credit card has a limit of 45300. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -... | please list the order number of the customer whose credit card has a limit of 45300. |
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.price... | Question: for which order was the most profitable, please list the customer name of the order and the profit of the order. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, repo... | for which order was the most profitable, please list the customer name of the order and the profit of the order. |
car_retails | select strftime('%y', t1.paymentdate), count(t1.customernumber) from payments as t1 where t1.amount < 10000 group by strftime('%y', t1.paymentdate) | Question: how many transactions payment made by customer that is lower than 10000. group the result by year. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitl... | how many transactions payment made by customer that is lower than 10000. group the result by year. |
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 | Question: list out 3 best seller products during year 2003 with their total quantity sold during 2003. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. cus... | list out 3 best seller products during year 2003 with their total quantity sold during 2003. |
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.salesrepemployeen... | Question: list out sale rep that has sold 1969 harley davidson ultimate chopper. list out their names and quantity sold throughout the year. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email... | list out sale rep that has sold 1969 harley davidson ultimate chopper. list out their names and quantity sold throughout the year. |
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' | Question: who are the sales representatives in new york city? list their full names. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customer... | who are the sales representatives in new york city? list their full names. |
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' | Question: identify the customer and list down the country with the check number gg31455. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> cust... | identify the customer and list down the country with the check number gg31455. |
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' | Question: how many 2001 ferrari enzo were ordered? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customerName, contactLastN... | how many 2001 ferrari enzo were ordered? |
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 | Question: which 5 products has the lowest amount of orders? list the product names. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerN... | which 5 products has the lowest amount of orders? list the product names. |
car_retails | select t1.customername from customers as t1 inner join orders as t2 on t1.customernumber = t2.customernumber where t2.status = 'disputed' | Question: list down the customer names with a disputed order status. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, customer... | list down the customer names with a disputed order status. |
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' | Question: how many countries from the usa have an in process order status? | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, reportsTo, jobTitle. customers -> customerNumber, cu... | how many countries from the usa have an in process order status? |
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 = 'l... | Question: calculate the total price of shipped orders belonging to land of toys inc. under the classic car line of products. | Tables: offices -> officeCode, city, phone, addressLine1, addressLine2, state, country, postalCode, territory. employees -> employeeNumber, lastName, firstName, extension, email, officeCode, re... | calculate the total price of shipped orders belonging to land of toys inc. under the classic car line of products. |
restaurant | select count(id_restaurant) from generalinfo where review < 3 | Question: how many restaurants have not obtained a minimum of 3 in their reviews? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = ge... | how many restaurants have not obtained a minimum of 3 in their reviews? |
restaurant | select food_type from generalinfo where review = ( select max(review) from generalinfo ) limit 4 | Question: what types of food are served at the 4 top-reviewed restaurants? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = generalin... | what types of food are served at the 4 top-reviewed restaurants? |
restaurant | select count(id_restaurant) from generalinfo where food_type = 'mediterranean' and city = 'richmond' | Question: how many restaurants in the city of richmond serve mediterranean food? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = gen... | how many restaurants in the city of richmond serve mediterranean food? |
restaurant | select city from geographic where county = 'sonoma county' | Question: list all the cities in sonoma county. | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = generalinfo.id_restaurant, location.... | list all the cities in sonoma county. |
restaurant | select distinct county from geographic where region != 'bay area' | Question: what counties are not in the bay area region? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = generalinfo.id_restaurant, l... | what counties are not in the bay area region? |
restaurant | select city from geographic where region = 'northern california' | Question: list all cities in the northern california region. | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = generalinfo.id_restaura... | list all cities in the northern california region. |
restaurant | select id_restaurant from location where city = 'oakland' and street_name = '11th street' | Question: list by its id number all restaurants on 11th street in oakland. | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = generalin... | list by its id number all restaurants on 11th street in oakland. |
restaurant | select count(id_restaurant) from location where street_num = 871 | Question: how many restaurants can we find at number 871 on its street? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = generalinfo.... | how many restaurants can we find at number 871 on its street? |
restaurant | select id_restaurant from location where city = 'san francisco' and street_name = '9th avenue' | Question: at what numbers on 9th avenue of san francisco there are restaurants? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = gene... | at what numbers on 9th avenue of san francisco there are restaurants? |
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' | Question: what type of food is there in the restaurants on adeline street in berkeley city? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_resta... | what type of food is there in the restaurants on adeline street in berkeley city? |
restaurant | select distinct t2.region from generalinfo as t1 inner join geographic as t2 on t1.city = t2.city where t1.food_type != 'african' | Question: in which regions are there no african food restaurants? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = generalinfo.id_res... | in which regions are there no african food restaurants? |
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' | Question: in which counties are there a&w root beer restaurants? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = generalinfo.id_rest... | in which counties are there a&w root beer restaurants? |
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' | Question: indicate street and number of the adelitas taqueria restaurants. | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = generalin... | indicate street and number of the adelitas taqueria restaurants. |
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 | Question: what type of food is served at the restaurant located at 3140, alpine road at san mateo county? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, loc... | what type of food is served at the restaurant located at 3140, alpine road at san mateo county? |
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 | Question: in which streets of the city of san francisco are there restaurants that serve seafood? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id... | in which streets of the city of san francisco are there restaurants that serve seafood? |
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' | Question: list all counties where there is no bakers square restaurant & pie shop. | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = g... | list all counties where there is no bakers square restaurant & pie shop. |
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' | Question: in how many counties is there a street called appian way? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = generalinfo.id_r... | in how many counties is there a street called appian way? |
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' | Question: what is the rating of each restaurant reviews on atlantic ave? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = generalinfo... | what is the rating of each restaurant reviews on atlantic ave? |
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' | Question: identify all restaurants in contra costa county by id. | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = generalinfo.id_rest... | identify all restaurants in contra costa county by id. |
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' | Question: identify all the restaurants in yolo county by their label. | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = generalinfo.id... | identify all the restaurants in yolo county by their label. |
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' | Question: what restaurant on drive street in san rafael doesn't serve american food? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant =... | what restaurant on drive street in san rafael doesn't serve american food? |
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 | Question: on which streets in the city of san francisco are there restaurants with a review of 1.7? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.... | on which streets in the city of san francisco are there restaurants with a review of 1.7? |
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 | Question: which restaurant on the street alameda de las pulgas in the city of menlo park is the worst rated? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, ... | which restaurant on the street alameda de las pulgas in the city of menlo park is the worst rated? |
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' | Question: on what street in tuolumne county is good heavens restaurant located? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = gene... | on what street in tuolumne county is good heavens restaurant located? |
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' | Question: indicate the street numbers where aux delices vietnamese restaurant are located. | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restau... | indicate the street numbers where aux delices vietnamese restaurant are located. |
restaurant | select t1.id_restaurant from generalinfo as t1 inner join geographic as t2 on t1.city = t2.city where t2.county = 'marin county' | Question: identify all the restaurants in marin county by their id. | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = generalinfo.id_r... | identify all the restaurants in marin county by their id. |
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' | Question: in which regions are there no pizza restaurants? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = generalinfo.id_restaurant... | in which regions are there no pizza restaurants? |
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' | Question: calculate the average rating of reviews for restaurants in santa cruz county. | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restauran... | calculate the average rating of reviews for restaurants in santa cruz county. |
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' | Question: what percentage of restaurants in monterey county have mexican food? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = gener... | what percentage of restaurants in monterey county have mexican food? |
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' | Question: what percentage of streets named 11th street are in alameda county? | Tables: geographic -> city, county, region. generalinfo -> id_restaurant, label, food_type, city, review. location -> id_restaurant, street_num, street_name, city. | Joins: generalinfo.city = geographic.city, location.id_restaurant = genera... | what percentage of streets named 11th street are in alameda county? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.