Find the first name and gender of student who have more than one pet.
CREATE TABLE student (fname VARCHAR, sex VARCHAR, stuid VARCHAR); CREATE TABLE has_pet (stuid VARCHAR)
SELECT T1.fname, T1.sex FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid GROUP BY T1.stuid HAVING COUNT(*) > 1
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE student (fname VARCHAR, sex VARCHAR, stuid VARCHAR); CREATE TABLE has_pet (stuid VARCHAR) Question: Find the first name and gender of student who have more than one pet. [/INST] SELECT T1.fname, T1.sex FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid GROUP BY T1.stuid HAVING COUNT(*) > 1 </s>