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,301
book_sql
book_sql
Did we receive payment from Courtney Snyder partnership Last fiscal year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'courtney snyder' 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,302
book_sql
book_sql
What was the first bill Taylor Moore received from Richard Simmons?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE customers = 'taylor moore' AND transaction_type = 'bill' AND vendor = 'richard simmons'
75,303
book_sql
book_sql
What was the mean invoice value for Dues & Subscriptions in This year to date?
val
medium
SELECT AVG(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'dues & subscriptions') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,304
book_sql
book_sql
How much revenue came through Jonathan Gomez 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 = 'jonathan gomez' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE)
75,305
book_sql
book_sql
How much revenue came through Edward Nichols 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 = 'edward nichols' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-1 day') AND DATE(CURRENT_DATE, '-1 day')
75,306
book_sql
book_sql
How much revenue came through Heather Clark This week 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 = 'heather clark' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE)
75,307
book_sql
book_sql
As of yesterday, how many invoices for Shannon Hamilton remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'shannon hamilton' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, '-1 day') AND DATE(CURRENT_DATE, '-1 day')
75,308
book_sql
book_sql
Did we receive payment from Michael Armstrong partnership Last 12 months?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'michael armstrong' AND transaction_date BETWEEN DATE(CURRENT_DATE, '-12 months', 'start of month') AND DATE(CURRENT_DATE, 'start of month', '-1 day')
75,309
book_sql
book_sql
What was the min bill Joseph Warren received from Trevor Lawrence?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE customers = 'joseph warren' AND transaction_type = 'bill' AND vendor = 'trevor lawrence'
75,310
book_sql
book_sql
How many Vicki Ball invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'vicki ball' AND transaction_type = 'invoice' AND open_balance > 0
75,311
book_sql
book_sql
What acount had our biggest expense This week?
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, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE) GROUP BY account ORDER BY SUM(debit) DESC LIMIT 1
75,312
book_sql
book_sql
How much revenue came through Stuart Williams 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 = 'stuart williams' 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,313
book_sql
book_sql
How much revenue came through Carol Ruiz 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 = 'carol ruiz' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,314
book_sql
book_sql
As of Last month, how many invoices for Jacqueline Murillo remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'jacqueline murillo' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month', '-1 months') AND DATE(CURRENT_DATE, 'start of month', '-1 days')
75,315
book_sql
book_sql
What was the total invoice value for Promotional in in aug this year?
val
medium
SELECT SUM(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'promotional') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+7 month') AND DATE(CURRENT_DATE, 'start of year', '+8 month', '-1 day')
75,316
book_sql
book_sql
How much did Carrie Humphrey 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 = 'carrie humphrey' AND INSTR(account, 'accounts receivable (a/r)') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND accoun...
75,317
book_sql
book_sql
When was the last time we sold Railroad switching
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 = 'railroad switching' ORDER BY transaction_date DESC LIMIT 1
75,318
book_sql
book_sql
What was the last bill Christy Dennis received from Sheila Russell?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE customers = 'christy dennis' AND transaction_type = 'bill' AND vendor = 'sheila russell'
75,319
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,320
book_sql
book_sql
What was the first invoice value for golf courses and country clubs in Last 12 months?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'golf courses and country clubs') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-12 months', 'start of month') AND DATE(CURRENT_DATE, 'start of month', '-1 day')
75,321
book_sql
book_sql
Compare sales by customer in q1 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') AND DATE(CURRENT_DATE, 'start of year', '+3 month', '-1 day') GROUP BY customers
75,322
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,323
book_sql
book_sql
What our monthly spend on Michael Lee
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'michael lee' GROUP BY DATE(transaction_date, 'start of month')
75,324
book_sql
book_sql
Did we receive payment from Jackie Khan partnership This week?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'jackie khan' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE)
75,325
book_sql
book_sql
What acount had our biggest expense MTD?
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 month') AND DATE(CURRENT_DATE) GROUP BY account ORDER BY SUM(debit) DESC LIMIT 1
75,326
book_sql
book_sql
Compare sales by customer This month
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,327
book_sql
book_sql
What was the max bill Heather Christensen received from Lori Rodriguez?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE customers = 'heather christensen' AND transaction_type = 'bill' AND vendor = 'lori rodriguez'
75,328
book_sql
book_sql
How many Logan Lee invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'logan lee' AND transaction_type = 'invoice' AND open_balance > 0
75,329
book_sql
book_sql
When was the last time we sold Bangalow
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 = 'bangalow' ORDER BY transaction_date DESC LIMIT 1
75,330
book_sql
book_sql
What was the average bill Susan Jackson received from Michael Hanna?
val
medium
SELECT AVG(credit) FROM master_txn_table WHERE customers = 'susan jackson' AND transaction_type = 'bill' AND vendor = 'michael hanna'
75,331
book_sql
book_sql
How much revenue came through Terry Zimmerman This 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 = 'terry zimmerman' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE)
75,332
book_sql
book_sql
When was the last time we sold Printing
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 = 'printing' ORDER BY transaction_date DESC LIMIT 1
75,333
book_sql
book_sql
When was the last time we sold Repair
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 = 'repair' ORDER BY transaction_date DESC LIMIT 1
75,334
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,335
book_sql
book_sql
As of This quarter to date, how many invoices for Kirk Poole remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'kirk poole' 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,336
book_sql
book_sql
How many Breeding did we sell to Douglas Cooper Last quarter?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'douglas cooper' AND product_service = 'breeding' 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,337
book_sql
book_sql
Number of invoices created for Design income in in jan this year?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'design income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE, 'start of year', '+1 month', '-1 day')
75,338
book_sql
book_sql
What was the average bill Phillip Figueroa received from Gail Schneider?
val
medium
SELECT AVG(credit) FROM master_txn_table WHERE customers = 'phillip figueroa' AND transaction_type = 'bill' AND vendor = 'gail schneider'
75,339
book_sql
book_sql
What our monthly spend on Donald Keller
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'donald keller' GROUP BY DATE(transaction_date, 'start of month')
75,340
book_sql
book_sql
What was the lowest bill Ariana Ayala received from Corey Liu?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE customers = 'ariana ayala' AND transaction_type = 'bill' AND vendor = 'corey liu'
75,341
book_sql
book_sql
Number of invoices created for License fees in This year?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'license fees') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,342
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,343
book_sql
book_sql
How much revenue came through Philip Morris 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 = 'philip morris' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,344
book_sql
book_sql
How many Vincent Carey invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'vincent carey' AND transaction_type = 'invoice' AND open_balance > 0
75,345
book_sql
book_sql
What our monthly spend on Kimberly Barker
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'kimberly barker' GROUP BY DATE(transaction_date, 'start of month')
75,346
book_sql
book_sql
What our monthly spend on Samuel Gomez
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'samuel gomez' GROUP BY DATE(transaction_date, 'start of month')
75,347
book_sql
book_sql
How many Lemon oil did we sell to Jason Johnson Last 30 days?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'jason johnson' AND product_service = 'lemon oil' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-30 days') AND DATE(CURRENT_DATE)
75,348
book_sql
book_sql
How much revenue came through Mariah Vaughn 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 = 'mariah vaughn' AND account_type IN ('income', 'other income') AND transaction_date >= STRFTIME('%y-%m-%d', STRFTIME('%y', 'now', '-1 year') || '-' || SUBSTRING('00' || ((CAST((STRFTIME('%m', 'n...
75,349
book_sql
book_sql
Compare sales by customer This week 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, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE) GROUP BY customers
75,350
book_sql
book_sql
Did we receive payment from Isabel Wade partnership today?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'isabel wade' AND transaction_date BETWEEN DATE(CURRENT_DATE) AND DATE(CURRENT_DATE)
75,351
book_sql
book_sql
When was the last time we sold Bangalow
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 = 'bangalow' ORDER BY transaction_date DESC LIMIT 1
75,352
book_sql
book_sql
What acount had our biggest expense 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, 'start of year', '-1 days', 'start of year') AND DATE(CURRENT_DATE, 'start of year', '-1 days') GROUP BY ...
75,353
book_sql
book_sql
Did we receive payment from James Mcdowell partnership This week to date?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'james mcdowell' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE)
75,354
book_sql
book_sql
As of Last 7 days, how many invoices for Isaac Baker remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'isaac baker' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, '-7 days') AND DATE(CURRENT_DATE)
75,355
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,356
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,357
book_sql
book_sql
What our monthly spend on Michael Hanna
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'michael hanna' GROUP BY DATE(transaction_date, 'start of month')
75,358
book_sql
book_sql
How much did Michael Collins spend on Attire and accessories 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 = 'michael collins' AND INSTR(account, 'attire and accessories') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND account_t...
75,359
book_sql
book_sql
How many Rebecca Bryant invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'rebecca bryant' AND transaction_type = 'invoice' AND open_balance > 0
75,360
book_sql
book_sql
What was the last bill Samuel Cross received from Dale Hudson?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE customers = 'samuel cross' AND transaction_type = 'bill' AND vendor = 'dale hudson'
75,361
book_sql
book_sql
What was the total invoice value for Private parcel mailing services in in q2 this year?
val
medium
SELECT SUM(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'private parcel mailing 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,362
book_sql
book_sql
Number of invoices created for Baby toys in This quarter?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'baby toys') 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')
75,363
book_sql
book_sql
When was the last time we sold Distressed Securities
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 = 'distressed securities' ORDER BY transaction_date DESC LIMIT 1
75,364
book_sql
book_sql
Compare sales by customer in jan 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') AND DATE(CURRENT_DATE, 'start of year', '+1 month', '-1 day') GROUP BY customers
75,365
book_sql
book_sql
What was the lowest invoice value for Exercise equipment retailing in This fiscal year to date?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'exercise equipment retailing') 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,366
book_sql
book_sql
What our monthly spend on Christopher Tran
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'christopher tran' GROUP BY DATE(transaction_date, 'start of month')
75,367
book_sql
book_sql
Did we receive payment from Danielle Arnold partnership in q2 this year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'danielle arnold' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+3 month') AND DATE(CURRENT_DATE, 'start of year', '+6 month', '-1 day')
75,368
book_sql
book_sql
Number of invoices created for Manufacturing spearmint oil in in q2 this year?
val
medium
SELECT COUNT(DISTINCT transaction_id) 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,369
book_sql
book_sql
What was the min invoice value for Cost of Labor in in q1 this year?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'cost of labor') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE, 'start of year', '+3 month', '-1 day')
75,370
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,371
book_sql
book_sql
Number of invoices created for Providing courses through business schools in in q2 this year?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'providing courses through business schools') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+3 month') AND DATE(CURRENT_DATE, 'start of year', '+6 month', '-1 day')
75,372
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,373
book_sql
book_sql
Did we receive payment from Brent Rodriguez partnership in q1 this year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'brent rodriguez' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE, 'start of year', '+3 month', '-1 day')
75,374
book_sql
book_sql
What our monthly spend on Jessica Wagner
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'jessica wagner' GROUP BY DATE(transaction_date, 'start of month')
75,375
book_sql
book_sql
When was the last time we sold Shearing
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 = 'shearing' ORDER BY transaction_date DESC LIMIT 1
75,376
book_sql
book_sql
Number of invoices created for Contract mining in in q1 this year?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'contract mining') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE, 'start of year', '+3 month', '-1 day')
75,377
book_sql
book_sql
What was the max invoice value for Coal exploration in Last 30 days?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'coal exploration') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-30 days') AND DATE(CURRENT_DATE)
75,378
book_sql
book_sql
Did we receive payment from Kaitlyn Mcdonald partnership This fiscal year to date?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'kaitlyn mcdonald' 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,379
book_sql
book_sql
What was the lowest invoice value for Providing financial planning services in This year to date?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'providing financial planning services') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,380
book_sql
book_sql
When was the last time we sold Computer Programming
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 = 'computer programming' ORDER BY transaction_date DESC LIMIT 1
75,381
book_sql
book_sql
What was the mean invoice value for Manufacturing industrial inorganic gases in Last year?
val
medium
SELECT AVG(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'manufacturing industrial inorganic gases') 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,382
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,383
book_sql
book_sql
What our monthly spend on Hannah Downs
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'hannah downs' GROUP BY DATE(transaction_date, 'start of month')
75,384
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,385
book_sql
book_sql
As of MTD, how many invoices for Angela Adams remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'angela adams' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE)
75,386
book_sql
book_sql
Compare sales by customer This 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 + 1), -2, 2) || '-01') GROUP BY customers
75,387
book_sql
book_sql
As of yesterday, how many invoices for Michael Vasquez remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'michael vasquez' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, '-1 day') AND DATE(CURRENT_DATE, '-1 day')
75,388
book_sql
book_sql
As of Last year, how many invoices for Kayla Marsh remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'kayla marsh' 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,389
book_sql
book_sql
When was the last time we sold Therapeutic
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 = 'therapeutic' ORDER BY transaction_date DESC LIMIT 1
75,390
book_sql
book_sql
How many Jesse Hall invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'jesse hall' AND transaction_type = 'invoice' AND open_balance > 0
75,391
book_sql
book_sql
What was the mean invoice value for Equipment Rental in Last 7 days?
val
medium
SELECT AVG(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'equipment rental') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-7 days') AND DATE(CURRENT_DATE)
75,392
book_sql
book_sql
How many Sarah Fritz invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'sarah fritz' AND transaction_type = 'invoice' AND open_balance > 0
75,393
book_sql
book_sql
How much revenue came through George Turner 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 = 'george turner' 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', 'sta...
75,394
book_sql
book_sql
How many Attire and accessories did we sell to Sharon Williams in q2 this year?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'sharon williams' AND product_service = 'attire and accessories' 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,395
book_sql
book_sql
How many Ventilation cleaning did we sell to Brooke Ramirez This year?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'brooke ramirez' AND product_service = 'ventilation cleaning' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,396
book_sql
book_sql
Number of invoices created for Breeding services in today?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'breeding services') AND transaction_date BETWEEN DATE(CURRENT_DATE) AND DATE(CURRENT_DATE)
75,397
book_sql
book_sql
How much did Kirk Patrick spend on Labor 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 = 'kirk patrick' AND INSTR(account, 'labor') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND account_type IN ('expense', '...
75,398
book_sql
book_sql
Compare sales by customer Last 12 months
val
hard
SELECT customers, SUM(credit) FROM master_txn_table WHERE account IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-12 months', 'start of month') AND DATE(CURRENT_DATE, 'start of month', '-1 day') GROUP BY customers
75,399
book_sql
book_sql
What was the first bill Julie Lin received from Brad Bryant?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE customers = 'julie lin' AND transaction_type = 'bill' AND vendor = 'brad bryant'
75,400
book_sql
book_sql
What was the mean bill Joanne Mann received from Kathleen Park?
val
medium
SELECT AVG(credit) FROM master_txn_table WHERE customers = 'joanne mann' AND transaction_type = 'bill' AND vendor = 'kathleen park'