SQL
stringlengths
18
577
question
stringlengths
317
11.5k
SELECT Location FROM GreaterManchesterCrime GROUP BY Location ORDER BY count(*) DESC LIMIT 1
Given the Table greater manchester crime having columns as CrimeID has datatype text, CrimeTS has datatype time, Location has datatype text, LSOA has datatype text, Type has datatype text, Outcome has datatype text which has crime id. Answer the question by writing the appropriate SQL code. Where is the most dangerous area?
SELECT Location FROM GreaterManchesterCrime GROUP BY Location ORDER BY count(*) LIMIT 1
Given the Table greater manchester crime having columns as CrimeID has datatype text, CrimeTS has datatype time, Location has datatype text, LSOA has datatype text, Type has datatype text, Outcome has datatype text which has crime id. Answer the question by writing the appropriate SQL code. Where is the safest area?
SELECT Location FROM GreaterManchesterCrime WHERE Type = "Violence and sexual offences" GROUP BY Location ORDER BY count(*) DESC LIMIT 1
Given the Table greater manchester crime having columns as CrimeID has datatype text, CrimeTS has datatype time, Location has datatype text, LSOA has datatype text, Type has datatype text, Outcome has datatype text which has crime id. Answer the question by writing the appropriate SQL code. Where is the place with the largest number of sexual offenses crime events?
SELECT Location FROM GreaterManchesterCrime GROUP BY Location ORDER BY count(*) DESC LIMIT 1
Given the Table greater manchester crime having columns as CrimeID has datatype text, CrimeTS has datatype time, Location has datatype text, LSOA has datatype text, Type has datatype text, Outcome has datatype text which has crime id. Answer the question by writing the appropriate SQL code. If it is possible to increase the number of police officers, which place is with the first priority?
SELECT Type FROM GreaterManchesterCrime WHERE Outcome = "Awaiting court outcome" GROUP BY Type ORDER BY count(*) DESC LIMIT 1
Given the Table greater manchester crime having columns as CrimeID has datatype text, CrimeTS has datatype time, Location has datatype text, LSOA has datatype text, Type has datatype text, Outcome has datatype text which has crime id. Answer the question by writing the appropriate SQL code. Which type of crime has the most prosecution cases?
SELECT Type FROM GreaterManchesterCrime WHERE Outcome = "Investigation complete; no suspect identified" GROUP BY Type ORDER BY count(*) DESC LIMIT 1
Given the Table greater manchester crime having columns as CrimeID has datatype text, CrimeTS has datatype time, Location has datatype text, LSOA has datatype text, Type has datatype text, Outcome has datatype text which has crime id. Answer the question by writing the appropriate SQL code. Which type of crime has the most investigation complete cases?
SELECT Outcome FROM GreaterManchesterCrime WHERE CrimeID = "6B:E2:54:C6:58:D2"
Given the Table greater manchester crime having columns as CrimeID has datatype text, CrimeTS has datatype time, Location has datatype text, LSOA has datatype text, Type has datatype text, Outcome has datatype text which has crime id. Answer the question by writing the appropriate SQL code. What is the result in case 6B:E2:54:C6:58:D2?
SELECT T2.birth_state FROM player AS T2 JOIN hall_of_fame as T1 ON T1.player_id = T2.player_id WHERE inducted = "Y" GROUP BY T2.birth_state ORDER BY count(T1.player_id) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which states have produced the largest number of candidates inducted into the hall of fame?
SELECT league_id FROM salary GROUP BY league_id ORDER BY sum(salary) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What is the top league that pays the most to their players?
SELECT league_id FROM salary GROUP BY league_id ORDER BY max(salary) - min(salary) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which leage have the largest difference in pay among their team players?
SELECT avg(T2.salary) FROM salary as T2 JOIN hall_of_fame as T1 ON T1.player_id = T2.player_id WHERE T1.inducted = "Y"
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What is the average pay for players inducted into the hall of fame?
SELECT avg(T2.salary) FROM salary as T2 JOIN hall_of_fame as T1 ON T1.player_id = T2.player_id WHERE T1.inducted = "N"
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What is the average pay for players not inducted into the hall of fame?
SELECT league_id FROM salary GROUP BY league_id ORDER BY avg(salary) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which leage has higher average salaries for player?
SELECT birth_country FROM player GROUP BY birth_country ORDER BY count(*) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which Country are most baseball players from?
SELECT name_first, name_last FROM player ORDER BY birth_year DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Who is the youngest baseball player so far?
SELECT league_id FROM salary GROUP BY league_id ORDER BY sum(salary) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which league gets paid the most?
SELECT T2.points_won FROM player_award as T1 JOIN player_award_vote as T2 ON T1.player_id = T2.player_id WHERE T1.league_id = "NL" AND T1.award_id = "Most Valuable Player" AND T1.year = "1990" AND T2.league_id = "NL" AND T2.year = "1990"
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. How much points were received by the NL league's most valuable player winner in 1990?
SELECT avg( death_year - birth_year) FROM player WHERE birth_country = "USA"
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What is the average age of players from USA?
SELECT avg( death_year - birth_year ) FROM player
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What is the average lifespan of a baseball player?
SELECT votedby FROM hall_of_fame WHERE yearid = "2000" GROUP BY votedby ORDER BY count(*) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which is the most popular voting method for Hall of Fame in 2000?
SELECT count(*) FROM player WHERE weight > 200
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. How many players weigh over 200 pounds?
SELECT player_id FROM player_award WHERE year = 2010 AND award_id = "Rookie of the Year"
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Who is the winner of Rookie of the Year in 2010?
SELECT player_id FROM salary WHERE year >= 2010 ORDER BY salary DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Who is the highest paid player since 2010?
SELECT T2.salary FROM salary as T2 JOIN hall_of_fame as T1 ON T1.player_id = T2.player_id WHERE T1.inducted = "Y"
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What are the salaries of players who have ever enter hall of fame?
SELECT min(votes), yearid FROM hall_of_fame WHERE inducted = "Y" AND yearid >= 1871 GROUP BY yearid
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What are the minimum votes needed to enter hall of fame for each year since 1871?
SELECT salary FROM salary WHERE league_id = "NL"
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What are the salaries in National League?
SELECT salary FROM salary WHERE league_id = "AL"
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What are the salaries in American League?
SELECT birth_country FROM player as T1 JOIN player_award as T2 ON T1.player_id = T2.player_id GROUP BY T1.birth_country ORDER BY count(*) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which birth place has the most player awards?
SELECT T1.birth_country FROM hall_of_fame as T2 JOIN player as T1 ON T1.player_id = T2.player_id WHERE T2.inducted = "Y" AND T2.yearid >= 1871
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What are the birth places of players won on hall of fame since 1871?
SELECT award_id FROM player_award as T1 JOIN salary as T2 ON T1.player_id = T2.player_id GROUP BY T1.award_id ORDER BY avg(T2.salary) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which award has the highest player's salary?
SELECT DISTINCT yearid FROM hall_of_fame WHERE needed_note != ""
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What were the years when any special elections happened in hall of fame?
SELECT T1.birth_country FROM player as T1 JOIN hall_of_fame as T2 ON T1.player_id = T2.player_id WHERE T2.inducted = "Y" GROUP BY T1.birth_country ORDER BY count(*) DESC LIMIT 10
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Top 10 countries with the most hall of fame players
SELECT T1.player_id, T1.award_id , min(T1.year - T2.birth_year) FROM player_award as T1 JOIN player as T2 ON T1.player_id = T2.player_id GROUP BY T1.award_id
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. For every award, who is the youngest winner?
SELECT T1.player_id, T1.award_id , max(T1.year - T2.birth_year) FROM player_award as T1 JOIN player as T2 ON T1.player_id = T2.player_id GROUP BY T1.award_id
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. For every award, who is the oldest winner?
SELECT T2.team_id FROM hall_of_fame as T1 JOIN salary as T2 ON T1.player_id = T2.player_id AND T1.yearid = T2.year WHERE T1.inducted = "Y" GROUP BY T2.team_id ORDER BY count(*) DESC LIMIT 10
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Top 10 teams with the most hall of fame players
SELECT avg(T1.death_year - T1.birth_year) FROM player as T1 JOIN hall_of_fame as T2 ON T1.player_id = T2.player_id WHERE T2.inducted = "Y"
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Average lifespan of hall of fame players
SELECT avg(T1.weight) FROM player as T1 JOIN player_award as T2 ON T1.player_id = T2.player_id GROUP BY notes
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. For award winners, what's average weight for each position
SELECT T2.notes FROM hall_of_fame as T1 JOIN player_award as T2 ON T1.player_id = T2.player_id WHERE T1.inducted = "Y" GROUP BY notes ORDER BY count(*) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. For award winners, which position that has the most hall of fame players?
SELECT player_id FROM player_award_vote WHERE year = "1971" ORDER BY points_won DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which player get the highest score in 1971?
SELECT T1.birth_month FROM player as T1 JOIN hall_of_fame as T2 ON T1.player_id = T2.player_id WHERE T2.inducted = "Y" GROUP BY T1.birth_month ORDER BY count(*) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which month that players were born has the highest likelihood to be elected as hall of fame?
SELECT league_id FROM player_award WHERE year = "2006" GROUP BY league_id ORDER BY count(*) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which league has the most player awarded in 2006?
SELECT DISTINCT notes FROM player_award WHERE player_id = "willite01"
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What defense position the player ID willite01 is?
SELECT count(*) FROM (SELECT player_id FROM player_award GROUP BY player_id HAVING count(*) > 10)
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. How many players were awarded more than ten times?
SELECT birth_city FROM player GROUP BY birth_city ORDER BY count(*) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which city the most players were born?
SELECT avg(T1.weight) FROM player as T1 JOIN player_award as T2 ON T1.player_id = T2.player_id WHERE T2.award_id = "TSN All-Star" AND notes = "3B"
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What is the average weight of players who were awarded third-base man in TSN all-star award?
SELECT player_id FROM salary WHERE year = "2015" ORDER BY salary DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Who is the player had the highest salary in 2015?
SELECT T1.school_district FROM FINREV_FED_17 as T1 JOIN FINREV_FED_KEY_17 as T2 ON T1.state_code = T2.state_code WHERE T2.state = "Wisconsin" ORDER BY T1.t_fed_rev DESC LIMIT 1
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which school district receive the most of federal revenue through state in Wisconsin?
SELECT avg(T1.c14) FROM FINREV_FED_17 as T1 JOIN FINREV_FED_KEY_17 as T2 ON T1.state_code = T2.state_code WHERE T2.state = "Virginia"
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the average Title 1 fund in Virginia?
SELECT T2.state, sum(c14),sum(c25) FROM FINREV_FED_17 as T1 JOIN FINREV_FED_KEY_17 as T2 ON T1.state_code = T2.state_code JOIN NDECoreExcel_Math_Grade8 as T3 ON T2.state = T3.state GROUP BY T2.state ORDER BY T3.average_scale_score DESC LIMIT 10
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the top 10 states that have the highest average math score and federal revenue they got through different categories?
SELECT T1.school_district, max(T1.c14), T3.average_scale_score FROM FINREV_FED_17 as T1 JOIN FINREV_FED_KEY_17 as T2 ON T1.state_code = T2.state_code JOIN NDECoreExcel_Math_Grade8 as T3 ON T2.state = T3.state UNION SELECT T1.school_district, max(T1.c25), T3.average_scale_score FROM FINREV_FED_17 as T1 JOIN FINREV_FED_KEY_17 as T2 ON T1.state_code = T2.state_code JOIN NDECoreExcel_Math_Grade8 as T3 ON T2.state = T3.state
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the schools with highest federal revenue in each federal revenue categories and what's their state average scores?
SELECT state FROM NDECoreExcel_Math_Grade8 ORDER BY average_scale_score DESC LIMIT 1
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. State with highest average math score
SELECT T1.school_district, max(T1.t_fed_rev / T3.average_scale_score) FROM FINREV_FED_17 as T1 JOIN FINREV_FED_KEY_17 as T2 on T1.state_code = T2.state_code JOIN NDECoreExcel_Math_Grade8 as T3 ON T2.state = T3.state
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. School with highest ratio of total revenue and average scores
SELECT T2.state, T3.average_scale_score FROM FINREV_FED_KEY_17 as T2 JOIN FINREV_FED_17 as T1 ON T1.state_code = T2.state_code JOIN NDECoreExcel_Math_Grade8 as T3 ON T2.state = T3.state GROUP BY T2.state ORDER BY sum(T1.t_fed_rev) DESC LIMIT 1
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which state spent the most revenue towards schools and whats the state average score
SELECT T1.school_district, min(T1.t_fed_rev / T3.average_scale_score) FROM FINREV_FED_17 as T1 JOIN FINREV_FED_KEY_17 as T2 on T1.state_code = T2.state_code JOIN NDECoreExcel_Math_Grade8 as T3 ON T2.state = T3.state
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. School with lowest ratio of total revenue and average scores
SELECT T2.state, T3.average_scale_score FROM FINREV_FED_KEY_17 as T2 JOIN FINREV_FED_17 as T1 ON T1.state_code = T2.state_code JOIN NDECoreExcel_Math_Grade8 as T3 ON T2.state = T3.state GROUP BY T2.state ORDER BY sum(T1.t_fed_rev) LIMIT 1
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which state spent the least revenue towards schools and whats the state average score
SELECT state FROM NDECoreExcel_Math_Grade8 ORDER BY average_scale_score DESC LIMIT 1
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which state has the highest average score in math exam?
SELECT average_scale_score FROM NDECoreExcel_Math_Grade8 WHERE state = "California"
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the average match score of CA?
SELECT count(DISTINCT school_district) FROM FINREV_FED_17 as T1 JOIN FINREV_FED_KEY_17 as T2 ON T1.state_code = T2.state_code WHERE T2.state = "Indiana"
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many unique school districts in Indiana?
SELECT state_code FROM FINREV_FED_KEY_17 WHERE state = "Virginia"
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the state code of VA?
SELECT T2.state FROM FINREV_FED_KEY_17 as T2 JOIN FINREV_FED_17 as T1 ON T1.state_code = T2.state_code GROUP BY T2.state ORDER BY sum(t_fed_rev) DESC LIMIT 1
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which state get the highest revenue?
SELECT sum(T1.c14), sum(T1.c25) FROM FINREV_FED_17 as T1 JOIN FINREV_FED_KEY_17 as T2 ON T1.state_code = T2.state_code WHERE T2.state = "Colorado"
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How much funding does Colorado schools receive from Title 1 and the Child Nutrition program respectively?
SELECT t_fed_rev FROM FINREV_FED_17 WHERE school_district LIKE "%Pecatonia Area%"
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How much federal funding does Pecatonia Area School district get?
SELECT average_scale_score FROM NDECoreExcel_Math_Grade8 WHERE state = "North Carolina" UNION SELECT average_scale_score FROM NDECoreExcel_Math_Grade8 WHERE state = "South Carolina"
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the student scores on the NAEP math exam for 8th graders in North Carolina and South Carolina?
SELECT average_scale_score FROM NDECoreExcel_Math_Grade8 WHERE state = "North Carolina" UNION SELECT average_scale_score FROM NDECoreExcel_Math_Grade8 WHERE state = "New York"
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the averge score of students in NC and in NY?
SELECT count(*) FROM FINREV_FED_17 WHERE c25 > c14
Given the Table finrev fed 17 having columns as state_code has datatype number, idcensus has datatype number, school_district has datatype text, nces_id has datatype text, yr_data has datatype number, t_fed_rev has datatype number, c14 has datatype number, c25 has datatype number which has NO_PRIMARY_KEY and Given the Table ndecoreexcel math grade8 having columns as year has datatype number, state has datatype text, all_students has datatype text, average_scale_score has datatype number which has NO_PRIMARY_KEY and Given the Table finrev fed key 17 having columns as State_Code has datatype number, State has datatype text, #_Records has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many schools get higher revenue via Child Nutrition A than revenue via child left school behind act?
SELECT groupName FROM torrents ORDER BY totalSnatched DESC LIMIT 100
Given the Table torrents having columns as groupName has datatype text, totalSnatched has datatype number, artist has datatype text, groupYear has datatype number, releaseType has datatype text, groupId has datatype number, id has datatype number which has id and Given the Table tags having columns as index has datatype number, id has datatype number, tag has datatype text which has id. Answer the question by writing the appropriate SQL code. What are the top 100 torrent releases?
SELECT artist FROM torrents GROUP BY artist ORDER BY sum(totalSnatched) DESC LIMIT 10
Given the Table torrents having columns as groupName has datatype text, totalSnatched has datatype number, artist has datatype text, groupYear has datatype number, releaseType has datatype text, groupId has datatype number, id has datatype number which has id and Given the Table tags having columns as index has datatype number, id has datatype number, tag has datatype text which has id. Answer the question by writing the appropriate SQL code. What are name of top 10 artists or groups?
SELECT releaseType FROM torrents GROUP BY releaseType ORDER BY sum(totalSnatched) DESC LIMIT 10
Given the Table torrents having columns as groupName has datatype text, totalSnatched has datatype number, artist has datatype text, groupYear has datatype number, releaseType has datatype text, groupId has datatype number, id has datatype number which has id and Given the Table tags having columns as index has datatype number, id has datatype number, tag has datatype text which has id. Answer the question by writing the appropriate SQL code. What are the top 10 torrent release types?
SELECT T2.groupName FROM torrents as T2 JOIN tags as T1 ON T1.id = T2.id WHERE T1.tag = "pop" and T2.releaseType = "album" ORDER BY T2.totalSnatched DESC LIMIT 20
Given the Table torrents having columns as groupName has datatype text, totalSnatched has datatype number, artist has datatype text, groupYear has datatype number, releaseType has datatype text, groupId has datatype number, id has datatype number which has id and Given the Table tags having columns as index has datatype number, id has datatype number, tag has datatype text which has id. Answer the question by writing the appropriate SQL code. What are the top 20 pop albums?
SELECT T2.groupName FROM torrents as T2 JOIN tags as T1 ON T1.id = T2.id WHERE T1.tag = "instrumental" and T2.releaseType = "album" and groupYear >= 2000 ORDER BY T2.totalSnatched DESC LIMIT 20
Given the Table torrents having columns as groupName has datatype text, totalSnatched has datatype number, artist has datatype text, groupYear has datatype number, releaseType has datatype text, groupId has datatype number, id has datatype number which has id and Given the Table tags having columns as index has datatype number, id has datatype number, tag has datatype text which has id. Answer the question by writing the appropriate SQL code. What are the top 20 instrumental albums since 2000?
SELECT T1.tag FROM torrents as T2 JOIN tags as T1 ON T1.id = T2.id WHERE T2.releaseType = "album" GROUP BY T1.tag ORDER BY sum(T2.totalSnatched) DESC LIMIT 1
Given the Table torrents having columns as groupName has datatype text, totalSnatched has datatype number, artist has datatype text, groupYear has datatype number, releaseType has datatype text, groupId has datatype number, id has datatype number which has id and Given the Table tags having columns as index has datatype number, id has datatype number, tag has datatype text which has id. Answer the question by writing the appropriate SQL code. What type of musical album is the most popular?
SELECT groupName FROM torrents WHERE releaseType = "single" ORDER BY totalSnatched DESC LIMIT 100
Given the Table torrents having columns as groupName has datatype text, totalSnatched has datatype number, artist has datatype text, groupYear has datatype number, releaseType has datatype text, groupId has datatype number, id has datatype number which has id and Given the Table tags having columns as index has datatype number, id has datatype number, tag has datatype text which has id. Answer the question by writing the appropriate SQL code. What are the top 100 single musics?
SELECT sum(totalSnatched), groupYear FROM torrents GROUP BY groupYear
Given the Table torrents having columns as groupName has datatype text, totalSnatched has datatype number, artist has datatype text, groupYear has datatype number, releaseType has datatype text, groupId has datatype number, id has datatype number which has id and Given the Table tags having columns as index has datatype number, id has datatype number, tag has datatype text which has id. Answer the question by writing the appropriate SQL code. What is the torrent download statistics for each release year?
SELECT count(*), releaseType FROM torrents GROUP BY releaseType
Given the Table torrents having columns as groupName has datatype text, totalSnatched has datatype number, artist has datatype text, groupYear has datatype number, releaseType has datatype text, groupId has datatype number, id has datatype number which has id and Given the Table tags having columns as index has datatype number, id has datatype number, tag has datatype text which has id. Answer the question by writing the appropriate SQL code. how many entries are of each type?
SELECT count(*), artist FROM torrents GROUP BY artist
Given the Table torrents having columns as groupName has datatype text, totalSnatched has datatype number, artist has datatype text, groupYear has datatype number, releaseType has datatype text, groupId has datatype number, id has datatype number which has id and Given the Table tags having columns as index has datatype number, id has datatype number, tag has datatype text which has id. Answer the question by writing the appropriate SQL code. how many unique entries are by the same Artist/group?
SELECT groupName FROM torrents ORDER BY totalSnatched DESC LIMIT 1
Given the Table torrents having columns as groupName has datatype text, totalSnatched has datatype number, artist has datatype text, groupYear has datatype number, releaseType has datatype text, groupId has datatype number, id has datatype number which has id and Given the Table tags having columns as index has datatype number, id has datatype number, tag has datatype text which has id. Answer the question by writing the appropriate SQL code. which entry have been downloaded the most?
SELECT groupName FROM torrents ORDER BY totalSnatched LIMIT 1
Given the Table torrents having columns as groupName has datatype text, totalSnatched has datatype number, artist has datatype text, groupYear has datatype number, releaseType has datatype text, groupId has datatype number, id has datatype number which has id and Given the Table tags having columns as index has datatype number, id has datatype number, tag has datatype text which has id. Answer the question by writing the appropriate SQL code. which entry have been downloaded the least?
SELECT DISTINCT groupName FROM torrents
Given the Table torrents having columns as groupName has datatype text, totalSnatched has datatype number, artist has datatype text, groupYear has datatype number, releaseType has datatype text, groupId has datatype number, id has datatype number which has id and Given the Table tags having columns as index has datatype number, id has datatype number, tag has datatype text which has id. Answer the question by writing the appropriate SQL code. what are titles for each unique entry?
SELECT T2.birth_state FROM player AS T2 JOIN hall_of_fame as T1 ON T1.player_id = T2.player_id WHERE inducted = "Y" GROUP BY T2.birth_state ORDER BY count(T1.player_id) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which states have produced the largest number of candidates inducted into the hall of fame?
SELECT league_id FROM salary GROUP BY league_id ORDER BY sum(salary) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What is the top league that pays the most to their players?
SELECT league_id FROM salary GROUP BY league_id ORDER BY max(salary) - min(salary) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which leage have the largest difference in pay among their team players?
SELECT avg(T2.salary) FROM salary as T2 JOIN hall_of_fame as T1 ON T1.player_id = T2.player_id WHERE T1.inducted = "Y"
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What is the average pay for players inducted into the hall of fame?
SELECT avg(T2.salary) FROM salary as T2 JOIN hall_of_fame as T1 ON T1.player_id = T2.player_id WHERE T1.inducted = "N"
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What is the average pay for players not inducted into the hall of fame?
SELECT league_id FROM salary GROUP BY league_id ORDER BY avg(salary) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which leage has higher average salaries for player?
SELECT birth_country FROM player GROUP BY birth_country ORDER BY count(*) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which Country are most baseball players from?
SELECT name_first, name_last FROM player ORDER BY birth_year DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Who is the youngest baseball player so far?
SELECT league_id FROM salary GROUP BY league_id ORDER BY sum(salary) DESC LIMIT 1
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. Which league gets paid the most?
SELECT T2.points_won FROM player_award as T1 JOIN player_award_vote as T2 ON T1.player_id = T2.player_id WHERE T1.league_id = "NL" AND T1.award_id = "Most Valuable Player" AND T1.year = "1990" AND T2.league_id = "NL" AND T2.year = "1990"
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. How much points were received by the NL league's most valuable player winner in 1990?
SELECT avg( death_year - birth_year) FROM player WHERE birth_country = "USA"
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What is the average age of players from USA?
SELECT avg( death_year - birth_year ) FROM player
Given the Table hall of fame having columns as player_id has datatype text, yearid has datatype number, votedby has datatype text, ballots has datatype text, needed has datatype text, votes has datatype text, inducted has datatype text, category has datatype text, needed_note has datatype text which has player id and Given the Table player award having columns as player_id has datatype text, award_id has datatype text, year has datatype number, league_id has datatype text, tie has datatype text, notes has datatype text which has player id and Given the Table player award vote having columns as award_id has datatype text, year has datatype number, league_id has datatype text, player_id has datatype text, points_won has datatype number, points_max has datatype number, votes_first has datatype text which has player id and Given the Table salary having columns as year has datatype number, team_id has datatype text, league_id has datatype text, player_id has datatype text, salary has datatype number which has player id and Given the Table player having columns as player_id has datatype text, birth_year has datatype text, birth_month has datatype text, birth_day has datatype text, birth_country has datatype text, birth_state has datatype text, birth_city has datatype text, death_year has datatype text, death_month has datatype text, death_day has datatype text, death_country has datatype text, death_state has datatype text, death_city has datatype text, name_first has datatype text, name_last has datatype text, name_given has datatype text, weight has datatype text which has player id. Answer the question by writing the appropriate SQL code. What is the average lifespan of a baseball player?
SELECT DISTINCT commod FROM resultsdata15 WHERE concen != ""
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Provide the list of products with pesticide residues detected.
SELECT extract FROM resultsdata15 GROUP BY extract ORDER BY count(*) DESC LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. What is the most effective extraction method in terms of pesticide residues detection?
SELECT determin FROM resultsdata15 GROUP BY determin ORDER BY count(*) DESC LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. What is the most effective determinative method in terms of pesticide residues detection?
SELECT lab FROM resultsdata15 GROUP BY lab ORDER BY count(*) DESC LIMIT 5
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. What are the top 5 analyzing labs where pesticide residues detection was conducted?
SELECT commtype FROM resultsdata15 WHERE commod = "AP" GROUP BY commtype ORDER BY sum(concen) DESC LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Wha commodity type of apple has the highest pesticide residues to consume?
SELECT T1.country FROM sampledata15 as T1 JOIN resultsdata15 as T2 ON T1.sample_pk = T2.sample_pk GROUP BY T1.country ORDER BY T2.concen
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Rank the country of product origins in terms of pesticide residues detection.
SELECT T1.disttype FROM sampledata15 as T1 JOIN resultsdata15 as T2 ON T1.sample_pk = T2.sample_pk GROUP BY T1.disttype ORDER BY sum(T2.concen) DESC LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. What type of collection facility results in the most risky consumption in terms of pesticide residues detection?
SELECT T1.country FROM sampledata15 as T1 JOIN resultsdata15 as T2 ON T1.sample_pk = T2.sample_pk WHERE T2.concen = "0" GROUP BY T1.country
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. What are the country of product origins where pesticide residues were not detected?
SELECT commod, count(*) FROM sampledata15 GROUP BY commod
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. how many entries are of each specific food?
SELECT pestcode FROM resultsdata15 GROUP BY pestcode ORDER BY count(*) DESC LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. which pesticides are most used?