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,201
book_sql
book_sql
What our monthly spend on Misty Hunter
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'misty hunter' GROUP BY DATE(transaction_date, 'start of month')
75,202
book_sql
book_sql
When was the last time we sold Window washing
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 = 'window washing' ORDER BY transaction_date DESC LIMIT 1
75,203
book_sql
book_sql
When was the last time we sold Railroad Equipment
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 equipment' ORDER BY transaction_date DESC LIMIT 1
75,204
book_sql
book_sql
Did we receive payment from Rick Landry partnership in q3 last year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'rick landry' 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,205
book_sql
book_sql
How many Software Training did we sell to Garrett Marquez today?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'garrett marquez' AND product_service = 'software training' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE) AND DATE(CURRENT_DATE)
75,206
book_sql
book_sql
What acount had our biggest expense today?
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) AND DATE(CURRENT_DATE) GROUP BY account ORDER BY SUM(debit) DESC LIMIT 1
75,207
book_sql
book_sql
How much did Holly Bishop 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 = 'holly bishop' 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 ac...
75,208
book_sql
book_sql
How many Home care did we sell to Jessica Russell Last 7 days?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'jessica russell' AND product_service = 'home care' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-7 days') AND DATE(CURRENT_DATE)
75,209
book_sql
book_sql
How much did Michael Pittman spend on Uncategorized 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 = 'michael pittman' AND INSTR(account, 'uncategorized income') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND account_typ...
75,210
book_sql
book_sql
Compare sales by customer in dec 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', '+11 month') AND DATE(CURRENT_DATE, '-1 year', 'start of year', '+12 month', '-1 day') GROUP BY customers
75,211
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,212
book_sql
book_sql
How many PCs did we sell to Charles Brady Last month?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'charles brady' AND product_service = 'pcs' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month', '-1 months') AND DATE(CURRENT_DATE, 'start of month', '-1 days')
75,213
book_sql
book_sql
How much revenue came through Michelle Carlson MD in q3 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 = 'michelle carlson md' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-1 year', 'start of year', '+6 month') AND DATE(CURRENT_DATE, '-1 year', 'st...
75,214
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,215
book_sql
book_sql
How much revenue came through Brandon Roberts 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 = 'brandon roberts' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE)
75,216
book_sql
book_sql
What our monthly spend on Henry Galvan
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'henry galvan' GROUP BY DATE(transaction_date, 'start of month')
75,217
book_sql
book_sql
What was the last bill Samantha Brown received from John Ashley?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE customers = 'samantha brown' AND transaction_type = 'bill' AND vendor = 'john ashley'
75,218
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,219
book_sql
book_sql
What was the average bill Jonathan Moore received from Jeremy Simpson?
val
medium
SELECT AVG(credit) FROM master_txn_table WHERE customers = 'jonathan moore' AND transaction_type = 'bill' AND vendor = 'jeremy simpson'
75,220
book_sql
book_sql
Number of invoices created for Travel in This week?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'travel') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE)
75,221
book_sql
book_sql
Did we receive payment from Cheryl Cardenas partnership in may last year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'cheryl cardenas' 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,222
book_sql
book_sql
Did we receive payment from Tracey Williams partnership This week?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'tracey williams' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE)
75,223
book_sql
book_sql
Compare sales by customer 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) GROUP BY customers
75,224
book_sql
book_sql
Did we receive payment from Paige Jones partnership in q2 this year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'paige jones' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+3 month') AND DATE(CURRENT_DATE, 'start of year', '+6 month', '-1 day')
75,225
book_sql
book_sql
How much did Austin Maddox spend on Wood- and wood waste-fueled power generation 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 = 'austin maddox' AND INSTR(account, 'wood- and wood waste-fueled power generation') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DAT...
75,226
book_sql
book_sql
How much did Loretta Gallegos 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 = 'loretta gallegos' AND INSTR(account, 'accounts receivable (a/r)') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND accou...
75,227
book_sql
book_sql
What our monthly spend on Mary Simpson
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'mary simpson' GROUP BY DATE(transaction_date, 'start of month')
75,228
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,229
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,230
book_sql
book_sql
Compare sales by customer MTD
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,231
book_sql
book_sql
How many April Stanley invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'april stanley' AND transaction_type = 'invoice' AND open_balance > 0
75,232
book_sql
book_sql
What our monthly spend on Patrick Jones
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'patrick jones' GROUP BY DATE(transaction_date, 'start of month')
75,233
book_sql
book_sql
How many Surveying wells did we sell to Joseph Moore This fiscal year to date?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'joseph moore' AND product_service = 'surveying wells' 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 yea...
75,234
book_sql
book_sql
As of in q2 this year, how many invoices for Nicholas Arnold remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'nicholas arnold' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+3 month') AND DATE(CURRENT_DATE, 'start of year', '+6 month', '-1 day')
75,235
book_sql
book_sql
When was the last time we sold Parking lot and driveway washing
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 = 'parking lot and driveway washing' ORDER BY transaction_date DESC LIMIT 1
75,236
book_sql
book_sql
How much revenue came through Glenn Howell 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 = 'glenn howell' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-30 days') AND DATE(CURRENT_DATE)
75,237
book_sql
book_sql
How much did Cassandra Craig spend on Providing support services for commodity markets 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 = 'cassandra craig' AND INSTR(account, 'providing support services for commodity markets') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRE...
75,238
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,239
book_sql
book_sql
What our monthly spend on Rodney Austin
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'rodney austin' GROUP BY DATE(transaction_date, 'start of month')
75,240
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,241
book_sql
book_sql
What was the mean invoice value for Basic office and secretarial skills training in Last 7 days?
val
medium
SELECT AVG(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'basic office and secretarial skills training') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-7 days') AND DATE(CURRENT_DATE)
75,242
book_sql
book_sql
Number of invoices created for Ethical Hacking Training in YTD?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'ethical hacking training') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,243
book_sql
book_sql
How many Home care did we sell to Ethan Bryan in jan this year?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'ethan bryan' AND product_service = 'home care' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE, 'start of year', '+1 month', '-1 day')
75,244
book_sql
book_sql
Number of invoices created for Retailing formal dining furniture in yesterday?
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, '-1 day') AND DATE(CURRENT_DATE, '-1 day')
75,245
book_sql
book_sql
Did we receive payment from Meghan Fuller partnership in aug this year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'meghan fuller' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+7 month') AND DATE(CURRENT_DATE, 'start of year', '+8 month', '-1 day')
75,246
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,247
book_sql
book_sql
How many Accessories did we sell to Joshua Banks YTD?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'joshua banks' AND product_service = 'accessories' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,248
book_sql
book_sql
Did we receive payment from Wesley Beck partnership This fiscal year to date?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'wesley beck' 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,249
book_sql
book_sql
As of in aug this year, how many invoices for Joe Mosley remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'joe mosley' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+7 month') AND DATE(CURRENT_DATE, 'start of year', '+8 month', '-1 day')
75,250
book_sql
book_sql
When was the last time we sold Golf Instructions
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 = 'golf instructions' ORDER BY transaction_date DESC LIMIT 1
75,251
book_sql
book_sql
Did we receive payment from Joshua Dyer partnership This quarter?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'joshua dyer' 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,252
book_sql
book_sql
When was the last time we sold Postal
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 = 'postal' ORDER BY transaction_date DESC LIMIT 1
75,253
book_sql
book_sql
Number of invoices created for Billable Expense Income in This week?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'billable expense income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE)
75,254
book_sql
book_sql
How much did Steven Cook spend on Acidizing and chemically treating wells 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 = 'steven cook' AND INSTR(account, 'acidizing and chemically treating wells') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 ...
75,255
book_sql
book_sql
How many Casings, Tubes and Rods did we sell to Zachary Greene DDS This fiscal year?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'zachary greene dds' AND product_service = 'casings, tubes and rods' 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)
75,256
book_sql
book_sql
What was the first bill Jessica Estes received from Scott Lopez?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE customers = 'jessica estes' AND transaction_type = 'bill' AND vendor = 'scott lopez'
75,257
book_sql
book_sql
As of in aug this year, how many invoices for Jason Montes remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'jason montes' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+7 month') AND DATE(CURRENT_DATE, 'start of year', '+8 month', '-1 day')
75,258
book_sql
book_sql
Did we receive payment from Christina Rogers partnership This year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'christina rogers' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,259
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,260
book_sql
book_sql
How much did Cathy Oneal spend on 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 = 'cathy oneal' AND INSTR(account, 'services') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND account_type IN ('expense',...
75,261
book_sql
book_sql
How many Raymond Scott invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'raymond scott' AND transaction_type = 'invoice' AND open_balance > 0
75,262
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,263
book_sql
book_sql
How much did Annette Alvarado spend on Abandoned infant assistance 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 = 'annette alvarado' AND INSTR(account, 'abandoned infant assistance') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND acc...
75,264
book_sql
book_sql
Compare sales by customer Last 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', '-1 months') AND DATE(CURRENT_DATE, 'start of month', '-1 days') GROUP BY customers
75,265
book_sql
book_sql
What was the min bill Timothy Vargas received from Michele Thomas?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE customers = 'timothy vargas' AND transaction_type = 'bill' AND vendor = 'michele thomas'
75,266
book_sql
book_sql
What was the mean invoice value for Rent or Lease in in aug this year?
val
medium
SELECT AVG(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'rent or lease') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+7 month') AND DATE(CURRENT_DATE, 'start of year', '+8 month', '-1 day')
75,267
book_sql
book_sql
Number of invoices created for Computer software and software application training in This week?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'computer software and software application training') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE)
75,268
book_sql
book_sql
How much did Douglas Duncan spend on Wholesaling aircraft engines and parts 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 = 'douglas duncan' AND INSTR(account, 'wholesaling aircraft engines and parts') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - ...
75,269
book_sql
book_sql
How much did Ray Harding spend on Adoption placement 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 = 'ray harding' AND INSTR(account, 'adoption placement services') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND account_...
75,270
book_sql
book_sql
As of Last fiscal year, how many invoices for Jamie Ibarra remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'jamie ibarra' 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 m...
75,271
book_sql
book_sql
How much did Jackie Morales 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 = 'jackie morales' 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,272
book_sql
book_sql
What our monthly spend on Alan Cardenas
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'alan cardenas' GROUP BY DATE(transaction_date, 'start of month')
75,273
book_sql
book_sql
When was the last time we sold Contract
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 = 'contract' ORDER BY transaction_date DESC LIMIT 1
75,274
book_sql
book_sql
How many Douglas Tran invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'douglas tran' AND transaction_type = 'invoice' AND open_balance > 0
75,275
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,276
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,277
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,278
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,279
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,280
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,281
book_sql
book_sql
Number of invoices created for Business services centers in Last year?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'business services centers') 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,282
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,283
book_sql
book_sql
Did we receive payment from Sarah Williams partnership in q1 this year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'sarah williams' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE, 'start of year', '+3 month', '-1 day')
75,284
book_sql
book_sql
What acount had our biggest expense Last 7 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, '-7 days') AND DATE(CURRENT_DATE) GROUP BY account ORDER BY SUM(debit) DESC LIMIT 1
75,285
book_sql
book_sql
How much revenue came through Alejandro Nguyen YTD?
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 = 'alejandro nguyen' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,286
book_sql
book_sql
How much did Anna Miles spend on Uncategorized 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 = 'anna miles' AND INSTR(account, 'uncategorized income') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND account_type IN ...
75,287
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,288
book_sql
book_sql
How many Business courses did we sell to Darrell Powell This week?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'darrell powell' AND product_service = 'business courses' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'weekday 0', '-7 days') AND DATE(CURRENT_DATE)
75,289
book_sql
book_sql
Number of invoices created for Private parcel mailing services in in q1 this year?
val
medium
SELECT COUNT(DISTINCT transaction_id) 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') AND DATE(CURRENT_DATE, 'start of year', '+3 month', '-1 day')
75,290
book_sql
book_sql
How many Spearmint oil did we sell to Aaron Hughes MTD?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'aaron hughes' AND product_service = 'spearmint oil' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE)
75,291
book_sql
book_sql
What was the mean bill Robert Arnold received from Mark Banks?
val
medium
SELECT AVG(credit) FROM master_txn_table WHERE customers = 'robert arnold' AND transaction_type = 'bill' AND vendor = 'mark banks'
75,292
book_sql
book_sql
What our monthly spend on Jessica Delgado
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'jessica delgado' GROUP BY DATE(transaction_date, 'start of month')
75,293
book_sql
book_sql
How many Kellie Thompson invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'kellie thompson' AND transaction_type = 'invoice' AND open_balance > 0
75,294
book_sql
book_sql
How much revenue came through Kathryn Williams Last 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 = 'kathryn williams' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-3 months', 'start of year', '-1 years', '+3 months') AND DATE(CURRENT_DATE, '-...
75,295
book_sql
book_sql
What was the last invoice value for Computer Repairs in in aug this year?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'computer repairs') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+7 month') AND DATE(CURRENT_DATE, 'start of year', '+8 month', '-1 day')
75,296
book_sql
book_sql
How much did Daisy Bell 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 = 'daisy bell' 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,297
book_sql
book_sql
As of in dec last year, how many invoices for Charles Kim remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'charles kim' AND transaction_type = 'invoice' AND open_balance > 0 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,298
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,299
book_sql
book_sql
What was the average bill Michael Mason received from Edward Carson?
val
medium
SELECT AVG(credit) FROM master_txn_table WHERE customers = 'michael mason' AND transaction_type = 'bill' AND vendor = 'edward carson'
75,300
book_sql
book_sql
What was the last invoice value for Exercise equipment retailing in in q2 this year?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'exercise equipment retailing') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+3 month') AND DATE(CURRENT_DATE, 'start of year', '+6 month', '-1 day')