input stringlengths 191 7.13k | output stringlengths 19 578 |
|---|---|
Tables: Player_Attributes, sqlite_sequence, Player, League, Country, Team, Team_Attributes
Columns: Player_Attributes.id, Player_Attributes.player_fifa_api_id, Player_Attributes.player_api_id, Player_Attributes.date, Player_Attributes.overall_rating, Player_Attributes.potential, Player_Attributes.preferred_foot, Player_Attributes.attacking_work_rate, Player_Attributes.defensive_work_rate, Player_Attributes.crossing, Player_Attributes.finishing, Player_Attributes.heading_accuracy, Player_Attributes.short_passing, Player_Attributes.volleys, Player_Attributes.dribbling, Player_Attributes.curve, Player_Attributes.free_kick_accuracy, Player_Attributes.long_passing, Player_Attributes.ball_control, Player_Attributes.acceleration, Player_Attributes.sprint_speed, Player_Attributes.agility, Player_Attributes.reactions, Player_Attributes.balance, Player_Attributes.shot_power, Player_Attributes.jumping, Player_Attributes.stamina, Player_Attributes.strength, Player_Attributes.long_shots, Player_Attributes.aggression, Player_Attributes.interceptions, Player_Attributes.positioning, Player_Attributes.vision, Player_Attributes.penalties, Player_Attributes.marking, Player_Attributes.standing_tackle, Player_Attributes.sliding_tackle, Player_Attributes.gk_diving, Player_Attributes.gk_handling, Player_Attributes.gk_kicking, Player_Attributes.gk_positioning, Player_Attributes.gk_reflexes, sqlite_sequence.name, sqlite_sequence.seq, Player.id, Player.player_api_id, Player.player_name, Player.player_fifa_api_id, Player.birthday, Player.height, Player.weight, League.id, League.country_id, League.name, Country.id, Country.name, Team.id, Team.team_api_id, Team.team_fifa_api_id, Team.team_long_name, Team.team_short_name, Team_Attributes.id, Team_Attributes.team_fifa_api_id, Team_Attributes.team_api_id, Team_Attributes.date, Team_Attributes.buildUpPlaySpeed, Team_Attributes.buildUpPlaySpeedClass, Team_Attributes.buildUpPlayDribbling, Team_Attributes.buildUpPlayDribblingClass, Team_Attributes.buildUpPlayPassing, Team_Attributes.buildUpPlayPassingClass, Team_Attributes.buildUpPlayPositioningClass, Team_Attributes.chanceCreationPassing, Team_Attributes.chanceCreationPassingClass, Team_Attributes.chanceCreationCrossing, Team_Attributes.chanceCreationCrossingClass, Team_Attributes.chanceCreationShooting, Team_Attributes.chanceCreationShootingClass, Team_Attributes.chanceCreationPositioningClass, Team_Attributes.defencePressure, Team_Attributes.defencePressureClass, Team_Attributes.defenceAggression, Team_Attributes.defenceAggressionClass, Team_Attributes.defenceTeamWidth, Team_Attributes.defenceTeamWidthClass, Team_Attributes.defenceDefenderLineClass
Question: List the names of all left-footed players who have overall rating between 85 and 90. [/INST] | 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; |
Tables: Player_Attributes, sqlite_sequence, Player, League, Country, Team, Team_Attributes
Columns: Player_Attributes.id, Player_Attributes.player_fifa_api_id, Player_Attributes.player_api_id, Player_Attributes.date, Player_Attributes.overall_rating, Player_Attributes.potential, Player_Attributes.preferred_foot, Player_Attributes.attacking_work_rate, Player_Attributes.defensive_work_rate, Player_Attributes.crossing, Player_Attributes.finishing, Player_Attributes.heading_accuracy, Player_Attributes.short_passing, Player_Attributes.volleys, Player_Attributes.dribbling, Player_Attributes.curve, Player_Attributes.free_kick_accuracy, Player_Attributes.long_passing, Player_Attributes.ball_control, Player_Attributes.acceleration, Player_Attributes.sprint_speed, Player_Attributes.agility, Player_Attributes.reactions, Player_Attributes.balance, Player_Attributes.shot_power, Player_Attributes.jumping, Player_Attributes.stamina, Player_Attributes.strength, Player_Attributes.long_shots, Player_Attributes.aggression, Player_Attributes.interceptions, Player_Attributes.positioning, Player_Attributes.vision, Player_Attributes.penalties, Player_Attributes.marking, Player_Attributes.standing_tackle, Player_Attributes.sliding_tackle, Player_Attributes.gk_diving, Player_Attributes.gk_handling, Player_Attributes.gk_kicking, Player_Attributes.gk_positioning, Player_Attributes.gk_reflexes, sqlite_sequence.name, sqlite_sequence.seq, Player.id, Player.player_api_id, Player.player_name, Player.player_fifa_api_id, Player.birthday, Player.height, Player.weight, League.id, League.country_id, League.name, Country.id, Country.name, Team.id, Team.team_api_id, Team.team_fifa_api_id, Team.team_long_name, Team.team_short_name, Team_Attributes.id, Team_Attributes.team_fifa_api_id, Team_Attributes.team_api_id, Team_Attributes.date, Team_Attributes.buildUpPlaySpeed, Team_Attributes.buildUpPlaySpeedClass, Team_Attributes.buildUpPlayDribbling, Team_Attributes.buildUpPlayDribblingClass, Team_Attributes.buildUpPlayPassing, Team_Attributes.buildUpPlayPassingClass, Team_Attributes.buildUpPlayPositioningClass, Team_Attributes.chanceCreationPassing, Team_Attributes.chanceCreationPassingClass, Team_Attributes.chanceCreationCrossing, Team_Attributes.chanceCreationCrossingClass, Team_Attributes.chanceCreationShooting, Team_Attributes.chanceCreationShootingClass, Team_Attributes.chanceCreationPositioningClass, Team_Attributes.defencePressure, Team_Attributes.defencePressureClass, Team_Attributes.defenceAggression, Team_Attributes.defenceAggressionClass, Team_Attributes.defenceTeamWidth, Team_Attributes.defenceTeamWidthClass, Team_Attributes.defenceDefenderLineClass
Question: What is the average rating for right-footed players and left-footed players? [/INST] | SELECT preferred_foot , avg(overall_rating) FROM Player_Attributes GROUP BY preferred_foot; |
Tables: Player_Attributes, sqlite_sequence, Player, League, Country, Team, Team_Attributes
Columns: Player_Attributes.id, Player_Attributes.player_fifa_api_id, Player_Attributes.player_api_id, Player_Attributes.date, Player_Attributes.overall_rating, Player_Attributes.potential, Player_Attributes.preferred_foot, Player_Attributes.attacking_work_rate, Player_Attributes.defensive_work_rate, Player_Attributes.crossing, Player_Attributes.finishing, Player_Attributes.heading_accuracy, Player_Attributes.short_passing, Player_Attributes.volleys, Player_Attributes.dribbling, Player_Attributes.curve, Player_Attributes.free_kick_accuracy, Player_Attributes.long_passing, Player_Attributes.ball_control, Player_Attributes.acceleration, Player_Attributes.sprint_speed, Player_Attributes.agility, Player_Attributes.reactions, Player_Attributes.balance, Player_Attributes.shot_power, Player_Attributes.jumping, Player_Attributes.stamina, Player_Attributes.strength, Player_Attributes.long_shots, Player_Attributes.aggression, Player_Attributes.interceptions, Player_Attributes.positioning, Player_Attributes.vision, Player_Attributes.penalties, Player_Attributes.marking, Player_Attributes.standing_tackle, Player_Attributes.sliding_tackle, Player_Attributes.gk_diving, Player_Attributes.gk_handling, Player_Attributes.gk_kicking, Player_Attributes.gk_positioning, Player_Attributes.gk_reflexes, sqlite_sequence.name, sqlite_sequence.seq, Player.id, Player.player_api_id, Player.player_name, Player.player_fifa_api_id, Player.birthday, Player.height, Player.weight, League.id, League.country_id, League.name, Country.id, Country.name, Team.id, Team.team_api_id, Team.team_fifa_api_id, Team.team_long_name, Team.team_short_name, Team_Attributes.id, Team_Attributes.team_fifa_api_id, Team_Attributes.team_api_id, Team_Attributes.date, Team_Attributes.buildUpPlaySpeed, Team_Attributes.buildUpPlaySpeedClass, Team_Attributes.buildUpPlayDribbling, Team_Attributes.buildUpPlayDribblingClass, Team_Attributes.buildUpPlayPassing, Team_Attributes.buildUpPlayPassingClass, Team_Attributes.buildUpPlayPositioningClass, Team_Attributes.chanceCreationPassing, Team_Attributes.chanceCreationPassingClass, Team_Attributes.chanceCreationCrossing, Team_Attributes.chanceCreationCrossingClass, Team_Attributes.chanceCreationShooting, Team_Attributes.chanceCreationShootingClass, Team_Attributes.chanceCreationPositioningClass, Team_Attributes.defencePressure, Team_Attributes.defencePressureClass, Team_Attributes.defenceAggression, Team_Attributes.defenceAggressionClass, Team_Attributes.defenceTeamWidth, Team_Attributes.defenceTeamWidthClass, Team_Attributes.defenceDefenderLineClass
Question: Of all players with an overall rating greater than 80, how many are right-footed and left-footed? [/INST] | SELECT preferred_foot , count(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot; |
Tables: Player_Attributes, sqlite_sequence, Player, League, Country, Team, Team_Attributes
Columns: Player_Attributes.id, Player_Attributes.player_fifa_api_id, Player_Attributes.player_api_id, Player_Attributes.date, Player_Attributes.overall_rating, Player_Attributes.potential, Player_Attributes.preferred_foot, Player_Attributes.attacking_work_rate, Player_Attributes.defensive_work_rate, Player_Attributes.crossing, Player_Attributes.finishing, Player_Attributes.heading_accuracy, Player_Attributes.short_passing, Player_Attributes.volleys, Player_Attributes.dribbling, Player_Attributes.curve, Player_Attributes.free_kick_accuracy, Player_Attributes.long_passing, Player_Attributes.ball_control, Player_Attributes.acceleration, Player_Attributes.sprint_speed, Player_Attributes.agility, Player_Attributes.reactions, Player_Attributes.balance, Player_Attributes.shot_power, Player_Attributes.jumping, Player_Attributes.stamina, Player_Attributes.strength, Player_Attributes.long_shots, Player_Attributes.aggression, Player_Attributes.interceptions, Player_Attributes.positioning, Player_Attributes.vision, Player_Attributes.penalties, Player_Attributes.marking, Player_Attributes.standing_tackle, Player_Attributes.sliding_tackle, Player_Attributes.gk_diving, Player_Attributes.gk_handling, Player_Attributes.gk_kicking, Player_Attributes.gk_positioning, Player_Attributes.gk_reflexes, sqlite_sequence.name, sqlite_sequence.seq, Player.id, Player.player_api_id, Player.player_name, Player.player_fifa_api_id, Player.birthday, Player.height, Player.weight, League.id, League.country_id, League.name, Country.id, Country.name, Team.id, Team.team_api_id, Team.team_fifa_api_id, Team.team_long_name, Team.team_short_name, Team_Attributes.id, Team_Attributes.team_fifa_api_id, Team_Attributes.team_api_id, Team_Attributes.date, Team_Attributes.buildUpPlaySpeed, Team_Attributes.buildUpPlaySpeedClass, Team_Attributes.buildUpPlayDribbling, Team_Attributes.buildUpPlayDribblingClass, Team_Attributes.buildUpPlayPassing, Team_Attributes.buildUpPlayPassingClass, Team_Attributes.buildUpPlayPositioningClass, Team_Attributes.chanceCreationPassing, Team_Attributes.chanceCreationPassingClass, Team_Attributes.chanceCreationCrossing, Team_Attributes.chanceCreationCrossingClass, Team_Attributes.chanceCreationShooting, Team_Attributes.chanceCreationShootingClass, Team_Attributes.chanceCreationPositioningClass, Team_Attributes.defencePressure, Team_Attributes.defencePressureClass, Team_Attributes.defenceAggression, Team_Attributes.defenceAggressionClass, Team_Attributes.defenceTeamWidth, Team_Attributes.defenceTeamWidthClass, Team_Attributes.defenceDefenderLineClass
Question: List all of the player ids with a height of at least 180cm and an overall rating higher than 85. [/INST] | SELECT player_api_id FROM Player WHERE height >= 180 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE overall_rating > 85; |
Tables: Player_Attributes, sqlite_sequence, Player, League, Country, Team, Team_Attributes
Columns: Player_Attributes.id, Player_Attributes.player_fifa_api_id, Player_Attributes.player_api_id, Player_Attributes.date, Player_Attributes.overall_rating, Player_Attributes.potential, Player_Attributes.preferred_foot, Player_Attributes.attacking_work_rate, Player_Attributes.defensive_work_rate, Player_Attributes.crossing, Player_Attributes.finishing, Player_Attributes.heading_accuracy, Player_Attributes.short_passing, Player_Attributes.volleys, Player_Attributes.dribbling, Player_Attributes.curve, Player_Attributes.free_kick_accuracy, Player_Attributes.long_passing, Player_Attributes.ball_control, Player_Attributes.acceleration, Player_Attributes.sprint_speed, Player_Attributes.agility, Player_Attributes.reactions, Player_Attributes.balance, Player_Attributes.shot_power, Player_Attributes.jumping, Player_Attributes.stamina, Player_Attributes.strength, Player_Attributes.long_shots, Player_Attributes.aggression, Player_Attributes.interceptions, Player_Attributes.positioning, Player_Attributes.vision, Player_Attributes.penalties, Player_Attributes.marking, Player_Attributes.standing_tackle, Player_Attributes.sliding_tackle, Player_Attributes.gk_diving, Player_Attributes.gk_handling, Player_Attributes.gk_kicking, Player_Attributes.gk_positioning, Player_Attributes.gk_reflexes, sqlite_sequence.name, sqlite_sequence.seq, Player.id, Player.player_api_id, Player.player_name, Player.player_fifa_api_id, Player.birthday, Player.height, Player.weight, League.id, League.country_id, League.name, Country.id, Country.name, Team.id, Team.team_api_id, Team.team_fifa_api_id, Team.team_long_name, Team.team_short_name, Team_Attributes.id, Team_Attributes.team_fifa_api_id, Team_Attributes.team_api_id, Team_Attributes.date, Team_Attributes.buildUpPlaySpeed, Team_Attributes.buildUpPlaySpeedClass, Team_Attributes.buildUpPlayDribbling, Team_Attributes.buildUpPlayDribblingClass, Team_Attributes.buildUpPlayPassing, Team_Attributes.buildUpPlayPassingClass, Team_Attributes.buildUpPlayPositioningClass, Team_Attributes.chanceCreationPassing, Team_Attributes.chanceCreationPassingClass, Team_Attributes.chanceCreationCrossing, Team_Attributes.chanceCreationCrossingClass, Team_Attributes.chanceCreationShooting, Team_Attributes.chanceCreationShootingClass, Team_Attributes.chanceCreationPositioningClass, Team_Attributes.defencePressure, Team_Attributes.defencePressureClass, Team_Attributes.defenceAggression, Team_Attributes.defenceAggressionClass, Team_Attributes.defenceTeamWidth, Team_Attributes.defenceTeamWidthClass, Team_Attributes.defenceDefenderLineClass
Question: List all of the ids for left-footed players with a height between 180cm and 190cm. [/INST] | SELECT player_api_id FROM Player WHERE height >= 180 AND height <= 190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot = "left"; |
Tables: Player_Attributes, sqlite_sequence, Player, League, Country, Team, Team_Attributes
Columns: Player_Attributes.id, Player_Attributes.player_fifa_api_id, Player_Attributes.player_api_id, Player_Attributes.date, Player_Attributes.overall_rating, Player_Attributes.potential, Player_Attributes.preferred_foot, Player_Attributes.attacking_work_rate, Player_Attributes.defensive_work_rate, Player_Attributes.crossing, Player_Attributes.finishing, Player_Attributes.heading_accuracy, Player_Attributes.short_passing, Player_Attributes.volleys, Player_Attributes.dribbling, Player_Attributes.curve, Player_Attributes.free_kick_accuracy, Player_Attributes.long_passing, Player_Attributes.ball_control, Player_Attributes.acceleration, Player_Attributes.sprint_speed, Player_Attributes.agility, Player_Attributes.reactions, Player_Attributes.balance, Player_Attributes.shot_power, Player_Attributes.jumping, Player_Attributes.stamina, Player_Attributes.strength, Player_Attributes.long_shots, Player_Attributes.aggression, Player_Attributes.interceptions, Player_Attributes.positioning, Player_Attributes.vision, Player_Attributes.penalties, Player_Attributes.marking, Player_Attributes.standing_tackle, Player_Attributes.sliding_tackle, Player_Attributes.gk_diving, Player_Attributes.gk_handling, Player_Attributes.gk_kicking, Player_Attributes.gk_positioning, Player_Attributes.gk_reflexes, sqlite_sequence.name, sqlite_sequence.seq, Player.id, Player.player_api_id, Player.player_name, Player.player_fifa_api_id, Player.birthday, Player.height, Player.weight, League.id, League.country_id, League.name, Country.id, Country.name, Team.id, Team.team_api_id, Team.team_fifa_api_id, Team.team_long_name, Team.team_short_name, Team_Attributes.id, Team_Attributes.team_fifa_api_id, Team_Attributes.team_api_id, Team_Attributes.date, Team_Attributes.buildUpPlaySpeed, Team_Attributes.buildUpPlaySpeedClass, Team_Attributes.buildUpPlayDribbling, Team_Attributes.buildUpPlayDribblingClass, Team_Attributes.buildUpPlayPassing, Team_Attributes.buildUpPlayPassingClass, Team_Attributes.buildUpPlayPositioningClass, Team_Attributes.chanceCreationPassing, Team_Attributes.chanceCreationPassingClass, Team_Attributes.chanceCreationCrossing, Team_Attributes.chanceCreationCrossingClass, Team_Attributes.chanceCreationShooting, Team_Attributes.chanceCreationShootingClass, Team_Attributes.chanceCreationPositioningClass, Team_Attributes.defencePressure, Team_Attributes.defencePressureClass, Team_Attributes.defenceAggression, Team_Attributes.defenceAggressionClass, Team_Attributes.defenceTeamWidth, Team_Attributes.defenceTeamWidthClass, Team_Attributes.defenceDefenderLineClass
Question: Who are the top 3 players in terms of overall rating? [/INST] | 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; |
Tables: Player_Attributes, sqlite_sequence, Player, League, Country, Team, Team_Attributes
Columns: Player_Attributes.id, Player_Attributes.player_fifa_api_id, Player_Attributes.player_api_id, Player_Attributes.date, Player_Attributes.overall_rating, Player_Attributes.potential, Player_Attributes.preferred_foot, Player_Attributes.attacking_work_rate, Player_Attributes.defensive_work_rate, Player_Attributes.crossing, Player_Attributes.finishing, Player_Attributes.heading_accuracy, Player_Attributes.short_passing, Player_Attributes.volleys, Player_Attributes.dribbling, Player_Attributes.curve, Player_Attributes.free_kick_accuracy, Player_Attributes.long_passing, Player_Attributes.ball_control, Player_Attributes.acceleration, Player_Attributes.sprint_speed, Player_Attributes.agility, Player_Attributes.reactions, Player_Attributes.balance, Player_Attributes.shot_power, Player_Attributes.jumping, Player_Attributes.stamina, Player_Attributes.strength, Player_Attributes.long_shots, Player_Attributes.aggression, Player_Attributes.interceptions, Player_Attributes.positioning, Player_Attributes.vision, Player_Attributes.penalties, Player_Attributes.marking, Player_Attributes.standing_tackle, Player_Attributes.sliding_tackle, Player_Attributes.gk_diving, Player_Attributes.gk_handling, Player_Attributes.gk_kicking, Player_Attributes.gk_positioning, Player_Attributes.gk_reflexes, sqlite_sequence.name, sqlite_sequence.seq, Player.id, Player.player_api_id, Player.player_name, Player.player_fifa_api_id, Player.birthday, Player.height, Player.weight, League.id, League.country_id, League.name, Country.id, Country.name, Team.id, Team.team_api_id, Team.team_fifa_api_id, Team.team_long_name, Team.team_short_name, Team_Attributes.id, Team_Attributes.team_fifa_api_id, Team_Attributes.team_api_id, Team_Attributes.date, Team_Attributes.buildUpPlaySpeed, Team_Attributes.buildUpPlaySpeedClass, Team_Attributes.buildUpPlayDribbling, Team_Attributes.buildUpPlayDribblingClass, Team_Attributes.buildUpPlayPassing, Team_Attributes.buildUpPlayPassingClass, Team_Attributes.buildUpPlayPositioningClass, Team_Attributes.chanceCreationPassing, Team_Attributes.chanceCreationPassingClass, Team_Attributes.chanceCreationCrossing, Team_Attributes.chanceCreationCrossingClass, Team_Attributes.chanceCreationShooting, Team_Attributes.chanceCreationShootingClass, Team_Attributes.chanceCreationPositioningClass, Team_Attributes.defencePressure, Team_Attributes.defencePressureClass, Team_Attributes.defenceAggression, Team_Attributes.defenceAggressionClass, Team_Attributes.defenceTeamWidth, Team_Attributes.defenceTeamWidthClass, Team_Attributes.defenceDefenderLineClass
Question: List the names and birthdays of the top five players in terms of potential. [/INST] | 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; |
Tables: member, performance, member_attendance
Columns: member.Member_ID, member.Name, member.Nationality, member.Role, performance.Performance_ID, performance.Date, performance.Host, performance.Location, performance.Attendance, member_attendance.Member_ID, member_attendance.Performance_ID, member_attendance.Num_of_Pieces
Question: How many performances are there? [/INST] | SELECT count(*) FROM performance; |
Tables: member, performance, member_attendance
Columns: member.Member_ID, member.Name, member.Nationality, member.Role, performance.Performance_ID, performance.Date, performance.Host, performance.Location, performance.Attendance, member_attendance.Member_ID, member_attendance.Performance_ID, member_attendance.Num_of_Pieces
Question: List the hosts of performances in ascending order of attendance. [/INST] | SELECT HOST FROM performance ORDER BY Attendance ASC; |
Tables: member, performance, member_attendance
Columns: member.Member_ID, member.Name, member.Nationality, member.Role, performance.Performance_ID, performance.Date, performance.Host, performance.Location, performance.Attendance, member_attendance.Member_ID, member_attendance.Performance_ID, member_attendance.Num_of_Pieces
Question: What are the dates and locations of performances? [/INST] | SELECT Date , LOCATION FROM performance; |
Tables: member, performance, member_attendance
Columns: member.Member_ID, member.Name, member.Nationality, member.Role, performance.Performance_ID, performance.Date, performance.Host, performance.Location, performance.Attendance, member_attendance.Member_ID, member_attendance.Performance_ID, member_attendance.Num_of_Pieces
Question: Show the attendances of the performances at location "TD Garden" or "Bell Centre" [/INST] | SELECT Attendance FROM performance WHERE LOCATION = "TD Garden" OR LOCATION = "Bell Centre"; |
Tables: member, performance, member_attendance
Columns: member.Member_ID, member.Name, member.Nationality, member.Role, performance.Performance_ID, performance.Date, performance.Host, performance.Location, performance.Attendance, member_attendance.Member_ID, member_attendance.Performance_ID, member_attendance.Num_of_Pieces
Question: What is the average number of attendees for performances? [/INST] | SELECT avg(Attendance) FROM performance; |
Tables: member, performance, member_attendance
Columns: member.Member_ID, member.Name, member.Nationality, member.Role, performance.Performance_ID, performance.Date, performance.Host, performance.Location, performance.Attendance, member_attendance.Member_ID, member_attendance.Performance_ID, member_attendance.Num_of_Pieces
Question: What is the date of the performance with the highest number of attendees? [/INST] | SELECT Date FROM performance ORDER BY Attendance DESC LIMIT 1; |
Tables: member, performance, member_attendance
Columns: member.Member_ID, member.Name, member.Nationality, member.Role, performance.Performance_ID, performance.Date, performance.Host, performance.Location, performance.Attendance, member_attendance.Member_ID, member_attendance.Performance_ID, member_attendance.Num_of_Pieces
Question: Show different locations and the number of performances at each location. [/INST] | SELECT LOCATION , COUNT(*) FROM performance GROUP BY LOCATION; |
Tables: member, performance, member_attendance
Columns: member.Member_ID, member.Name, member.Nationality, member.Role, performance.Performance_ID, performance.Date, performance.Host, performance.Location, performance.Attendance, member_attendance.Member_ID, member_attendance.Performance_ID, member_attendance.Num_of_Pieces
Question: Show the most common location of performances. [/INST] | SELECT LOCATION FROM performance GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1; |
Tables: member, performance, member_attendance
Columns: member.Member_ID, member.Name, member.Nationality, member.Role, performance.Performance_ID, performance.Date, performance.Host, performance.Location, performance.Attendance, member_attendance.Member_ID, member_attendance.Performance_ID, member_attendance.Num_of_Pieces
Question: Show the locations that have at least two performances. [/INST] | SELECT LOCATION FROM performance GROUP BY LOCATION HAVING COUNT(*) >= 2; |
Tables: member, performance, member_attendance
Columns: member.Member_ID, member.Name, member.Nationality, member.Role, performance.Performance_ID, performance.Date, performance.Host, performance.Location, performance.Attendance, member_attendance.Member_ID, member_attendance.Performance_ID, member_attendance.Num_of_Pieces
Question: Show the locations that have both performances with more than 2000 attendees and performances with less than 1000 attendees. [/INST] | SELECT LOCATION FROM performance WHERE Attendance > 2000 INTERSECT SELECT LOCATION FROM performance WHERE Attendance < 1000; |
Tables: member, performance, member_attendance
Columns: member.Member_ID, member.Name, member.Nationality, member.Role, performance.Performance_ID, performance.Date, performance.Host, performance.Location, performance.Attendance, member_attendance.Member_ID, member_attendance.Performance_ID, member_attendance.Num_of_Pieces
Question: Show the names of members and the location of the performances they attended. [/INST] | 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; |
Tables: member, performance, member_attendance
Columns: member.Member_ID, member.Name, member.Nationality, member.Role, performance.Performance_ID, performance.Date, performance.Host, performance.Location, performance.Attendance, member_attendance.Member_ID, member_attendance.Performance_ID, member_attendance.Num_of_Pieces
Question: Show the names of members and the location of performances they attended in ascending alphabetical order of their names. [/INST] | 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; |
Tables: member, performance, member_attendance
Columns: member.Member_ID, member.Name, member.Nationality, member.Role, performance.Performance_ID, performance.Date, performance.Host, performance.Location, performance.Attendance, member_attendance.Member_ID, member_attendance.Performance_ID, member_attendance.Num_of_Pieces
Question: Show the dates of performances with attending members whose roles are "Violin". [/INST] | 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"; |
Tables: member, performance, member_attendance
Columns: member.Member_ID, member.Name, member.Nationality, member.Role, performance.Performance_ID, performance.Date, performance.Host, performance.Location, performance.Attendance, member_attendance.Member_ID, member_attendance.Performance_ID, member_attendance.Num_of_Pieces
Question: Show the names of members and the dates of performances they attended in descending order of attendance of the performances. [/INST] | 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; |
Tables: member, performance, member_attendance
Columns: member.Member_ID, member.Name, member.Nationality, member.Role, performance.Performance_ID, performance.Date, performance.Host, performance.Location, performance.Attendance, member_attendance.Member_ID, member_attendance.Performance_ID, member_attendance.Num_of_Pieces
Question: List the names of members who did not attend any performance. [/INST] | SELECT Name FROM member WHERE Member_ID NOT IN (SELECT Member_ID FROM member_attendance); |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the buildings which have rooms with capacity more than 50. [/INST] | SELECT DISTINCT building FROM classroom WHERE capacity > 50; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What are the distinct buildings with capacities of greater than 50? [/INST] | SELECT DISTINCT building FROM classroom WHERE capacity > 50; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Count the number of rooms that are not in the Lamberton building. [/INST] | SELECT count(*) FROM classroom WHERE building != 'Lamberton'; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: How many classrooms are not in Lamberton? [/INST] | SELECT count(*) FROM classroom WHERE building != 'Lamberton'; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What is the name and building of the departments whose budget is more than the average budget? [/INST] | SELECT dept_name , building FROM department WHERE budget > (SELECT avg(budget) FROM department); |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Give the name and building of the departments with greater than average budget. [/INST] | SELECT dept_name , building FROM department WHERE budget > (SELECT avg(budget) FROM department); |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the room number of the rooms which can sit 50 to 100 students and their buildings. [/INST] | SELECT building , room_number FROM classroom WHERE capacity BETWEEN 50 AND 100; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What are the room numbers and corresponding buildings for classrooms which can seat between 50 to 100 students? [/INST] | SELECT building , room_number FROM classroom WHERE capacity BETWEEN 50 AND 100; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the name and building of the department with the highest budget. [/INST] | SELECT dept_name , building FROM department ORDER BY budget DESC LIMIT 1; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What is the department name and corresponding building for the department with the greatest budget? [/INST] | SELECT dept_name , building FROM department ORDER BY budget DESC LIMIT 1; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What is the name of the student who has the highest total credits in the History department. [/INST] | SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Give the name of the student in the History department with the most credits. [/INST] | SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: How many rooms does the Lamberton building have? [/INST] | SELECT count(*) FROM classroom WHERE building = 'Lamberton'; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Count the number of classrooms in Lamberton. [/INST] | SELECT count(*) FROM classroom WHERE building = 'Lamberton'; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: How many students have advisors? [/INST] | SELECT count(DISTINCT s_id) FROM advisor; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Count the number of students who have advisors. [/INST] | SELECT count(DISTINCT s_id) FROM advisor; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: How many departments offer courses? [/INST] | SELECT count(DISTINCT dept_name) FROM course; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Count the number of departments which offer courses. [/INST] | SELECT count(DISTINCT dept_name) FROM course; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: How many different courses offered by Physics department? [/INST] | SELECT count(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Count the number of courses in the Physics department. [/INST] | SELECT count(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the title of courses that have two prerequisites? [/INST] | 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; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What are the titles for courses with two prerequisites? [/INST] | 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; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the title, credit, and department name of courses that have more than one prerequisites? [/INST] | 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; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What is the title, credit value, and department name for courses with more than one prerequisite? [/INST] | 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; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: How many courses that do not have prerequisite? [/INST] | SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq); |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Count the number of courses without prerequisites. [/INST] | SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq); |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the name of the courses that do not have any prerequisite? [/INST] | SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq); |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What are the titles of courses without prerequisites? [/INST] | SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq); |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: How many different instructors have taught some course? [/INST] | SELECT COUNT (DISTINCT id) FROM teaches; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Count the number of distinct instructors who have taught a course. [/INST] | SELECT COUNT (DISTINCT id) FROM teaches; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the total budgets of the Marketing or Finance department. [/INST] | SELECT sum(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What is the sum of budgets of the Marketing and Finance departments? [/INST] | SELECT sum(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the department name of the instructor whose name contains 'Soisalon'. [/INST] | SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What is the name of the department with an instructure who has a name like 'Soisalon'? [/INST] | SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: How many rooms whose capacity is less than 50 does the Lamberton building have? [/INST] | SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Count the number of rooms in Lamberton with capacity lower than 50. [/INST] | SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the name and budget of departments whose budgets are more than the average budget. [/INST] | SELECT dept_name , budget FROM department WHERE budget > (SELECT avg(budget) FROM department); |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What are the names and budgets of departments with budgets greater than the average? [/INST] | SELECT dept_name , budget FROM department WHERE budget > (SELECT avg(budget) FROM department); |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: what is the name of the instructor who is in Statistics department and earns the lowest salary? [/INST] | SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Give the name of the lowest earning instructor in the Statistics department. [/INST] | SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the title of course that is provided by both Statistics and Psychology departments. [/INST] | SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What is the title of a course that is listed in both the Statistics and Psychology departments? [/INST] | SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the title of course that is provided by Statistics but not Psychology departments. [/INST] | SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What are the titles of courses that are in the Statistics department but not the Psychology department? [/INST] | SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the id of instructors who taught a class in Fall 2009 but not in Spring 2010. [/INST] | SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What are the ids of instructors who taught in the Fall of 2009 but not in the Spring of 2010? [/INST] | SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the name of students who took any class in the years of 2009 and 2010. [/INST] | SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What are the names of the students who took classes in 2009 or 2010? [/INST] | SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the names of the top 3 departments that provide the largest amount of courses? [/INST] | SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC LIMIT 3; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What are the names of the 3 departments with the most courses? [/INST] | SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC LIMIT 3; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the name of the department that offers the highest total credits? [/INST] | SELECT dept_name FROM course GROUP BY dept_name ORDER BY sum(credits) DESC LIMIT 1; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What is the name of the department with the most credits? [/INST] | SELECT dept_name FROM course GROUP BY dept_name ORDER BY sum(credits) DESC LIMIT 1; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: List the names of all courses ordered by their titles and credits. [/INST] | SELECT title FROM course ORDER BY title , credits; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Given the titles of all courses, in order of titles and credits. [/INST] | SELECT title FROM course ORDER BY title , credits; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Which department has the lowest budget? [/INST] | SELECT dept_name FROM department ORDER BY budget LIMIT 1; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Give the name of the department with the lowest budget. [/INST] | SELECT dept_name FROM department ORDER BY budget LIMIT 1; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: List the names and buildings of all departments sorted by the budget from large to small. [/INST] | SELECT dept_name , building FROM department ORDER BY budget DESC; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What are the names and buildings of the deparments, sorted by budget descending? [/INST] | SELECT dept_name , building FROM department ORDER BY budget DESC; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Who is the instructor with the highest salary? [/INST] | SELECT name FROM instructor ORDER BY salary DESC LIMIT 1; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Give the name of the highest paid instructor. [/INST] | SELECT name FROM instructor ORDER BY salary DESC LIMIT 1; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: List the information of all instructors ordered by their salary in ascending order. [/INST] | SELECT * FROM instructor ORDER BY salary; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Give all information regarding instructors, in order of salary from least to greatest. [/INST] | SELECT * FROM instructor ORDER BY salary; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the name of the students and their department names sorted by their total credits in ascending order. [/INST] | SELECT name , dept_name FROM student ORDER BY tot_cred; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What are the names of students and their respective departments, ordered by number of credits from least to greatest? [/INST] | SELECT name , dept_name FROM student ORDER BY tot_cred; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: list in alphabetic order all course names and their instructors' names in year 2008. [/INST] | 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; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Show all titles and their instructors' names for courses in 2008, in alphabetical order by title. [/INST] | 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; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the name of instructors who are advising more than one student. [/INST] | 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; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What are the names of instructors who advise more than one student? [/INST] | 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; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the name of the students who have more than one advisor? [/INST] | 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; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What are the names of students who have more than one advisor? [/INST] | 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; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the number of rooms with more than 50 capacity for each building. [/INST] | SELECT count(*) , building FROM classroom WHERE capacity > 50 GROUP BY building; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: How many rooms in each building have a capacity of over 50? [/INST] | SELECT count(*) , building FROM classroom WHERE capacity > 50 GROUP BY building; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the maximum and average capacity among rooms in each building. [/INST] | SELECT max(capacity) , avg(capacity) , building FROM classroom GROUP BY building; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What are the greatest and average capacity for rooms in each building? [/INST] | SELECT max(capacity) , avg(capacity) , building FROM classroom GROUP BY building; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the title of the course that is offered by more than one department. [/INST] | SELECT title FROM course GROUP BY title HAVING count(*) > 1; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: What are the titles of courses that are offered in more than one department? [/INST] | SELECT title FROM course GROUP BY title HAVING count(*) > 1; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: Find the total credits of courses provided by different department. [/INST] | SELECT sum(credits) , dept_name FROM course GROUP BY dept_name; |
Tables: classroom, department, course, instructor, section, teaches, student, takes, advisor, time_slot, prereq
Columns: classroom.building, classroom.room_number, classroom.capacity, department.dept_name, department.building, department.budget, course.course_id, course.title, course.dept_name, course.credits, instructor.ID, instructor.name, instructor.dept_name, instructor.salary, section.course_id, section.sec_id, section.semester, section.year, section.building, section.room_number, section.time_slot_id, teaches.ID, teaches.course_id, teaches.sec_id, teaches.semester, teaches.year, student.ID, student.name, student.dept_name, student.tot_cred, takes.ID, takes.course_id, takes.sec_id, takes.semester, takes.year, takes.grade, advisor.s_ID, advisor.i_ID, time_slot.time_slot_id, time_slot.day, time_slot.start_hr, time_slot.start_min, time_slot.end_hr, time_slot.end_min, prereq.course_id, prereq.prereq_id
Question: How many total credits are offered by each department? [/INST] | SELECT sum(credits) , dept_name FROM course GROUP BY dept_name; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.