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,101
book_sql
book_sql
What acount had our biggest expense yesterday?
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 day') AND DATE(CURRENT_DATE, '-1 day') GROUP BY account ORDER BY SUM(debit) DESC LIMIT 1
75,102
book_sql
book_sql
What was the last invoice value for Care-planning services in in q3 last year?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'care-planning 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,103
book_sql
book_sql
What acount had our biggest expense This month?
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,104
book_sql
book_sql
How many Exercise did we sell to Anthony Jacobs Last fiscal year?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'anthony jacobs' AND product_service = 'exercise' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-3 months', 'start of year', '-1 years', '+3 months') AND DATE(CURRENT_DATE, '-3 months', 'start of year', ...
75,105
book_sql
book_sql
How much revenue came through Julia Quinn Last 7 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 = 'julia quinn' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-7 days') AND DATE(CURRENT_DATE)
75,106
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,107
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,108
book_sql
book_sql
Did we receive payment from Michele Flores partnership This quarter to date?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'michele flores' 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,109
book_sql
book_sql
As of in aug this year, how many invoices for Angel Silva remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'angel silva' 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,110
book_sql
book_sql
Number of invoices created for Providing courses through business schools in Last 12 months?
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, '-12 months', 'start of month') AND DATE(CURRENT_DATE, 'start of month', '-1 day')
75,111
book_sql
book_sql
Number of invoices created for Quality management accreditation in This quarter?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'quality management accreditation') 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,112
book_sql
book_sql
How much revenue came through Dustin Jackson 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 = 'dustin jackson' 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,113
book_sql
book_sql
What was the lowest invoice value for Opera performances in Last 12 months?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'opera performances') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-12 months', 'start of month') AND DATE(CURRENT_DATE, 'start of month', '-1 day')
75,114
book_sql
book_sql
When was the last time we sold PCs
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 = 'pcs' ORDER BY transaction_date DESC LIMIT 1
75,115
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,116
book_sql
book_sql
When was the last time we sold Diapers
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 = 'diapers' ORDER BY transaction_date DESC LIMIT 1
75,117
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,118
book_sql
book_sql
What was the last bill Christina Austin received from Brandi Barton?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE customers = 'christina austin' AND transaction_type = 'bill' AND vendor = 'brandi barton'
75,119
book_sql
book_sql
What acount had our biggest expense in q2 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', '+3 month') AND DATE(CURRENT_DATE, 'start of year', '+6 month', '-1 day') GROUP BY accou...
75,120
book_sql
book_sql
What was the max invoice value for Maintenance and Repairs in today?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'maintenance and repairs') AND transaction_date BETWEEN DATE(CURRENT_DATE) AND DATE(CURRENT_DATE)
75,121
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,122
book_sql
book_sql
As of Last 7 days, how many invoices for Carlos Benitez remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'carlos benitez' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, '-7 days') AND DATE(CURRENT_DATE)
75,123
book_sql
book_sql
How many Copying did we sell to Travis Hill This fiscal year?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'travis hill' AND product_service = 'copying' 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,124
book_sql
book_sql
How many Popular music shows did we sell to Jeremy Bird Last month?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'jeremy bird' AND product_service = 'popular music shows' 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,125
book_sql
book_sql
What was the last invoice value for Drain cleaning in Last quarter?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'drain cleaning') AND transaction_date < STRFTIME('%y-%m-%d', STRFTIME('%y', 'now', '-1 year') || '-' || SUBSTRING('00' || ((CAST((STRFTIME('%m', 'now') - 1) AS REAL) / 3) * 3 + 4), -2, 2) || '-01')
75,126
book_sql
book_sql
How much revenue came through Jennifer Sullivan 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 = 'jennifer sullivan' AND account_type IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '-1 days', 'start of year') AND DATE(CURRENT_DATE, 'start of y...
75,127
book_sql
book_sql
What our monthly spend on Angela Bauer
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'angela bauer' GROUP BY DATE(transaction_date, 'start of month')
75,128
book_sql
book_sql
Number of invoices created for Job Expenses in This quarter to date?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'job expenses') 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,129
book_sql
book_sql
How much revenue came through Adrian Reyes 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 = 'adrian reyes' 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', 'start of ...
75,130
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,131
book_sql
book_sql
When was the last time we sold Coffee and Snack
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 = 'coffee and snack' ORDER BY transaction_date DESC LIMIT 1
75,132
book_sql
book_sql
What was the total bill Kristin Rodriguez received from Matthew Crawford?
val
medium
SELECT SUM(credit) FROM master_txn_table WHERE customers = 'kristin rodriguez' AND transaction_type = 'bill' AND vendor = 'matthew crawford'
75,133
book_sql
book_sql
What was the lowest bill David Bailey received from Laura Kim?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE customers = 'david bailey' AND transaction_type = 'bill' AND vendor = 'laura kim'
75,134
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,135
book_sql
book_sql
When was the last time we sold Townhouses
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 = 'townhouses' ORDER BY transaction_date DESC LIMIT 1
75,136
book_sql
book_sql
As of This year, how many invoices for Karen Sanders remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'karen sanders' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year') AND DATE(CURRENT_DATE)
75,137
book_sql
book_sql
When was the last time we sold Database management
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 = 'database management' ORDER BY transaction_date DESC LIMIT 1
75,138
book_sql
book_sql
What was the max invoice value for Wholesaling ships in in dec last year?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'wholesaling ships') 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,139
book_sql
book_sql
How many Brokerage did we sell to Craig Baker MTD?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'craig baker' AND product_service = 'brokerage' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE)
75,140
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,141
book_sql
book_sql
Compare sales by customer This month to date
val
hard
SELECT customers, SUM(credit) FROM master_txn_table WHERE account IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE) GROUP BY customers
75,142
book_sql
book_sql
When was the last time we sold Installation
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 = 'installation' ORDER BY transaction_date DESC LIMIT 1
75,143
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,144
book_sql
book_sql
Did we receive payment from Karen Fisher partnership Last fiscal year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'karen fisher' 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,145
book_sql
book_sql
How many Carbon dioxide did we sell to Mary Taylor Last 7 days?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'mary taylor' AND product_service = 'carbon dioxide' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-7 days') AND DATE(CURRENT_DATE)
75,146
book_sql
book_sql
Compare sales by customer This quarter to date
val
hard
SELECT customers, SUM(credit) FROM master_txn_table WHERE account IN ('income', 'other income') AND transaction_date >= STRFTIME('%y-%m-%d', STRFTIME('%y', 'now', '-1 year') || '-' || SUBSTRING('00' || ((CAST((STRFTIME('%m', 'now') - 1) AS REAL) / 3) * 3 + 1), -2, 2) || '-01') GROUP BY customers
75,147
book_sql
book_sql
When was the last time we sold Non-nuclear
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 = 'non-nuclear' ORDER BY transaction_date DESC LIMIT 1
75,148
book_sql
book_sql
What was the lowest invoice value for Savings in This quarter to date?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'savings') 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,149
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,150
book_sql
book_sql
What was the min bill Laurie Phelps received from Melissa Johnson?
val
medium
SELECT MIN(credit) FROM master_txn_table WHERE customers = 'laurie phelps' AND transaction_type = 'bill' AND vendor = 'melissa johnson'
75,151
book_sql
book_sql
When was the last time we sold Business courses
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 = 'business courses' ORDER BY transaction_date DESC LIMIT 1
75,152
book_sql
book_sql
What our monthly spend on Michael Davis
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'michael davis' GROUP BY DATE(transaction_date, 'start of month')
75,153
book_sql
book_sql
What was the total bill Harry Taylor received from James Carr?
val
medium
SELECT SUM(credit) FROM master_txn_table WHERE customers = 'harry taylor' AND transaction_type = 'bill' AND vendor = 'james carr'
75,154
book_sql
book_sql
How many Child abuse prevention did we sell to Sheila Garrett in aug this year?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'sheila garrett' AND product_service = 'child abuse prevention' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+7 month') AND DATE(CURRENT_DATE, 'start of year', '+8 month', '-1 day')
75,155
book_sql
book_sql
How many Postal did we sell to Debra Morales This quarter?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'debra morales' AND product_service = 'postal' 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) * 3 ...
75,156
book_sql
book_sql
As of Last month, how many invoices for Phillip Wilson remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'phillip wilson' 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,157
book_sql
book_sql
What our monthly spend on Alyssa Barton
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'alyssa barton' GROUP BY DATE(transaction_date, 'start of month')
75,158
book_sql
book_sql
As of yesterday, how many invoices for Patrick Nelson remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'patrick nelson' AND transaction_type = 'invoice' AND open_balance > 0 AND transaction_date BETWEEN DATE(CURRENT_DATE, '-1 day') AND DATE(CURRENT_DATE, '-1 day')
75,159
book_sql
book_sql
Number of invoices created for Mining machinery and equipment rental or leasing in This month?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'mining machinery and equipment rental or leasing') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE)
75,160
book_sql
book_sql
What acount had our biggest expense in dec 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', '+11 month') AND DATE(CURRENT_DATE, '-1 year', 'start of year', '+12 month', ...
75,161
book_sql
book_sql
Did we receive payment from Christina Townsend partnership today?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'christina townsend' AND transaction_date BETWEEN DATE(CURRENT_DATE) AND DATE(CURRENT_DATE)
75,162
book_sql
book_sql
What our monthly spend on Amber White
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'amber white' GROUP BY DATE(transaction_date, 'start of month')
75,163
book_sql
book_sql
Number of invoices created for Bars and nightclubs in Last quarter?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'bars and nightclubs') AND transaction_date < STRFTIME('%y-%m-%d', STRFTIME('%y', 'now', '-1 year') || '-' || SUBSTRING('00' || ((CAST((STRFTIME('%m', 'now') - 1) AS REAL) / 3) * 3 + 4), -2, 2) || '-01')
75,164
book_sql
book_sql
When was the last time we sold Project assessments
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 = 'project assessments' ORDER BY transaction_date DESC LIMIT 1
75,165
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,166
book_sql
book_sql
As of in jan this year, how many invoices for Misty Kelly remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'misty kelly' 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', '+1 month', '-1 day')
75,167
book_sql
book_sql
Did we receive payment from Curtis Nash partnership Last month?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'curtis nash' AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month', '-1 months') AND DATE(CURRENT_DATE, 'start of month', '-1 days')
75,168
book_sql
book_sql
What our monthly spend on Gregory Gilbert
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'gregory gilbert' GROUP BY DATE(transaction_date, 'start of month')
75,169
book_sql
book_sql
What was the max bill Kyle Contreras received from Jeffrey Brown?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE customers = 'kyle contreras' AND transaction_type = 'bill' AND vendor = 'jeffrey brown'
75,170
book_sql
book_sql
What was the highest invoice value for Wholesaling navigational instruments (except electronic) in in q2 this year?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'wholesaling navigational instruments (except electronic)') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of year', '+3 month') AND DATE(CURRENT_DATE, 'start of year', '+6 month', '-1 day')
75,171
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,172
book_sql
book_sql
What acount had our biggest expense yesterday?
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 day') AND DATE(CURRENT_DATE, '-1 day') GROUP BY account ORDER BY SUM(debit) DESC LIMIT 1
75,173
book_sql
book_sql
How much revenue came through Sophia Cole 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 = 'sophia cole' 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', '-1 ...
75,174
book_sql
book_sql
Number of invoices created for Constructing condominiums in Last 30 days?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'constructing condominiums') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-30 days') AND DATE(CURRENT_DATE)
75,175
book_sql
book_sql
As of in q3 last year, how many invoices for Holly Garcia remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'holly garcia' AND transaction_type = 'invoice' AND open_balance > 0 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,176
book_sql
book_sql
Compare sales by customer Last 30 days
val
hard
SELECT customers, SUM(credit) FROM master_txn_table WHERE account IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-30 days') AND DATE(CURRENT_DATE) GROUP BY customers
75,177
book_sql
book_sql
How much did James Price spend on Therapeutic 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 = 'james price' AND INSTR(account, 'therapeutic services') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_DATE) - 1 AND account_type IN...
75,178
book_sql
book_sql
What our monthly spend on Scott Lopez
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'scott lopez' GROUP BY DATE(transaction_date, 'start of month')
75,179
book_sql
book_sql
What our monthly spend on Trevor Reed
val
hard
SELECT DATE(transaction_date, 'start of month'), SUM(debit) FROM master_txn_table WHERE vendor = 'trevor reed' GROUP BY DATE(transaction_date, 'start of month')
75,180
book_sql
book_sql
How much did Brian Daniels 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 = 'brian daniels' 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,181
book_sql
book_sql
Did we receive payment from Melissa Fleming partnership Last fiscal year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'melissa fleming' 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,182
book_sql
book_sql
As of Last year, how many invoices for David Gilbert remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'david gilbert' 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,183
book_sql
book_sql
Compare sales by customer YTD
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,184
book_sql
book_sql
How many Food & drink did we sell to Vanessa Sullivan This month to date?
val
medium
SELECT SUM(quantity) FROM master_txn_table WHERE customers = 'vanessa sullivan' AND product_service = 'food & drink' AND transaction_type IN ('invoice', 'sales receipt') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE)
75,185
book_sql
book_sql
How much did Jennifer Burnett spend on Providing other outdoor maintenance 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 = 'jennifer burnett' AND INSTR(account, 'providing other outdoor maintenance services') AND STRFTIME('%m', transaction_date) = '07' AND STRFTIME('%y', transaction_date) = STRFTIME('%y', CURRENT_...
75,186
book_sql
book_sql
As of Last fiscal year, how many invoices for Erik Paul remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'erik paul' 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 mont...
75,187
book_sql
book_sql
What acount had our biggest expense Last 12 months?
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, '-12 months', 'start of month') AND DATE(CURRENT_DATE, 'start of month', '-1 day') GROUP BY account ORDER...
75,188
book_sql
book_sql
What was the max invoice value for Feasibility studies in MTD?
val
medium
SELECT MAX(credit) FROM master_txn_table WHERE transaction_type = 'invoice' AND INSTR(account, 'feasibility studies') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE)
75,189
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,190
book_sql
book_sql
How much did Heather Sexton 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 = 'heather sexton' 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,191
book_sql
book_sql
What was the mean bill Stephanie Bond received from Susan Orr?
val
medium
SELECT AVG(credit) FROM master_txn_table WHERE customers = 'stephanie bond' AND transaction_type = 'bill' AND vendor = 'susan orr'
75,192
book_sql
book_sql
As of This quarter to date, how many invoices for Wendy Cross remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'wendy cross' 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,193
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,194
book_sql
book_sql
When was the last time we sold Equity long bias
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 = 'equity long bias' ORDER BY transaction_date DESC LIMIT 1
75,195
book_sql
book_sql
Compare sales by customer This month to date
val
hard
SELECT customers, SUM(credit) FROM master_txn_table WHERE account IN ('income', 'other income') AND transaction_date BETWEEN DATE(CURRENT_DATE, 'start of month') AND DATE(CURRENT_DATE) GROUP BY customers
75,196
book_sql
book_sql
As of in dec last year, how many invoices for James Dunlap remained unpaid?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'james dunlap' 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,197
book_sql
book_sql
What acount had our biggest expense Last fiscal year?
val
hard
SELECT account, SUM(debit) FROM master_txn_table AS t1 JOIN chart_of_accounts AS t2 ON t1.account = t2.account_name WHERE account_type IN ('expense', 'other expense') AND transaction_date BETWEEN DATE(CURRENT_DATE, '-3 months', 'start of year', '-1 years', '+3 months') AND DATE(CURRENT_DATE, '-3 months', 'start of year...
75,198
book_sql
book_sql
Did we receive payment from Brandy James partnership This fiscal year?
val
medium
SELECT transaction_id FROM master_txn_table WHERE transaction_type = 'payment' AND customers = 'brandy james' AND transaction_date BETWEEN DATE(CURRENT_DATE, '-3 months', 'start of year', '+3 months') AND DATE(CURRENT_DATE)
75,199
book_sql
book_sql
How much revenue came through Morgan Daniel This quarter 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 = 'morgan daniel' 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,200
book_sql
book_sql
How many Cameron Morales invoices are still oustanding?
val
medium
SELECT COUNT(DISTINCT transaction_id) FROM master_txn_table WHERE customers = 'cameron morales' AND transaction_type = 'invoice' AND open_balance > 0