CREATE TABLE Statements (Statement_ID INT, Statement_Details VARCHAR)
CREATE TABLE Projects (Project_ID INT, Project_Details VARCHAR)
CREATE TABLE Documents_with_Expenses (Document_ID INT, Budget_Type_Code CHAR, Document_Details VARCHAR)
CREATE TABLE Accounts (Account_ID INT, Statement_ID INT, Account_Details VARCHAR)
CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR, Document_Type_Name VARCHAR, Document_Type_Description VARCHAR)
CREATE TABLE Documents (Document_ID INT, Document_Type_Code CHAR, Project_ID INT, Document_Date DATETIME, Document_Name VARCHAR, Document_Description VARCHAR, Other_Details VARCHAR)
CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR, Budget_Type_Description VARCHAR)

Show the average of account details for different statement details in a bar chart, and sort bar in descending order.
SELECT Statement_Details, AVG(Account_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details ORDER BY Statement_Details DESC
SELECT "Statement_Details", AVG("Account_Details") FROM "Accounts" AS "T1" JOIN "Statements" AS "T2" ON "T1"."Statement_ID" = "T2"."Statement_ID" GROUP BY "Statement_Details" ORDER BY "Statement_Details" DESC NULLS LAST