Find the id and last name of the student that has the most behavior incidents?
CREATE TABLE Students (last_name VARCHAR, student_id VARCHAR); CREATE TABLE Behavior_Incident (student_id VARCHAR)
SELECT TOP 1 T1.student_id, T2.last_name FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Students (last_name VARCHAR, student_id VARCHAR); CREATE TABLE Behavior_Incident (student_id VARCHAR) Question: Find the id and last name of the student that has the most behavior incidents? [/INST] SELECT TOP 1 T1.student_id, T2.last_name FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC </s>