Task: Text to Code
Input (English): Step 1: For each row in Apartments table, find the corresponding rows in Apartment_Bookings table.
Step 2: find apt_number of the results of step 1 whose booking_status_code equals 0.
Step 3: find apt_number of the results of step 1 whose booking_status_code equals 1.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output (English): SELECT T1.apt_number FROM Apartments AS T1 JOIN Apartment_Bookings AS T2 ON T1.apt_id = T2.apt_id WHERE T2.booking_status_code = 0 INTERSECT SELECT T1.apt_number FROM Apartments AS T1 JOIN Apartment_Bookings AS T2 ON T1.apt_id = T2.apt_id WHERE T2.booking_status_code = 1