What is the name of the patient who made the most recent appointment?
CREATE TABLE patient (name VARCHAR, ssn VARCHAR); CREATE TABLE appointment (patient VARCHAR, start VARCHAR)
SELECT TOP 1 T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE patient (name VARCHAR, ssn VARCHAR); CREATE TABLE appointment (patient VARCHAR, start VARCHAR) Question: What is the name of the patient who made the most recent appointment? [/INST] SELECT TOP 1 T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC </s>