question_id int64 1 75.7k | db_id stringclasses 33
values | db_name stringclasses 4
values | question stringlengths 19 259 | partition stringclasses 4
values | difficulty stringclasses 3
values | SQL stringlengths 25 862 |
|---|---|---|---|---|---|---|
75,601 | book_sql | book_sql | As of This month, how many invoices for Christopher Woods remained unpaid? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'christopher woods' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE) |
75,602 | book_sql | book_sql | When was the last time we sold high-rise and low-rise buildings | val | hard | SELECT transaction_date FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('income', 'other income') AND product_service = 'high-rise and low-rise buildings' ORDER BY transaction_date DESC LIMIT 1 |
75,603 | book_sql | book_sql | What was the lowest bill Sierra Andrews received from Samuel Gomez? | val | medium | SELECT MIN(credit) FROM master_txn_table WHERE customers = 'sierra andrews' AND transaction_type = 'bill' AND vendor = 'samuel gomez' |
75,604 | book_sql | book_sql | How much revenue came through Russell Clay in q1 this year? | val | hard | SELECT SUM(credit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE customers = 'russell clay' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE, 'start of year', '+3 month', '-1 day') |
75,605 | book_sql | book_sql | As of Last quarter, how many invoices for Kristin Mata remained unpaid? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'kristin mata' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date < STRFTIME('%y-%m-%d', STRFTIME('%y', 'now', '-1 year') || '-' || SUBSTRING('00' || ((CAST((STRFTIME('%m', 'now') - 1) AS REAL) / 3) * 3 + 4), -2, 2) ||... |
75,606 | book_sql | book_sql | When was the last time we sold LAN | val | hard | SELECT transaction_date FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('income', 'other income') AND product_service = 'lan' ORDER BY transaction_date DESC LIMIT 1 |
75,607 | book_sql | book_sql | Did we receive payment from Tiffany Evans partnership This year? | val | medium | SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'tiffany evans' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE) |
75,608 | book_sql | book_sql | When was the last time we sold Diving | val | hard | SELECT transaction_date FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('income', 'other income') AND product_service = 'diving' ORDER BY transaction_date DESC LIMIT 1 |
75,609 | book_sql | book_sql | As of MTD, how many invoices for Micheal Watson remained unpaid? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'micheal watson' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE) |
75,610 | book_sql | book_sql | How many Alyssa Davis invoices are still oustanding? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'alyssa davis' AND transaction_type = 'invoice' AND open_balance > 0 |
75,611 | book_sql | book_sql | What acount had our biggest expense This quarter to date? | val | hard | SELECT account, SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('expense', 'other expense') AND transaction_date >= STRFTIME('%y-%m-%d', STRFTIME('%y', 'now', '-1 year') || '-' || SUBSTRING('00' || ((CAST((STRFTIME('%m', 'now') - 1) AS REAL) / 3... |
75,612 | book_sql | book_sql | What our monthly spend on Lisa Weiss | val | hard | SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'lisa weiss' GROUP BY DATE(transaction_date, 'start of month') |
75,613 | book_sql | book_sql | What acount had our biggest expense Last fiscal year? | val | hard | SELECT account, SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('expense', 'other expense') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-3 months', 'start of year', '-1 years', '+3 months') AND DATE(CURRENT_DATE, '-3 months', 'start of year... |
75,614 | book_sql | book_sql | How much revenue came through Sarah Barton This quarter? | val | hard | SELECT SUM(credit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE customers = 'sarah barton' AND account_type IN ('income', 'other income') AND transaction_date >= STRFTIME('%y-%m-%d', STRFTIME('%y', 'now', '-1 year') || '-' || SUBSTRING('00' || ((CAST((STRFTIME('%m', 'no... |
75,615 | book_sql | book_sql | Did we receive payment from Jennifer Barker partnership in q2 this year? | val | medium | SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'jennifer barker' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+3 month') AND DATE(CURRENT_DATE, 'start of year', '+6 month', '-1 day') |
75,616 | book_sql | book_sql | What our monthly spend on Jason Ewing | val | hard | SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'jason ewing' GROUP BY DATE(transaction_date, 'start of month') |
75,617 | book_sql | book_sql | Compare sales by customer in q3 last year | val | hard | SELECT customers, SUM(credit) FROM master_txn_table WHERE account IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-1 year', 'start of year', '+6 month') AND DATE(CURRENT_DATE, '-1 year', 'start of year', '+9 month', '-1 day') GROUP BY customers |
75,618 | book_sql | book_sql | Check the sales receipts record and compute the average quantities ordered with the payment method [payment_method]. | val | hard | SELECT AVG(quantity_per_transaction) FROM (SELECT transaction_id, SUM(quantity) AS quantity_per_transaction FROM master_txn_table WHERE transaction_type = 'sales receipt' AND payment_method = '[payment_method]' GROUP BY transaction_id) |
75,619 | book_sql | book_sql | How many Andrew Paul invoices are still oustanding? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'andrew paul' AND transaction_type = 'invoice' AND open_balance > 0 |
75,620 | book_sql | book_sql | How much revenue came through Miss Lauren Porter MD MTD? | val | hard | SELECT SUM(credit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE customers = 'miss lauren porter md' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE) |
75,621 | book_sql | book_sql | What was the last bill Omar Williams received from Juan Norris? | val | medium | SELECT MAX(credit) FROM master_txn_table WHERE customers = 'omar williams' AND transaction_type = 'bill' AND vendor = 'juan norris' |
75,622 | book_sql | book_sql | How many Sofas/sofa-sleepers did we sell to Mary Williams Last 30 days? | val | medium | SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'mary williams' AND product_service = 'sofas/sofa-sleepers' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-30 days') AND DATE(CURRENT_DATE) |
75,623 | book_sql | book_sql | What was the last invoice value for Manufacturing grapefruit oil in This fiscal year? | val | medium | SELECT MAX(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'manufacturing grapefruit oil') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-3 months', 'start of year', '+3 months') AND DATE(CURRENT_DATE) |
75,624 | book_sql | book_sql | What our monthly spend on Cynthia Jones | val | hard | SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'cynthia jones' GROUP BY DATE(transaction_date, 'start of month') |
75,625 | book_sql | book_sql | Number of invoices created for Data processing computer services in in q2 this year? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'data processing computer services') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+3 month') AND DATE(CURRENT_DATE, 'start of year', '+6 month', '-1 day') |
75,626 | book_sql | book_sql | What was the lowest invoice value for Copy centers in in aug this year? | val | medium | SELECT MIN(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'copy centers') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+7 month') AND DATE(CURRENT_DATE, 'start of year', '+8 month', '-1 day') |
75,627 | book_sql | book_sql | What our monthly spend on Bradley Simmons | val | hard | SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'bradley simmons' GROUP BY DATE(transaction_date, 'start of month') |
75,628 | book_sql | book_sql | When was the last time we sold Investment | val | hard | SELECT transaction_date FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('income', 'other income') AND product_service = 'investment' ORDER BY transaction_date DESC LIMIT 1 |
75,629 | book_sql | book_sql | Compare sales by customer Last quarter | val | hard | SELECT customers, SUM(credit) FROM master_txn_table WHERE account IN ('income', 'other income') AND transaction_date < STRFTIME('%y-%m-%d', STRFTIME('%y', 'now', '-1 year') || '-' || SUBSTRING('00' || ((CAST((STRFTIME('%m', 'now') - 1) AS REAL) / 3) * 3 + 4), -2, 2) || '-01') GROUP BY customers |
75,630 | book_sql | book_sql | What our monthly spend on Thomas Smith | val | hard | SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'thomas smith' GROUP BY DATE(transaction_date, 'start of month') |
75,631 | book_sql | book_sql | Check the sales receipts record and compute the average quantities ordered with the payment method [payment_method]. | val | hard | SELECT AVG(quantity_per_transaction) FROM (SELECT transaction_id, SUM(quantity) AS quantity_per_transaction FROM master_txn_table WHERE transaction_type = 'sales receipt' AND payment_method = '[payment_method]' GROUP BY transaction_id) |
75,632 | book_sql | book_sql | How much did Brian Clark PhD spend on Offering equity long/short in July during last year? | val | hard | SELECT SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE t1.customers = 'brian clark phd' AND INSTR(account, 'offering equity long/short ') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND acco... |
75,633 | book_sql | book_sql | Check the sales receipts record and compute the average quantities ordered with the payment method [payment_method]. | val | hard | SELECT AVG(quantity_per_transaction) FROM (SELECT transaction_id, SUM(quantity) AS quantity_per_transaction FROM master_txn_table WHERE transaction_type = 'sales receipt' AND payment_method = '[payment_method]' GROUP BY transaction_id) |
75,634 | book_sql | book_sql | How much revenue came through Hannah Chen in may last year? | val | hard | SELECT SUM(credit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE customers = 'hannah chen' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-1 year', 'start of year', '+4 month') AND DATE(CURRENT_DATE, '-1 year', 'start of y... |
75,635 | book_sql | book_sql | Did we receive payment from Kelly Gillespie partnership in dec last year? | val | medium | SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'kelly gillespie' AND transaction_date BETWEEN DATE(CURRENT_DATE, '-1 year', 'start of year', '+11 month') AND DATE(CURRENT_DATE, '-1 year', 'start of year', '+12 month', '-1 day') |
75,636 | book_sql | book_sql | How much did Stephen Obrien spend on Accounts Receivable (A/R) in July during last year? | val | hard | SELECT SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE t1.customers = 'stephen obrien' AND INSTR(account, 'accounts receivable (a/r)') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND account... |
75,637 | book_sql | book_sql | How many Railcar did we sell to Angela Valencia in q2 this year? | val | medium | SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'angela valencia' AND product_service = 'railcar' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+3 month') AND DATE(CURRENT_DATE, 'start of year', '+6 month', '-1 day') |
75,638 | book_sql | book_sql | How much revenue came through Amber Mccoy Last month? | val | hard | SELECT SUM(credit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE customers = 'amber mccoy' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month', '-1 months') AND DATE(CURRENT_DATE, 'start of month', '-1 days') |
75,639 | book_sql | book_sql | When was the last time we sold Outdoor goods | val | hard | SELECT transaction_date FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('income', 'other income') AND product_service = 'outdoor goods' ORDER BY transaction_date DESC LIMIT 1 |
75,640 | book_sql | book_sql | How much revenue came through Marcus White This week? | val | hard | SELECT SUM(credit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE customers = 'marcus white' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE) |
75,641 | book_sql | book_sql | Compare sales by customer Last fiscal year | val | hard | SELECT customers, SUM(credit) FROM master_txn_table WHERE account IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-3 months', 'start of year', '-1 years', '+3 months') AND DATE(CURRENT_DATE, '-3 months', 'start of year', '-1 years', '+3 months', '+1 years', '-1 days') GROUP BY customers |
75,642 | book_sql | book_sql | As of Last year, how many invoices for Joshua Rice remained unpaid? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'joshua rice' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '-1 days', 'start of year') AND DATE(CURRENT_DATE, 'start of year', '-1 days') |
75,643 | book_sql | book_sql | Did we receive payment from Allison Stewart partnership Last month? | val | medium | SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'allison stewart' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month', '-1 months') AND DATE(CURRENT_DATE, 'start of month', '-1 days') |
75,644 | book_sql | book_sql | What our monthly spend on Kathleen Martinez | val | hard | SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'kathleen martinez' GROUP BY DATE(transaction_date, 'start of month') |
75,645 | book_sql | book_sql | Check the sales receipts record and compute the average quantities ordered with the payment method [payment_method]. | val | hard | SELECT AVG(quantity_per_transaction) FROM (SELECT transaction_id, SUM(quantity) AS quantity_per_transaction FROM master_txn_table WHERE transaction_type = 'sales receipt' AND payment_method = '[payment_method]' GROUP BY transaction_id) |
75,646 | book_sql | book_sql | What was the last bill Christopher Sanders received from Shelley Foley? | val | medium | SELECT MAX(credit) FROM master_txn_table WHERE customers = 'christopher sanders' AND transaction_type = 'bill' AND vendor = 'shelley foley' |
75,647 | book_sql | book_sql | Number of invoices created for Retailing formal dining furniture in Last fiscal year? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'retailing formal dining furniture') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-3 months', 'start of year', '-1 years', '+3 months') AND DATE(CURRENT_DATE, '-3 months', 'start of year', '-1 years', '... |
75,648 | book_sql | book_sql | Number of invoices created for Fuel in This week? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'fuel') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE) |
75,649 | book_sql | book_sql | How much did Penny Roy spend on Fees Billed in July during last year? | val | hard | SELECT SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE t1.customers = 'penny roy' AND INSTR(account, 'fees billed') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND account_type IN ('expense'... |
75,650 | book_sql | book_sql | What was the lowest bill Daniel Dawson received from Elizabeth Brown? | val | medium | SELECT MIN(credit) FROM master_txn_table WHERE customers = 'daniel dawson' AND transaction_type = 'bill' AND vendor = 'elizabeth brown' |
75,651 | book_sql | book_sql | As of Last fiscal year, how many invoices for Natalie Parker remained unpaid? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'natalie parker' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, '-3 months', 'start of year', '-1 years', '+3 months') AND DATE(CURRENT_DATE, '-3 months', 'start of year', '-1 years', '+3... |
75,652 | book_sql | book_sql | How much did Kenneth Craig spend on Decks and Patios in July during last year? | val | hard | SELECT SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE t1.customers = 'kenneth craig' AND INSTR(account, 'decks and patios') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND account_type IN (... |
75,653 | book_sql | book_sql | Compare sales by customer This month to date | val | hard | SELECT customers, SUM(credit) FROM master_txn_table WHERE account IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE) GROUP BY customers |
75,654 | book_sql | book_sql | What was the highest invoice value for Fees Billed in in q3 last year? | val | medium | SELECT MAX(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'fees billed') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-1 year', 'start of year', '+6 month') AND DATE(CURRENT_DATE, '-1 year', 'start of year', '+9 month', '-1 day') |
75,655 | book_sql | book_sql | As of today, how many invoices for Marissa Cabrera remained unpaid? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'marissa cabrera' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE) AND DATE(CURRENT_DATE) |
75,656 | book_sql | book_sql | How much did Penny Rogers spend on Accounts Receivable (A/R) in July during last year? | val | hard | SELECT SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE t1.customers = 'penny rogers' AND INSTR(account, 'accounts receivable (a/r)') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND account_t... |
75,657 | book_sql | book_sql | Compare sales by customer This year to date | val | hard | SELECT customers, SUM(credit) FROM master_txn_table WHERE account IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE) GROUP BY customers |
75,658 | book_sql | book_sql | How much revenue came through Jason Olsen This fiscal year? | val | hard | SELECT SUM(credit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE customers = 'jason olsen' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-3 months', 'start of year', '+3 months') AND DATE(CURRENT_DATE) |
75,659 | book_sql | book_sql | How much did Alexander Wilson spend on Document copying services in July during last year? | val | hard | SELECT SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE t1.customers = 'alexander wilson' AND INSTR(account, 'document copying services') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND accou... |
75,660 | book_sql | book_sql | Did we receive payment from Theresa Rogers partnership This year? | val | medium | SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'theresa rogers' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE) |
75,661 | book_sql | book_sql | When was the last time we sold Fluorocarbon gases | val | hard | SELECT transaction_date FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('income', 'other income') AND product_service = 'fluorocarbon gases' ORDER BY transaction_date DESC LIMIT 1 |
75,662 | book_sql | book_sql | Number of invoices created for Development of software products for automobiles in This week to date? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'development of software products for automobiles') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE) |
75,663 | book_sql | book_sql | When was the last time we sold Dance | val | hard | SELECT transaction_date FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('income', 'other income') AND product_service = 'dance' ORDER BY transaction_date DESC LIMIT 1 |
75,664 | book_sql | book_sql | How many Tyler Olson invoices are still oustanding? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'tyler olson' AND transaction_type = 'invoice' AND open_balance > 0 |
75,665 | book_sql | book_sql | How much did Alan Young spend on Accounts Receivable (A/R) in July during last year? | val | hard | SELECT SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE t1.customers = 'alan young' AND INSTR(account, 'accounts receivable (a/r)') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND account_typ... |
75,666 | book_sql | book_sql | How much did Christopher Taylor spend on Loan Payable in July during last year? | val | hard | SELECT SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE t1.customers = 'christopher taylor' AND INSTR(account, 'loan payable') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND account_type IN ... |
75,667 | book_sql | book_sql | Check the sales receipts record and compute the average quantities ordered with the payment method [payment_method]. | val | hard | SELECT AVG(quantity_per_transaction) FROM (SELECT transaction_id, SUM(quantity) AS quantity_per_transaction FROM master_txn_table WHERE transaction_type = 'sales receipt' AND payment_method = '[payment_method]' GROUP BY transaction_id) |
75,668 | book_sql | book_sql | As of This quarter, how many invoices for William Oconnor remained unpaid? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'william oconnor' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date >= STRFTIME('%y-%m-%d', STRFTIME('%y', 'now', '-1 year') || '-' || SUBSTRING('00' || ((CAST((STRFTIME('%m', 'now') - 1) AS REAL) / 3) * 3 + 1), -2, 2... |
75,669 | book_sql | book_sql | As of today, how many invoices for Julie Gill remained unpaid? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'julie gill' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE) AND DATE(CURRENT_DATE) |
75,670 | book_sql | book_sql | Check the sales receipts record and compute the average quantities ordered with the payment method [payment_method]. | val | hard | SELECT AVG(quantity_per_transaction) FROM (SELECT transaction_id, SUM(quantity) AS quantity_per_transaction FROM master_txn_table WHERE transaction_type = 'sales receipt' AND payment_method = '[payment_method]' GROUP BY transaction_id) |
75,671 | book_sql | book_sql | Number of invoices created for Therapeutic services in Last 7 days? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'therapeutic services') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-7 days') AND DATE(CURRENT_DATE) |
75,672 | book_sql | book_sql | Check the sales receipts record and compute the average quantities ordered with the payment method [payment_method]. | val | hard | SELECT AVG(quantity_per_transaction) FROM (SELECT transaction_id, SUM(quantity) AS quantity_per_transaction FROM master_txn_table WHERE transaction_type = 'sales receipt' AND payment_method = '[payment_method]' GROUP BY transaction_id) |
75,673 | book_sql | book_sql | Compare sales by customer This quarter to date | val | hard | SELECT customers, SUM(credit) FROM master_txn_table WHERE account IN ('income', 'other income') AND transaction_date >= STRFTIME('%y-%m-%d', STRFTIME('%y', 'now', '-1 year') || '-' || SUBSTRING('00' || ((CAST((STRFTIME('%m', 'now') - 1) AS REAL) / 3) * 3 + 1), -2, 2) || '-01') GROUP BY customers |
75,674 | book_sql | book_sql | Number of invoices created for Providing brokerage services in in jan this year? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'providing brokerage services') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE, 'start of year', '+1 month', '-1 day') |
75,675 | book_sql | book_sql | What our monthly spend on Sean Daniels | val | hard | SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'sean daniels' GROUP BY DATE(transaction_date, 'start of month') |
75,676 | book_sql | book_sql | When was the last time we sold Recreation | val | hard | SELECT transaction_date FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('income', 'other income') AND product_service = 'recreation' ORDER BY transaction_date DESC LIMIT 1 |
75,677 | book_sql | book_sql | How many Karen Duncan invoices are still oustanding? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'karen duncan' AND transaction_type = 'invoice' AND open_balance > 0 |
75,678 | book_sql | book_sql | What acount had our biggest expense This year to date? | val | hard | SELECT account, SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('expense', 'other expense') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE) GROUP BY account ORDER BY SUM(debit) DESC LIMIT 1 |
75,679 | book_sql | book_sql | Did we receive payment from Veronica Harris partnership in jan this year? | val | medium | SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'veronica harris' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE, 'start of year', '+1 month', '-1 day') |
75,680 | book_sql | book_sql | What was the total invoice value for Fishing supply retailing in MTD? | val | medium | SELECT SUM(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'fishing supply retailing') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE) |
75,681 | book_sql | book_sql | Compare sales by customer in aug this year | val | hard | SELECT customers, SUM(credit) FROM master_txn_table WHERE account IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+7 month') AND DATE(CURRENT_DATE, 'start of year', '+8 month', '-1 day') GROUP BY customers |
75,682 | book_sql | book_sql | When was the last time we sold Orange oil | val | hard | SELECT transaction_date FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('income', 'other income') AND product_service = 'orange oil' ORDER BY transaction_date DESC LIMIT 1 |
75,683 | book_sql | book_sql | As of Last 30 days, how many invoices for Charles Ayala remained unpaid? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'charles ayala' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, '-30 days') AND DATE(CURRENT_DATE) |
75,684 | book_sql | book_sql | What was the min invoice value for Providing shunting trailers in rail terminals in YTD? | val | medium | SELECT MIN(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'providing shunting trailers in rail terminals') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE) |
75,685 | book_sql | book_sql | What acount had our biggest expense in may last year? | val | hard | SELECT account, SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('expense', 'other expense') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-1 year', 'start of year', '+4 month') AND DATE(CURRENT_DATE, '-1 year', 'start of year', '+5 month', '-... |
75,686 | book_sql | book_sql | Compare sales by customer in may last year | val | hard | SELECT customers, SUM(credit) FROM master_txn_table WHERE account IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-1 year', 'start of year', '+4 month') AND DATE(CURRENT_DATE, '-1 year', 'start of year', '+5 month', '-1 day') GROUP BY customers |
75,687 | book_sql | book_sql | How much revenue came through Bradley Sanders in may last year? | val | hard | SELECT SUM(credit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE customers = 'bradley sanders' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-1 year', 'start of year', '+4 month') AND DATE(CURRENT_DATE, '-1 year', 'start ... |
75,688 | book_sql | book_sql | What was the total bill Andrea Carter received from Cynthia Jones? | val | medium | SELECT SUM(credit) FROM master_txn_table WHERE customers = 'andrea carter' AND transaction_type = 'bill' AND vendor = 'cynthia jones' |
75,689 | book_sql | book_sql | What acount had our biggest expense Last quarter? | val | hard | SELECT account, SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('expense', 'other expense') AND transaction_date < STRFTIME('%y-%m-%d', STRFTIME('%y', 'now', '-1 year') || '-' || SUBSTRING('00' || ((CAST((STRFTIME('%m', 'now') - 1) AS REAL) / 3)... |
75,690 | book_sql | book_sql | Check the sales receipts record and compute the average quantities ordered with the payment method [payment_method]. | val | hard | SELECT AVG(quantity_per_transaction) FROM (SELECT transaction_id, SUM(quantity) AS quantity_per_transaction FROM master_txn_table WHERE transaction_type = 'sales receipt' AND payment_method = '[payment_method]' GROUP BY transaction_id) |
75,691 | book_sql | book_sql | How much revenue came through William Schmidt This year to date? | val | hard | SELECT SUM(credit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE customers = 'william schmidt' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE) |
75,692 | book_sql | book_sql | Check the sales receipts record and compute the average quantities ordered with the payment method [payment_method]. | val | hard | SELECT AVG(quantity_per_transaction) FROM (SELECT transaction_id, SUM(quantity) AS quantity_per_transaction FROM master_txn_table WHERE transaction_type = 'sales receipt' AND payment_method = '[payment_method]' GROUP BY transaction_id) |
75,693 | book_sql | book_sql | Compare sales by customer Last 30 days | val | hard | SELECT customers, SUM(credit) FROM master_txn_table WHERE account IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-30 days') AND DATE(CURRENT_DATE) GROUP BY customers |
75,694 | book_sql | book_sql | How much did Jon Acevedo spend on Arizona Dept. of Revenue Payable in July during last year? | val | hard | SELECT SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE t1.customers = 'jon acevedo' AND INSTR(account, 'arizona dept. of revenue payable') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND acc... |
75,695 | book_sql | book_sql | What our monthly spend on Paul Walters | val | hard | SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'paul walters' GROUP BY DATE(transaction_date, 'start of month') |
75,696 | book_sql | book_sql | What acount had our biggest expense YTD? | val | hard | SELECT account, SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('expense', 'other expense') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE) GROUP BY account ORDER BY SUM(debit) DESC LIMIT 1 |
75,697 | book_sql | book_sql | What was the last invoice value for Baby car seats in in q2 this year? | val | medium | SELECT MAX(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'baby car seats') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+3 month') AND DATE(CURRENT_DATE, 'start of year', '+6 month', '-1 day') |
75,698 | book_sql | book_sql | How much revenue came through Steven Mcgrath yesterday? | val | hard | SELECT SUM(credit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE customers = 'steven mcgrath' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-1 day') AND DATE(CURRENT_DATE, '-1 day') |
75,699 | book_sql | book_sql | Number of invoices created for Manufacturing lemon oil in in q1 this year? | val | medium | SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'manufacturing lemon oil') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE, 'start of year', '+3 month', '-1 day') |
75,700 | book_sql | book_sql | What acount had our biggest expense Last fiscal year? | val | hard | SELECT account, SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('expense', 'other expense') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-3 months', 'start of year', '-1 years', '+3 months') AND DATE(CURRENT_DATE, '-3 months', 'start of year... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.