Show the ids of high schoolers who have friends and are also liked by someone else.
CREATE TABLE Likes (student_id VARCHAR, liked_id VARCHAR); CREATE TABLE Friend (student_id VARCHAR, liked_id VARCHAR)
SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Likes (student_id VARCHAR, liked_id VARCHAR); CREATE TABLE Friend (student_id VARCHAR, liked_id VARCHAR) Question: Show the ids of high schoolers who have friends and are also liked by someone else. [/INST] SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes </s>