Find the name and age of the person who is a friend of both Dan and Alice.
CREATE TABLE Person (name VARCHAR, age VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR)
SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Person (name VARCHAR, age VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) Question: Find the name and age of the person who is a friend of both Dan and Alice. [/INST] SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' </s>