niryuu/sni-each-converted huggingface dataset:
find the Campus of faculty table for which Year equals or between 1935 and 1939
Output: SELECT Campus FROM faculty WHERE Year BETWEEN 1939 AND 1935
Step 1: find the first_name of Staff table.
Step 2: find the first_name of Staff table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT first_name FROM Staff EXCEPT SELECT first_name FROM Staff
Step 1: For each row in Apartment_Buildings table, find the corresponding rows in Apartments table.
Step 2: find the summation of bathroom_count in the results of step 1 whose building_full_name equals Columbus Square and building_short_name contains Normandie Court
Output: SELECT Sum ( T2.bathroom_count ) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_full_name = "Columbus Square" AND T1.building_short_name LIKE "Normandie Court"
Step 1: For each row in Rating table, find corresponding rows in Movie table and in Reviewer table.
Step 2: find title of the results of step 1 whose name equals Steven Spielberg
Output: SELECT T1.title FROM Movie AS T1 JOIN Reviewer AS T2 JOIN Rating AS T3 ON T1.mID = T3.mID AND T3.rID = T2.rID WHERE T2.name = "Steven Spielberg"
Step 1: For each row in Movie table, find the corresponding rows in Rating table.
Step 2: find director of the results of step 1 whose stars equals 2.
Step 3: For each row in Reviewer table, find the corresponding rows in Rating table.
Step 4: find name, name of the results of step 3 whose stars equals 5.
Step 5: show the rows that are in both the results of step 2 and the results of step 4
Output: SELECT T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 2 INTERSECT SELECT T3.name , T3.name FROM Reviewer AS T3 JOIN Rating AS T2 ON T3.rID = T2.rID WHERE T2.stars = 5
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in faculty table.
Step 2: find CampusFee of the results of step 1 whose csu_fees's Year equals 1996 and faculty's Year equals San Jose State University
Output: SELECT T2.CampusFee FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN faculty AS T3 ON T1.Id = T3.Campus WHERE T2.Year = 1996 AND T3.Year = "San Jose State University"
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in faculty table.
Step 2: find the number of rows in the results of step 1 whose faculty's Year equals 2002 and csu_fees's Year equals Long Beach State University
Output: SELECT Count ( * ) FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN faculty AS T3 ON T1.Id = T3.Campus WHERE T3.Year = 2002 AND T2.Year = "Long Beach State University"
find the number of rows in Campuses table
Output: SELECT Count ( * ) FROM Campuses
Step 1: For each row in Apartments table, find the corresponding rows in Apartment_Facilities table.
Step 2: find the number of rows of each value of Apartments's apt_id in the results of step 1.
Step 3: find facility_code in the results of step 1 whose corresponding value in step 2 is greater than 4
Output: SELECT T2.facility_code FROM Apartments AS T1 JOIN Apartment_Facilities AS T2 ON T1.apt_id = T2.apt_id GROUP BY T1.apt_id HAVING Count ( * ) > 4
find the District_name, City_Population of district table for which City_Area equals or between 200000 and 2000000
Output: SELECT District_name , City_Population FROM district WHERE City_Area BETWEEN 2000000 AND 200000
Step 1: For each row in phone table, find corresponding rows in chip_model table and in screen_mode table.
Step 2: find Char_cells, Pixels, Hardware_colours of the results of step 1 whose Model_name equals LG-P760
Output: SELECT T2.Char_cells , T2.Pixels , T2.Hardware_colours FROM chip_model AS T1 JOIN screen_mode AS T2 JOIN phone AS T3 ON T1.Model_name = T3.chip_model AND T3.screen_mode = T2.Graphics_mode WHERE T1.Model_name = "LG-P760"
find the first_name, last_name of Staff table
Output: SELECT first_name , last_name FROM Staff
Step 1: For each row in Staff table, find the corresponding rows in Lessons table.
Step 2: find lesson_id of the results of step 1 whose first_name equals Janessa and last_name equals Sawayn
Output: SELECT T2.lesson_id FROM Staff AS T1 JOIN Lessons AS T2 ON T1.staff_id = T2.staff_id WHERE T1.first_name = "Janessa" AND T1.last_name = "Sawayn"
Step 1: For each row in Reviewer table, find the corresponding rows in Rating table.
Step 2: find the number of rows of each value of Rating's rID in the results of step 1.
Step 3: find name in the results of step 1 whose corresponding value in step 2 is greater than 3
Output: SELECT T1.name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID GROUP BY T2.rID HAVING Count ( * ) > 3
find the maximum Degrees in degrees table
Output: SELECT Max ( Degrees ) FROM degrees
Step 1: For each row in Movie table, find the corresponding rows in Rating table.
Step 2: find title, director of the results of step 1 with smallest value of stars
Output: SELECT T1.title , T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID ORDER BY T2.stars Asc LIMIT 1
Step 1: find the People_ID of body_builder table.
Step 2: find the Name, Weight of people table whose People_ID not one of the results of step 1
Output: SELECT T1.Name , T1.Weight FROM people AS T1 WHERE T1.People_ID NOT IN ( SELECT T2.People_ID FROM body_builder AS T2 )
Step 1: For each row in Campuses table, find the corresponding rows in faculty table.
Step 2: find rows of the results of step 1 whose County equals Los Angeles and faculty's Year greater than 1950 and faculty's Year greater than 2002
Output: SELECT * FROM Campuses AS T1 JOIN faculty AS T2 ON T1.Id = T2.Campus WHERE T1.County = "Los Angeles" AND T2.Year > 2002 AND T2.Year > 1950
Step 1: For each row in Campuses table, find corresponding rows in discipline_enrollments table and in faculty table.
Step 2: find Faculty of the results of step 1 whose Undergraduate greater than 1956 and discipline_enrollments's Year equals 400
Output: SELECT T3.Faculty FROM Campuses AS T1 JOIN discipline_enrollments AS T2 ON T2.Campus = T1.Id JOIN faculty AS T3 ON T1.Id = T3.Campus WHERE T2.Undergraduate > 1956 AND T2.Year = 400
Step 1: For each row in Addresses table, find corresponding rows in Staff table and in Customers table.
Step 2: find Customers's last_name of the results of step 1 whose Staff's last_name equals Sawayn.
Step 3: find Customers's last_name of the results of step 1 whose Staff's last_name equals Sawayn.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T3.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T2.staff_address_id = T1.address_id JOIN Customers AS T3 ON T1.address_id = T3.customer_address_id WHERE T2.last_name = "Sawayn" INTERSECT SELECT T3.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T2.staff_address_id = T1.address_id JOIN Customers AS T3 ON T1.address_id = T3.customer_address_id WHERE T2.last_name = "Sawayn"
find the date_incident_start, date_incident_start of Behavior_Incident table for which incident_type_code equals NOISE
Output: SELECT date_incident_start , date_incident_start FROM Behavior_Incident WHERE incident_type_code = "NOISE"
Step 1: For each row in Reviewer table, find the corresponding rows in Rating table.
Step 2: find stars of the results of step 1 whose name equals Daniel Lewis
Output: SELECT T2.stars FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE T1.name = "Daniel Lewis"
find the number of rows in faculty table whose Year equals 1
Output: SELECT Count ( * ) FROM faculty WHERE Year = 1
find without repetition the customer_first_name, customer_last_name, phone_number of Customers table
Output: SELECT DISTINCT customer_first_name , customer_last_name , phone_number FROM Customers
find the number of rows in faculty table whose Year equals 2004 and Year equals San Francisco State University
Output: SELECT Count ( * ) FROM faculty WHERE Year = "San Francisco State University" AND Year = 2004
find each value of order_id in Orders table along with the number of the corresponding rows to each value
Output: SELECT order_id , Count ( * ) FROM Orders GROUP BY order_id
Step 1: For each row in Rating table, find corresponding rows in Movie table and in Reviewer table.
Step 2: find title of the results of step 1 whose name equals Sarah Martinez and year greater than 2000.
Step 3: find title of the results of step 1 whose name equals James Cameron and name equals Sarah Martinez.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.title FROM Movie AS T1 JOIN Reviewer AS T2 JOIN Rating AS T3 ON T1.mID = T3.mID AND T3.rID = T2.rID WHERE T2.name = "Sarah Martinez" AND T1.year > 2000 INTERSECT SELECT T1.title FROM Movie AS T1 JOIN Reviewer AS T2 JOIN Rating AS T3 ON T1.mID = T3.mID AND T3.rID = T2.rID WHERE T2.name = "Sarah Martinez" AND T2.name = "James Cameron"
Step 1: For each row in Movie table, find the corresponding rows in Rating table.
Step 2: find each value of director in the results of step 1 along with the maximum stars of the corresponding rows to each value
Output: SELECT T1.title , Max ( T2.stars ) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director
find Campus of faculty table whose Year equals San Francisco or Year equals San Francisco
Output: SELECT Campus FROM faculty WHERE Year = "San Francisco" OR Year = "San Francisco"
Step 1: For each row in Reviewer table, find the corresponding rows in Rating table.
Step 2: find name, stars of the results of step 1 whose stars equals 2.
Step 3: For each row in Movie table, find the corresponding rows in Rating table.
Step 4: find director of the results of step 3 whose stars equals 5.
Step 5: show the rows that are in both the results of step 2 and the results of step 4
Output: SELECT T1.name , T2.stars FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE T2.stars = 2 INTERSECT SELECT T3.director FROM Movie AS T3 JOIN Rating AS T2 ON T3.mID = T2.mID WHERE T2.stars = 5
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in discipline_enrollments table.
Step 2: find the average CampusFee in the results of step 1 whose csu_fees's Year equals 2005 and Discipline equals 4
Output: SELECT Avg ( T2.CampusFee ) FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN discipline_enrollments AS T3 ON T1.Id = T3.Campus WHERE T2.Year = 2005 AND T3.Discipline = 4
find the email_address, email_address of Customers table for which first_name equals Carole
Output: SELECT email_address , email_address FROM Customers WHERE first_name = "Carole"
Step 1: find the average Year of each value of Campus in faculty table.
Step 2: find Faculty of faculty table with largest value in the results of step 1
Output: SELECT Faculty FROM faculty GROUP BY Campus ORDER BY Avg ( Year ) Desc LIMIT 1
Step 1: find the year of Movie table ordered descending by year.
Step 2: only show the first 4 rows of the results
Output: SELECT year FROM Movie ORDER BY year Desc LIMIT 4
Step 1: For each row in screen_mode table, find the corresponding rows in phone table.
Step 2: find Hardware_Model_name of the results of step 1 whose chip_model equals Graphics and Type equals Nokia Corporation
Output: SELECT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.chip_model = "Graphics" AND T1.Type = "Nokia Corporation"
Step 1: For each row in Rating table, find corresponding rows in Movie table and in Reviewer table.
Step 2: find title of the results of step 1 whose year less than 1980 or name equals James Cameron
Output: SELECT T1.title FROM Movie AS T1 JOIN Reviewer AS T2 JOIN Rating AS T3 ON T1.mID = T3.mID AND T3.rID = T2.rID WHERE T1.year < 1980 OR T2.name = "James Cameron"
find the name of Reviewer table
Output: SELECT name FROM Reviewer
Step 1: find the number of rows of each value of apt_booking_id in Apartment_Bookings table.
Step 2: find booking_start_date, booking_end_date in Apartment_Bookings table whose corresponding value in step 1 is greater than 2
Output: SELECT booking_start_date , booking_end_date FROM Apartment_Bookings GROUP BY apt_booking_id HAVING Count ( * ) > 2
Step 1: For each row in screen_mode table, find the corresponding rows in phone table.
Step 2: find Hardware_Model_name of the results of step 1 whose Accreditation_type equals Graphics and Type equals Nokia Corporation
Output: SELECT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Accreditation_type = "Graphics" AND T1.Type = "Nokia Corporation"
find each value of account_id in Accounts table along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , account_id FROM Accounts GROUP BY account_id
find each value of director in Movie table along with the number of the corresponding rows to each value
Output: SELECT director , Count ( * ) FROM Movie GROUP BY director
Step 1: find the number of rows of each value of order_id in Orders table.
Step 2: find order_id, order_details in Orders table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT order_id , order_details FROM Orders GROUP BY order_id HAVING Count ( * ) > = 2
find the average bathroom_count in Apartments table whose apt_type_code equals Studio
Output: SELECT Avg ( bathroom_count ) FROM Apartments WHERE apt_type_code = "Studio"
Step 1: find the average Graduate of each value of Year in discipline_enrollments table.
Step 2: find Year of discipline_enrollments table with largest value in the results of step 1
Output: SELECT Year FROM discipline_enrollments GROUP BY Year ORDER BY Avg ( Graduate ) Desc LIMIT 1
Step 1: For each row in Students table, find the corresponding rows in Student_Addresses table.
Step 2: find email_address of the results of step 1 ordered descending by monthly_rental
Output: SELECT T1.email_address FROM Students AS T1 JOIN Student_Addresses AS T2 ON T1.student_id = T2.student_id ORDER BY T2.monthly_rental Desc
Step 1: For each row in Movie table, find the corresponding rows in Rating table.
Step 2: find director of the results of step 1 whose stars equals 2.
Step 3: For each row in Reviewer table, find the corresponding rows in Rating table.
Step 4: find name, stars of the results of step 3 whose stars equals 5.
Step 5: show the rows that are in both the results of step 2 and the results of step 4
Output: SELECT T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 2 INTERSECT SELECT T3.name , T2.stars FROM Reviewer AS T3 JOIN Rating AS T2 ON T3.rID = T2.rID WHERE T2.stars = 5
Step 1: For each row in Movie table, find the corresponding rows in Rating table.
Step 2: find without repetition director of the results of step 1 whose stars equals Sarah Martinez
Output: SELECT DISTINCT T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = "Sarah Martinez"
Step 1: For each row in Students table, find the corresponding rows in Behavior_Incident table.
Step 2: find date_incident_start of the results of step 1 whose first_name equals Fanny
Output: SELECT T2.date_incident_start FROM Students AS T1 JOIN Behavior_Incident AS T2 ON T1.student_id = T2.student_id WHERE T1.first_name = "Fanny"
Step 1: For each row in Apartment_Buildings table, find the corresponding rows in Apartments table.
Step 2: find the summation of room_count in the results of step 1 whose building_full_name equals Columbus Square and building_short_name equals Normandie Court
Output: SELECT Sum ( T2.room_count ) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_full_name = "Columbus Square" AND T1.building_short_name = "Normandie Court"
find each value of product_name in Products table along with the number of the corresponding rows to each value
Output: SELECT product_name , Count ( * ) FROM Products GROUP BY product_name
Step 1: For each row in Teachers table, find the corresponding rows in Detention table.
Step 2: find detention_summary of the results of step 1 whose last_name equals Schuster
Output: SELECT T2.detention_summary FROM Teachers AS T1 JOIN Detention AS T2 ON T1.teacher_id = T2.teacher_id WHERE T1.last_name = "Schuster"
Step 1: For each row in Rating table, find corresponding rows in Movie table and in Reviewer table.
Step 2: find without repetition name, title, director of the results of step 1
Output: SELECT DISTINCT T2.name , T1.title , T1.director FROM Movie AS T1 JOIN Reviewer AS T2 JOIN Rating AS T3 ON T1.mID = T3.mID AND T3.rID = T2.rID
Step 1: For each row in Rating table, find corresponding rows in Movie table and in Reviewer table.
Step 2: find title of the results of step 1 whose year greater than 1980 or name equals James Cameron
Output: SELECT T1.title FROM Movie AS T1 JOIN Reviewer AS T2 JOIN Rating AS T3 ON T1.mID = T3.mID AND T3.rID = T2.rID WHERE T1.year > 1980 OR T2.name = "James Cameron"
find the product of product table for which dpi equals or between 5 and A4
Output: SELECT product FROM product WHERE dpi BETWEEN "A4" AND 5
find each value of Birth_Date in people table along with the number of the corresponding rows to each value
Output: SELECT Birth_Date , Count ( * ) FROM people GROUP BY Birth_Date
find the Birth_Place of people table ordered ascending by Height
Output: SELECT Birth_Place FROM people ORDER BY Height Asc
Step 1: For each row in chip_model table, find the corresponding rows in phone table.
Step 2: find Accreditation_type, Company_name of the results of step 1 whose Launch_year greater than 2002 and RAM_MiB greater than 32
Output: SELECT T2.Accreditation_type , T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year > 2002 AND T1.RAM_MiB > 32
find product of product table whose dpi greater than 5 and dpi less than A4
Output: SELECT product FROM product WHERE dpi > "A4" AND dpi < 5
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in enrollments table.
Step 2: find the average CampusFee in the results of step 1 whose csu_fees's Year equals 2005 and enrollments's Year equals 1956
Output: SELECT Avg ( T2.CampusFee ) FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN enrollments AS T3 ON T1.Id = T3.Campus WHERE T2.Year = 2005 AND T3.Year = 1956
Step 1: For each row in Movie table, find the corresponding rows in Rating table.
Step 2: find the  year in the results of step 1 whose stars less than or equals 2 ordered descending by year.
Step 3: only show the first 4 rows of the results
Output: SELECT T1.year FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars < = 2 ORDER BY T1.year Desc LIMIT 4
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 Provisional
Output: 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 = "Provisional"
Step 1: find the number of rows of each value of customer_id in Customers table.
Step 2: find customer_id, customer_first_name, customer_last_name of Customers table with largest value in the results of step 1
Output: SELECT customer_id , customer_first_name , customer_last_name FROM Customers GROUP BY customer_id ORDER BY Count ( * ) Desc LIMIT 1
find date_left_staff of Staff table whose first_name equals Janessa and last_name equals Sawayn
Output: SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
Step 1: find the number of rows of each value of city in Addresses table.
Step 2: find city of Addresses table ordered ascending by the results of step 1
Output: SELECT city FROM Addresses GROUP BY city ORDER BY Count ( * ) Asc
Step 1: find the number of rows of each value of building_short_name in Apartment_Buildings table.
Step 2: find building_description in Apartment_Buildings table whose corresponding value in step 1 is greater than 2
Output: SELECT building_description FROM Apartment_Buildings GROUP BY building_short_name HAVING Count ( * ) > 2
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in faculty table.
Step 2: find the average CampusFee in the results of step 1 whose faculty's Year equals 1996 and faculty's Campus equals 1
Output: SELECT Avg ( T2.CampusFee ) FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN faculty AS T3 ON T1.Id = T3.Campus WHERE T3.Year = 1996 AND T3.Campus = 1
Step 1: For each row in Movie table, find the corresponding rows in Rating table.
Step 2: find each value of director in the results of step 1 along with the minimum stars of the corresponding rows to each value
Output: SELECT T1.director , Min ( T2.stars ) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director
Step 1: For each row in Rating table, find corresponding rows in Movie table and in Reviewer table.
Step 2: find name, title, title of the results of step 1 ordered ascending by stars
Output: SELECT T2.name , T1.title , T1.title FROM Movie AS T1 JOIN Reviewer AS T2 JOIN Rating AS T3 ON T1.mID = T3.mID AND T3.rID = T2.rID AND T1.mID = T3.mID ORDER BY T3.stars Asc
find the number of rows in Apartment_Buildings table whose building_short_name equals Columbus Square
Output: SELECT Count ( * ) FROM Apartment_Buildings WHERE building_short_name = "Columbus Square"
Step 1: find the number of rows of each value of building_description in Apartment_Buildings table.
Step 2: find building_short_name in Apartment_Buildings table whose corresponding value in step 1 is greater than 2
Output: SELECT building_short_name FROM Apartment_Buildings GROUP BY building_description HAVING Count ( * ) > 2
find product of product table whose dpi greater than 5 or dpi less than A4
Output: SELECT product FROM product WHERE dpi > "A4" OR dpi < 5
Step 1: For each row in Movie table, find the corresponding rows in Rating table.
Step 2: find title of the results of step 1 whose stars not equals 2
Output: SELECT T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars ! = 2
Step 1: For each row in Customers table, find the corresponding rows in Lessons table.
Step 2: find the summation of lesson_time in the results of step 1 whose first_name equals Janessa and last_name equals Sawayn
Output: SELECT Sum ( T2.lesson_time ) FROM Customers AS T1 JOIN Lessons AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = "Janessa" AND T1.last_name = "Sawayn"
find the Headquartered_City of district table for which City_Population equals Blackville
Output: SELECT Headquartered_City FROM district WHERE City_Population = "Blackville"
Step 1: For each row in Campuses table, find the corresponding rows in csu_fees table.
Step 2: find CampusFee of the results of step 1 whose County equals San Jose State University and csu_fees's Year equals 1996
Output: SELECT T2.CampusFee FROM Campuses AS T1 JOIN csu_fees AS T2 ON T1.Id = T2.Campus WHERE T1.County = "San Jose State University" AND T2.Year = 1996
Step 1: For each row in store_district table, find corresponding rows in store table and in district table.
Step 2: find District_name of the results of step 1 whose Store_Name equals City Mall.
Step 3: find District_name of the results of step 1 whose Store_Name equals Village Store.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T2.District_name FROM store AS T1 JOIN district AS T2 JOIN store_district AS T3 ON T1.Store_ID = T3.Store_ID AND T3.District_ID = T2.District_ID WHERE T1.Store_Name = "City Mall" INTERSECT SELECT T2.District_name FROM store AS T1 JOIN district AS T2 JOIN store_district AS T3 ON T1.Store_ID = T3.Store_ID AND T3.District_ID = T2.District_ID WHERE T1.Store_Name = "Village Store"
Step 1: For each row in Campuses table, find the corresponding rows in faculty table.
Step 2: find Campuses's Campus of the results of step 1 whose County equals Los Angeles and Campuses's Year less than 1950 and faculty's Year greater than 2002
Output: SELECT T1.Campus FROM Campuses AS T1 JOIN faculty AS T2 ON T1.Id = T2.Campus WHERE T1.County = "Los Angeles" AND T1.Year < 1950 AND T2.Year > 2002
Step 1: For each row in Apartment_Buildings table, find the corresponding rows in Apartments table.
Step 2: find the summation of bathroom_count in the results of step 1 whose building_short_name equals Columbus Square and building_short_name equals Normandie Court
Output: SELECT Sum ( T2.bathroom_count ) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = "Normandie Court" AND T1.building_short_name = "Columbus Square"
Step 1: For each row in Apartments table, find the corresponding rows in Apartment_Facilities table.
Step 2: find the summation of bathroom_count in the results of step 1 whose facility_code equals Gym
Output: SELECT Sum ( T1.bathroom_count ) FROM Apartments AS T1 JOIN Apartment_Facilities AS T2 ON T1.apt_id = T2.apt_id WHERE T2.facility_code = "Gym"
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in faculty table.
Step 2: find the average CampusFee in the results of step 1 whose csu_fees's Year equals 2005 and Faculty equals 357.1
Output: SELECT Avg ( T2.CampusFee ) FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN faculty AS T3 ON T1.Id = T3.Campus WHERE T2.Year = 2005 AND T3.Faculty = 357.1
Step 1: For each row in Movie table, find the corresponding rows in Rating table.
Step 2: find director of the results of step 1 whose stars equals 2.
Step 3: find director of the results of step 1 whose stars equals 5.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 2 INTERSECT SELECT T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 5
find the summation of rows in Apartments table whose apt_number contains Columbus Square
Output: SELECT Sum ( * ) FROM Apartments WHERE apt_number LIKE "Columbus Square"
Step 1: find the number of rows of each value of building_short_name in Apartment_Buildings table.
Step 2: find building_short_name in Apartment_Buildings table whose corresponding value in step 1 is greater than 2
Output: SELECT building_short_name FROM Apartment_Buildings GROUP BY building_short_name HAVING Count ( * ) > 2
Step 1: For each row in Detention table, find corresponding rows in Ref_Detention_Type table and in Teachers table.
Step 2: find detention_type_description of the results of step 1 whose last_name equals Schuster
Output: SELECT T1.detention_type_description FROM Ref_Detention_Type AS T1 JOIN Teachers AS T2 JOIN Detention AS T3 ON T1.detention_type_code = T3.detention_type_code AND T3.teacher_id = T2.teacher_id WHERE T2.last_name = "Schuster"
find the number of rows in Campuses table whose County equals San Jose State University
Output: SELECT Count ( * ) FROM Campuses WHERE County = "San Jose State University"
find product of product table whose dpi less than 5 and dpi greater than A4
Output: SELECT product FROM product WHERE dpi < "A4" AND dpi > 5
Step 1: find the District_name of district table for which Headquartered_City equals City Mall.
Step 2: For each row in store_district table, find corresponding rows in store table and in district table.
Step 3: find District_name of the results of step 2 whose Type equals Village Store.
Step 4: show the rows that are in both the results of step 1 and the results of step 3
Output: SELECT T1.District_name FROM district AS T1 WHERE T1.Headquartered_City = "City Mall" INTERSECT SELECT T1.District_name FROM store AS T2 JOIN district AS T1 JOIN store_district AS T3 ON T2.Store_ID = T3.Store_ID AND T3.District_ID = T1.District_ID WHERE T2.Type = "Village Store"
Step 1: For each row in Product_Categories table, find the corresponding rows in Products table.
Step 2: find each value of product_name in the results of step 1 along with the summation of vat_rating of the corresponding rows to each value
Output: SELECT T2.product_name , Sum ( T1.vat_rating ) FROM Product_Categories AS T1 JOIN Products AS T2 ON T1.production_type_code = T2.production_type_code GROUP BY T2.product_name
Step 1: For each row in Rating table, find corresponding rows in Movie table and in Reviewer table.
Step 2: find name of the results of step 1 whose title equals null
Output: SELECT T2.name FROM Movie AS T1 JOIN Reviewer AS T2 JOIN Rating AS T3 ON T1.mID = T3.mID AND T3.rID = T2.rID WHERE T1.title = "null"
Step 1: find the product of product table.
Step 2: find the maximum Area_size in store table.
Step 3: For each row in product table, find the corresponding rows in store table.
Step 4: find product in the results of step 3 whose Area_size less than or equals the results of step 2.
Step 5: show the rows that are in the results of step 1 but not in the results of step 4
Output: SELECT T1.product FROM product AS T1 EXCEPT SELECT T1.product FROM product AS T1 JOIN store AS T2 WHERE T2.Area_size < = ( SELECT Max ( T2.Area_size ) FROM store AS T2 )
Step 1: find the number of rows of each value of building_full_name in Apartment_Buildings table.
Step 2: find building_short_name in Apartment_Buildings table whose corresponding value in step 1 is greater than 2
Output: SELECT building_short_name FROM Apartment_Buildings GROUP BY building_full_name HAVING Count ( * ) > 2
Step 1: For each row in Movie table, find the corresponding rows in Rating table.
Step 2: find title, stars of the results of step 1
Output: SELECT T1.title , T2.stars FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID
Step 1: find the number of rows of each value of customer_id in Customers table.
Step 2: find customer_last_name, phone_number, customer_id of Customers table with largest value in the results of step 1
Output: SELECT customer_last_name , phone_number , customer_id FROM Customers GROUP BY customer_id ORDER BY Count ( * ) Desc LIMIT 1
find without repetition the address_type_code of Ref_Address_Types table
Output: SELECT DISTINCT address_type_code FROM Ref_Address_Types
Step 1: For each row in store_district table, find corresponding rows in store table and in district table.
Step 2: find Store_Name of the results of step 1 whose Headquartered_City equals Khanewal District
Output: SELECT T1.Store_Name FROM store AS T1 JOIN district AS T2 JOIN store_district AS T3 ON T1.Store_ID = T3.Store_ID AND T3.District_ID = T2.District_ID WHERE T2.Headquartered_City = "Khanewal District"
find the Hardware_Model_name of phone table
Output: SELECT Hardware_Model_name FROM phone
Step 1: for each value of Type in screen_mode table, calculate number of rows.
Step 2: show each value of Type in screen_mode table along with the corresponding number of rows with smallest value in the results of step 1
Output: SELECT Type , Count ( * ) FROM screen_mode GROUP BY Type ORDER BY Count ( * ) Asc LIMIT 1
Step 1: For each row in Reviewer table, find the corresponding rows in Rating table.
Step 2: find name, stars of the results of step 1 with smallest value of stars
Output: SELECT T1.name , T2.stars FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID ORDER BY T2.stars Asc LIMIT 1
Step 1: find the product_name of Products table.
Step 2: find the product_name of Products table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT product_name FROM Products EXCEPT SELECT product_name FROM Products
Step 1: For each row in phone table, find corresponding rows in chip_model table and in screen_mode table.
Step 2: find Graphics_mode, Type of the results of step 1 whose Model_name equals LG-P760
Output: SELECT T2.Graphics_mode , T2.Type FROM chip_model AS T1 JOIN screen_mode AS T2 JOIN phone AS T3 ON T1.Model_name = T3.chip_model AND T3.screen_mode = T2.Graphics_mode WHERE T1.Model_name = "LG-P760"
find the number of rows in phone table whose screen_mode equals No
Output: SELECT Count ( * ) FROM phone WHERE screen_mode = "No"
find the number of rows in Apartment_Buildings table
Output: SELECT Count ( * ) FROM Apartment_Buildings
Step 1: find the number of rows of each value of Headquartered_City in district table.
Step 2: find Headquartered_City of district table with largest value in the results of step 1
Output: SELECT Headquartered_City FROM district GROUP BY Headquartered_City ORDER BY Count ( * ) Desc LIMIT 1
find Campus of faculty table whose Year greater than or equals 1935 and Year less than or equals 1939
Output: SELECT Campus FROM faculty WHERE Year > = 1939 AND Year < = 1935
Step 1: For each row in Rating table, find corresponding rows in Movie table and in Reviewer table.
Step 2: find name, title of the results of step 1 with smallest value of stars
Output: SELECT T2.name , T1.title FROM Movie AS T1 JOIN Reviewer AS T2 JOIN Rating AS T3 ON T1.mID = T3.mID AND T3.rID = T2.rID AND T1.mID = T3.mID ORDER BY T3.stars Asc LIMIT 1
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: For each row in Apartments table, find corresponding rows in Apartment_Buildings table and in Apartment_Bookings table.
Step 4: find building_manager of the results of step 3 whose booking_status_code equals 1.
Step 5: show the rows that are in both the results of step 2 and the results of step 4
Output: 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 T3.building_manager FROM Apartment_Buildings AS T3 JOIN Apartments AS T1 ON T3.building_id = T1.building_id JOIN Apartment_Bookings AS T2 ON T1.apt_id = T2.apt_id WHERE T2.booking_status_code = 1
Step 1: For each row in Rating table, find corresponding rows in Movie table and in Reviewer table.
Step 2: find name of the results of step 1 whose director equals Avatar
Output: SELECT T2.name FROM Movie AS T1 JOIN Reviewer AS T2 JOIN Rating AS T3 ON T1.mID = T3.mID AND T3.rID = T2.rID WHERE T1.director = "Avatar"
find the number of rows in Apartments table whose apt_number equals Columbus Square
Output: SELECT Count ( * ) FROM Apartments WHERE apt_number = "Columbus Square"
find the date_became_customer of Customers table for which customer_status_code equals Good Customer
Output: SELECT date_became_customer FROM Customers WHERE customer_status_code = "Good Customer"
find the District_name, Headquartered_City of district table for which City_Population equals or between 200000 and 2000000
Output: SELECT District_name , Headquartered_City FROM district WHERE City_Population BETWEEN 2000000 AND 200000
find the average CampusFee in csu_fees table whose Year equals 1996 and Year equals 1996
Output: SELECT Avg ( CampusFee ) FROM csu_fees WHERE Year = 1996 AND Year = 1996
Step 1: find the rID of Reviewer table.
Step 2: find the Rating's rID of Rating table for which stars equals 4.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT T1.rID FROM Reviewer AS T1 EXCEPT SELECT T2.rID FROM Rating AS T2 WHERE T2.stars = 4
Step 1: find the product_id of Products table.
Step 2: find the number of rows in Products table whose product_id not one of the results of step 1
Output: SELECT Count ( * ) FROM Products WHERE product_id NOT IN ( SELECT product_id FROM Products )
Step 1: For each row in people table, find the corresponding rows in body_builder table.
Step 2: find Height, Weight of the results of step 1 ordered descending by Total
Output: SELECT T2.Height , T2.Weight FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total Desc
Step 1: For each row in Campuses table, find corresponding rows in degrees table and in faculty table.
Step 2: find the summation of Degrees of each value of degrees's Campus in the results of step 1.
Step 3: find faculty's Campus of the results of step 1 with largest value in the results of step 2
Output: SELECT T3.Campus FROM Campuses AS T1 JOIN degrees AS T2 ON T2.Campus = T1.Id JOIN faculty AS T3 ON T1.Id = T3.Campus GROUP BY T2.Campus ORDER BY Sum ( T2.Degrees ) Desc LIMIT 1
Step 1: For each row in Campuses table, find the corresponding rows in faculty table.
Step 2: find County of the results of step 1 whose Campuses's Campus equals Los Angeles and faculty's Year greater than 1950
Output: SELECT T1.County FROM Campuses AS T1 JOIN faculty AS T2 ON T1.Id = T2.Campus WHERE T1.Campus = "Los Angeles" AND T2.Year > 1950
find the title, year of Movie table with largest value of year
Output: SELECT title , year FROM Movie ORDER BY year Desc LIMIT 1
Step 1: For each row in Campuses table, find the corresponding rows in faculty table.
Step 2: find Campuses's Campus of the results of step 1 whose County equals Los Angeles and faculty's Year greater than 1950 and faculty's Year greater than 2002
Output: SELECT T1.Campus FROM Campuses AS T1 JOIN faculty AS T2 ON T1.Id = T2.Campus WHERE T1.County = "Los Angeles" AND T2.Year > 2002 AND T2.Year > 1950
Step 1: find the number of rows of each value of state_province_county in Addresses table.
Step 2: find state_province_county in Addresses table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT state_province_county FROM Addresses GROUP BY state_province_county HAVING Count ( * ) > = 2
Step 1: find the number of rows of each value of vehicle_id in Vehicles table.
Step 2: find vehicle_id, vehicle_details of Vehicles table with largest value in the results of step 1
Output: SELECT vehicle_id , vehicle_details FROM Vehicles GROUP BY vehicle_id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in discipline_enrollments table.
Step 2: find CampusFee of the results of step 1 whose Undergraduate equals 1996 and discipline_enrollments's Year equals San Jose State University
Output: SELECT T2.CampusFee FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN discipline_enrollments AS T3 ON T1.Id = T3.Campus WHERE T3.Undergraduate = 1996 AND T3.Year = "San Jose State University"
Step 1: For each row in Reviewer table, find the corresponding rows in Rating table.
Step 2: find name of the results of step 1 whose stars contains 4 or stars contains 3
Output: SELECT T1.name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE T2.stars LIKE 3 OR T2.stars LIKE 4
Step 1: For each row in Campuses table, find corresponding rows in degrees table and in faculty table.
Step 2: find the average Degrees of each value of degrees's Campus in the results of step 1.
Step 3: find faculty's Campus of the results of step 1 with largest value in the results of step 2
Output: SELECT T3.Campus FROM Campuses AS T1 JOIN degrees AS T2 ON T2.Campus = T1.Id JOIN faculty AS T3 ON T1.Id = T3.Campus GROUP BY T2.Campus ORDER BY Avg ( T2.Degrees ) Desc LIMIT 1
find the minimum Total in body_builder table
Output: SELECT Min ( Total ) FROM body_builder
find the number of rows in faculty table whose Year equals 2002
Output: SELECT Count ( * ) FROM faculty WHERE Year = 2002
find District_name of district table whose City_Area greater than 10 or Headquartered_City equals Attock City
Output: SELECT District_name FROM district WHERE City_Area > 10 OR Headquartered_City = "Attock City"
Step 1: For each row in Apartment_Buildings table, find the corresponding rows in Apartments table.
Step 2: find the summation of bathroom_count in the results of step 1 whose building_description equals Columbus Square and building_short_name contains Normandie Court
Output: SELECT Sum ( T2.bathroom_count ) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_description = "Columbus Square" AND T1.building_short_name LIKE "Normandie Court"
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in discipline_enrollments table.
Step 2: find CampusFee of the results of step 1 whose Graduate equals 1996 and csu_fees's Year equals San Jose State University
Output: SELECT T2.CampusFee FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN discipline_enrollments AS T3 ON T1.Id = T3.Campus WHERE T3.Graduate = 1996 AND T2.Year = "San Jose State University"
Step 1: For each row in Campuses table, find corresponding rows in discipline_enrollments table and in faculty table.
Step 2: find the summation of Graduate in the results of step 1 whose faculty's Year equals 2000 and faculty's Year equals San Jose State University
Output: SELECT Sum ( T2.Graduate ) FROM Campuses AS T1 JOIN discipline_enrollments AS T2 ON T2.Campus = T1.Id JOIN faculty AS T3 ON T1.Id = T3.Campus WHERE T3.Year = "San Jose State University" AND T3.Year = 2000
find Weight of people table whose Height greater than 140 or Height greater than 200
Output: SELECT Weight FROM people WHERE Height > 200 OR Height > 140
find the number of rows in faculty table whose Campus equals 2004 and Year equals San Jose State University
Output: SELECT Count ( * ) FROM faculty WHERE Campus = 2004 AND Year = "San Jose State University"
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in faculty table.
Step 2: find the average CampusFee in the results of step 1 whose faculty's Year equals 2005 and faculty's Year equals 2002
Output: SELECT Avg ( T2.CampusFee ) FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN faculty AS T3 ON T1.Id = T3.Campus WHERE T3.Year = 2002 AND T3.Year = 2005
Step 1: For each row in Rating table, find corresponding rows in Movie table and in Reviewer table.
Step 2: find title of the results of step 1 whose name equals James Cameron and year greater than 2000
Output: SELECT T1.title FROM Movie AS T1 JOIN Reviewer AS T2 JOIN Rating AS T3 ON T1.mID = T3.mID AND T3.rID = T2.rID WHERE T2.name = "James Cameron" AND T1.year > 2000
Step 1: For each row in Customers table, find the corresponding rows in Accounts table.
Step 2: find account_id, date_account_opened, other_account_details of the results of step 1 whose customer_first_name equals Meaghan
Output: SELECT T2.account_id , T2.date_account_opened , T2.other_account_details FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_first_name = "Meaghan"
find each value of order_id in Orders table along with the summation of the corresponding rows to each value
Output: SELECT order_id , Sum ( * ) FROM Orders GROUP BY order_id
Step 1: For each row in Addresses table, find the corresponding rows in Students table.
Step 2: find zip_postcode of the results of step 1 whose first_name equals Lyla
Output: SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = "Lyla"
Step 1: find the year, title of Movie table for which year less than or equals 1939 ordered descending by year.
Step 2: only show the first 4 rows of the results
Output: SELECT year , title FROM Movie WHERE year < = 1939 ORDER BY year Desc LIMIT 4
Step 1: find the Pixels of screen_mode table for which Type equals Provisional.
Step 2: For each row in screen_mode table, find the corresponding rows in phone table.
Step 3: find Pixels of the results of step 2 whose Accreditation_type equals Full.
Step 4: show the rows that are in both the results of step 1 and the results of step 3
Output: SELECT T1.Pixels FROM screen_mode AS T1 WHERE T1.Type = "Provisional" INTERSECT SELECT T1.Pixels FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Accreditation_type = "Full"
Step 1: find the apt_id of Apartment_Bookings table.
Step 2: find the number of rows in Apartments table whose Apartments's apt_id not one of the results of step 1
Output: SELECT Count ( * ) FROM Apartments AS T1 WHERE T1.apt_id NOT IN ( SELECT T2.apt_id FROM Apartment_Bookings AS T2 )
Step 1: find the average bathroom_count of each value of apt_type_code in Apartments table.
Step 2: find apt_type_code of Apartments table ordered descending by the results of step 1
Output: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY Avg ( bathroom_count ) Desc
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in faculty table.
Step 2: find the average CampusFee in the results of step 1 whose faculty's Year equals 2005 and faculty's Campus equals 1
Output: SELECT Avg ( T2.CampusFee ) FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN faculty AS T3 ON T1.Id = T3.Campus WHERE T3.Year = 2005 AND T3.Campus = 1
find product of product table whose dpi less than 5 or dpi greater than A4
Output: SELECT product FROM product WHERE dpi < "A4" OR dpi > 5
find the number of rows in Ref_Address_Types table
Output: SELECT Count ( * ) FROM Ref_Address_Types
Step 1: For each row in Apartment_Buildings table, find the corresponding rows in Apartments table.
Step 2: find the summation of bathroom_count in the results of step 1 whose building_short_name equals Columbus Square and building_short_name contains Normandie Court
Output: SELECT Sum ( T2.bathroom_count ) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = "Normandie Court" AND T1.building_short_name LIKE "Columbus Square"
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in faculty table.
Step 2: find the average CampusFee in the results of step 1 whose csu_fees's Year equals 1996 and Faculty equals 357.1
Output: SELECT Avg ( T2.CampusFee ) FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN faculty AS T3 ON T1.Id = T3.Campus WHERE T2.Year = 1996 AND T3.Faculty = 357.1
Step 1: find the number of rows of each value of student_id in Students table.
Step 2: find student_id, last_name of Students table with largest value in the results of step 1
Output: SELECT student_id , last_name FROM Students GROUP BY student_id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in faculty table.
Step 2: find CampusFee of the results of step 1 whose faculty's Year equals 2000 and csu_fees's Year equals San Jose State University
Output: SELECT T2.CampusFee FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN faculty AS T3 ON T1.Id = T3.Campus WHERE T3.Year = 2000 AND T2.Year = "San Jose State University"
Step 1: For each row in Customers table, find the corresponding rows in Lessons table.
Step 2: find the average price in the results of step 1 whose first_name equals Janessa and last_name equals Sawayn
Output: SELECT Avg ( T2.price ) FROM Customers AS T1 JOIN Lessons AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = "Janessa" AND T1.last_name = "Sawayn"
find the Model_name of chip_model table for which Launch_year equals 1
Output: SELECT Model_name FROM chip_model WHERE Launch_year = 1
find customer_status_code, phone_number, email_address of Customers table whose first_name equals Marina or last_name equals Kohler
Output: SELECT customer_status_code , phone_number , email_address FROM Customers WHERE first_name = "Marina" OR last_name = "Kohler"
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in faculty table.
Step 2: find the average CampusFee in the results of step 1 whose csu_fees's Year equals 1996 and faculty's Campus equals 1
Output: SELECT Avg ( T2.CampusFee ) FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN faculty AS T3 ON T1.Id = T3.Campus WHERE T2.Year = 1996 AND T3.Campus = 1
find the bathroom_count of Apartments table ordered ascending by bathroom_count
Output: SELECT bathroom_count FROM Apartments ORDER BY bathroom_count Asc
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in faculty table.
Step 2: find the average CampusFee in the results of step 1 whose faculty's Year equals 1996 and Faculty equals 357.1
Output: SELECT Avg ( T2.CampusFee ) FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN faculty AS T3 ON T1.Id = T3.Campus WHERE T3.Year = 1996 AND T3.Faculty = 357.1
Step 1: For each row in Apartment_Buildings table, find the corresponding rows in Apartments table.
Step 2: find the summation of bathroom_count in the results of step 1 whose apt_number equals Columbus Square and building_full_name contains Normandie Court
Output: SELECT Sum ( T2.bathroom_count ) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.apt_number = "Columbus Square" AND T1.building_full_name LIKE "Normandie Court"