1sf/bird-sql-train-with-schema huggingface dataset:
Database: car_retails
Tables: offices, employees, customers, orders, payments, productlines, products, orderdetails
Columns (table index, column name): -1, *, 0, officeCode, 0, city, 0, phone, 0, addressLine1, 0, addressLine2, 0, state, 0, country, 0, postalCode, 0, territory, 1, employeeNumber, 1, lastName, 1, firstName, 1, extension, 1, email, 1, officeCode, 1, reportsTo, 1, jobTitle, 2, customerNumber, 2, customerName, 2, contactLastName, 2, contactFirstName, 2, phone, 2, addressLine1, 2, addressLine2, 2, city, 2, state, 2, postalCode, 2, country, 2, salesRepEmployeeNumber, 2, creditLimit, 3, orderNumber, 3, orderDate, 3, requiredDate, 3, shippedDate, 3, status, 3, comments, 3, customerNumber, 4, customerNumber, 4, checkNumber, 4, paymentDate, 4, amount, 5, productLine, 5, textDescription, 5, htmlDescription, 5, image, 6, productCode, 6, productName, 6, productLine, 6, productScale, 6, productVendor, 6, productDescription, 6, quantityInStock, 6, buyPrice, 6, MSRP, 7, orderNumber, 7, productCode, 7, quantityOrdered, 7, priceEach, 7, orderLineNumber
Question: Between 8/1/2003 and 8/30/2004, how many checks were issued by Mini Gifts Distributors Ltd.? Please list their check numbers.
Evidence: paymentDate BETWEEN '2003-08-01' AND '2004-08-30'; Mini Gifts Distributors Ltd. Is a customer name;
SQL: SELECT T1.checkNumber FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber WHERE T1.paymentDate >= '2003-08-01' AND T1.paymentDate <= '2004-08-30' AND T2.customerName = 'Mini Gifts Distributors Ltd.'
Database: car_retails
Tables: offices, employees, customers, orders, payments, productlines, products, orderdetails
Columns (table index, column name): -1, *, 0, officeCode, 0, city, 0, phone, 0, addressLine1, 0, addressLine2, 0, state, 0, country, 0, postalCode, 0, territory, 1, employeeNumber, 1, lastName, 1, firstName, 1, extension, 1, email, 1, officeCode, 1, reportsTo, 1, jobTitle, 2, customerNumber, 2, customerName, 2, contactLastName, 2, contactFirstName, 2, phone, 2, addressLine1, 2, addressLine2, 2, city, 2, state, 2, postalCode, 2, country, 2, salesRepEmployeeNumber, 2, creditLimit, 3, orderNumber, 3, orderDate, 3, requiredDate, 3, shippedDate, 3, status, 3, comments, 3, customerNumber, 4, customerNumber, 4, checkNumber, 4, paymentDate, 4, amount, 5, productLine, 5, textDescription, 5, htmlDescription, 5, image, 6, productCode, 6, productName, 6, productLine, 6, productScale, 6, productVendor, 6, productDescription, 6, quantityInStock, 6, buyPrice, 6, MSRP, 7, orderNumber, 7, productCode, 7, quantityOrdered, 7, priceEach, 7, orderLineNumber
Question: For the planes which has the hightest total price, how much it exceeds the average?
Evidence: plane is a product line; total price = MULTIPLY(quantityOrdered, priceEach); how much the total price exceeds the average = SUBTRACT(MAX(MULTIPLY(quantityOrdered, priceEach))), AVG(priceEach));
SQL: SELECT MAX(quantityOrdered * priceEach) - AVG(priceEach) FROM orderdetails WHERE productCode IN ( SELECT productCode FROM products WHERE productLine = 'Planes' )
Database: car_retails
Tables: offices, employees, customers, orders, payments, productlines, products, orderdetails
Columns (table index, column name): -1, *, 0, officeCode, 0, city, 0, phone, 0, addressLine1, 0, addressLine2, 0, state, 0, country, 0, postalCode, 0, territory, 1, employeeNumber, 1, lastName, 1, firstName, 1, extension, 1, email, 1, officeCode, 1, reportsTo, 1, jobTitle, 2, customerNumber, 2, customerName, 2, contactLastName, 2, contactFirstName, 2, phone, 2, addressLine1, 2, addressLine2, 2, city, 2, state, 2, postalCode, 2, country, 2, salesRepEmployeeNumber, 2, creditLimit, 3, orderNumber, 3, orderDate, 3, requiredDate, 3, shippedDate, 3, status, 3, comments, 3, customerNumber, 4, customerNumber, 4, checkNumber, 4, paymentDate, 4, amount, 5, productLine, 5, textDescription, 5, htmlDescription, 5, image, 6, productCode, 6, productName, 6, productLine, 6, productScale, 6, productVendor, 6, productDescription, 6, quantityInStock, 6, buyPrice, 6, MSRP, 7, orderNumber, 7, productCode, 7, quantityOrdered, 7, priceEach, 7, orderLineNumber
Question: What is the total value of shipped vintage car orders from 2003-2004?
Evidence: total value = SUM(MULTIPLY(quantityOrdered, priceEach)); shipped orders refers to status = 'Shipped'; vintage car is a product line; year(orderDate) between 2003 and 2004;
SQL: SELECT SUM(T2.priceEach * 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 WHERE T3.status = 'Shipped' AND T3.orderDate BETWEEN '2003-01-01' AND '2004-12-31'
Database: car_retails
Tables: offices, employees, customers, orders, payments, productlines, products, orderdetails
Columns (table index, column name): -1, *, 0, officeCode, 0, city, 0, phone, 0, addressLine1, 0, addressLine2, 0, state, 0, country, 0, postalCode, 0, territory, 1, employeeNumber, 1, lastName, 1, firstName, 1, extension, 1, email, 1, officeCode, 1, reportsTo, 1, jobTitle, 2, customerNumber, 2, customerName, 2, contactLastName, 2, contactFirstName, 2, phone, 2, addressLine1, 2, addressLine2, 2, city, 2, state, 2, postalCode, 2, country, 2, salesRepEmployeeNumber, 2, creditLimit, 3, orderNumber, 3, orderDate, 3, requiredDate, 3, shippedDate, 3, status, 3, comments, 3, customerNumber, 4, customerNumber, 4, checkNumber, 4, paymentDate, 4, amount, 5, productLine, 5, textDescription, 5, htmlDescription, 5, image, 6, productCode, 6, productName, 6, productLine, 6, productScale, 6, productVendor, 6, productDescription, 6, quantityInStock, 6, buyPrice, 6, MSRP, 7, orderNumber, 7, productCode, 7, quantityOrdered, 7, priceEach, 7, orderLineNumber
Question: Who is the sales agent of the customer who has made the highest payment? Include the full names of employee and his/her supervisor.
Evidence: payment refers to amount; full name = firstName+lastName; supervisor refers to reportsTO; 'reportsTO' is the leader of the 'employeeNumber';
SQL: SELECT T1.firstName, T1.lastName, T1.reportsTo FROM employees AS T1 INNER JOIN customers AS T2 ON T1.employeeNumber = T2.salesRepEmployeeNumber INNER JOIN payments AS T3 ON T2.customerNumber = T3.customerNumber ORDER BY T3.amount DESC LIMIT 1
Database: car_retails
Tables: offices, employees, customers, orders, payments, productlines, products, orderdetails
Columns (table index, column name): -1, *, 0, officeCode, 0, city, 0, phone, 0, addressLine1, 0, addressLine2, 0, state, 0, country, 0, postalCode, 0, territory, 1, employeeNumber, 1, lastName, 1, firstName, 1, extension, 1, email, 1, officeCode, 1, reportsTo, 1, jobTitle, 2, customerNumber, 2, customerName, 2, contactLastName, 2, contactFirstName, 2, phone, 2, addressLine1, 2, addressLine2, 2, city, 2, state, 2, postalCode, 2, country, 2, salesRepEmployeeNumber, 2, creditLimit, 3, orderNumber, 3, orderDate, 3, requiredDate, 3, shippedDate, 3, status, 3, comments, 3, customerNumber, 4, customerNumber, 4, checkNumber, 4, paymentDate, 4, amount, 5, productLine, 5, textDescription, 5, htmlDescription, 5, image, 6, productCode, 6, productName, 6, productLine, 6, productScale, 6, productVendor, 6, productDescription, 6, quantityInStock, 6, buyPrice, 6, MSRP, 7, orderNumber, 7, productCode, 7, quantityOrdered, 7, priceEach, 7, orderLineNumber
Question: What is the highest amount of order made by the sales representative in Boston? Please give the name of the product and amount.
Evidence: Boston is a city; amount of order = MULTIPLY(quantityOrdered, priceEach);
SQL: SELECT T2.productName, T1.quantityOrdered * T1.priceEach FROM orderdetails AS T1 INNER JOIN products AS T2 ON T1.productCode = T2.productCode INNER JOIN orders AS T3 ON T1.orderNumber = T3.orderNumber INNER JOIN customers AS T4 ON T3.customerNumber = T4.customerNumber WHERE T4.city = 'Boston' AND T4.salesRepEmployeeNumber IN ( SELECT employeeNumber FROM employees WHERE jobTitle = 'Sales Rep' ) ORDER BY T1.quantityOrdered DESC LIMIT 1
Database: car_retails
Tables: offices, employees, customers, orders, payments, productlines, products, orderdetails
Columns (table index, column name): -1, *, 0, officeCode, 0, city, 0, phone, 0, addressLine1, 0, addressLine2, 0, state, 0, country, 0, postalCode, 0, territory, 1, employeeNumber, 1, lastName, 1, firstName, 1, extension, 1, email, 1, officeCode, 1, reportsTo, 1, jobTitle, 2, customerNumber, 2, customerName, 2, contactLastName, 2, contactFirstName, 2, phone, 2, addressLine1, 2, addressLine2, 2, city, 2, state, 2, postalCode, 2, country, 2, salesRepEmployeeNumber, 2, creditLimit, 3, orderNumber, 3, orderDate, 3, requiredDate, 3, shippedDate, 3, status, 3, comments, 3, customerNumber, 4, customerNumber, 4, checkNumber, 4, paymentDate, 4, amount, 5, productLine, 5, textDescription, 5, htmlDescription, 5, image, 6, productCode, 6, productName, 6, productLine, 6, productScale, 6, productVendor, 6, productDescription, 6, quantityInStock, 6, buyPrice, 6, MSRP, 7, orderNumber, 7, productCode, 7, quantityOrdered, 7, priceEach, 7, orderLineNumber
Question: What is the total actual profit gained from orders made by American customers from 2003-01-06 to 2005-05-09?
Evidence: total actual profit = SUM(SUBTRACT(priceEach, buyPrice)); American is a nationality of country = 'USA'; orderDate BETWEEN '2003-01-06' AND '2005-05-09';
SQL: SELECT SUM(T2.priceEach - T1.buyPrice) 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 T3.orderDate > '2003-01-05' AND T3.orderDate < '2005-05-10'
Database: car_retails
Tables: offices, employees, customers, orders, payments, productlines, products, orderdetails
Columns (table index, column name): -1, *, 0, officeCode, 0, city, 0, phone, 0, addressLine1, 0, addressLine2, 0, state, 0, country, 0, postalCode, 0, territory, 1, employeeNumber, 1, lastName, 1, firstName, 1, extension, 1, email, 1, officeCode, 1, reportsTo, 1, jobTitle, 2, customerNumber, 2, customerName, 2, contactLastName, 2, contactFirstName, 2, phone, 2, addressLine1, 2, addressLine2, 2, city, 2, state, 2, postalCode, 2, country, 2, salesRepEmployeeNumber, 2, creditLimit, 3, orderNumber, 3, orderDate, 3, requiredDate, 3, shippedDate, 3, status, 3, comments, 3, customerNumber, 4, customerNumber, 4, checkNumber, 4, paymentDate, 4, amount, 5, productLine, 5, textDescription, 5, htmlDescription, 5, image, 6, productCode, 6, productName, 6, productLine, 6, productScale, 6, productVendor, 6, productDescription, 6, quantityInStock, 6, buyPrice, 6, MSRP, 7, orderNumber, 7, productCode, 7, quantityOrdered, 7, priceEach, 7, orderLineNumber
Question: From which branch does the sales representative employee who made the most sales in 2005? Please indicates its full address and phone number.
Evidence: orderDate between '2005-01-01' and '2005-12-31'; full address = addressLine1+addressLine2;
SQL: SELECT T3.addressLine1, T3.addressLine2, T3.phone 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 employees AS T4 ON T3.salesRepEmployeeNumber = T4.employeeNumber INNER JOIN offices AS T5 ON T4.officeCode = T5.officeCode WHERE STRFTIME('%Y', T2.orderDate) = '2005' AND T4.jobTitle = 'Sales Rep' ORDER BY T1.quantityOrdered DESC LIMIT 1
Database: car_retails
Tables: offices, employees, customers, orders, payments, productlines, products, orderdetails
Columns (table index, column name): -1, *, 0, officeCode, 0, city, 0, phone, 0, addressLine1, 0, addressLine2, 0, state, 0, country, 0, postalCode, 0, territory, 1, employeeNumber, 1, lastName, 1, firstName, 1, extension, 1, email, 1, officeCode, 1, reportsTo, 1, jobTitle, 2, customerNumber, 2, customerName, 2, contactLastName, 2, contactFirstName, 2, phone, 2, addressLine1, 2, addressLine2, 2, city, 2, state, 2, postalCode, 2, country, 2, salesRepEmployeeNumber, 2, creditLimit, 3, orderNumber, 3, orderDate, 3, requiredDate, 3, shippedDate, 3, status, 3, comments, 3, customerNumber, 4, customerNumber, 4, checkNumber, 4, paymentDate, 4, amount, 5, productLine, 5, textDescription, 5, htmlDescription, 5, image, 6, productCode, 6, productName, 6, productLine, 6, productScale, 6, productVendor, 6, productDescription, 6, quantityInStock, 6, buyPrice, 6, MSRP, 7, orderNumber, 7, productCode, 7, quantityOrdered, 7, priceEach, 7, orderLineNumber
Question: What is the phone number of all companies where the last name of the contact person starts with the letter M and are not from Germany?
Evidence: last name of contact person starts with M refers to lastName LIKE 'M%'; Germany is a country; not from Germany refers to country<>'Germany';
SQL: SELECT phone FROM customers WHERE contactLastName LIKE 'M%' AND country != 'Germany'
Database: car_retails
Tables: offices, employees, customers, orders, payments, productlines, products, orderdetails
Columns (table index, column name): -1, *, 0, officeCode, 0, city, 0, phone, 0, addressLine1, 0, addressLine2, 0, state, 0, country, 0, postalCode, 0, territory, 1, employeeNumber, 1, lastName, 1, firstName, 1, extension, 1, email, 1, officeCode, 1, reportsTo, 1, jobTitle, 2, customerNumber, 2, customerName, 2, contactLastName, 2, contactFirstName, 2, phone, 2, addressLine1, 2, addressLine2, 2, city, 2, state, 2, postalCode, 2, country, 2, salesRepEmployeeNumber, 2, creditLimit, 3, orderNumber, 3, orderDate, 3, requiredDate, 3, shippedDate, 3, status, 3, comments, 3, customerNumber, 4, customerNumber, 4, checkNumber, 4, paymentDate, 4, amount, 5, productLine, 5, textDescription, 5, htmlDescription, 5, image, 6, productCode, 6, productName, 6, productLine, 6, productScale, 6, productVendor, 6, productDescription, 6, quantityInStock, 6, buyPrice, 6, MSRP, 7, orderNumber, 7, productCode, 7, quantityOrdered, 7, priceEach, 7, orderLineNumber
Question: Calculate the average amount of payments made by customers during the first half of 2004.
Evidence: average amount of payments = DIVIDE(SUM(amount), COUNT(customerNumber); first half of 2014 refers to paymentDate > = '2004-01-01' AND paymentDate < '2004-07-01;
SQL: SELECT AVG(amount) FROM payments WHERE paymentDate BETWEEN '2004-01-01' AND '2004-06-30'
Database: car_retails
Tables: offices, employees, customers, orders, payments, productlines, products, orderdetails
Columns (table index, column name): -1, *, 0, officeCode, 0, city, 0, phone, 0, addressLine1, 0, addressLine2, 0, state, 0, country, 0, postalCode, 0, territory, 1, employeeNumber, 1, lastName, 1, firstName, 1, extension, 1, email, 1, officeCode, 1, reportsTo, 1, jobTitle, 2, customerNumber, 2, customerName, 2, contactLastName, 2, contactFirstName, 2, phone, 2, addressLine1, 2, addressLine2, 2, city, 2, state, 2, postalCode, 2, country, 2, salesRepEmployeeNumber, 2, creditLimit, 3, orderNumber, 3, orderDate, 3, requiredDate, 3, shippedDate, 3, status, 3, comments, 3, customerNumber, 4, customerNumber, 4, checkNumber, 4, paymentDate, 4, amount, 5, productLine, 5, textDescription, 5, htmlDescription, 5, image, 6, productCode, 6, productName, 6, productLine, 6, productScale, 6, productVendor, 6, productDescription, 6, quantityInStock, 6, buyPrice, 6, MSRP, 7, orderNumber, 7, productCode, 7, quantityOrdered, 7, priceEach, 7, orderLineNumber
Question: Of all the orders placed and shipped throughout the year 2005, what percentage of those orders corresponds to customer number 186?
Evidence: shipped orders refers to status = 'shipped'; year(shippedDate) = 2005; percentage = DIVIDE(SUM(customerNumber = 186)), COUNT(orderNumber)) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN customerNumber = 186 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(orderNumber) FROM orders WHERE status = 'Shipped' AND shippedDate BETWEEN '2005-01-01' AND '2005-12-31'
Database: car_retails
Tables: offices, employees, customers, orders, payments, productlines, products, orderdetails
Columns (table index, column name): -1, *, 0, officeCode, 0, city, 0, phone, 0, addressLine1, 0, addressLine2, 0, state, 0, country, 0, postalCode, 0, territory, 1, employeeNumber, 1, lastName, 1, firstName, 1, extension, 1, email, 1, officeCode, 1, reportsTo, 1, jobTitle, 2, customerNumber, 2, customerName, 2, contactLastName, 2, contactFirstName, 2, phone, 2, addressLine1, 2, addressLine2, 2, city, 2, state, 2, postalCode, 2, country, 2, salesRepEmployeeNumber, 2, creditLimit, 3, orderNumber, 3, orderDate, 3, requiredDate, 3, shippedDate, 3, status, 3, comments, 3, customerNumber, 4, customerNumber, 4, checkNumber, 4, paymentDate, 4, amount, 5, productLine, 5, textDescription, 5, htmlDescription, 5, image, 6, productCode, 6, productName, 6, productLine, 6, productScale, 6, productVendor, 6, productDescription, 6, quantityInStock, 6, buyPrice, 6, MSRP, 7, orderNumber, 7, productCode, 7, quantityOrdered, 7, priceEach, 7, orderLineNumber
Question: How many customers with a canceled shipment have a credit limit greater than 115,000?
Evidence: cancelled shipment refers to status = 'cancelled'; creditLimit > 115000;
SQL: 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
Database: car_retails
Tables: offices, employees, customers, orders, payments, productlines, products, orderdetails
Columns (table index, column name): -1, *, 0, officeCode, 0, city, 0, phone, 0, addressLine1, 0, addressLine2, 0, state, 0, country, 0, postalCode, 0, territory, 1, employeeNumber, 1, lastName, 1, firstName, 1, extension, 1, email, 1, officeCode, 1, reportsTo, 1, jobTitle, 2, customerNumber, 2, customerName, 2, contactLastName, 2, contactFirstName, 2, phone, 2, addressLine1, 2, addressLine2, 2, city, 2, state, 2, postalCode, 2, country, 2, salesRepEmployeeNumber, 2, creditLimit, 3, orderNumber, 3, orderDate, 3, requiredDate, 3, shippedDate, 3, status, 3, comments, 3, customerNumber, 4, customerNumber, 4, checkNumber, 4, paymentDate, 4, amount, 5, productLine, 5, textDescription, 5, htmlDescription, 5, image, 6, productCode, 6, productName, 6, productLine, 6, productScale, 6, productVendor, 6, productDescription, 6, quantityInStock, 6, buyPrice, 6, MSRP, 7, orderNumber, 7, productCode, 7, quantityOrdered, 7, priceEach, 7, orderLineNumber
Question: On what date did the customer with the lowest credit limit serviced by sales representative Barry Jones make payments for his/her orders?
SQL: 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
Database: car_retails
Tables: offices, employees, customers, orders, payments, productlines, products, orderdetails
Columns (table index, column name): -1, *, 0, officeCode, 0, city, 0, phone, 0, addressLine1, 0, addressLine2, 0, state, 0, country, 0, postalCode, 0, territory, 1, employeeNumber, 1, lastName, 1, firstName, 1, extension, 1, email, 1, officeCode, 1, reportsTo, 1, jobTitle, 2, customerNumber, 2, customerName, 2, contactLastName, 2, contactFirstName, 2, phone, 2, addressLine1, 2, addressLine2, 2, city, 2, state, 2, postalCode, 2, country, 2, salesRepEmployeeNumber, 2, creditLimit, 3, orderNumber, 3, orderDate, 3, requiredDate, 3, shippedDate, 3, status, 3, comments, 3, customerNumber, 4, customerNumber, 4, checkNumber, 4, paymentDate, 4, amount, 5, productLine, 5, textDescription, 5, htmlDescription, 5, image, 6, productCode, 6, productName, 6, productLine, 6, productScale, 6, productVendor, 6, productDescription, 6, quantityInStock, 6, buyPrice, 6, MSRP, 7, orderNumber, 7, productCode, 7, quantityOrdered, 7, priceEach, 7, orderLineNumber
Question: To whom does the employee have to inform that is the sales representative of the French customer?
Evidence: inform refers to reportsTo; 'reportsTO' is the leader of the 'employeeNumber'; France is a country; country = 'France';
SQL: SELECT T1.reportsTo FROM employees AS T1 INNER JOIN customers AS T2 ON T1.employeeNumber = T2.salesRepEmployeeNumber WHERE T2.country = 'France'
Database: car_retails
Tables: offices, employees, customers, orders, payments, productlines, products, orderdetails
Columns (table index, column name): -1, *, 0, officeCode, 0, city, 0, phone, 0, addressLine1, 0, addressLine2, 0, state, 0, country, 0, postalCode, 0, territory, 1, employeeNumber, 1, lastName, 1, firstName, 1, extension, 1, email, 1, officeCode, 1, reportsTo, 1, jobTitle, 2, customerNumber, 2, customerName, 2, contactLastName, 2, contactFirstName, 2, phone, 2, addressLine1, 2, addressLine2, 2, city, 2, state, 2, postalCode, 2, country, 2, salesRepEmployeeNumber, 2, creditLimit, 3, orderNumber, 3, orderDate, 3, requiredDate, 3, shippedDate, 3, status, 3, comments, 3, customerNumber, 4, customerNumber, 4, checkNumber, 4, paymentDate, 4, amount, 5, productLine, 5, textDescription, 5, htmlDescription, 5, image, 6, productCode, 6, productName, 6, productLine, 6, productScale, 6, productVendor, 6, productDescription, 6, quantityInStock, 6, buyPrice, 6, MSRP, 7, orderNumber, 7, productCode, 7, quantityOrdered, 7, priceEach, 7, orderLineNumber
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?
Evidence: full address = addressLine1+addressLine2; shippedDate = '2005-04-04';
SQL: 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'
Database: car_retails
Tables: offices, employees, customers, orders, payments, productlines, products, orderdetails
Columns (table index, column name): -1, *, 0, officeCode, 0, city, 0, phone, 0, addressLine1, 0, addressLine2, 0, state, 0, country, 0, postalCode, 0, territory, 1, employeeNumber, 1, lastName, 1, firstName, 1, extension, 1, email, 1, officeCode, 1, reportsTo, 1, jobTitle, 2, customerNumber, 2, customerName, 2, contactLastName, 2, contactFirstName, 2, phone, 2, addressLine1, 2, addressLine2, 2, city, 2, state, 2, postalCode, 2, country, 2, salesRepEmployeeNumber, 2, creditLimit, 3, orderNumber, 3, orderDate, 3, requiredDate, 3, shippedDate, 3, status, 3, comments, 3, customerNumber, 4, customerNumber, 4, checkNumber, 4, paymentDate, 4, amount, 5, productLine, 5, textDescription, 5, htmlDescription, 5, image, 6, productCode, 6, productName, 6, productLine, 6, productScale, 6, productVendor, 6, productDescription, 6, quantityInStock, 6, buyPrice, 6, MSRP, 7, orderNumber, 7, productCode, 7, quantityOrdered, 7, priceEach, 7, orderLineNumber
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?
Evidence: full address = addressLine1 + addressLine2; NYC is a shortname of New York City.
SQL: 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'