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,401
book_sql
book_sql
Did we receive payment from Bonnie Kelly partnership YTD?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'bonnie kelly' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,402
book_sql
book_sql
What our monthly spend on Taylor Williams
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'taylor williams' GROUP BY DATE(transaction_date, 'start of month')
75,403
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,404
book_sql
book_sql
When was the last time we sold Car seats
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 = 'car seats' ORDER BY transaction_date DESC LIMIT 1
75,405
book_sql
book_sql
Number of invoices created for Refunds-Allowances in in aug this year?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'refunds-allowances') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+7 month') AND DATE(CURRENT_DATE, 'start of year', '+8 month', '-1 day')
75,406
book_sql
book_sql
Did we receive payment from Jeremy Pineda partnership in q3 last year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'jeremy pineda' 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,407
book_sql
book_sql
Did we receive payment from Bailey Dennis partnership in q2 this year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'bailey dennis' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+3 month') AND DATE(CURRENT_DATE, 'start of year', '+6 month', '-1 day')
75,408
book_sql
book_sql
What was the max bill Rebekah Nelson received from Allen Fisher?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE customers = 'rebekah nelson' AND transaction_type = 'bill' AND vendor = 'allen fisher'
75,409
book_sql
book_sql
What was the max bill Jenny Marshall received from Craig Tyler?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE customers = 'jenny marshall' AND transaction_type = 'bill' AND vendor = 'craig tyler'
75,410
book_sql
book_sql
How many Toys did we sell to Susan Campbell This month to date?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'susan campbell' AND product_service = 'toys' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE)
75,411
book_sql
book_sql
How much did Robert Griffin 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 = 'robert griffin' 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,412
book_sql
book_sql
What acount had our biggest expense Last 30 days?
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, '-30 days') AND DATE(CURRENT_DATE) GROUP BY account ORDER BY SUM(debit) DESC LIMIT 1
75,413
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,414
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,415
book_sql
book_sql
How many Data storage management did we sell to Ashlee Walton in q2 this year?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'ashlee walton' AND product_service = 'data storage management' 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,416
book_sql
book_sql
What was the lowest bill Philip Villarreal received from Kimberly Torres?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE customers = 'philip villarreal' AND transaction_type = 'bill' AND vendor = 'kimberly torres'
75,417
book_sql
book_sql
How much revenue came through Kristie Snyder in q2 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 = 'kristie snyder' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+3 month') AND DATE(CURRENT_DATE, 'start of year', '+6 month', '...
75,418
book_sql
book_sql
Did we receive payment from Tamara Parks partnership in may last year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'tamara parks' 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')
75,419
book_sql
book_sql
Number of invoices created for Manufacturing lemon oil in in q3 last 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, '-1 year', 'start of year', '+6 month') AND DATE(CURRENT_DATE, '-1 year', 'start of year', '+9 month', '-1 day')
75,420
book_sql
book_sql
Number of invoices created for Musicians in Last 7 days?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'musicians') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-7 days') AND DATE(CURRENT_DATE)
75,421
book_sql
book_sql
How much revenue came through Meghan Harper 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 = 'meghan harper' 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,422
book_sql
book_sql
How much revenue came through Jacob Leon Last 30 days?
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 = 'jacob leon' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-30 days') AND DATE(CURRENT_DATE)
75,423
book_sql
book_sql
How much did Nicole Coffey 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 = 'nicole coffey' AND INSTR(account, 'offering equity long/short ') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND accoun...
75,424
book_sql
book_sql
What our monthly spend on Jessica Manning
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'jessica manning' GROUP BY DATE(transaction_date, 'start of month')
75,425
book_sql
book_sql
How many Maria Griffin invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'maria griffin' AND transaction_type = 'invoice' AND open_balance > 0
75,426
book_sql
book_sql
Did we receive payment from Michael Warner partnership Last fiscal year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'michael warner' 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')
75,427
book_sql
book_sql
How many Fishing did we sell to Veronica Carlson This fiscal year to date?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'veronica carlson' AND product_service = 'fishing' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-3 months', 'start of year', '+3 months') AND DATE(CURRENT_DATE, '-3 months', 'start of year', '+1 year', ...
75,428
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,429
book_sql
book_sql
How much revenue came through Christopher Boyle 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 = 'christopher boyle' 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,430
book_sql
book_sql
What was the last invoice value for Data processing in This year to date?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'data processing') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,431
book_sql
book_sql
As of in q1 this year, how many invoices for Jasmine Mercer remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'jasmine mercer' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE, 'start of year', '+3 month', '-1 day')
75,432
book_sql
book_sql
Number of invoices created for Wholesaling boats (except pleasure) in Last 12 months?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'wholesaling boats (except pleasure)') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-12 months', 'start of month') AND DATE(CURRENT_DATE, 'start of month', '-1 day')
75,433
book_sql
book_sql
How many Heavy construction equipment did we sell to Heidi Gates MTD?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'heidi gates' AND product_service = 'heavy construction equipment' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE)
75,434
book_sql
book_sql
Number of invoices created for Other accommodation services in in q3 last year?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'other accommodation services') 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,435
book_sql
book_sql
How many Musicians did we sell to Ashley Wolfe This week?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'ashley wolfe' AND product_service = 'musicians' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE)
75,436
book_sql
book_sql
Did we receive payment from Shawn Hopkins partnership YTD?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'shawn hopkins' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,437
book_sql
book_sql
What acount had our biggest expense This 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,438
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,439
book_sql
book_sql
Did we receive payment from Allen Murphy partnership This fiscal year to date?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'allen murphy' AND transaction_date BETWEEN DATE(CURRENT_DATE, '-3 months', 'start of year', '+3 months') AND DATE(CURRENT_DATE, '-3 months', 'start of year', '+1 year', '+3 months', '-1 day')
75,440
book_sql
book_sql
How many Ships did we sell to Thomas Cain This week?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'thomas cain' AND product_service = 'ships' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE)
75,441
book_sql
book_sql
What acount had our biggest expense in q3 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', '+6 month') AND DATE(CURRENT_DATE, '-1 year', 'start of year', '+9 month', '-...
75,442
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,443
book_sql
book_sql
How many Paula Bullock invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'paula bullock' AND transaction_type = 'invoice' AND open_balance > 0
75,444
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,445
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,446
book_sql
book_sql
How many Railroad Cars did we sell to John Andrews Last 7 days?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'john andrews' AND product_service = 'railroad cars' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-7 days') AND DATE(CURRENT_DATE)
75,447
book_sql
book_sql
How many Renee Williams invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'renee williams' AND transaction_type = 'invoice' AND open_balance > 0
75,448
book_sql
book_sql
Did we receive payment from Kathleen Williams partnership in dec last year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'kathleen williams' 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,449
book_sql
book_sql
Compare sales by customer This 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', '+3 months') AND DATE(CURRENT_DATE) GROUP BY customers
75,450
book_sql
book_sql
Did we receive payment from Michelle Fields partnership Last fiscal year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'michelle fields' 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')
75,451
book_sql
book_sql
Did we receive payment from Tracy Carr partnership This year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'tracy carr' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,452
book_sql
book_sql
Did we receive payment from Brenda Potts partnership This month?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'brenda potts' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE)
75,453
book_sql
book_sql
Number of invoices created for Coal Power generation in today?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'coal power generation') AND transaction_date BETWEEN DATE(CURRENT_DATE) AND DATE(CURRENT_DATE)
75,454
book_sql
book_sql
What our monthly spend on James Curry
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'james curry' GROUP BY DATE(transaction_date, 'start of month')
75,455
book_sql
book_sql
When was the last time we sold Fishing
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 = 'fishing' ORDER BY transaction_date DESC LIMIT 1
75,456
book_sql
book_sql
How much revenue came through Leslie Beck 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 = 'leslie beck' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,457
book_sql
book_sql
When was the last time we sold Carbon dioxide
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 = 'carbon dioxide' ORDER BY transaction_date DESC LIMIT 1
75,458
book_sql
book_sql
How much revenue came through Brandon Stark in aug 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 = 'brandon stark' AND account_type 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', '-...
75,459
book_sql
book_sql
Number of invoices created for Pool maintenance in This month to date?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'pool maintenance') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE)
75,460
book_sql
book_sql
How many Hydrogen did we sell to Rebecca Martin Last quarter?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'rebecca martin' AND product_service = 'hydrogen' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date < STRFTIME('%y-%m-%d', STRFTIME('%y', 'now', '-1 year') || '-' || SUBSTRING('00' || ((CAST((STRFTIME('%m', 'now') - 1) AS REAL) / 3) * ...
75,461
book_sql
book_sql
How many Foster Care did we sell to Victor Brown in q2 this year?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'victor brown' AND product_service = 'foster care' 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,462
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,463
book_sql
book_sql
As of in q1 this year, how many invoices for Nicole Suarez remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'nicole suarez' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE, 'start of year', '+3 month', '-1 day')
75,464
book_sql
book_sql
What was the average invoice value for Shearing services in yesterday?
val
medium
SELECT AVG(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'shearing services') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-1 day') AND DATE(CURRENT_DATE, '-1 day')
75,465
book_sql
book_sql
As of Last fiscal year, how many invoices for Sara Schwartz remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'sara schwartz' 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,466
book_sql
book_sql
Did we receive payment from Brian Hawkins partnership Last month?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'brian hawkins' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month', '-1 months') AND DATE(CURRENT_DATE, 'start of month', '-1 days')
75,467
book_sql
book_sql
What our monthly spend on Bruce Martinez
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'bruce martinez' GROUP BY DATE(transaction_date, 'start of month')
75,468
book_sql
book_sql
How many Jesse Nelson invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'jesse nelson' AND transaction_type = 'invoice' AND open_balance > 0
75,469
book_sql
book_sql
How much did Michele Turner spend on Unapplied Cash Payment Income 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 = 'michele turner' AND INSTR(account, 'unapplied cash payment income') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND acc...
75,470
book_sql
book_sql
Number of invoices created for Constructing multifamily residential in This year to date?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'constructing multifamily residential') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,471
book_sql
book_sql
What acount had our biggest expense This 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,472
book_sql
book_sql
What was the first invoice value for Constructing bangalow in Last month?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'constructing bangalow') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month', '-1 months') AND DATE(CURRENT_DATE, 'start of month', '-1 days')
75,473
book_sql
book_sql
How many Memberships did we sell to Lynn Arias in may last year?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'lynn arias' AND product_service = 'memberships' AND transaction_type IN ('invoice', 'sales receipt') 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 da...
75,474
book_sql
book_sql
When was the last time we sold Tanker
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 = 'tanker' ORDER BY transaction_date DESC LIMIT 1
75,475
book_sql
book_sql
When was the last time we sold Multi-strategy
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 = 'multi-strategy' ORDER BY transaction_date DESC LIMIT 1
75,476
book_sql
book_sql
How many Kristen Perry invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'kristen perry' AND transaction_type = 'invoice' AND open_balance > 0
75,477
book_sql
book_sql
How much did Jared Pena spend on Construction management of multifamily building 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 = 'jared pena' AND INSTR(account, 'construction management of multifamily building') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DAT...
75,478
book_sql
book_sql
Number of invoices created for Equipment Rental in Last month?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'equipment rental') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month', '-1 months') AND DATE(CURRENT_DATE, 'start of month', '-1 days')
75,479
book_sql
book_sql
As of This week to date, how many invoices for Regina Davis MD remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'regina davis md' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE)
75,480
book_sql
book_sql
What acount had our biggest expense in q1 this 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, 'start of year') AND DATE(CURRENT_DATE, 'start of year', '+3 month', '-1 day') GROUP BY account ORDER BY ...
75,481
book_sql
book_sql
Number of invoices created for Fuel in in jan this year?
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, 'start of year') AND DATE(CURRENT_DATE, 'start of year', '+1 month', '-1 day')
75,482
book_sql
book_sql
How much revenue came through Emily Singleton Last 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 = 'emily singleton' AND account_type IN ('income', 'other income') AND transaction_date < STRFTIME('%y-%m-%d', STRFTIME('%y', 'now', '-1 year') || '-' || SUBSTRING('00' || ((CAST((STRFTIME('%m', '...
75,483
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,484
book_sql
book_sql
When was the last time we sold Multi-strategy
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 = 'multi-strategy' ORDER BY transaction_date DESC LIMIT 1
75,485
book_sql
book_sql
What was the last invoice value for Manufacturing spearmint oil in in q2 this year?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'manufacturing spearmint oil') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+3 month') AND DATE(CURRENT_DATE, 'start of year', '+6 month', '-1 day')
75,486
book_sql
book_sql
When was the last time we sold Sofas/sofa-sleepers
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 = 'sofas/sofa-sleepers' ORDER BY transaction_date DESC LIMIT 1
75,487
book_sql
book_sql
What our monthly spend on Katelyn Nguyen
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'katelyn nguyen' GROUP BY DATE(transaction_date, 'start of month')
75,488
book_sql
book_sql
How many Swimming pool Cleaning did we sell to Regina Clark DDS in may last year?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'regina clark dds' AND product_service = 'swimming pool cleaning' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-1 year', 'start of year', '+4 month') AND DATE(CURRENT_DATE, '-1 year', 'start of year', '...
75,489
book_sql
book_sql
When was the last time we sold Entertainment
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 = 'entertainment' ORDER BY transaction_date DESC LIMIT 1
75,490
book_sql
book_sql
How many Auto sector did we sell to Kathleen Wells Last 7 days?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'kathleen wells' AND product_service = 'auto sector' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-7 days') AND DATE(CURRENT_DATE)
75,491
book_sql
book_sql
How many Golf Equipment did we sell to Steven Walker in dec last year?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'steven walker' AND product_service = 'golf equipment' AND transaction_type IN ('invoice', 'sales receipt') 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'...
75,492
book_sql
book_sql
What acount had our biggest expense This fiscal 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, '-3 months', 'start of year', '+3 months') AND DATE(CURRENT_DATE, '-3 months', 'start of year', '+1 year'...
75,493
book_sql
book_sql
Did we receive payment from Jeffrey Powell PhD partnership in jan this year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'jeffrey powell phd' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE, 'start of year', '+1 month', '-1 day')
75,494
book_sql
book_sql
Number of invoices created for Maintenance and Repair in in aug this year?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'maintenance and repair') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+7 month') AND DATE(CURRENT_DATE, 'start of year', '+8 month', '-1 day')
75,495
book_sql
book_sql
How much revenue came through Amber Mccormick This fiscal 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 = 'amber mccormick' 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, '-3 months', 's...
75,496
book_sql
book_sql
When was the last time we sold Home care
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 = 'home care' ORDER BY transaction_date DESC LIMIT 1
75,497
book_sql
book_sql
Did we receive payment from Gary Braun partnership in aug this year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'gary braun' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+7 month') AND DATE(CURRENT_DATE, 'start of year', '+8 month', '-1 day')
75,498
book_sql
book_sql
What our monthly spend on Helen Smith
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'helen smith' GROUP BY DATE(transaction_date, 'start of month')
75,499
book_sql
book_sql
What was the total bill Jay Brooks received from Tanya Lee?
val
medium
SELECT SUM(credit) FROM master_txn_table WHERE customers = 'jay brooks' AND transaction_type = 'bill' AND vendor = 'tanya lee'
75,500
book_sql
book_sql
What was the lowest bill Jenna Bradley MD received from Erica Walker?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE customers = 'jenna bradley md' AND transaction_type = 'bill' AND vendor = 'erica walker'