niryuu/sni-each-converted huggingface dataset:
Step 1: For each row in Apartments table, find the corresponding rows in Apartment_Bookings table.
Step 2: find the average bathroom_count in the results of step 1 whose booking_status_code equals Provisional
Output: SELECT Avg ( T1.bathroom_count ) FROM Apartments AS T1 JOIN Apartment_Bookings AS T2 ON T1.apt_id = T2.apt_id WHERE T2.booking_status_code = "Provisional"
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 csu_fees's Year equals 1996
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 T2.Year = 1996
find each value of product_name in Products table along with the summation of the corresponding rows to each value
Output: SELECT product_name , Sum ( * ) FROM Products GROUP BY product_name
Step 1: For each row in Addresses table, find the corresponding rows in Student_Addresses table.
Step 2: find the average monthly_rental of each value of student_id in the results of step 1.
Step 3: find student_id, city of step 1 results with largest value in the results of step 2
Output: SELECT T2.student_id , T1.city FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.student_id ORDER BY Avg ( T2.monthly_rental ) Desc LIMIT 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_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 T2.apt_number = "Columbus Square" AND T1.building_short_name = "Normandie Court"
Step 1: find the number of rows of each value of facility_code in Apartment_Facilities table.
Step 2: find facility_code in Apartment_Facilities table whose corresponding value in step 1 is greater than 4
Output: SELECT facility_code FROM Apartment_Facilities GROUP BY facility_code HAVING Count ( * ) > 4
Step 1: For each row in Campuses table, find the corresponding rows in faculty table.
Step 2: find the number of rows in the results of step 1 whose Campuses's Campus equals Long Beach State University and faculty's Year equals 2002
Output: SELECT Count ( * ) FROM Campuses AS T1 JOIN faculty AS T2 ON T1.Id = T2.Campus WHERE T1.Campus = "Long Beach State University" AND T2.Year = 2002
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 discipline_enrollments's Year 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.Year = "San Jose State University" AND T3.Year = 1996
Step 1: find the number of rows of each value of city in Addresses table.
Step 2: find city of Addresses table with largest value in the results of step 1
Output: SELECT city FROM Addresses GROUP BY city ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the average stars in Rating table.
Step 2: For each row in Movie table, find the corresponding rows in Rating table.
Step 3: find title, director in the results of step 2 whose stars greater than the results of step 1
Output: SELECT T1.title , T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars > ( SELECT Avg ( T2.stars ) FROM Rating AS T2 )
Step 1: For each row in Orders table, find the corresponding rows in Invoices table.
Step 2: find date_order_placed, Invoices's order_id of the results of step 1
Output: SELECT T1.date_order_placed , T2.order_id FROM Orders AS T1 JOIN Invoices AS T2 ON T1.order_id = T2.order_id
find the summation of amount_outstanding in Customers table whose first_name equals Carole and last_name equals Bernhard
Output: SELECT Sum ( amount_outstanding ) FROM Customers WHERE first_name = "Carole" AND last_name = "Bernhard"
Step 1: find the rows in faculty table whose Year equals 2003.
Step 2: find each value of Faculty in the results of step 1 ordered descending by number of rows that correspond of each value.
Step 3: only show the first row of the results
Output: SELECT Faculty FROM faculty WHERE Year = 2003 GROUP BY Campus ORDER BY Count ( * ) Desc LIMIT 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 average stars of the corresponding rows to each value
Output: SELECT T1.title , Avg ( T2.stars ) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director
find the number of rows in faculty table whose Year equals 2002 and Year equals Long Beach State University
Output: SELECT Count ( * ) FROM faculty WHERE Year = "Long Beach State University" AND Year = 2002
Step 1: find the number of rows of each value of product in product table.
Step 2: find product of product table with largest value in the results of step 1
Output: SELECT product FROM product GROUP BY product ORDER BY Count ( * ) Desc LIMIT 1
find the number of rows in Customers table whose first_name equals Rylan and last_name equals Goodwin
Output: SELECT Count ( * ) FROM Customers WHERE first_name = "Rylan" AND last_name = "Goodwin"
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 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 T1.Year > 1950 AND T2.Year > 2002
find the city of Addresses table for which line_1_number_building equals Janessa
Output: SELECT city FROM Addresses WHERE line_1_number_building = "Janessa"
Step 1: find the average transaction_amount in Financial_Transactions table.
Step 2: find the account_id of Financial_Transactions table whose transaction_amount greater than the results of step 1
Output: SELECT account_id FROM Financial_Transactions WHERE transaction_amount > ( SELECT Avg ( transaction_amount ) FROM Financial_Transactions )
Step 1: find the number of rows of each value of customer_id in Customers table.
Step 2: find first_name, last_name in Customers table whose corresponding value in step 1 is greater than 2
Output: SELECT first_name , last_name FROM Customers GROUP BY customer_id HAVING Count ( * ) > 2
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 equals null
Output: SELECT T1.name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE T2.stars = "null"
find the Name of people table
Output: SELECT Name FROM people
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 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_full_name = "Columbus Square" AND T1.building_short_name = "Normandie Court"
find the order_id, date_order_placed, order_details of Orders table
Output: SELECT order_id , date_order_placed , order_details FROM Orders
find without repetition the District_name of district table ordered descending by City_Population
Output: SELECT DISTINCT District_name FROM district ORDER BY City_Population Desc
find each value of product_id in Products table along with the number of the corresponding rows to each value
Output: SELECT product_id , Count ( * ) FROM Products GROUP BY product_id
find each value of apt_number in Apartments table along with the number of the corresponding rows to each value
Output: SELECT apt_number , Count ( * ) FROM Apartments GROUP BY apt_number
Step 1: For each row in Guests table, find the corresponding rows in Apartment_Bookings table.
Step 2: find booking_start_date, booking_end_date of the results of step 1 whose gender_code equals Female
Output: SELECT T2.booking_start_date , T2.booking_end_date FROM Guests AS T1 JOIN Apartment_Bookings AS T2 ON T1.guest_id = T2.guest_id WHERE T1.gender_code = "Female"
Step 1: For each row in Teachers table, find the corresponding rows in Assessment_Notes table.
Step 2: find notes_id of the results of step 1 whose last_name equals Schuster
Output: SELECT T2.notes_id FROM Teachers AS T1 JOIN Assessment_Notes AS T2 ON T1.teacher_id = T2.teacher_id WHERE T1.last_name = "Schuster"
Step 1: For each row in Campuses table, find corresponding rows in degrees table and in discipline_enrollments table.
Step 2: find the average Degrees of each value of discipline_enrollments's Year in the results of step 1.
Step 3: find discipline_enrollments's Year of the results of step 1 with largest value in the results of step 2
Output: SELECT T3.Year FROM Campuses AS T1 JOIN degrees AS T2 ON T2.Campus = T1.Id JOIN discipline_enrollments AS T3 ON T1.Id = T3.Campus GROUP BY T3.Year ORDER BY Avg ( T2.Degrees ) Desc LIMIT 1
Step 1: For each row in Campuses table, find corresponding rows in discipline_enrollments table and in faculty table.
Step 2: find faculty's Year of the results of step 1 whose Undergraduate greater than 400.
Step 3: find the discipline_enrollments's Campus of discipline_enrollments table for which Discipline greater than 1956.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T3.Year 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 > 400 INTERSECT SELECT T2.Campus FROM discipline_enrollments AS T2 WHERE T2.Discipline > 1956
find the average bathroom_count in Apartments table
Output: SELECT Avg ( bathroom_count ) FROM Apartments
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 County equals Los Angeles and Campuses's Year greater than 1950 and faculty's Year greater than 2002
Output: SELECT T1.County 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
find the rows of Behavior_Incident table ordered ascending by date_incident_start
Output: SELECT * FROM Behavior_Incident ORDER BY date_incident_start Asc
find the Id of Campuses table for which County equals Los Angeles
Output: SELECT Id FROM Campuses WHERE County = "Los Angeles"
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 contains 4 or stars contains 3
Output: SELECT T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars LIKE 3 OR T2.stars LIKE 4
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 csu_fees's Year 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 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 faculty's Campus of the results of step 1 whose faculty's Year greater than or equals 1935 and csu_fees's Year less than or equals 1939
Output: SELECT T3.Campus 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 > = 1935 AND T2.Year < = 1939
find the average Clean_Jerk in body_builder table
Output: SELECT Avg ( Clean_Jerk ) FROM body_builder
Step 1: find the number of rows of each value of building_description 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_description HAVING Count ( * ) > 2
Step 1: For each row in people table, find the corresponding rows in body_builder table.
Step 2: find the summation of Total in the results of step 1 whose Name contains January
Output: SELECT Sum ( T1.Total ) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Name LIKE "January"
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 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.Undergraduate = 1996 AND T2.Year = "San Jose State University"
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: 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
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 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 T3.Year = "San Jose State University" AND T3.Year = 1996
find the Accreditation_type, Company_name of phone table for which Accreditation_type contains Full
Output: SELECT Accreditation_type , Company_name FROM phone WHERE Accreditation_type LIKE "Full"
Step 1: find the number of rows of each value of apt_type_code in Apartments table.
Step 2: find apt_type_code in Apartments table whose corresponding value in step 1 is greater than 1
Output: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code HAVING Count ( * ) > 1
Step 1: find the Hardware_colours of screen_mode table.
Step 2: find the number of rows in screen_mode table whose Hardware_colours not one of the results of step 1
Output: SELECT Count ( * ) FROM screen_mode WHERE Hardware_colours NOT IN ( SELECT Hardware_colours FROM screen_mode )
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 contains Mike
Output: SELECT T2.stars FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE T1.name LIKE "Mike"
Step 1: find the director of Movie table for which title equals null.
Step 2: find the name of Reviewer table whose rID not one of the results of step 1
Output: SELECT T1.name FROM Reviewer AS T1 WHERE T1.rID NOT IN ( SELECT T2.director FROM Movie AS T2 WHERE T2.title = "null" )
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 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 T1.Type = "Nokia Corporation" AND T1.Type = "Graphics"
Step 1: find the number of rows of each value of apt_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_id HAVING Count ( * ) > 2
Step 1: For each row in Invoices table, find corresponding rows in Orders table and in Financial_Transactions table.
Step 2: find the number of rows of each value of Financial_Transactions's invoice_number in the results of step 1.
Step 3: find Financial_Transactions's invoice_number, date_order_placed of the results of step 1 with largest value in the results of step 2
Output: SELECT T3.invoice_number , T1.date_order_placed FROM Orders AS T1 JOIN Invoices AS T2 ON T1.order_id = T2.order_id JOIN Financial_Transactions AS T3 ON T2.invoice_number = T3.invoice_number GROUP BY T3.invoice_number ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Rating table, find corresponding rows in Movie table and in Reviewer table.
Step 2: find name, title, ratingDate of the results of step 1 ordered ascending by stars
Output: SELECT T2.name , T1.title , T3.ratingDate 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 rows of Ref_Incident_Type table ordered ascending by incident_type_description
Output: SELECT * FROM Ref_Incident_Type ORDER BY incident_type_description Asc
find without repetition the product_color of Products table
Output: SELECT DISTINCT product_color FROM Products
find the number of rows in Accounts table whose account_name equals 337
Output: SELECT Count ( * ) FROM Accounts WHERE account_name = 337
find the Clean_Jerk, Total of body_builder table with largest value of Total
Output: SELECT Clean_Jerk , Total FROM body_builder ORDER BY Total Desc LIMIT 1
Step 1: for each value of city in Addresses table, calculate number of rows.
Step 2: show each value of city in Addresses table along with the corresponding number of rows with largest value in the results of step 1
Output: SELECT city , Count ( * ) FROM Addresses GROUP BY city ORDER BY Count ( * ) Desc LIMIT 1
find the account_id, date_account_opened, other_account_details of Accounts table
Output: SELECT account_id , date_account_opened , other_account_details FROM Accounts
Step 1: For each row in Movie table, find the corresponding rows in Rating table.
Step 2: find the average stars of each value of Rating's mID in the results of step 1.
Step 3: find title in the results of step 1 whose corresponding value in step 2 is greater than or equals 2
Output: SELECT T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T2.mID HAVING Avg ( T2.stars ) > = 2
Step 1: find the number of rows of each value of building_description in Apartment_Buildings table.
Step 2: find building_address in Apartment_Buildings table whose corresponding value in step 1 is greater than 2
Output: SELECT building_address FROM Apartment_Buildings GROUP BY building_description HAVING Count ( * ) > 2
Step 1: find the email_address of Students table.
Step 2: find the email_address of Teachers table.
Step 3: show the rows that are in any of the results of step 1 or the results of step 2
Output: SELECT T1.email_address FROM Students AS T1 UNION SELECT T2.email_address FROM Teachers AS T2
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 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_description = "Columbus Square" AND T1.building_short_name = "Normandie Court"
Step 1: find the product of product table.
Step 2: find the product of product table for which dpi less than or equals 1.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT product FROM product EXCEPT SELECT product FROM product WHERE dpi < = 1
find the Name of people table with largest value of Weight
Output: SELECT Name FROM people ORDER BY Weight Desc LIMIT 1
Step 1: find the number of rows of each value of apt_number in Apartments table.
Step 2: find apt_number of Apartments table with largest value in the results of step 1
Output: SELECT apt_number FROM Apartments GROUP BY apt_number 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 the average CampusFee in the results of step 1 whose faculty's Year equals 2005 and csu_fees's Year equals 1996
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 T2.Year = 1996
Step 1: For each row in Movie table, find the corresponding rows in Rating table.
Step 2: find stars, title of the results of step 1
Output: SELECT T2.stars , T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID
find the Total, Clean_Jerk of body_builder table ordered ascending by Total
Output: SELECT Total , Clean_Jerk FROM body_builder ORDER BY Total Asc
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in enrollments table.
Step 2: find CampusFee of the results of step 1 whose enrollments's Year 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 enrollments AS T3 ON T1.Id = T3.Campus WHERE T3.Year = 1996 AND T2.Year = "San Jose State University"
Step 1: For each row in Reviewer table, find the corresponding rows in Rating table.
Step 2: find Rating's rID of the results of step 1 whose name equals Mike
Output: SELECT T2.rID FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE T1.name = "Mike"
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 Type equals Graphics and Accreditation_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 T1.Type = "Graphics" AND T2.Accreditation_type = "Nokia Corporation"
find the number of rows in Customers table whose first_name equals Ray and last_name equals Bernhard
Output: SELECT Count ( * ) FROM Customers WHERE first_name = "Ray" AND last_name = "Bernhard"
find the number of rows in faculty table whose Campus equals 2004 and Year equals San Francisco State University
Output: SELECT Count ( * ) FROM faculty WHERE Campus = 2004 AND Year = "San Francisco State University"
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 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.Graduate = 1996 AND T3.Year = "San Jose State University"
find the title of Movie table with largest value of year
Output: SELECT title FROM Movie ORDER BY year Desc LIMIT 1
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 Campuses's Year 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 T1.Id = T2.Campus WHERE T1.Year = 1996 AND T2.Year = "San Jose State University"
find each value of Headquartered_City in district table along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , Headquartered_City FROM district GROUP BY Headquartered_City
find the apt_number of Apartments table ordered ascending by bathroom_count
Output: SELECT apt_number 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 csu_fees'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 T2.Year = 2005 AND T3.Campus = 1
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 equals 2.
Step 3: find name of the results of step 1 whose stars greater than or equals 3.
Step 4: show the rows that are in any of the results of step 2 or the results of step 3
Output: SELECT T1.name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE T2.stars = 2 UNION SELECT T1.name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE T2.stars > = 3
Step 1: find the number of rows of each value of dimensions in product table.
Step 2: find dimensions in product table whose corresponding value in step 1 is greater than 3
Output: SELECT dimensions FROM product GROUP BY dimensions HAVING Count ( * ) > 3
find the minimum Height in people table
Output: SELECT Min ( Height ) FROM people
find the building_full_name of Apartment_Buildings table for which building_short_name contains court
Output: SELECT building_full_name FROM Apartment_Buildings WHERE building_short_name LIKE "court"
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 faculty'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 T3.Campus ORDER BY Avg ( T2.Degrees ) Desc LIMIT 1
Step 1: For each row in Campuses table, find corresponding rows in enrollments table and in faculty table.
Step 2: find the average FTE_AY in the results of step 1 whose faculty's Year equals 2005 and Faculty equals 357.1
Output: SELECT Avg ( T2.FTE_AY ) FROM Campuses AS T1 JOIN enrollments AS T2 ON T2.Campus = T1.Id JOIN faculty AS T3 ON T1.Id = T3.Campus WHERE T3.Year = 2005 AND T3.Faculty = 357.1
find the cell_mobile_phone_number, email_address of Customers table for which amount_outstanding greater than 2000
Output: SELECT cell_mobile_phone_number , email_address FROM Customers WHERE amount_outstanding > 2000
Step 1: For each row in Campuses table, find corresponding rows in discipline_enrollments table and in faculty table.
Step 2: find Graduate of the results of step 1 whose faculty's Campus equals 2001 and faculty's Year equals San Francisco State University
Output: SELECT 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.Campus = 2001 AND T3.Year = "San Francisco State University"
find the Headquartered_City of district table for which District_name equals Blackville
Output: SELECT Headquartered_City FROM district WHERE District_name = "Blackville"
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
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
Step 1: For each row in screen_mode table, find the corresponding rows in phone table.
Step 2: find Company_name of the results of step 1 whose Type equals Graphics and Accreditation_type equals Nokia Corporation
Output: SELECT T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = "Graphics" AND T2.Accreditation_type = "Nokia Corporation"
Step 1: find the number of rows of each value of incident_type_code in Ref_Incident_Type table.
Step 2: find incident_type_code, incident_type_description of Ref_Incident_Type table with smallest value in the results of step 1
Output: SELECT incident_type_code , incident_type_description FROM Ref_Incident_Type GROUP BY incident_type_code ORDER BY Count ( * ) Asc LIMIT 1
Step 1: find the Model_name of chip_model table.
Step 2: For each row in phone table, find corresponding rows in chip_model table and in screen_mode table.
Step 3: find Model_name of the results of step 2 whose Type equals Full.
Step 4: show the rows that are in the results of step 1 but not in the results of step 3
Output: SELECT T1.Model_name FROM chip_model AS T1 EXCEPT SELECT T1.Model_name 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 T2.Type = "Full"
Step 1: For each row in chip_model table, find the corresponding rows in phone table.
Step 2: find Bluetooth, Company_name of the results of step 1 whose Accreditation_type contains Full
Output: SELECT T1.Bluetooth , T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Accreditation_type LIKE "Full"
Step 1: For each row in screen_mode table, find the corresponding rows in phone table.
Step 2: find Company_name of the results of step 1 whose Type equals Graphics and Type equals Nokia Corporation
Output: SELECT T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = "Nokia Corporation" AND T1.Type = "Graphics"
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 Campuses'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 T1.Year > 1950 AND T2.Year > 2002
Step 1: find the number of rows of each value of incident_type_code in Ref_Incident_Type table.
Step 2: find incident_type_code, incident_type_description of Ref_Incident_Type table with largest value in the results of step 1
Output: SELECT incident_type_code , incident_type_description FROM Ref_Incident_Type GROUP BY incident_type_code ORDER BY Count ( * ) Desc LIMIT 1
find the building_address, building_phone of Apartment_Buildings table for which building_short_name equals Brenden
Output: SELECT building_address , building_phone FROM Apartment_Buildings WHERE building_short_name = "Brenden"
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 County equals Los Angeles and faculty's Year greater than 1950 and faculty's Year greater than 2002
Output: SELECT T1.County 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
find the minimum Clean_Jerk in body_builder table
Output: SELECT Min ( Clean_Jerk ) FROM body_builder
Step 1: For each row in phone table, find corresponding rows in chip_model table and in screen_mode table.
Step 2: find Company_name of the results of step 1 whose Type equals Text and RAM_MiB greater than 32
Output: SELECT T3.Company_name 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 AND T1.Model_name = T3.chip_model WHERE T2.Type = "Text" AND T1.RAM_MiB > 32
find the number of rows in Apartments table whose apt_number contains Columbus Square
Output: SELECT Count ( * ) FROM Apartments WHERE apt_number LIKE "Columbus Square"
find the maximum bathroom_count and the maximum bathroom_count in Apartments table
Output: SELECT Max ( bathroom_count ) , Max ( bathroom_count ) FROM Apartments
Step 1: For each row in Reviewer table, find the corresponding rows in Rating table.
Step 2: find name, name 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 , T1.name 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
find product of product table whose dpi less than 5 or dpi less than A4
Output: SELECT product FROM product WHERE dpi < "A4" OR dpi < 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 Undergraduate of each value of csu_fees's Year in the results of step 1.
Step 3: find discipline_enrollments's Year of the results of step 1 with largest value in the results of step 2
Output: SELECT T3.Year FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN discipline_enrollments AS T3 ON T1.Id = T3.Campus GROUP BY T2.Year ORDER BY Avg ( T3.Undergraduate ) Desc LIMIT 1
Step 1: For each row in Movie table, find the corresponding rows in Rating table.
Step 2: find the average stars of each value of title in the results of step 1.
Step 3: find title in the results of step 1 whose corresponding value in step 2 is greater than 2
Output: SELECT T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.title HAVING Avg ( T2.stars ) > 2
find the Model_name of chip_model table for which Launch_year equals 2002 with largest value of RAM_MiB
Output: SELECT Model_name FROM chip_model WHERE Launch_year = 2002 ORDER BY RAM_MiB Desc LIMIT 1
find the average CampusFee in csu_fees table whose Year equals 2005 and Year equals 1996
Output: SELECT Avg ( CampusFee ) FROM csu_fees WHERE Year = 1996 AND Year = 2005
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 Company_name 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.Company_name = "Graphics" AND T1.Type = "Nokia Corporation"
find the average screen_mode in phone table whose Company_name equals Nokia Corporation
Output: SELECT Avg ( screen_mode ) FROM phone WHERE Company_name = "Nokia Corporation"
find the number of rows in Customers table
Output: SELECT Count ( * ) FROM Customers
Step 1: For each row in Apartment_Bookings table, find corresponding rows in Apartments table and in Guests table.
Step 2: find apt_type_code, apt_number of the results of step 1 whose guest_first_name equals Kyle
Output: SELECT T1.apt_type_code , T1.apt_number FROM Apartments AS T1 JOIN Guests AS T2 JOIN Apartment_Bookings AS T3 ON T1.apt_id = T3.apt_id AND T3.guest_id = T2.guest_id WHERE T2.guest_first_name = "Kyle"
find the number of rows in Movie table
Output: SELECT Count ( * ) FROM Movie
Step 1: For each row in Campuses table, find corresponding rows in csu_fees table and in degrees table.
Step 2: find the average Degrees of each value of csu_fees's Year in the results of step 1.
Step 3: find csu_fees's Year of the results of step 1 with largest value in the results of step 2
Output: SELECT T2.Year FROM Campuses AS T1 JOIN csu_fees AS T2 ON T2.Campus = T1.Id JOIN degrees AS T3 ON T1.Id = T3.Campus GROUP BY T2.Year ORDER BY Avg ( T3.Degrees ) Desc LIMIT 1
find the number of rows in Addresses table
Output: SELECT Count ( * ) FROM Addresses
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_address 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_address = "Columbus Square" AND T1.building_short_name = "Normandie Court"
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 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 = 2005 AND T3.Faculty = 357.1
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'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 T2.Year = 2005 AND T3.Year = 2002
find the City_Population of district table for which District_name equals Blackville
Output: SELECT City_Population FROM district WHERE District_name = "Blackville"
Step 1: find the number of rows of each value of customer_id in Customers table.
Step 2: find customer_last_name, customer_id, phone_number of Customers table with largest value in the results of step 1
Output: SELECT customer_last_name , customer_id , phone_number FROM Customers GROUP BY customer_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 the average CampusFee in the results of step 1 whose csu_fees's Year equals 2005 and discipline_enrollments's Campus equals 1
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.Campus = 1
find the bedroom_count of Apartments table ordered ascending by bathroom_count
Output: SELECT bedroom_count FROM Apartments ORDER BY bathroom_count Asc
Step 1: For each row in Campuses table, find the corresponding rows in enrollments table.
Step 2: find Campuses's Campus of the results of step 1 whose County equals Los Angeles and Campuses's Year greater than 1950 and enrollments's Year greater than 1956
Output: SELECT T1.Campus FROM Campuses AS T1 JOIN enrollments AS T2 ON T1.Id = T2.Campus WHERE T1.County = "Los Angeles" AND T1.Year > 1950 AND T2.Year > 1956
Step 1: For each row in Movie table, find the corresponding rows in Rating table.
Step 2: find director, title of the results of step 1 with largest value of stars
Output: SELECT T1.director , T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID ORDER BY T2.stars Desc LIMIT 1
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 County equals San Jose State University and faculty's Year equals 2000
Output: SELECT Sum ( T2.Graduate ) FROM Campuses AS T1 JOIN discipline_enrollments AS T2 ON T1.Id = T2.Campus JOIN faculty AS T3 ON T1.Id = T3.Campus WHERE T1.County = "San Jose State University" AND T3.Year = 2000
find the used_kb of screen_mode table for which Type equals Graphics
Output: SELECT used_kb FROM screen_mode WHERE Type = "Graphics"
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 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 = 1996
find the number of rows in Staff table whose first_name contains a
Output: SELECT Count ( * ) FROM Staff WHERE first_name LIKE "a"
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 contains Columbus Square
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 LIKE "Columbus Square"
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
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 = "Columbus Square"
find the number of rows in Apartment_Facilities table whose facility_code equals Gym
Output: SELECT Count ( * ) FROM Apartment_Facilities WHERE facility_code = "Gym"
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 2000
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 = 2000
find the average Ranking in store table
Output: SELECT Avg ( Ranking ) FROM store
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 discipline_enrollments's Year 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.Year = 1996 AND T2.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 csu_fees's Year equals 1996 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 T2.Year = 1996 AND T3.Year = 2002
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 equals 2.
Step 3: For each row in Movie table, find the corresponding rows in Rating table.
Step 4: find director, title 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 FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE T2.stars = 2 INTERSECT SELECT T3.director , T3.title FROM Movie AS T3 JOIN Rating AS T2 ON T3.mID = T2.mID WHERE T2.stars = 5
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.
Step 3: only show the first 3 rows of the results
Output: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY Avg ( bathroom_count ) Desc LIMIT 3
Step 1: For each row in phone table, find corresponding rows in chip_model table and in screen_mode table.
Step 2: find Model_name of the results of step 1 whose Type equals Text.
Step 3: find Model_name of the results of step 1 whose Type equals Nokia Corporation.
Step 4: show the rows that are in the results of step 2 but not in the results of step 3
Output: SELECT T1.Model_name 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 T2.Type = "Text" EXCEPT SELECT T1.Model_name 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 T2.Type = "Nokia Corporation"
Step 1: For each row in screen_mode table, find the corresponding rows in phone table.
Step 2: find Hardware_colours, Char_cells of the results of step 1 whose Company_name equals LG-P760
Output: SELECT T1.Hardware_colours , T1.Char_cells FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Company_name = "LG-P760"
find without repetition the name of Reviewer table
Output: SELECT DISTINCT name FROM Reviewer
Step 1: For each row in Campuses table, find corresponding rows in degrees table and in discipline_enrollments table.
Step 2: find the average Degrees of each value of degrees's Year in the results of step 1.
Step 3: find discipline_enrollments's Year of the results of step 1 with largest value in the results of step 2
Output: SELECT T3.Year FROM Campuses AS T1 JOIN degrees AS T2 ON T2.Campus = T1.Id JOIN discipline_enrollments AS T3 ON T1.Id = T3.Campus GROUP BY T2.Year ORDER BY Avg ( T2.Degrees ) Desc LIMIT 1
find CampusFee of csu_fees table whose Year equals 1996 and Year equals San Jose State University
Output: SELECT CampusFee FROM csu_fees WHERE Year = "San Jose State University" AND Year = 1996
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 equals 2.
Step 3: For each row in Movie table, find the corresponding rows in Rating table.
Step 4: find director, 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.name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE T2.stars = 2 INTERSECT SELECT T3.director , T2.stars 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 the corresponding rows in faculty table.
Step 2: find Campuses's Campus of the results of step 1 whose Campuses's Campus 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.Campus = "Los Angeles" AND T2.Year > 2002 AND T2.Year > 1950
Step 1: find the chip_model of phone table.
Step 2: find the average Hardware_colours in screen_mode table whose Hardware_colours not one of the results of step 1
Output: SELECT Avg ( T1.Hardware_colours ) FROM screen_mode AS T1 WHERE T1.Hardware_colours NOT IN ( SELECT T2.chip_model FROM phone AS T2 )
Step 1: For each row in Campuses table, find corresponding rows in discipline_enrollments table and in faculty table.
Step 2: find Graduate of the results of step 1 whose Campuses's Campus equals San Francisco State University and faculty's Year equals 2001
Output: SELECT T2.Graduate FROM Campuses AS T1 JOIN discipline_enrollments AS T2 ON T1.Id = T2.Campus JOIN faculty AS T3 ON T1.Id = T3.Campus WHERE T1.Campus = "San Francisco State University" AND T3.Year = 2001
Step 1: For each row in Addresses table, find the corresponding rows in Customers table.
Step 2: find country of the results of step 1 whose first_name equals Janessa and state_province_county equals Sawayn
Output: SELECT T1.country FROM Addresses AS T1 JOIN Customers AS T2 ON T1.address_id = T2.customer_address_id WHERE T2.first_name = "Janessa" AND T1.state_province_county = "Sawayn"
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 contains Columbus Square
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 LIKE "Columbus Square"
Step 1: For each row in Movie table, find the corresponding rows in Rating table.
Step 2: find the summation of stars of each value of Rating's mID in the results of step 1.
Step 3: find title of step 1 results with largest value in the results of step 2
Output: SELECT T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T2.mID ORDER BY Sum ( T2.stars ) 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 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 faculty AS T3 ON T1.Id = T3.Campus WHERE T3.Year = 1996 AND T2.Year = "San Jose State University"
find the middle_name, last_name of Staff table
Output: SELECT middle_name , last_name FROM Staff
find the District_name of district table with largest value of City_Population
Output: SELECT District_name FROM district ORDER BY City_Population Desc LIMIT 1
find the bedroom_count of Apartments table for which apt_type_code equals Flat
Output: SELECT bedroom_count FROM Apartments WHERE apt_type_code = "Flat"