Chinastark/bird_dataset huggingface dataset:
Database: debit_card_specializing
Note: '2012/8/24' can be represented by '2012-08-24';
Question: What's the nationality of the customer who spent 548.4 in 2012/8/24?
SQL: SELECT gasstations.country FROM transactions_1k INNER JOIN gasstations ON transactions_1k.gasstationid = gasstations.gasstationid WHERE transactions_1k.date = '2012-08-24' AND transactions_1k.price = 548.4
Database: debit_card_specializing
Note: '2012/8/25' can be represented by '2012-08-25';
Question: What is the percentage of the customers who used EUR in 2012/8/25?
SQL: SELECT cast(sum(iif(customers.currency = 'EUR', 1, 0)) AS FLOAT) * 100 / count(transactions_1k.customerid) FROM transactions_1k INNER JOIN customers ON transactions_1k.customerid = customers.customerid WHERE transactions_1k.date = '2012-08-25'
Database: debit_card_specializing
Note: '2012/8/24' can be represented by '2012-08-24'; consumption decrease rate = (consumption_2012 - consumption_2013) / consumption_2012;
Question: For the customer who paid 634.8 in 2012/8/25, what was the consumption decrease rate from Year 2012 to 2013?
SQL: SELECT cast(sum(iif(substr(Date, 1, 4) = '2012', consumption, 0)) - sum(iif(substr(Date, 1, 4) = '2013', consumption, 0)) AS FLOAT) / sum(iif(substr(Date, 1, 4) = '2012', consumption, 0)) FROM yearmonth WHERE customerid = ( SELECT transactions_1k.customerid FROM transactions_1k INNER JOIN gasstations ON transactions_1k.gasstationid = gasstations.gasstationid WHERE transactions_1k.date = '2012-08-25' AND transactions_1k.price = 634.8 )
Database: debit_card_specializing
Question: Which gas station has the highest amount of revenue?
SQL: SELECT gasstationid FROM transactions_1k GROUP BY gasstationid ORDER BY sum(price) DESC LIMIT 1
Database: debit_card_specializing
Question: What is the percentage of "premium" against the overall segment in Country = "SVK"?
SQL: SELECT cast(sum(iif(country = 'SVK' AND SEGMENT = 'Premium', 1, 0)) AS FLOAT) * 100 / sum(iif(country = 'SVK', 1, 0)) FROM gasstations
Database: debit_card_specializing
Note: January 2012 refers to the date value = '201201';
Question: What is the amount spent by customer "38508" at the gas stations? How much had the customer spent in January 2012?
SQL: SELECT sum(transactions_1k.price) , sum(iif(yearmonth.date = '201201', transactions_1k.price, 0)) FROM transactions_1k INNER JOIN gasstations ON transactions_1k.gasstationid = gasstations.gasstationid INNER JOIN yearmonth ON transactions_1k.customerid = yearmonth.customerid WHERE transactions_1k.customerid = '38508'
Database: debit_card_specializing
Note: description of products contains full name;
Question: Which are the top five best selling products? Please state the full name of them.
SQL: SELECT products.description FROM transactions_1k INNER JOIN products ON transactions_1k.productid = products.productid ORDER BY transactions_1k.amount DESC LIMIT 5
Database: debit_card_specializing
Note: average price per single item = Total(price) / Total(amount);
Question: Who is the top spending customer and how much is the average price per single item purchased by this customer? What currency was being used?
SQL: SELECT transactions_1k.customerid, sum(transactions_1k.price / transactions_1k.amount), customers.currency FROM customers INNER JOIN transactions_1k ON customers.customerid = transactions_1k.customerid WHERE transactions_1k.customerid = ( SELECT customerid FROM yearmonth ORDER BY consumption DESC LIMIT 1 ) GROUP BY transactions_1k.customerid, customers.currency
Database: debit_card_specializing
Question: Which country had the gas station that sold the most expensive product id No.2 for one unit?
SQL: SELECT gasstations.country FROM transactions_1k INNER JOIN gasstations ON transactions_1k.gasstationid = gasstations.gasstationid WHERE transactions_1k.productid = 2 ORDER BY transactions_1k.price DESC LIMIT 1
Database: debit_card_specializing
Note: August of 2012 refers to the date value = '201208' ; price per unit of product = price / amount;
Question: For all the people who paid more than 29.00 per unit of product id No.5. Give their consumption status in the August of 2012.
SQL: SELECT yearmonth.consumption FROM transactions_1k INNER JOIN yearmonth ON transactions_1k.customerid = yearmonth.customerid WHERE transactions_1k.price / transactions_1k.amount > 29.00 AND transactions_1k.productid = 5 AND yearmonth.date = '201208'