target-benchmark/spider-queries huggingface dataset:
Database: apartment_rentals (tables: apartments)
Question: Return each apartment type code with the number of apartments having that apartment type, in ascending order of the number of apartments.
SQL: SELECT apt_type_code ,  COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC
Database: apartment_rentals (tables: apartments)
Question: Show the top 3 apartment type codes sorted by the average number of rooms in descending order.
SQL: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 3
Database: apartment_rentals (tables: apartments)
Question: What are the top three apartment types in terms of the average room count? Give me the
SQL: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 3
Database: apartment_rentals (tables: apartments)
Question: Show the apartment type code that has the largest number of total rooms, together with the number of bathrooms and number of bedrooms.
SQL: SELECT apt_type_code ,  bathroom_count ,  bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY sum(room_count) DESC LIMIT 1
Database: apartment_rentals (tables: apartments)
Question: Which apartment type has the largest number of total rooms? Return the apartment type code, its number of bathrooms and number of bedrooms.
SQL: SELECT apt_type_code ,  bathroom_count ,  bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY sum(room_count) DESC LIMIT 1
Database: apartment_rentals (tables: apartments)
Question: Show the most common apartment type code.
SQL: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1
Database: apartment_rentals (tables: apartments)
Question: Which apartment type code appears the most often?
SQL: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1
Database: apartment_rentals (tables: apartments)
Question: Show the most common apartment type code among apartments with more than 1 bathroom.
SQL: SELECT apt_type_code FROM Apartments WHERE bathroom_count  >  1 GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1
Database: apartment_rentals (tables: apartments)
Question: Which apartment type code is the most common among apartments with more than one bathroom?
SQL: SELECT apt_type_code FROM Apartments WHERE bathroom_count  >  1 GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1
Database: apartment_rentals (tables: apartments)
Question: Show each apartment type code, and the maximum and minimum number of rooms for each type.
SQL: SELECT apt_type_code ,  max(room_count) ,  min(room_count) FROM Apartments GROUP BY apt_type_code
Database: apartment_rentals (tables: apartments)
Question: Return each apartment type code along with the maximum and minimum number of rooms among each type.
SQL: SELECT apt_type_code ,  max(room_count) ,  min(room_count) FROM Apartments GROUP BY apt_type_code
Database: apartment_rentals (tables: guests)
Question: Show each gender code and the corresponding count of guests sorted by the count in descending order.
SQL: SELECT gender_code ,  COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC
Database: apartment_rentals (tables: guests)
Question: Sort the gender codes in descending order of their corresponding number of guests. Return both the gender codes and counts.
SQL: SELECT gender_code ,  COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC
Database: apartment_rentals (tables: apartment_facilities, apartments)
Question: How many apartments do not have any facility?
SQL: SELECT count(*) FROM Apartments WHERE apt_id NOT IN (SELECT apt_id FROM Apartment_Facilities)
Database: apartment_rentals (tables: apartment_facilities, apartments)
Question: Find the number of apartments that have no facility.
SQL: SELECT count(*) FROM Apartments WHERE apt_id NOT IN (SELECT apt_id FROM Apartment_Facilities)
Database: apartment_rentals (tables: apartments, apartment_bookings)
Question: Show the apartment numbers of apartments with bookings that have status code both "Provisional" and "Confirmed"
SQL: 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"
Database: apartment_rentals (tables: apartments, apartment_bookings)
Question: Which apartments have bookings with both status codes "Provisional" and "Confirmed"? Give me the apartment numbers.
SQL: 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"
Database: apartment_rentals (tables: apartments, view_unit_status)
Question: Show the apartment numbers of apartments with unit status availability of both 0 and 1.
SQL: 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
Database: apartment_rentals (tables: apartments, view_unit_status)
Question: Which apartments have unit status availability of both 0 and 1? Return their apartment numbers.
SQL: 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
Database: game_injury (tables: game)
Question: How many games are held after season 2007?
SQL: SELECT count(*) FROM game WHERE season  >  2007
Database: game_injury (tables: game)
Question: List the dates of games by the home team name in descending order.
SQL: SELECT Date FROM game ORDER BY home_team DESC
Database: game_injury (tables: game)
Question: List the season, home team, away team of all the games.
SQL: SELECT season ,  home_team ,  away_team FROM game
Database: game_injury (tables: stadium)
Question: What are the maximum, minimum and average home games each stadium held?
SQL: SELECT max(home_games) ,  min(home_games) ,  avg(home_games) FROM stadium
Database: game_injury (tables: stadium)
Question: What is the average attendance of stadiums with capacity percentage higher than 100%?
SQL: SELECT average_attendance FROM stadium WHERE capacity_percentage  >  100
Database: game_injury (tables: injury_accident)
Question: What are the player name, number of matches, and information source for players who do not suffer from injury of 'Knee problem'?
SQL: SELECT player ,  number_of_matches ,  SOURCE FROM injury_accident WHERE injury != 'Knee problem'
Database: game_injury (tables: game, injury_accident)
Question: What is the season of the game which causes the player 'Walter Samuel' to get injured?
SQL: SELECT T1.season FROM game AS T1 JOIN injury_accident AS T2 ON T1.id  =  T2.game_id WHERE T2.player  =  'Walter Samuel'
Database: game_injury (tables: game, injury_accident)
Question: What are the ids, scores, and dates of the games which caused at least two injury accidents?
SQL: 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
Database: game_injury (tables: game, stadium, injury_accident)
Question: What are the id and name of the stadium where the most injury accidents happened?
SQL: 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
Database: game_injury (tables: game, stadium, injury_accident)
Question: Find the id and name of the stadium where the largest number of injury accidents occurred.
SQL: 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
Database: game_injury (tables: game, stadium, injury_accident)
Question: In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'?
SQL: 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'
Database: game_injury (tables: injury_accident)
Question: How many different kinds of information sources are there for injury accidents?
SQL: SELECT count(DISTINCT SOURCE) FROM injury_accident
Database: game_injury (tables: game, injury_accident)
Question: How many games are free of injury accidents?
SQL: SELECT count(*) FROM game WHERE id NOT IN ( SELECT game_id FROM injury_accident )
Database: game_injury (tables: game, injury_accident)
Question: How many distinct kinds of injuries happened after season 2010?
SQL: SELECT count(DISTINCT T1.injury) FROM injury_accident AS T1 JOIN game AS T2 ON T1.game_id  =  T2.id WHERE T2.season  >  2010
Database: game_injury (tables: game, stadium, injury_accident)
Question: List the name of the stadium where both the player 'Walter Samuel' and the player 'Thiago Motta' got injured.
SQL: 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'
Database: game_injury (tables: game, stadium, injury_accident)
Question: Show the name, average attendance, total attendance for stadiums where no accidents happened.
SQL: 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
Database: game_injury (tables: stadium)
Question: Which stadium name contains the substring "Bank"?
SQL: SELECT name FROM stadium WHERE name LIKE "%Bank%"
Database: game_injury (tables: game, stadium)
Question: How many games has each stadium held?
SQL: SELECT T1.id ,  count(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id  =  T2.stadium_id GROUP BY T1.id
Database: game_injury (tables: game, injury_accident)
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.
SQL: 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
Database: soccer_1 (tables: country, league)
Question: List all country and league names.
SQL: SELECT T1.name ,  T2.name FROM Country AS T1 JOIN League AS T2 ON T1.id  =  T2.country_id
Database: soccer_1 (tables: country, league)
Question: How many leagues are there in England?
SQL: SELECT count(*) FROM Country AS T1 JOIN League AS T2 ON T1.id  =  T2.country_id WHERE T1.name  =  "England"
Database: soccer_1 (tables: player)
Question: What is the average weight of all players?
SQL: SELECT avg(weight) FROM Player
Database: soccer_1 (tables: player)
Question: What is the maximum and minimum height of all players?
SQL: SELECT max(weight) ,  min(weight) FROM Player
Database: soccer_1 (tables: player_attributes, player)
Question: List all player names who have an overall rating higher than the average.
SQL: 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 )
Database: soccer_1 (tables: player_attributes, player)
Question: What are the names of players who have the best dribbling?
SQL: 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)
Database: soccer_1 (tables: player_attributes, player)
Question: List the names of all players who have a crossing score higher than 90 and prefer their right foot.
SQL: 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"
Database: soccer_1 (tables: player_attributes, player)
Question: List the names of all left-footed players who have overall rating between 85 and 90.
SQL: 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
Database: soccer_1 (tables: player_attributes)
Question: What is the average rating for right-footed players and left-footed players?
SQL: SELECT preferred_foot ,  avg(overall_rating) FROM Player_Attributes GROUP BY preferred_foot
Database: soccer_1 (tables: player_attributes)
Question: Of all players with an overall rating greater than 80, how many are right-footed and left-footed?
SQL: SELECT preferred_foot ,  count(*) FROM Player_Attributes WHERE overall_rating  >  80 GROUP BY preferred_foot
Database: soccer_1 (tables: player_attributes, player)
Question: List all of the player ids with a height of at least 180cm and an overall rating higher than 85.
SQL: SELECT player_api_id FROM Player WHERE height  >=  180 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE overall_rating  >  85
Database: soccer_1 (tables: player_attributes, player)
Question: List all of the ids for left-footed players with a height between 180cm and 190cm.
SQL: SELECT player_api_id FROM Player WHERE height  >=  180 AND height  <=  190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot  =  "left"
Database: soccer_1 (tables: player_attributes, player)
Question: Who are the top 3 players in terms of overall rating?
SQL: 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
Database: soccer_1 (tables: player_attributes, player)
Question: List the names and birthdays of the top five players in terms of potential.
SQL: 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
Database: performance_attendance (tables: performance)
Question: How many performances are there?
SQL: SELECT count(*) FROM performance
Database: performance_attendance (tables: performance)
Question: List the hosts of performances in ascending order of attendance.
SQL: SELECT HOST FROM performance ORDER BY Attendance ASC
Database: performance_attendance (tables: performance)
Question: What are the dates and locations of performances?
SQL: SELECT Date ,  LOCATION FROM performance
Database: performance_attendance (tables: performance)
Question: Show the attendances of the performances at location "TD Garden" or "Bell Centre"
SQL: SELECT Attendance FROM performance WHERE LOCATION  =  "TD Garden" OR LOCATION  =  "Bell Centre"
Database: performance_attendance (tables: performance)
Question: What is the average number of attendees for performances?
SQL: SELECT avg(Attendance) FROM performance
Database: performance_attendance (tables: performance)
Question: What is the date of the performance with the highest number of attendees?
SQL: SELECT Date FROM performance ORDER BY Attendance DESC LIMIT 1
Database: performance_attendance (tables: performance)
Question: Show different locations and the number of performances at each location.
SQL: SELECT LOCATION ,  COUNT(*) FROM performance GROUP BY LOCATION
Database: performance_attendance (tables: performance)
Question: Show the most common location of performances.
SQL: SELECT LOCATION FROM performance GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
Database: performance_attendance (tables: performance)
Question: Show the locations that have at least two performances.
SQL: SELECT LOCATION FROM performance GROUP BY LOCATION HAVING COUNT(*)  >=  2
Database: performance_attendance (tables: performance)
Question: Show the locations that have both performances with more than 2000 attendees and performances with less than 1000 attendees.
SQL: SELECT LOCATION FROM performance WHERE Attendance  >  2000 INTERSECT SELECT LOCATION FROM performance WHERE Attendance  <  1000
Database: performance_attendance (tables: performance, member, member_attendance)
Question: Show the names of members and the location of the performances they attended.
SQL: 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
Database: performance_attendance (tables: performance, member, member_attendance)
Question: Show the names of members and the location of performances they attended in ascending alphabetical order of their names.
SQL: 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 ASC
Database: performance_attendance (tables: performance, member, member_attendance)
Question: Show the dates of performances with attending members whose roles are "Violin".
SQL: 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"
Database: performance_attendance (tables: performance, member, member_attendance)
Question: Show the names of members and the dates of performances they attended in descending order of attendance of the performances.
SQL: 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
Database: performance_attendance (tables: member, member_attendance)
Question: List the names of members who did not attend any performance.
SQL: SELECT Name FROM member WHERE Member_ID NOT IN (SELECT Member_ID FROM member_attendance)
Database: college_2 (tables: classroom)
Question: Find the buildings which have rooms with capacity more than 50.
SQL: SELECT DISTINCT building FROM classroom WHERE capacity  >  50
Database: college_2 (tables: classroom)
Question: What are the distinct buildings with capacities of greater than 50?
SQL: SELECT DISTINCT building FROM classroom WHERE capacity  >  50
Database: college_2 (tables: classroom)
Question: Count the number of rooms that are not in the Lamberton building.
SQL: SELECT count(*) FROM classroom WHERE building != 'Lamberton'
Database: college_2 (tables: classroom)
Question: How many classrooms are not in Lamberton?
SQL: SELECT count(*) FROM classroom WHERE building != 'Lamberton'
Database: college_2 (tables: department)
Question: What is the name and building of the departments whose budget is more than the average budget?
SQL: SELECT dept_name ,  building FROM department WHERE budget  >  (SELECT avg(budget) FROM department)
Database: college_2 (tables: department)
Question: Give the name and building of the departments with greater than average budget.
SQL: SELECT dept_name ,  building FROM department WHERE budget  >  (SELECT avg(budget) FROM department)
Database: college_2 (tables: classroom)
Question: Find the room number of the rooms which can sit 50 to 100 students and their buildings.
SQL: SELECT building ,  room_number FROM classroom WHERE capacity BETWEEN 50 AND 100
Database: college_2 (tables: classroom)
Question: What are the room numbers and corresponding buildings for classrooms which can seat between 50 to 100 students?
SQL: SELECT building ,  room_number FROM classroom WHERE capacity BETWEEN 50 AND 100
Database: college_2 (tables: department)
Question: Find the name and building of the department with the highest budget.
SQL: SELECT dept_name ,  building FROM department ORDER BY budget DESC LIMIT 1
Database: college_2 (tables: department)
Question: What is the department name and corresponding building for the department with the greatest budget?
SQL: SELECT dept_name ,  building FROM department ORDER BY budget DESC LIMIT 1
Database: college_2 (tables: student)
Question: What is the name of the student who has the highest total credits in the History department.
SQL: SELECT name FROM student WHERE dept_name  =  'History' ORDER BY tot_cred DESC LIMIT 1
Database: college_2 (tables: student)
Question: Give the name of the student in the History department with the most credits.
SQL: SELECT name FROM student WHERE dept_name  =  'History' ORDER BY tot_cred DESC LIMIT 1
Database: college_2 (tables: classroom)
Question: How many rooms does the Lamberton building have?
SQL: SELECT count(*) FROM classroom WHERE building  =  'Lamberton'
Database: college_2 (tables: classroom)
Question: Count the number of classrooms in Lamberton.
SQL: SELECT count(*) FROM classroom WHERE building  =  'Lamberton'
Database: college_2 (tables: advisor)
Question: How many students have advisors?
SQL: SELECT count(DISTINCT s_id) FROM advisor
Database: college_2 (tables: advisor)
Question: Count the number of students who have advisors.
SQL: SELECT count(DISTINCT s_id) FROM advisor
Database: college_2 (tables: course)
Question: How many departments offer courses?
SQL: SELECT count(DISTINCT dept_name) FROM course
Database: college_2 (tables: course)
Question: Count the number of departments which offer courses.
SQL: SELECT count(DISTINCT dept_name) FROM course
Database: college_2 (tables: course)
Question: How many different courses offered by Physics department?
SQL: SELECT count(DISTINCT course_id) FROM course WHERE dept_name  =  'Physics'
Database: college_2 (tables: course)
Question: Count the number of courses in the Physics department.
SQL: SELECT count(DISTINCT course_id) FROM course WHERE dept_name  =  'Physics'
Database: college_2 (tables: course, prereq)
Question: Find the title of courses that have two prerequisites?
SQL: 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
Database: college_2 (tables: course, prereq)
Question: What are the titles for courses with two prerequisites?
SQL: 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
Database: college_2 (tables: course, prereq)
Question: Find the title, credit, and department name of courses that have more than one prerequisites?
SQL: 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
Database: college_2 (tables: course, prereq)
Question: What is the title, credit value, and department name for courses with more than one prerequisite?
SQL: 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
Database: college_2 (tables: course, prereq)
Question: How many courses that do not have prerequisite?
SQL: SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
Database: college_2 (tables: course, prereq)
Question: Count the number of courses without prerequisites.
SQL: SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
Database: college_2 (tables: course, prereq)
Question: Find the name of the courses that do not have any prerequisite?
SQL: SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
Database: college_2 (tables: course, prereq)
Question: What are the titles of courses without prerequisites?
SQL: SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
Database: college_2 (tables: teaches)
Question: How many different instructors have taught some course?
SQL: SELECT COUNT (DISTINCT id) FROM teaches
Database: college_2 (tables: teaches)
Question: Count the number of distinct instructors who have taught a course.
SQL: SELECT COUNT (DISTINCT id) FROM teaches