Unnamed: 0
int64 0
60k
| input
stringlengths 76
562
| answer
stringlengths 18
557
|
---|---|---|
700 | <question>: Show the start dates and end dates of all the apartment bookings made by guests with gender code "Female". <context>: CREATE TABLE Apartment_Bookings (booking_start_date VARCHAR, guest_id VARCHAR); CREATE TABLE Guests (guest_id VARCHAR, gender_code VARCHAR) | SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" |
701 | <question>: Show the first names and last names of all the guests that have apartment bookings with status code "Confirmed". <context>: CREATE TABLE Apartment_Bookings (guest_id VARCHAR, booking_status_code VARCHAR); CREATE TABLE Guests (guest_first_name VARCHAR, guest_last_name VARCHAR, guest_id VARCHAR) | SELECT T2.guest_first_name, T2.guest_last_name FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = "Confirmed" |
702 | <question>: Show the facility codes of apartments with more than 4 bedrooms. <context>: CREATE TABLE Apartment_Facilities (facility_code VARCHAR, apt_id VARCHAR); CREATE TABLE Apartments (apt_id VARCHAR, bedroom_count INTEGER) | SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 |
703 | <question>: Show the total number of rooms of all apartments with facility code "Gym". <context>: CREATE TABLE Apartments (room_count INTEGER, apt_id VARCHAR); CREATE TABLE Apartment_Facilities (apt_id VARCHAR, facility_code VARCHAR) | SELECT SUM(T2.room_count) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = "Gym" |
704 | <question>: Show the total number of rooms of the apartments in the building with short name "Columbus Square". <context>: CREATE TABLE Apartment_Buildings (building_id VARCHAR, building_short_name VARCHAR); CREATE TABLE Apartments (room_count INTEGER, building_id VARCHAR) | SELECT SUM(T2.room_count) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = "Columbus Square" |
705 | <question>: Show the addresses of the buildings that have apartments with more than 2 bathrooms. <context>: CREATE TABLE Apartment_Buildings (building_address VARCHAR, building_id VARCHAR); CREATE TABLE Apartments (building_id VARCHAR, bathroom_count INTEGER) | SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.bathroom_count > 2 |
706 | <question>: Show the apartment type codes and apartment numbers in the buildings managed by "Kyle". <context>: CREATE TABLE Apartment_Buildings (building_id VARCHAR, building_manager VARCHAR); CREATE TABLE Apartments (apt_type_code VARCHAR, apt_number VARCHAR, building_id VARCHAR) | SELECT T2.apt_type_code, T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Kyle" |
707 | <question>: Show the booking status code and the corresponding number of bookings. <context>: CREATE TABLE Apartment_Bookings (booking_status_code VARCHAR) | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code |
708 | <question>: Return all the apartment numbers sorted by the room count in ascending order. <context>: CREATE TABLE Apartments (apt_number VARCHAR, room_count VARCHAR) | SELECT apt_number FROM Apartments ORDER BY room_count |
709 | <question>: Return the apartment number with the largest number of bedrooms. <context>: CREATE TABLE Apartments (apt_number VARCHAR, bedroom_count VARCHAR) | SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1 |
710 | <question>: Show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending order. <context>: CREATE TABLE Apartments (apt_type_code VARCHAR) | SELECT apt_type_code, COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) |
711 | <question>: Show the top 3 apartment type codes sorted by the average number of rooms in descending order. <context>: CREATE TABLE Apartments (apt_type_code VARCHAR, room_count INTEGER) | SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY AVG(room_count) DESC LIMIT 3 |
712 | <question>: Show the apartment type code that has the largest number of total rooms, together with the number of bathrooms and number of bedrooms. <context>: CREATE TABLE Apartments (apt_type_code VARCHAR, bathroom_count VARCHAR, bedroom_count VARCHAR, room_count INTEGER) | SELECT apt_type_code, bathroom_count, bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY SUM(room_count) DESC LIMIT 1 |
713 | <question>: Show the most common apartment type code. <context>: CREATE TABLE Apartments (apt_type_code VARCHAR) | SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1 |
714 | <question>: Show the most common apartment type code among apartments with more than 1 bathroom. <context>: CREATE TABLE Apartments (apt_type_code VARCHAR, bathroom_count INTEGER) | SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1 |
715 | <question>: Show each apartment type code, and the maximum and minimum number of rooms for each type. <context>: CREATE TABLE Apartments (apt_type_code VARCHAR, room_count INTEGER) | SELECT apt_type_code, MAX(room_count), MIN(room_count) FROM Apartments GROUP BY apt_type_code |
716 | <question>: Show each gender code and the corresponding count of guests sorted by the count in descending order. <context>: CREATE TABLE Guests (gender_code VARCHAR) | SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC |
717 | <question>: How many apartments do not have any facility? <context>: CREATE TABLE Apartment_Facilities (apt_id VARCHAR); CREATE TABLE Apartments (apt_id VARCHAR) | SELECT COUNT(*) FROM Apartments WHERE NOT apt_id IN (SELECT apt_id FROM Apartment_Facilities) |
718 | <question>: Show the apartment numbers of apartments with bookings that have status code both "Provisional" and "Confirmed" <context>: CREATE TABLE Apartments (apt_number VARCHAR, apt_id VARCHAR); CREATE TABLE Apartment_Bookings (apt_id VARCHAR, booking_status_code VARCHAR) | SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Confirmed" INTERSECT SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional" |
719 | <question>: Show the apartment numbers of apartments with unit status availability of both 0 and 1. <context>: CREATE TABLE View_Unit_Status (apt_id VARCHAR, available_yn VARCHAR); CREATE TABLE Apartments (apt_number VARCHAR, apt_id VARCHAR) | SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 0 INTERSECT SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 1 |
720 | <question>: How many games are held after season 2007? <context>: CREATE TABLE game (season INTEGER) | SELECT COUNT(*) FROM game WHERE season > 2007 |
721 | <question>: List the dates of games by the home team name in descending order. <context>: CREATE TABLE game (Date VARCHAR, home_team VARCHAR) | SELECT Date FROM game ORDER BY home_team DESC |
722 | <question>: List the season, home team, away team of all the games. <context>: CREATE TABLE game (season VARCHAR, home_team VARCHAR, away_team VARCHAR) | SELECT season, home_team, away_team FROM game |
723 | <question>: What are the maximum, minimum and average home games each stadium held? <context>: CREATE TABLE stadium (home_games INTEGER) | SELECT MAX(home_games), MIN(home_games), AVG(home_games) FROM stadium |
724 | <question>: What is the average attendance of stadiums with capacity percentage higher than 100%? <context>: CREATE TABLE stadium (average_attendance VARCHAR, capacity_percentage INTEGER) | SELECT average_attendance FROM stadium WHERE capacity_percentage > 100 |
725 | <question>: What are the player name, number of matches, and information source for players who do not suffer from injury of 'Knee problem'? <context>: CREATE TABLE injury_accident (player VARCHAR, number_of_matches VARCHAR, SOURCE VARCHAR, injury VARCHAR) | SELECT player, number_of_matches, SOURCE FROM injury_accident WHERE injury <> 'Knee problem' |
726 | <question>: What is the season of the game which causes the player 'Walter Samuel' to get injured? <context>: CREATE TABLE injury_accident (game_id VARCHAR, player VARCHAR); CREATE TABLE game (season VARCHAR, id VARCHAR) | SELECT T1.season FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id WHERE T2.player = 'Walter Samuel' |
727 | <question>: What are the ids, scores, and dates of the games which caused at least two injury accidents? <context>: CREATE TABLE game (id VARCHAR, score VARCHAR, date VARCHAR); CREATE TABLE injury_accident (game_id VARCHAR) | SELECT T1.id, T1.score, T1.date FROM game AS T1 JOIN injury_accident AS T2 ON T2.game_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2 |
728 | <question>: What are the id and name of the stadium where the most injury accidents happened? <context>: CREATE TABLE stadium (id VARCHAR, name VARCHAR); CREATE TABLE injury_accident (game_id VARCHAR); CREATE TABLE game (stadium_id VARCHAR, id VARCHAR) | SELECT T1.id, T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1 |
729 | <question>: In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'? <context>: CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE injury_accident (game_id VARCHAR, injury VARCHAR); CREATE TABLE game (season VARCHAR, stadium_id VARCHAR, id VARCHAR) | SELECT T1.season, T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.injury = 'Foot injury' OR T3.injury = 'Knee problem' |
730 | <question>: How many different kinds of information sources are there for injury accidents? <context>: CREATE TABLE injury_accident (SOURCE VARCHAR) | SELECT COUNT(DISTINCT SOURCE) FROM injury_accident |
731 | <question>: How many games are free of injury accidents? <context>: CREATE TABLE injury_accident (id VARCHAR, game_id VARCHAR); CREATE TABLE game (id VARCHAR, game_id VARCHAR) | SELECT COUNT(*) FROM game WHERE NOT id IN (SELECT game_id FROM injury_accident) |
732 | <question>: How many distinct kinds of injuries happened after season 2010? <context>: CREATE TABLE injury_accident (injury VARCHAR, game_id VARCHAR); CREATE TABLE game (id VARCHAR, season INTEGER) | SELECT COUNT(DISTINCT T1.injury) FROM injury_accident AS T1 JOIN game AS T2 ON T1.game_id = T2.id WHERE T2.season > 2010 |
733 | <question>: List the name of the stadium where both the player 'Walter Samuel' and the player 'Thiago Motta' got injured. <context>: CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE game (stadium_id VARCHAR, id VARCHAR); CREATE TABLE injury_accident (game_id VARCHAR, player VARCHAR) | SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Walter Samuel' INTERSECT SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Thiago Motta' |
734 | <question>: Show the name, average attendance, total attendance for stadiums where no accidents happened. <context>: CREATE TABLE stadium (name VARCHAR, average_attendance VARCHAR, total_attendance VARCHAR, id VARCHAR); CREATE TABLE stadium (name VARCHAR, average_attendance VARCHAR, total_attendance VARCHAR); CREATE TABLE game (stadium_id VARCHAR, id VARCHAR); CREATE TABLE injury_accident (game_id VARCHAR) | SELECT name, average_attendance, total_attendance FROM stadium EXCEPT SELECT T2.name, T2.average_attendance, T2.total_attendance FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id |
735 | <question>: Which stadium name contains the substring "Bank"? <context>: CREATE TABLE stadium (name VARCHAR) | SELECT name FROM stadium WHERE name LIKE "%Bank%" |
736 | <question>: How many games has each stadium held? <context>: CREATE TABLE stadium (id VARCHAR); CREATE TABLE game (stadium_id VARCHAR) | SELECT T1.id, COUNT(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id |
737 | <question>: For each injury accident, find the date of the game and the name of the injured player in the game, and sort the results in descending order of game season. <context>: CREATE TABLE game (date VARCHAR, id VARCHAR, season VARCHAR); CREATE TABLE injury_accident (player VARCHAR, game_id VARCHAR) | SELECT T1.date, T2.player FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id ORDER BY T1.season DESC |
738 | <question>: List all country and league names. <context>: CREATE TABLE League (name VARCHAR, country_id VARCHAR); CREATE TABLE Country (name VARCHAR, id VARCHAR) | SELECT T1.name, T2.name FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id |
739 | <question>: How many leagues are there in England? <context>: CREATE TABLE League (country_id VARCHAR); CREATE TABLE Country (id VARCHAR, name VARCHAR) | SELECT COUNT(*) FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id WHERE T1.name = "England" |
740 | <question>: What is the average weight of all players? <context>: CREATE TABLE Player (weight INTEGER) | SELECT AVG(weight) FROM Player |
741 | <question>: What is the maximum and minimum height of all players? <context>: CREATE TABLE Player (weight INTEGER) | SELECT MAX(weight), MIN(weight) FROM Player |
742 | <question>: List all player names who have an overall rating higher than the average. <context>: CREATE TABLE Player (player_name VARCHAR, player_api_id VARCHAR); CREATE TABLE Player_Attributes (overall_rating INTEGER); CREATE TABLE Player_Attributes (player_api_id VARCHAR, overall_rating INTEGER) | SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.overall_rating > (SELECT AVG(overall_rating) FROM Player_Attributes) |
743 | <question>: What are the names of players who have the best dribbling? <context>: CREATE TABLE Player (player_name VARCHAR, player_api_id VARCHAR); CREATE TABLE Player_Attributes (player_api_id VARCHAR, dribbling VARCHAR); CREATE TABLE Player_Attributes (overall_rating INTEGER) | SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.dribbling = (SELECT MAX(overall_rating) FROM Player_Attributes) |
744 | <question>: List the names of all players who have a crossing score higher than 90 and prefer their right foot. <context>: CREATE TABLE Player (player_name VARCHAR, player_api_id VARCHAR); CREATE TABLE Player_Attributes (player_api_id VARCHAR, crossing VARCHAR, preferred_foot VARCHAR) | SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.crossing > 90 AND T2.preferred_foot = "right" |
745 | <question>: List the names of all left-footed players who have overall rating between 85 and 90. <context>: CREATE TABLE Player (player_name VARCHAR, player_api_id VARCHAR); CREATE TABLE Player_Attributes (player_api_id VARCHAR, overall_rating VARCHAR, preferred_foot VARCHAR) | SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.preferred_foot = "left" AND T2.overall_rating >= 85 AND T2.overall_rating <= 90 |
746 | <question>: What is the average rating for right-footed players and left-footed players? <context>: CREATE TABLE Player_Attributes (preferred_foot VARCHAR, overall_rating INTEGER) | SELECT preferred_foot, AVG(overall_rating) FROM Player_Attributes GROUP BY preferred_foot |
747 | <question>: Of all players with an overall rating greater than 80, how many are right-footed and left-footed? <context>: CREATE TABLE Player_Attributes (preferred_foot VARCHAR, overall_rating INTEGER) | SELECT preferred_foot, COUNT(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot |
748 | <question>: List all of the player ids with a height of at least 180cm and an overall rating higher than 85. <context>: CREATE TABLE Player_Attributes (player_api_id VARCHAR, height VARCHAR, overall_rating INTEGER); CREATE TABLE Player (player_api_id VARCHAR, height VARCHAR, overall_rating INTEGER) | SELECT player_api_id FROM Player WHERE height >= 180 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE overall_rating > 85 |
749 | <question>: List all of the ids for left-footed players with a height between 180cm and 190cm. <context>: CREATE TABLE Player_Attributes (player_api_id VARCHAR, preferred_foot VARCHAR, height VARCHAR); CREATE TABLE Player (player_api_id VARCHAR, preferred_foot VARCHAR, height VARCHAR) | SELECT player_api_id FROM Player WHERE height >= 180 AND height <= 190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot = "left" |
750 | <question>: Who are the top 3 players in terms of overall rating? <context>: CREATE TABLE Player (player_name VARCHAR, player_api_id VARCHAR); CREATE TABLE Player_Attributes (player_api_id VARCHAR) | SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY overall_rating DESC LIMIT 3 |
751 | <question>: List the names and birthdays of the top five players in terms of potential. <context>: CREATE TABLE Player_Attributes (player_api_id VARCHAR); CREATE TABLE Player (player_name VARCHAR, birthday VARCHAR, player_api_id VARCHAR) | SELECT DISTINCT T1.player_name, T1.birthday FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY potential DESC LIMIT 5 |
752 | <question>: How many performances are there? <context>: CREATE TABLE performance (Id VARCHAR) | SELECT COUNT(*) FROM performance |
753 | <question>: List the hosts of performances in ascending order of attendance. <context>: CREATE TABLE performance (HOST VARCHAR, Attendance VARCHAR) | SELECT HOST FROM performance ORDER BY Attendance |
754 | <question>: What are the dates and locations of performances? <context>: CREATE TABLE performance (Date VARCHAR, LOCATION VARCHAR) | SELECT Date, LOCATION FROM performance |
755 | <question>: Show the attendances of the performances at location "TD Garden" or "Bell Centre" <context>: CREATE TABLE performance (Attendance VARCHAR, LOCATION VARCHAR) | SELECT Attendance FROM performance WHERE LOCATION = "TD Garden" OR LOCATION = "Bell Centre" |
756 | <question>: What is the average number of attendees for performances? <context>: CREATE TABLE performance (Attendance INTEGER) | SELECT AVG(Attendance) FROM performance |
757 | <question>: What is the date of the performance with the highest number of attendees? <context>: CREATE TABLE performance (Date VARCHAR, Attendance VARCHAR) | SELECT Date FROM performance ORDER BY Attendance DESC LIMIT 1 |
758 | <question>: Show different locations and the number of performances at each location. <context>: CREATE TABLE performance (LOCATION VARCHAR) | SELECT LOCATION, COUNT(*) FROM performance GROUP BY LOCATION |
759 | <question>: Show the most common location of performances. <context>: CREATE TABLE performance (LOCATION VARCHAR) | SELECT LOCATION FROM performance GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1 |
760 | <question>: Show the locations that have at least two performances. <context>: CREATE TABLE performance (LOCATION VARCHAR) | SELECT LOCATION FROM performance GROUP BY LOCATION HAVING COUNT(*) >= 2 |
761 | <question>: Show the locations that have both performances with more than 2000 attendees and performances with less than 1000 attendees. <context>: CREATE TABLE performance (LOCATION VARCHAR, Attendance INTEGER) | SELECT LOCATION FROM performance WHERE Attendance > 2000 INTERSECT SELECT LOCATION FROM performance WHERE Attendance < 1000 |
762 | <question>: Show the names of members and the location of the performances they attended. <context>: CREATE TABLE performance (Location VARCHAR, Performance_ID VARCHAR); CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE member_attendance (Member_ID VARCHAR, Performance_ID VARCHAR) | SELECT T2.Name, T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID |
763 | <question>: Show the names of members and the location of performances they attended in ascending alphabetical order of their names. <context>: CREATE TABLE performance (Location VARCHAR, Performance_ID VARCHAR); CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE member_attendance (Member_ID VARCHAR, Performance_ID VARCHAR) | SELECT T2.Name, T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T2.Name |
764 | <question>: Show the dates of performances with attending members whose roles are "Violin". <context>: CREATE TABLE performance (Date VARCHAR, Performance_ID VARCHAR); CREATE TABLE member (Member_ID VARCHAR, Role VARCHAR); CREATE TABLE member_attendance (Member_ID VARCHAR, Performance_ID VARCHAR) | SELECT T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID WHERE T2.Role = "Violin" |
765 | <question>: Show the names of members and the dates of performances they attended in descending order of attendance of the performances. <context>: CREATE TABLE performance (Date VARCHAR, Performance_ID VARCHAR, Attendance VARCHAR); CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE member_attendance (Member_ID VARCHAR, Performance_ID VARCHAR) | SELECT T2.Name, T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T3.Attendance DESC |
766 | <question>: List the names of members who did not attend any performance. <context>: CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE member_attendance (Name VARCHAR, Member_ID VARCHAR) | SELECT Name FROM member WHERE NOT Member_ID IN (SELECT Member_ID FROM member_attendance) |
767 | <question>: Find the buildings which have rooms with capacity more than 50. <context>: CREATE TABLE classroom (building VARCHAR, capacity INTEGER) | SELECT DISTINCT building FROM classroom WHERE capacity > 50 |
768 | <question>: Count the number of rooms that are not in the Lamberton building. <context>: CREATE TABLE classroom (building VARCHAR) | SELECT COUNT(*) FROM classroom WHERE building <> 'Lamberton' |
769 | <question>: What is the name and building of the departments whose budget is more than the average budget? <context>: CREATE TABLE department (dept_name VARCHAR, building VARCHAR, budget INTEGER) | SELECT dept_name, building FROM department WHERE budget > (SELECT AVG(budget) FROM department) |
770 | <question>: Find the room number of the rooms which can sit 50 to 100 students and their buildings. <context>: CREATE TABLE classroom (building VARCHAR, room_number VARCHAR, capacity INTEGER) | SELECT building, room_number FROM classroom WHERE capacity BETWEEN 50 AND 100 |
771 | <question>: Find the name and building of the department with the highest budget. <context>: CREATE TABLE department (dept_name VARCHAR, building VARCHAR, budget VARCHAR) | SELECT dept_name, building FROM department ORDER BY budget DESC LIMIT 1 |
772 | <question>: What is the name of the student who has the highest total credits in the History department. <context>: CREATE TABLE student (name VARCHAR, dept_name VARCHAR, tot_cred VARCHAR) | SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1 |
773 | <question>: How many rooms does the Lamberton building have? <context>: CREATE TABLE classroom (building VARCHAR) | SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton' |
774 | <question>: How many students have advisors? <context>: CREATE TABLE advisor (s_id VARCHAR) | SELECT COUNT(DISTINCT s_id) FROM advisor |
775 | <question>: How many departments offer courses? <context>: CREATE TABLE course (dept_name VARCHAR) | SELECT COUNT(DISTINCT dept_name) FROM course |
776 | <question>: How many different courses offered by Physics department? <context>: CREATE TABLE course (course_id VARCHAR, dept_name VARCHAR) | SELECT COUNT(DISTINCT course_id) FROM course WHERE dept_name = 'Physics' |
777 | <question>: Find the title of courses that have two prerequisites? <context>: CREATE TABLE prereq (course_id VARCHAR); CREATE TABLE course (title VARCHAR, course_id VARCHAR) | SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) = 2 |
778 | <question>: Find the title, credit, and department name of courses that have more than one prerequisites? <context>: CREATE TABLE prereq (course_id VARCHAR); CREATE TABLE course (title VARCHAR, credits VARCHAR, dept_name VARCHAR, course_id VARCHAR) | SELECT T1.title, T1.credits, T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) > 1 |
779 | <question>: How many courses that do not have prerequisite? <context>: CREATE TABLE prereq (course_id VARCHAR); CREATE TABLE course (course_id VARCHAR) | SELECT COUNT(*) FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq) |
780 | <question>: Find the name of the courses that do not have any prerequisite? <context>: CREATE TABLE prereq (title VARCHAR, course_id VARCHAR); CREATE TABLE course (title VARCHAR, course_id VARCHAR) | SELECT title FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq) |
781 | <question>: How many different instructors have taught some course? <context>: CREATE TABLE teaches (id VARCHAR) | SELECT COUNT(DISTINCT id) FROM teaches |
782 | <question>: Find the total budgets of the Marketing or Finance department. <context>: CREATE TABLE department (budget INTEGER, dept_name VARCHAR) | SELECT SUM(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance' |
783 | <question>: Find the department name of the instructor whose name contains 'Soisalon'. <context>: CREATE TABLE instructor (dept_name VARCHAR, name VARCHAR) | SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%' |
784 | <question>: How many rooms whose capacity is less than 50 does the Lamberton building have? <context>: CREATE TABLE classroom (building VARCHAR, capacity VARCHAR) | SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50 |
785 | <question>: Find the name and budget of departments whose budgets are more than the average budget. <context>: CREATE TABLE department (dept_name VARCHAR, budget INTEGER) | SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department) |
786 | <question>: what is the name of the instructor who is in Statistics department and earns the lowest salary? <context>: CREATE TABLE instructor (name VARCHAR, dept_name VARCHAR, salary VARCHAR) | SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1 |
787 | <question>: Find the title of course that is provided by both Statistics and Psychology departments. <context>: CREATE TABLE course (title VARCHAR, dept_name VARCHAR) | SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology' |
788 | <question>: Find the title of course that is provided by Statistics but not Psychology departments. <context>: CREATE TABLE course (title VARCHAR, dept_name VARCHAR) | SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology' |
789 | <question>: Find the id of instructors who taught a class in Fall 2009 but not in Spring 2010. <context>: CREATE TABLE teaches (id VARCHAR, semester VARCHAR, YEAR VARCHAR) | SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010 |
790 | <question>: Find the name of students who took any class in the years of 2009 and 2010. <context>: CREATE TABLE student (name VARCHAR, id VARCHAR); CREATE TABLE takes (id VARCHAR) | SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010 |
791 | <question>: Find the names of the top 3 departments that provide the largest amount of courses? <context>: CREATE TABLE course (dept_name VARCHAR) | SELECT dept_name FROM course GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 3 |
792 | <question>: Find the name of the department that offers the highest total credits? <context>: CREATE TABLE course (dept_name VARCHAR, credits INTEGER) | SELECT dept_name FROM course GROUP BY dept_name ORDER BY SUM(credits) DESC LIMIT 1 |
793 | <question>: List the names of all courses ordered by their titles and credits. <context>: CREATE TABLE course (title VARCHAR, credits VARCHAR) | SELECT title FROM course ORDER BY title, credits |
794 | <question>: Which department has the lowest budget? <context>: CREATE TABLE department (dept_name VARCHAR, budget VARCHAR) | SELECT dept_name FROM department ORDER BY budget LIMIT 1 |
795 | <question>: List the names and buildings of all departments sorted by the budget from large to small. <context>: CREATE TABLE department (dept_name VARCHAR, building VARCHAR, budget VARCHAR) | SELECT dept_name, building FROM department ORDER BY budget DESC |
796 | <question>: Who is the instructor with the highest salary? <context>: CREATE TABLE instructor (name VARCHAR, salary VARCHAR) | SELECT name FROM instructor ORDER BY salary DESC LIMIT 1 |
797 | <question>: List the information of all instructors ordered by their salary in ascending order. <context>: CREATE TABLE instructor (salary VARCHAR) | SELECT * FROM instructor ORDER BY salary |
798 | <question>: Find the name of the students and their department names sorted by their total credits in ascending order. <context>: CREATE TABLE student (name VARCHAR, dept_name VARCHAR, tot_cred VARCHAR) | SELECT name, dept_name FROM student ORDER BY tot_cred |
799 | <question>: list in alphabetic order all course names and their instructors' names in year 2008. <context>: CREATE TABLE course (title VARCHAR, course_id VARCHAR); CREATE TABLE teaches (course_id VARCHAR, id VARCHAR); CREATE TABLE instructor (name VARCHAR, id VARCHAR) | SELECT T1.title, T3.name FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.id = T3.id WHERE YEAR = 2008 ORDER BY T1.title |