CREATE TABLE student (stuid DECIMAL, lname TEXT, fname TEXT, age DECIMAL, sex TEXT, major DECIMAL, advisor DECIMAL, city_code TEXT)
CREATE TABLE lives_in (stuid DECIMAL, dormid DECIMAL, room_number DECIMAL)
CREATE TABLE has_amenity (dormid DECIMAL, amenid DECIMAL)
CREATE TABLE dorm_amenity (amenid DECIMAL, amenity_name TEXT)
CREATE TABLE dorm (dormid DECIMAL, dorm_name TEXT, student_capacity DECIMAL, gender TEXT)

Find the first and last name of students who are living in the dorms that have amenity TV Lounge.
SELECT T1.fname, T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')
WITH "_u_0" AS (SELECT "T3"."dormid" FROM "has_amenity" AS "T3" JOIN "dorm_amenity" AS "T4" ON "T3"."amenid" = "T4"."amenid" AND "T4"."amenity_name" = 'TV Lounge' GROUP BY "dormid") SELECT "T1"."fname", "T1"."lname" FROM "student" AS "T1" JOIN "lives_in" AS "T2" ON "T1"."stuid" = "T2"."stuid" LEFT JOIN "_u_0" AS "_u_0" ON "T2"."dormid" = "_u_0"."" WHERE NOT "_u_0"."" IS NULL