text
stringlengths
479
695
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: Income of last 3 months. ? [/INST] SELECT SUM(Deposit_amount) AS Total_Income FROM transactions WHERE Value_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 3 MONTH) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: Total expenses/spendings of last 8 months ? [/INST] SELECT SUM(Withdrawal_amount) AS Total_Expenses FROM transactions WHERE Value_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 8 MONTH) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: Total saving of last month as my account number is 409000493201' ? [/INST] SELECT (SUM(Deposit_amount) - SUM(Withdrawal_amount)) AS Savings_Last_Month FROM transactions WHERE Account_No = "409000493201'" AND YEAR(Value_date) = YEAR(CURRENT_DATE() - INTERVAL 1 MONTH) AND MONTH(Value_date) = MONTH(CURRENT_DATE() - INTERVAL 1 MONTH); </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: How many transactions did I make in last 2 week [/INST] SELECT COUNT(*) AS Total_Transactions FROM transactions WHERE Value_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 2 WEEK) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: Amount spent last week [/INST] SELECT SUM(Withdrawal_amount) AS Total_Spending FROM transactions WHERE Value_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 1 WEEK) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: Expenses for each day this month ? [/INST] SELECT Date, SUM(Withdrawal_amount) AS Total_Expenses FROM transactions WHERE YEAR(Value_date) = YEAR(CURRENT_DATE()) AND MONTH(Value_date) = MONTH(CURRENT_DATE()) GROUP BY Date </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: savings of previous year for each month [/INST] SELECT MONTH(Value_date) AS Month, (SUM(Deposit_amount) - SUM(Withdrawal_amount)) AS Total_Savings FROM transactions WHERE YEAR(Value_date) = YEAR(CURRENT_DATE() - INTERVAL 1 YEAR) GROUP BY MONTH(Value_date) ORDER BY MONTH(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: Amount Saved each year [/INST] SELECT YEAR(Value_date) AS Year,SUM(Deposit_amount) - SUM(Withdrawal_amount) AS Savings FROM transactions GROUP BY YEAR(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: Savings of last 2 year [/INST] SELECT YEAR(Value_date) AS Year, SUM(Deposit_amount) - SUM(Withdrawal_amount) AS Net_Savings FROM transactions WHERE Value_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 2 YEAR) GROUP BY YEAR(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: Expenses of each day of last week [/INST] SELECT DATE(Value_date) AS Date, SUM(Withdrawal_amount) AS Total_Spending FROM transactions WHERE Value_date >= DATE_SUB(CURDATE(), INTERVAL 1 WEEK) GROUP BY DATE(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: Amount spent this year ? [/INST] SELECT year(Value_date) as Year,sum(Withdrawal_amount) AS Total_Expenses FROM transactions WHERE year(Value_date) = year(curdate()) group by year(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: amount/money saved each month previous year ? [/INST] SELECT YEAR(Value_date) AS Year, MONTH(Value_date) AS Month, SUM(Deposit_amount) - SUM(Withdrawal_amount) AS Savings FROM transactions WHERE YEAR(Value_date) = YEAR(CURRENT_DATE - INTERVAL 1 YEAR) GROUP BY YEAR(Value_date), MONTH(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: income of the previous year [/INST] SELECT SUM(Deposit_amount) AS Total_Income FROM transactions WHERE YEAR(Value_date) = YEAR(CURRENT_DATE) - 1 </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: income of the first 4 month of previous year [/INST] SELECT SUM(Deposit_amount) AS Total_Income FROM transactions WHERE MONTH(Value_date) IN (1,2,3,4) AND YEAR(Value_date) = YEAR(CURRENT_DATE) - 1 </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: amount I lost each year? [/INST] SELECT YEAR(Value_date) AS Year,SUM(Withdrawal_amount) - SUM(Deposit_amount) AS Losses FROM transactions GROUP BY YEAR(Value_date); </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is the average of last 5 transactions? [/INST] SELECT AVG(CASE WHEN Withdrawal_amount IS NOT NULL THEN Withdrawal_amount ELSE Deposit_amount END) AS Average_Amount FROM (SELECT Withdrawal_amount, Deposit_amount FROM transactions ORDER BY Date DESC LIMIT 5) AS Last5Transactions </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is my total income this year? [/INST] SELECT SUM(Deposit_amount) AS Total_Income FROM transactions WHERE YEAR(Value_date) = YEAR(CURRENT_DATE()) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is my income of the first 3 months of this year? [/INST] SELECT SUM(Deposit_amount) AS Total_Income FROM transactions WHERE YEAR(Value_date) = YEAR(CURRENT_DATE()) AND MONTH(Value_date) IN (1, 2, 3) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is my expenses of the first 4 months of this year? [/INST] SELECT SUM(Withdrawal_amount) AS Total_Expenses FROM transactions WHERE YEAR(Value_date) = YEAR(CURRENT_DATE()) AND MONTH(Value_date) IN (1, 2, 3, 4) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is my income of the last 5 months of this year? [/INST] SELECT SUM(Deposit_amount) AS Total_Income FROM transactions WHERE Value_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 5 MONTH) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: How much amount did I earn each year? [/INST] SELECT YEAR(Value_date) AS Year, SUM(Deposit_amount) AS Total_Income FROM transactions GROUP BY YEAR(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: How much amount did I save each year? [/INST] SELECT YEAR(Value_date) AS Year, SUM(Deposit_amount) - SUM(Withdrawal_amount) AS Savings FROM transactions GROUP BY YEAR(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: How much amount did I spend each year? [/INST] SELECT YEAR(Value_date) AS Year, SUM(Withdrawal_amount) AS Total_Spending FROM transactions GROUP BY YEAR(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: Give me the breakdown of expenses of each day of this week? [/INST] SELECT DATE(Value_date) AS Date, SUM(Withdrawal_amount) AS Total_Expenses FROM transactions WHERE Value_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 1 WEEK) GROUP BY DATE(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: Give me the breakdown of savings of each day of this month? [/INST] SELECT DATE(Value_date) AS Date, SUM(Deposit_amount) - SUM(Withdrawal_amount) AS Daily_Savings FROM transactions WHERE MONTH(Value_date) = MONTH(CURRENT_DATE()) AND YEAR(Value_date) = YEAR(CURRENT_DATE()) GROUP BY DATE(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: Give me the breakdown of amount I spent each day of this month? [/INST] SELECT DATE(Value_date) AS Date, SUM(Withdrawal_amount) AS Daily_Spending FROM transactions WHERE MONTH(Value_date) = MONTH(CURRENT_DATE()) AND YEAR(Value_date) = YEAR(CURRENT_DATE()) GROUP BY DATE(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: Give me the breakdown of amount I spent each day of this week? [/INST] SELECT DATE(Value_date) AS Date, SUM(Withdrawal_amount) AS Daily_Spending FROM transactions WHERE Value_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 1 WEEK) GROUP BY DATE(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: On average how much amount I spent each day? [/INST] SELECT AVG(Withdrawal_amount) AS Average_Daily_Spending FROM transactions </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: On average how much amount I spent each month? [/INST] SELECT YEAR(Value_date) AS Year, MONTH(Value_date) AS Month, AVG(SUM(Withdrawal_amount)) OVER (PARTITION BY YEAR(Value_date), MONTH(Value_date)) AS Average_Monthly_Spending FROM transactions GROUP BY YEAR(Value_date), MONTH(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: On average how much amount I spent each year? [/INST] SELECT YEAR(Value_date) AS Year, AVG(SUM(Withdrawal_amount)) OVER (PARTITION BY YEAR(Value_date)) AS Average_Yearly_Spending FROM transactions GROUP BY YEAR(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is my average spendings each month in this year? [/INST] SELECT MONTH(Value_date) AS Month, AVG(SUM(Withdrawal_amount)) OVER () AS Average_Monthly_Spending FROM transactions WHERE YEAR(Value_date) = YEAR(CURRENT_DATE()) GROUP BY MONTH(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: How many transactions did I make this year? [/INST] SELECT COUNT(*) AS Total_Transactions FROM transactions WHERE YEAR(Value_date) = YEAR(CURRENT_DATE()) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: How many transactions did I make each year? [/INST] SELECT YEAR(Value_date) AS Year, COUNT(*) AS Total_Transactions FROM transactions GROUP BY YEAR(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: How many transactions did I make this week? [/INST] SELECT COUNT(*) AS Total_Transactions FROM transactions WHERE WEEK(Value_date) = WEEK(CURRENT_DATE()) AND YEAR(Value_date) = YEAR(CURRENT_DATE()) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: How many transactions did I make this month? [/INST] SELECT COUNT(*) AS Total_Transactions FROM transactions WHERE MONTH(Value_date) = MONTH(CURRENT_DATE()) AND YEAR(Value_date) = YEAR(CURRENT_DATE()) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is my total savings of last month? [/INST] SELECT SUM(Deposit_amount) - SUM(Withdrawal_amount) AS Total_Savings FROM transactions WHERE YEAR(Value_date) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH) AND MONTH(Value_date) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is my total savings of each year? [/INST] SELECT YEAR(Value_date) AS Year, SUM(Deposit_amount) - SUM(Withdrawal_amount) AS Total_Savings FROM transactions GROUP BY YEAR(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is my savings this week? [/INST] SELECT SUM(Deposit_amount) - SUM(Withdrawal_amount) AS Total_Savings FROM transactions WHERE WEEK(Value_date) = WEEK(CURRENT_DATE()) AND YEAR(Value_date) = YEAR(CURRENT_DATE()) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is my expenses amount of last month? [/INST] SELECT SUM(Withdrawal_amount) AS Total_Expenses FROM transactions WHERE YEAR(Value_date) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH) AND MONTH(Value_date) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is my expenses amount of this month? [/INST] SELECT SUM(Withdrawal_amount) AS Total_Expenses FROM transactions WHERE YEAR(Value_date) = YEAR(CURRENT_DATE()) AND MONTH(Value_date) = MONTH(CURRENT_DATE()) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is the pattern in my last 3 transactions? Are they increasing or decreasing? [/INST] SELECT Transaction_details, Withdrawal_amount, Deposit_amount, Value_date FROM transactions ORDER BY Value_date DESC LIMIT 3 </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is my current net worth? [/INST] SELECT Balance_amount AS Current_Net_Worth FROM transactions ORDER BY Value_date DESC LIMIT 1 </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: Has my income changed recently? [/INST] SELECT DATE(Value_date) AS Date, SUM(Deposit_amount) AS Daily_Income FROM transactions GROUP BY DATE(Value_date) ORDER BY DATE(Value_date) DESC LIMIT 7 </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is my income of the last 2 years? [/INST] SELECT YEAR(Value_date) AS Year, SUM(Deposit_amount) AS Total_Income FROM transactions WHERE Value_date >= DATE_SUB(CURDATE(), INTERVAL 2 YEAR) GROUP BY YEAR(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is my expenses of the last 1 year? [/INST] SELECT YEAR(Value_date) AS Year, SUM(Withdrawal_amount) AS Total_Expenses FROM transactions WHERE Value_date >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR) GROUP BY YEAR(Value_date) </s>
<s>[INST] [INST] Here is a database schema: CREATE TABLE transactions ( `Account_No` VARCHAR(50) NOT NULL, `Transaction_details` TEXT, `Withdrawal_amount` INTEGER, `Deposit_amount` INTEGER, `Balance_amount` INTEGER, `Value_date` DATE, `Date` DATE ) Please write me a SQL statement that answers the following question: What is my savings of the last 3 years? [/INST] SELECT YEAR(Value_date) AS Year, SUM(Deposit_amount) - SUM(Withdrawal_amount) AS Net_Savings FROM transactions WHERE Value_date >= DATE_SUB(CURDATE(), INTERVAL 3 YEAR) GROUP BY YEAR(Value_date) </s>