Find the first name and age of students who have a pet.
CREATE TABLE student (fname VARCHAR, age VARCHAR, stuid VARCHAR); CREATE TABLE has_pet (stuid VARCHAR)
SELECT DISTINCT T1.fname, T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE student (fname VARCHAR, age VARCHAR, stuid VARCHAR); CREATE TABLE has_pet (stuid VARCHAR) Question: Find the first name and age of students who have a pet. [/INST] SELECT DISTINCT T1.fname, T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid </s>