db_id
stringlengths 3
31
| query
stringlengths 18
577
| question
stringlengths 3
224
| schema
stringlengths 177
6.14k
| primary_keys
stringlengths 16
545
| foreign_keys
stringlengths 16
1.48k
|
---|---|---|---|---|---|
soccer_1
|
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
|
List the names of all left-footed players who have overall rating between 85 and 90.
|
[Schema (values) (types)]: | soccer_1 | Player_Attributes : id (text) , player_fifa_api_id (number) , player_api_id (number) , date (number) , overall_rating (text) , potential (number) , preferred_foot (number) , attacking_work_rate (text) , defensive_work_rate (text) , crossing (text) , finishing (number) , heading_accuracy (number) , short_passing (number) , volleys (number) , dribbling (number) , curve (number) , free_kick_accuracy (number) , long_passing (number) , ball_control (number) , acceleration (number) , sprint_speed (number) , agility (number) , reactions (number) , balance (number) , shot_power (number) , jumping (number) , stamina (number) , strength (number) , long_shots (number) , aggression (number) , interceptions (number) , positioning (number) , vision (number) , penalties (number) , marking (number) , standing_tackle (number) , sliding_tackle (number) , gk_diving (number) , gk_handling (number) , gk_kicking (number) , gk_positioning (number) , gk_reflexes (number) | sqlite_sequence : name (text) , seq (number) | Player : id (text) , player_api_id (number) , player_name (number) , player_fifa_api_id (number) , birthday (text) , height (number) , weight (number) | League : id (text) , country_id (number) , name (number) | Country : id (text) , name (number) | Team : id (text) , team_api_id (number) , team_fifa_api_id (number) , team_long_name (number) , team_short_name (text) | Team_Attributes : id (text) , team_fifa_api_id (number) , team_api_id (number) , date (number) , buildupplayspeed (text) , buildupplayspeedclass (number) , buildupplaydribbling (number) , buildupplaydribblingclass (text) , buildupplaypassing (text) , buildupplaypassingclass (text) , buildupplaypositioningclass (number) , chancecreationpassing (number) , chancecreationpassingclass (number) , chancecreationcrossing (number) , chancecreationcrossingclass (number) , chancecreationshooting (number) , chancecreationshootingclass (number) , chancecreationpositioningclass (number) , defencepressure (number) , defencepressureclass (number) , defenceaggression (number) , defenceaggressionclass (number) , defenceteamwidth (number) , defenceteamwidthclass (number) , defencedefenderlineclass (number);
|
[Primary Keys]: player_attributes : id, sqlite_sequence : id, player : id, league : id, country : id, team : id
|
[Foreign Keys]: player_attributes : player_api_id = player : player_api_id | player_attributes : player_fifa_api_id = player : player_fifa_api_id | league : country_id = country : id | team_attributes : team_api_id = team : team_api_id | team_attributes : team_fifa_api_id = team : team_fifa_api_id
|
soccer_1
|
SELECT preferred_foot , avg(overall_rating) FROM Player_Attributes GROUP BY preferred_foot
|
What is the average rating for right-footed players and left-footed players?
|
[Schema (values) (types)]: | soccer_1 | Player_Attributes : id (text) , player_fifa_api_id (number) , player_api_id (number) , date (number) , overall_rating (text) , potential (number) , preferred_foot (number) , attacking_work_rate (text) , defensive_work_rate (text) , crossing (text) , finishing (number) , heading_accuracy (number) , short_passing (number) , volleys (number) , dribbling (number) , curve (number) , free_kick_accuracy (number) , long_passing (number) , ball_control (number) , acceleration (number) , sprint_speed (number) , agility (number) , reactions (number) , balance (number) , shot_power (number) , jumping (number) , stamina (number) , strength (number) , long_shots (number) , aggression (number) , interceptions (number) , positioning (number) , vision (number) , penalties (number) , marking (number) , standing_tackle (number) , sliding_tackle (number) , gk_diving (number) , gk_handling (number) , gk_kicking (number) , gk_positioning (number) , gk_reflexes (number) | sqlite_sequence : name (text) , seq (number) | Player : id (text) , player_api_id (number) , player_name (number) , player_fifa_api_id (number) , birthday (text) , height (number) , weight (number) | League : id (text) , country_id (number) , name (number) | Country : id (text) , name (number) | Team : id (text) , team_api_id (number) , team_fifa_api_id (number) , team_long_name (number) , team_short_name (text) | Team_Attributes : id (text) , team_fifa_api_id (number) , team_api_id (number) , date (number) , buildupplayspeed (text) , buildupplayspeedclass (number) , buildupplaydribbling (number) , buildupplaydribblingclass (text) , buildupplaypassing (text) , buildupplaypassingclass (text) , buildupplaypositioningclass (number) , chancecreationpassing (number) , chancecreationpassingclass (number) , chancecreationcrossing (number) , chancecreationcrossingclass (number) , chancecreationshooting (number) , chancecreationshootingclass (number) , chancecreationpositioningclass (number) , defencepressure (number) , defencepressureclass (number) , defenceaggression (number) , defenceaggressionclass (number) , defenceteamwidth (number) , defenceteamwidthclass (number) , defencedefenderlineclass (number);
|
[Primary Keys]: player_attributes : id, sqlite_sequence : id, player : id, league : id, country : id, team : id
|
[Foreign Keys]: player_attributes : player_api_id = player : player_api_id | player_attributes : player_fifa_api_id = player : player_fifa_api_id | league : country_id = country : id | team_attributes : team_api_id = team : team_api_id | team_attributes : team_fifa_api_id = team : team_fifa_api_id
|
soccer_1
|
SELECT preferred_foot , count(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot
|
Of all players with an overall rating greater than 80, how many are right-footed and left-footed?
|
[Schema (values) (types)]: | soccer_1 | Player_Attributes : id (text) , player_fifa_api_id (number) , player_api_id (number) , date (number) , overall_rating (text) , potential (number) , preferred_foot (number) , attacking_work_rate (text) , defensive_work_rate (text) , crossing (text) , finishing (number) , heading_accuracy (number) , short_passing (number) , volleys (number) , dribbling (number) , curve (number) , free_kick_accuracy (number) , long_passing (number) , ball_control (number) , acceleration (number) , sprint_speed (number) , agility (number) , reactions (number) , balance (number) , shot_power (number) , jumping (number) , stamina (number) , strength (number) , long_shots (number) , aggression (number) , interceptions (number) , positioning (number) , vision (number) , penalties (number) , marking (number) , standing_tackle (number) , sliding_tackle (number) , gk_diving (number) , gk_handling (number) , gk_kicking (number) , gk_positioning (number) , gk_reflexes (number) | sqlite_sequence : name (text) , seq (number) | Player : id (text) , player_api_id (number) , player_name (number) , player_fifa_api_id (number) , birthday (text) , height (number) , weight (number) | League : id (text) , country_id (number) , name (number) | Country : id (text) , name (number) | Team : id (text) , team_api_id (number) , team_fifa_api_id (number) , team_long_name (number) , team_short_name (text) | Team_Attributes : id (text) , team_fifa_api_id (number) , team_api_id (number) , date (number) , buildupplayspeed (text) , buildupplayspeedclass (number) , buildupplaydribbling (number) , buildupplaydribblingclass (text) , buildupplaypassing (text) , buildupplaypassingclass (text) , buildupplaypositioningclass (number) , chancecreationpassing (number) , chancecreationpassingclass (number) , chancecreationcrossing (number) , chancecreationcrossingclass (number) , chancecreationshooting (number) , chancecreationshootingclass (number) , chancecreationpositioningclass (number) , defencepressure (number) , defencepressureclass (number) , defenceaggression (number) , defenceaggressionclass (number) , defenceteamwidth (number) , defenceteamwidthclass (number) , defencedefenderlineclass (number);
|
[Primary Keys]: player_attributes : id, sqlite_sequence : id, player : id, league : id, country : id, team : id
|
[Foreign Keys]: player_attributes : player_api_id = player : player_api_id | player_attributes : player_fifa_api_id = player : player_fifa_api_id | league : country_id = country : id | team_attributes : team_api_id = team : team_api_id | team_attributes : team_fifa_api_id = team : team_fifa_api_id
|
soccer_1
|
SELECT player_api_id FROM Player WHERE height >= 180 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE overall_rating > 85
|
List all of the player ids with a height of at least 180cm and an overall rating higher than 85.
|
[Schema (values) (types)]: | soccer_1 | Player_Attributes : id (text) , player_fifa_api_id (number) , player_api_id (number) , date (number) , overall_rating (text) , potential (number) , preferred_foot (number) , attacking_work_rate (text) , defensive_work_rate (text) , crossing (text) , finishing (number) , heading_accuracy (number) , short_passing (number) , volleys (number) , dribbling (number) , curve (number) , free_kick_accuracy (number) , long_passing (number) , ball_control (number) , acceleration (number) , sprint_speed (number) , agility (number) , reactions (number) , balance (number) , shot_power (number) , jumping (number) , stamina (number) , strength (number) , long_shots (number) , aggression (number) , interceptions (number) , positioning (number) , vision (number) , penalties (number) , marking (number) , standing_tackle (number) , sliding_tackle (number) , gk_diving (number) , gk_handling (number) , gk_kicking (number) , gk_positioning (number) , gk_reflexes (number) | sqlite_sequence : name (text) , seq (number) | Player : id (text) , player_api_id (number) , player_name (number) , player_fifa_api_id (number) , birthday (text) , height (number) , weight (number) | League : id (text) , country_id (number) , name (number) | Country : id (text) , name (number) | Team : id (text) , team_api_id (number) , team_fifa_api_id (number) , team_long_name (number) , team_short_name (text) | Team_Attributes : id (text) , team_fifa_api_id (number) , team_api_id (number) , date (number) , buildupplayspeed (text) , buildupplayspeedclass (number) , buildupplaydribbling (number) , buildupplaydribblingclass (text) , buildupplaypassing (text) , buildupplaypassingclass (text) , buildupplaypositioningclass (number) , chancecreationpassing (number) , chancecreationpassingclass (number) , chancecreationcrossing (number) , chancecreationcrossingclass (number) , chancecreationshooting (number) , chancecreationshootingclass (number) , chancecreationpositioningclass (number) , defencepressure (number) , defencepressureclass (number) , defenceaggression (number) , defenceaggressionclass (number) , defenceteamwidth (number) , defenceteamwidthclass (number) , defencedefenderlineclass (number);
|
[Primary Keys]: player_attributes : id, sqlite_sequence : id, player : id, league : id, country : id, team : id
|
[Foreign Keys]: player_attributes : player_api_id = player : player_api_id | player_attributes : player_fifa_api_id = player : player_fifa_api_id | league : country_id = country : id | team_attributes : team_api_id = team : team_api_id | team_attributes : team_fifa_api_id = team : team_fifa_api_id
|
soccer_1
|
SELECT player_api_id FROM Player WHERE height >= 180 AND height <= 190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot = "left"
|
List all of the ids for left-footed players with a height between 180cm and 190cm.
|
[Schema (values) (types)]: | soccer_1 | Player_Attributes : id (text) , player_fifa_api_id (number) , player_api_id (number) , date (number) , overall_rating (text) , potential (number) , preferred_foot (number) , attacking_work_rate (text) , defensive_work_rate (text) , crossing (text) , finishing (number) , heading_accuracy (number) , short_passing (number) , volleys (number) , dribbling (number) , curve (number) , free_kick_accuracy (number) , long_passing (number) , ball_control (number) , acceleration (number) , sprint_speed (number) , agility (number) , reactions (number) , balance (number) , shot_power (number) , jumping (number) , stamina (number) , strength (number) , long_shots (number) , aggression (number) , interceptions (number) , positioning (number) , vision (number) , penalties (number) , marking (number) , standing_tackle (number) , sliding_tackle (number) , gk_diving (number) , gk_handling (number) , gk_kicking (number) , gk_positioning (number) , gk_reflexes (number) | sqlite_sequence : name (text) , seq (number) | Player : id (text) , player_api_id (number) , player_name (number) , player_fifa_api_id (number) , birthday (text) , height (number) , weight (number) | League : id (text) , country_id (number) , name (number) | Country : id (text) , name (number) | Team : id (text) , team_api_id (number) , team_fifa_api_id (number) , team_long_name (number) , team_short_name (text) | Team_Attributes : id (text) , team_fifa_api_id (number) , team_api_id (number) , date (number) , buildupplayspeed (text) , buildupplayspeedclass (number) , buildupplaydribbling (number) , buildupplaydribblingclass (text) , buildupplaypassing (text) , buildupplaypassingclass (text) , buildupplaypositioningclass (number) , chancecreationpassing (number) , chancecreationpassingclass (number) , chancecreationcrossing (number) , chancecreationcrossingclass (number) , chancecreationshooting (number) , chancecreationshootingclass (number) , chancecreationpositioningclass (number) , defencepressure (number) , defencepressureclass (number) , defenceaggression (number) , defenceaggressionclass (number) , defenceteamwidth (number) , defenceteamwidthclass (number) , defencedefenderlineclass (number);
|
[Primary Keys]: player_attributes : id, sqlite_sequence : id, player : id, league : id, country : id, team : id
|
[Foreign Keys]: player_attributes : player_api_id = player : player_api_id | player_attributes : player_fifa_api_id = player : player_fifa_api_id | league : country_id = country : id | team_attributes : team_api_id = team : team_api_id | team_attributes : team_fifa_api_id = team : team_fifa_api_id
|
soccer_1
|
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
|
Who are the top 3 players in terms of overall rating?
|
[Schema (values) (types)]: | soccer_1 | Player_Attributes : id (text) , player_fifa_api_id (number) , player_api_id (number) , date (number) , overall_rating (text) , potential (number) , preferred_foot (number) , attacking_work_rate (text) , defensive_work_rate (text) , crossing (text) , finishing (number) , heading_accuracy (number) , short_passing (number) , volleys (number) , dribbling (number) , curve (number) , free_kick_accuracy (number) , long_passing (number) , ball_control (number) , acceleration (number) , sprint_speed (number) , agility (number) , reactions (number) , balance (number) , shot_power (number) , jumping (number) , stamina (number) , strength (number) , long_shots (number) , aggression (number) , interceptions (number) , positioning (number) , vision (number) , penalties (number) , marking (number) , standing_tackle (number) , sliding_tackle (number) , gk_diving (number) , gk_handling (number) , gk_kicking (number) , gk_positioning (number) , gk_reflexes (number) | sqlite_sequence : name (text) , seq (number) | Player : id (text) , player_api_id (number) , player_name (number) , player_fifa_api_id (number) , birthday (text) , height (number) , weight (number) | League : id (text) , country_id (number) , name (number) | Country : id (text) , name (number) | Team : id (text) , team_api_id (number) , team_fifa_api_id (number) , team_long_name (number) , team_short_name (text) | Team_Attributes : id (text) , team_fifa_api_id (number) , team_api_id (number) , date (number) , buildupplayspeed (text) , buildupplayspeedclass (number) , buildupplaydribbling (number) , buildupplaydribblingclass (text) , buildupplaypassing (text) , buildupplaypassingclass (text) , buildupplaypositioningclass (number) , chancecreationpassing (number) , chancecreationpassingclass (number) , chancecreationcrossing (number) , chancecreationcrossingclass (number) , chancecreationshooting (number) , chancecreationshootingclass (number) , chancecreationpositioningclass (number) , defencepressure (number) , defencepressureclass (number) , defenceaggression (number) , defenceaggressionclass (number) , defenceteamwidth (number) , defenceteamwidthclass (number) , defencedefenderlineclass (number);
|
[Primary Keys]: player_attributes : id, sqlite_sequence : id, player : id, league : id, country : id, team : id
|
[Foreign Keys]: player_attributes : player_api_id = player : player_api_id | player_attributes : player_fifa_api_id = player : player_fifa_api_id | league : country_id = country : id | team_attributes : team_api_id = team : team_api_id | team_attributes : team_fifa_api_id = team : team_fifa_api_id
|
soccer_1
|
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
|
List the names and birthdays of the top five players in terms of potential.
|
[Schema (values) (types)]: | soccer_1 | Player_Attributes : id (text) , player_fifa_api_id (number) , player_api_id (number) , date (number) , overall_rating (text) , potential (number) , preferred_foot (number) , attacking_work_rate (text) , defensive_work_rate (text) , crossing (text) , finishing (number) , heading_accuracy (number) , short_passing (number) , volleys (number) , dribbling (number) , curve (number) , free_kick_accuracy (number) , long_passing (number) , ball_control (number) , acceleration (number) , sprint_speed (number) , agility (number) , reactions (number) , balance (number) , shot_power (number) , jumping (number) , stamina (number) , strength (number) , long_shots (number) , aggression (number) , interceptions (number) , positioning (number) , vision (number) , penalties (number) , marking (number) , standing_tackle (number) , sliding_tackle (number) , gk_diving (number) , gk_handling (number) , gk_kicking (number) , gk_positioning (number) , gk_reflexes (number) | sqlite_sequence : name (text) , seq (number) | Player : id (text) , player_api_id (number) , player_name (number) , player_fifa_api_id (number) , birthday (text) , height (number) , weight (number) | League : id (text) , country_id (number) , name (number) | Country : id (text) , name (number) | Team : id (text) , team_api_id (number) , team_fifa_api_id (number) , team_long_name (number) , team_short_name (text) | Team_Attributes : id (text) , team_fifa_api_id (number) , team_api_id (number) , date (number) , buildupplayspeed (text) , buildupplayspeedclass (number) , buildupplaydribbling (number) , buildupplaydribblingclass (text) , buildupplaypassing (text) , buildupplaypassingclass (text) , buildupplaypositioningclass (number) , chancecreationpassing (number) , chancecreationpassingclass (number) , chancecreationcrossing (number) , chancecreationcrossingclass (number) , chancecreationshooting (number) , chancecreationshootingclass (number) , chancecreationpositioningclass (number) , defencepressure (number) , defencepressureclass (number) , defenceaggression (number) , defenceaggressionclass (number) , defenceteamwidth (number) , defenceteamwidthclass (number) , defencedefenderlineclass (number);
|
[Primary Keys]: player_attributes : id, sqlite_sequence : id, player : id, league : id, country : id, team : id
|
[Foreign Keys]: player_attributes : player_api_id = player : player_api_id | player_attributes : player_fifa_api_id = player : player_fifa_api_id | league : country_id = country : id | team_attributes : team_api_id = team : team_api_id | team_attributes : team_fifa_api_id = team : team_fifa_api_id
|
performance_attendance
|
SELECT count(*) FROM performance
|
How many performances are there?
|
[Schema (values) (types)]: | performance_attendance | member : member_id (text) , name (text) , nationality (text) , role (text) | performance : performance_id (text) , date (text) , host (text) , location (text) , attendance (text) | member_attendance : member_id (text) , performance_id (text) , num_of_pieces (text);
|
[Primary Keys]: member : member_id, performance : performance_id, member_attendance : member_id
|
[Foreign Keys]: member_attendance : performance_id = performance : performance_id | member_attendance : member_id = member : member_id
|
performance_attendance
|
SELECT HOST FROM performance ORDER BY Attendance ASC
|
List the hosts of performances in ascending order of attendance.
|
[Schema (values) (types)]: | performance_attendance | member : member_id (text) , name (text) , nationality (text) , role (text) | performance : performance_id (text) , date (text) , host (text) , location (text) , attendance (text) | member_attendance : member_id (text) , performance_id (text) , num_of_pieces (text);
|
[Primary Keys]: member : member_id, performance : performance_id, member_attendance : member_id
|
[Foreign Keys]: member_attendance : performance_id = performance : performance_id | member_attendance : member_id = member : member_id
|
performance_attendance
|
SELECT Date , LOCATION FROM performance
|
What are the dates and locations of performances?
|
[Schema (values) (types)]: | performance_attendance | member : member_id (text) , name (text) , nationality (text) , role (text) | performance : performance_id (text) , date (text) , host (text) , location (text) , attendance (text) | member_attendance : member_id (text) , performance_id (text) , num_of_pieces (text);
|
[Primary Keys]: member : member_id, performance : performance_id, member_attendance : member_id
|
[Foreign Keys]: member_attendance : performance_id = performance : performance_id | member_attendance : member_id = member : member_id
|
performance_attendance
|
SELECT Attendance FROM performance WHERE LOCATION = "TD Garden" OR LOCATION = "Bell Centre"
|
Show the attendances of the performances at location "TD Garden" or "Bell Centre"
|
[Schema (values) (types)]: | performance_attendance | member : member_id (text) , name (text) , nationality (text) , role (text) | performance : performance_id (text) , date (text) , host (text) , location (text) , attendance (text) | member_attendance : member_id (text) , performance_id (text) , num_of_pieces (text);
|
[Primary Keys]: member : member_id, performance : performance_id, member_attendance : member_id
|
[Foreign Keys]: member_attendance : performance_id = performance : performance_id | member_attendance : member_id = member : member_id
|
performance_attendance
|
SELECT avg(Attendance) FROM performance
|
What is the average number of attendees for performances?
|
[Schema (values) (types)]: | performance_attendance | member : member_id (text) , name (text) , nationality (text) , role (text) | performance : performance_id (text) , date (text) , host (text) , location (text) , attendance (text) | member_attendance : member_id (text) , performance_id (text) , num_of_pieces (text);
|
[Primary Keys]: member : member_id, performance : performance_id, member_attendance : member_id
|
[Foreign Keys]: member_attendance : performance_id = performance : performance_id | member_attendance : member_id = member : member_id
|
performance_attendance
|
SELECT Date FROM performance ORDER BY Attendance DESC LIMIT 1
|
What is the date of the performance with the highest number of attendees?
|
[Schema (values) (types)]: | performance_attendance | member : member_id (text) , name (text) , nationality (text) , role (text) | performance : performance_id (text) , date (text) , host (text) , location (text) , attendance (text) | member_attendance : member_id (text) , performance_id (text) , num_of_pieces (text);
|
[Primary Keys]: member : member_id, performance : performance_id, member_attendance : member_id
|
[Foreign Keys]: member_attendance : performance_id = performance : performance_id | member_attendance : member_id = member : member_id
|
performance_attendance
|
SELECT LOCATION , COUNT(*) FROM performance GROUP BY LOCATION
|
Show different locations and the number of performances at each location.
|
[Schema (values) (types)]: | performance_attendance | member : member_id (text) , name (text) , nationality (text) , role (text) | performance : performance_id (text) , date (text) , host (text) , location (text) , attendance (text) | member_attendance : member_id (text) , performance_id (text) , num_of_pieces (text);
|
[Primary Keys]: member : member_id, performance : performance_id, member_attendance : member_id
|
[Foreign Keys]: member_attendance : performance_id = performance : performance_id | member_attendance : member_id = member : member_id
|
performance_attendance
|
SELECT LOCATION FROM performance GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
|
Show the most common location of performances.
|
[Schema (values) (types)]: | performance_attendance | member : member_id (text) , name (text) , nationality (text) , role (text) | performance : performance_id (text) , date (text) , host (text) , location (text) , attendance (text) | member_attendance : member_id (text) , performance_id (text) , num_of_pieces (text);
|
[Primary Keys]: member : member_id, performance : performance_id, member_attendance : member_id
|
[Foreign Keys]: member_attendance : performance_id = performance : performance_id | member_attendance : member_id = member : member_id
|
performance_attendance
|
SELECT LOCATION FROM performance GROUP BY LOCATION HAVING COUNT(*) >= 2
|
Show the locations that have at least two performances.
|
[Schema (values) (types)]: | performance_attendance | member : member_id (text) , name (text) , nationality (text) , role (text) | performance : performance_id (text) , date (text) , host (text) , location (text) , attendance (text) | member_attendance : member_id (text) , performance_id (text) , num_of_pieces (text);
|
[Primary Keys]: member : member_id, performance : performance_id, member_attendance : member_id
|
[Foreign Keys]: member_attendance : performance_id = performance : performance_id | member_attendance : member_id = member : member_id
|
performance_attendance
|
SELECT LOCATION FROM performance WHERE Attendance > 2000 INTERSECT SELECT LOCATION FROM performance WHERE Attendance < 1000
|
Show the locations that have both performances with more than 2000 attendees and performances with less than 1000 attendees.
|
[Schema (values) (types)]: | performance_attendance | member : member_id (text) , name (text) , nationality (text) , role (text) | performance : performance_id (text) , date (text) , host (text) , location (text) , attendance (text) | member_attendance : member_id (text) , performance_id (text) , num_of_pieces (text);
|
[Primary Keys]: member : member_id, performance : performance_id, member_attendance : member_id
|
[Foreign Keys]: member_attendance : performance_id = performance : performance_id | member_attendance : member_id = member : member_id
|
performance_attendance
|
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
|
Show the names of members and the location of the performances they attended.
|
[Schema (values) (types)]: | performance_attendance | member : member_id (text) , name (text) , nationality (text) , role (text) | performance : performance_id (text) , date (text) , host (text) , location (text) , attendance (text) | member_attendance : member_id (text) , performance_id (text) , num_of_pieces (text);
|
[Primary Keys]: member : member_id, performance : performance_id, member_attendance : member_id
|
[Foreign Keys]: member_attendance : performance_id = performance : performance_id | member_attendance : member_id = member : member_id
|
performance_attendance
|
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
|
Show the names of members and the location of performances they attended in ascending alphabetical order of their names.
|
[Schema (values) (types)]: | performance_attendance | member : member_id (text) , name (text) , nationality (text) , role (text) | performance : performance_id (text) , date (text) , host (text) , location (text) , attendance (text) | member_attendance : member_id (text) , performance_id (text) , num_of_pieces (text);
|
[Primary Keys]: member : member_id, performance : performance_id, member_attendance : member_id
|
[Foreign Keys]: member_attendance : performance_id = performance : performance_id | member_attendance : member_id = member : member_id
|
performance_attendance
|
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"
|
Show the dates of performances with attending members whose roles are "Violin".
|
[Schema (values) (types)]: | performance_attendance | member : member_id (text) , name (text) , nationality (text) , role (text) | performance : performance_id (text) , date (text) , host (text) , location (text) , attendance (text) | member_attendance : member_id (text) , performance_id (text) , num_of_pieces (text);
|
[Primary Keys]: member : member_id, performance : performance_id, member_attendance : member_id
|
[Foreign Keys]: member_attendance : performance_id = performance : performance_id | member_attendance : member_id = member : member_id
|
performance_attendance
|
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
|
Show the names of members and the dates of performances they attended in descending order of attendance of the performances.
|
[Schema (values) (types)]: | performance_attendance | member : member_id (text) , name (text) , nationality (text) , role (text) | performance : performance_id (text) , date (text) , host (text) , location (text) , attendance (text) | member_attendance : member_id (text) , performance_id (text) , num_of_pieces (text);
|
[Primary Keys]: member : member_id, performance : performance_id, member_attendance : member_id
|
[Foreign Keys]: member_attendance : performance_id = performance : performance_id | member_attendance : member_id = member : member_id
|
performance_attendance
|
SELECT Name FROM member WHERE Member_ID NOT IN (SELECT Member_ID FROM member_attendance)
|
List the names of members who did not attend any performance.
|
[Schema (values) (types)]: | performance_attendance | member : member_id (text) , name (text) , nationality (text) , role (text) | performance : performance_id (text) , date (text) , host (text) , location (text) , attendance (text) | member_attendance : member_id (text) , performance_id (text) , num_of_pieces (text);
|
[Primary Keys]: member : member_id, performance : performance_id, member_attendance : member_id
|
[Foreign Keys]: member_attendance : performance_id = performance : performance_id | member_attendance : member_id = member : member_id
|
college_2
|
SELECT DISTINCT building FROM classroom WHERE capacity > 50
|
Find the buildings which have rooms with capacity more than 50.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT DISTINCT building FROM classroom WHERE capacity > 50
|
What are the distinct buildings with capacities of greater than 50?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(*) FROM classroom WHERE building != 'Lamberton'
|
Count the number of rooms that are not in the Lamberton building.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(*) FROM classroom WHERE building != 'Lamberton'
|
How many classrooms are not in Lamberton?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name , building FROM department WHERE budget > (SELECT avg(budget) FROM department)
|
What is the name and building of the departments whose budget is more than the average budget?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name , building FROM department WHERE budget > (SELECT avg(budget) FROM department)
|
Give the name and building of the departments with greater than average budget.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT building , room_number FROM classroom WHERE capacity BETWEEN 50 AND 100
|
Find the room number of the rooms which can sit 50 to 100 students and their buildings.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT building , room_number FROM classroom WHERE capacity BETWEEN 50 AND 100
|
What are the room numbers and corresponding buildings for classrooms which can seat between 50 to 100 students?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name , building FROM department ORDER BY budget DESC LIMIT 1
|
Find the name and building of the department with the highest budget.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name , building FROM department ORDER BY budget DESC LIMIT 1
|
What is the department name and corresponding building for the department with the greatest budget?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1
|
What is the name of the student who has the highest total credits in the History department.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1
|
Give the name of the student in the History department with the most credits.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(*) FROM classroom WHERE building = 'Lamberton'
|
How many rooms does the Lamberton building have?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(*) FROM classroom WHERE building = 'Lamberton'
|
Count the number of classrooms in Lamberton.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(DISTINCT s_id) FROM advisor
|
How many students have advisors?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(DISTINCT s_id) FROM advisor
|
Count the number of students who have advisors.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(DISTINCT dept_name) FROM course
|
How many departments offer courses?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(DISTINCT dept_name) FROM course
|
Count the number of departments which offer courses.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'
|
How many different courses offered by Physics department?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'
|
Count the number of courses in the Physics department.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
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
|
Find the title of courses that have two prerequisites?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
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
|
What are the titles for courses with two prerequisites?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
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
|
Find the title, credit, and department name of courses that have more than one prerequisites?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
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
|
What is the title, credit value, and department name for courses with more than one prerequisite?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
|
How many courses that do not have prerequisite?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
|
Count the number of courses without prerequisites.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
|
Find the name of the courses that do not have any prerequisite?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
|
What are the titles of courses without prerequisites?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT COUNT (DISTINCT id) FROM teaches
|
How many different instructors have taught some course?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT COUNT (DISTINCT id) FROM teaches
|
Count the number of distinct instructors who have taught a course.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT sum(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'
|
Find the total budgets of the Marketing or Finance department.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT sum(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'
|
What is the sum of budgets of the Marketing and Finance departments?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'
|
Find the department name of the instructor whose name contains 'Soisalon'.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'
|
What is the name of the department with an instructure who has a name like 'Soisalon'?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50
|
How many rooms whose capacity is less than 50 does the Lamberton building have?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50
|
Count the number of rooms in Lamberton with capacity lower than 50.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name , budget FROM department WHERE budget > (SELECT avg(budget) FROM department)
|
Find the name and budget of departments whose budgets are more than the average budget.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name , budget FROM department WHERE budget > (SELECT avg(budget) FROM department)
|
What are the names and budgets of departments with budgets greater than the average?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1
|
what is the name of the instructor who is in Statistics department and earns the lowest salary?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1
|
Give the name of the lowest earning instructor in the Statistics department.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'
|
Find the title of course that is provided by both Statistics and Psychology departments.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'
|
What is the title of a course that is listed in both the Statistics and Psychology departments?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'
|
Find the title of course that is provided by Statistics but not Psychology departments.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'
|
What are the titles of courses that are in the Statistics department but not the Psychology department?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010
|
Find the id of instructors who taught a class in Fall 2009 but not in Spring 2010.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010
|
What are the ids of instructors who taught in the Fall of 2009 but not in the Spring of 2010?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010
|
Find the name of students who took any class in the years of 2009 and 2010.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010
|
What are the names of the students who took classes in 2009 or 2010?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC LIMIT 3
|
Find the names of the top 3 departments that provide the largest amount of courses?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC LIMIT 3
|
What are the names of the 3 departments with the most courses?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name FROM course GROUP BY dept_name ORDER BY sum(credits) DESC LIMIT 1
|
Find the name of the department that offers the highest total credits?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name FROM course GROUP BY dept_name ORDER BY sum(credits) DESC LIMIT 1
|
What is the name of the department with the most credits?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT title FROM course ORDER BY title , credits
|
List the names of all courses ordered by their titles and credits.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT title FROM course ORDER BY title , credits
|
Given the titles of all courses, in order of titles and credits.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name FROM department ORDER BY budget LIMIT 1
|
Which department has the lowest budget?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name FROM department ORDER BY budget LIMIT 1
|
Give the name of the department with the lowest budget.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name , building FROM department ORDER BY budget DESC
|
List the names and buildings of all departments sorted by the budget from large to small.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT dept_name , building FROM department ORDER BY budget DESC
|
What are the names and buildings of the deparments, sorted by budget descending?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT name FROM instructor ORDER BY salary DESC LIMIT 1
|
Who is the instructor with the highest salary?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT name FROM instructor ORDER BY salary DESC LIMIT 1
|
Give the name of the highest paid instructor.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT * FROM instructor ORDER BY salary
|
List the information of all instructors ordered by their salary in ascending order.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT * FROM instructor ORDER BY salary
|
Give all information regarding instructors, in order of salary from least to greatest.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT name , dept_name FROM student ORDER BY tot_cred
|
Find the name of the students and their department names sorted by their total credits in ascending order.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT name , dept_name FROM student ORDER BY tot_cred
|
What are the names of students and their respective departments, ordered by number of credits from least to greatest?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
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
|
list in alphabetic order all course names and their instructors' names in year 2008.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
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
|
Show all titles and their instructors' names for courses in 2008, in alphabetical order by title.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT T1.name FROM instructor AS T1 JOIN advisor AS T2 ON T1.id = T2.i_id GROUP BY T2.i_id HAVING count(*) > 1
|
Find the name of instructors who are advising more than one student.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT T1.name FROM instructor AS T1 JOIN advisor AS T2 ON T1.id = T2.i_id GROUP BY T2.i_id HAVING count(*) > 1
|
What are the names of instructors who advise more than one student?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT T1.name FROM student AS T1 JOIN advisor AS T2 ON T1.id = T2.s_id GROUP BY T2.s_id HAVING count(*) > 1
|
Find the name of the students who have more than one advisor?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT T1.name FROM student AS T1 JOIN advisor AS T2 ON T1.id = T2.s_id GROUP BY T2.s_id HAVING count(*) > 1
|
What are the names of students who have more than one advisor?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(*) , building FROM classroom WHERE capacity > 50 GROUP BY building
|
Find the number of rooms with more than 50 capacity for each building.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT count(*) , building FROM classroom WHERE capacity > 50 GROUP BY building
|
How many rooms in each building have a capacity of over 50?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT max(capacity) , avg(capacity) , building FROM classroom GROUP BY building
|
Find the maximum and average capacity among rooms in each building.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT max(capacity) , avg(capacity) , building FROM classroom GROUP BY building
|
What are the greatest and average capacity for rooms in each building?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT title FROM course GROUP BY title HAVING count(*) > 1
|
Find the title of the course that is offered by more than one department.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT title FROM course GROUP BY title HAVING count(*) > 1
|
What are the titles of courses that are offered in more than one department?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT sum(credits) , dept_name FROM course GROUP BY dept_name
|
Find the total credits of courses provided by different department.
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
college_2
|
SELECT sum(credits) , dept_name FROM course GROUP BY dept_name
|
How many total credits are offered by each department?
|
[Schema (values) (types)]: | college_2 | classroom : building (text) , room_number (text) , capacity (text) | department : dept_name (text) , building (text) , budget (text) | course : course_id (text) , title (text) , dept_name (text) , credits (number) | instructor : id (text) , name (text) , dept_name (text) , salary (number) | section : course_id (text) , sec_id (text) , semester (text) , year (number) , building (text) , room_number (text) , time_slot_id (number) | teaches : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) | student : id (text) , name (text) , dept_name (text) , tot_cred (number) | takes : id (text) , course_id (text) , sec_id (text) , semester (number) , year (text) , grade (text) | advisor : s_id (text) , i_id (text) | time_slot : time_slot_id (text) , day (text) , start_hr (text) , start_min (number) , end_hr (text) , end_min (text) | prereq : course_id (text) , prereq_id (text);
|
[Primary Keys]: classroom : building, department : dept_name, course : course_id, instructor : id, section : course_id, teaches : id, student : id, takes : id, advisor : s_id, time_slot : time_slot_id, prereq : course_id
|
[Foreign Keys]: course : dept_name = department : dept_name | instructor : dept_name = department : dept_name | section : building = classroom : building | section : room_number = classroom : room_number | section : course_id = course : course_id | teaches : id = instructor : id | teaches : course_id = section : course_id | teaches : sec_id = section : sec_id | teaches : semester = section : semester | teaches : year = section : year | student : dept_name = department : dept_name | takes : id = student : id | takes : course_id = section : course_id | takes : sec_id = section : sec_id | takes : semester = section : semester | takes : year = section : year | advisor : s_id = student : id | advisor : i_id = instructor : id | prereq : prereq_id = course : course_id | prereq : course_id = course : course_id
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.