Find the total amount claimed in the most recently created document.
CREATE TABLE claim_headers (amount_claimed INTEGER, claim_header_id VARCHAR); CREATE TABLE claims_documents (claim_id VARCHAR, created_date VARCHAR); CREATE TABLE claims_documents (created_date VARCHAR)
SELECT SUM(t1.amount_claimed) FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id = t2.claim_id WHERE t2.created_date = (SELECT TOP 1 created_date FROM claims_documents ORDER BY created_date)
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE claim_headers (amount_claimed INTEGER, claim_header_id VARCHAR); CREATE TABLE claims_documents (claim_id VARCHAR, created_date VARCHAR); CREATE TABLE claims_documents (created_date VARCHAR) Question: Find the total amount claimed in the most recently created document. [/INST] SELECT SUM(t1.amount_claimed) FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id = t2.claim_id WHERE t2.created_date = (SELECT TOP 1 created_date FROM claims_documents ORDER BY created_date) </s>