human
Schema:
Ref_Document_Types (Document_Type_Code, Document_Type_Name, Document_Type_Description)
Ref_Budget_Codes (Budget_Type_Code, Budget_Type_Description)
Projects (Project_ID, Project_Details)
Documents (Document_ID, Document_Type_Code, Project_ID, Document_Date, Document_Name, Document_Description, Other_Details)
Statements (Statement_ID, Statement_Details)
Documents_with_Expenses (Document_ID, Budget_Type_Code, Document_Details)
Accounts (Account_ID, Statement_ID, Account_Details)
Please answer with SQL.
assistant
Sure, I understand.
human
Show the statement id and the statement detail for the statement with most number of accounts?
assistant
SELECT T1.statement_id , T2.statement_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id GROUP BY T1.statement_id ORDER BY COUNT( * ) DESC LIMIT 1;
human
How many account ids are on the table?
assistant
SELECT COUNT( Account_ID ) FROM accounts;
human
What is the statement detail of statement id 57?
assistant
SELECT Statement_Details FROM Statements WHERE Statement_ID = '57';
human
What is the account details of account id 61?
assistant
SELECT Account_Details FROM accounts WHERE Account_ID = 61 ;