Find the name of accounts whose checking balance is below the average checking balance.
CREATE TABLE accounts (name VARCHAR, custid VARCHAR); CREATE TABLE checking (balance INTEGER); CREATE TABLE checking (custid VARCHAR, balance INTEGER)
SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM checking)
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE accounts (name VARCHAR, custid VARCHAR); CREATE TABLE checking (balance INTEGER); CREATE TABLE checking (custid VARCHAR, balance INTEGER) Question: Find the name of accounts whose checking balance is below the average checking balance. [/INST] SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM checking) </s>