Show last names for all student who are on scholarship.
CREATE TABLE Student (Lname VARCHAR, StuID VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR, onscholarship VARCHAR)
SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y'
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Student (Lname VARCHAR, StuID VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR, onscholarship VARCHAR) Question: Show last names for all student who are on scholarship. [/INST] SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y' </s>