instruction
stringlengths
1.07k
3.45k
output
stringlengths
19
508
system
stringclasses
1 value
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT min(t1.duration), min(t2.rating), t2.genre_is FROM files AS t1 JOIN song AS t2 ON t1.f_id = t2.f_id GROUP BY t2.genre_is ORDER BY t2.genre_is;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.artist_name, count(*) FROM artist AS t1 JOIN song AS t2 ON t1.artist_name = t2.artist_name WHERE t2.languages = "english" GROUP BY t2.artist_name HAVING count(*) >= 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.artist_name, count(*) FROM artist AS t1 JOIN song AS t2 ON t1.artist_name = t2.artist_name WHERE t2.languages = "english" GROUP BY t2.artist_name HAVING count(*) >= 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.artist_name, t1.country FROM artist AS t1 JOIN song AS t2 ON t1.artist_name = t2.artist_name WHERE t2.resolution > 900 GROUP BY t2.artist_name HAVING count(*) >= 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.artist_name, t1.country FROM artist AS t1 JOIN song AS t2 ON t1.artist_name = t2.artist_name WHERE t2.resolution > 900 GROUP BY t2.artist_name HAVING count(*) >= 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.artist_name, count(*) FROM artist AS t1 JOIN song AS t2 ON t1.artist_name = t2.artist_name GROUP BY t2.artist_name ORDER BY count(*) DESC LIMIT 3;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.artist_name, count(*) FROM artist AS t1 JOIN song AS t2 ON t1.artist_name = t2.artist_name GROUP BY t2.artist_name ORDER BY count(*) DESC LIMIT 3;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.country FROM artist AS t1 JOIN song AS t2 ON t1.artist_name = t2.artist_name GROUP BY t2.artist_name ORDER BY count(*) LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.country FROM artist AS t1 JOIN song AS t2 ON t1.artist_name = t2.artist_name GROUP BY t2.artist_name ORDER BY count(*) LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT song_name FROM song WHERE rating < (SELECT min(rating) FROM song WHERE languages = 'english');
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT song_name FROM song WHERE rating < (SELECT min(rating) FROM song WHERE languages = 'english');
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT f_id FROM song WHERE resolution > (SELECT max(resolution) FROM song WHERE rating < 8);
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT f_id FROM song WHERE resolution > (SELECT max(resolution) FROM song WHERE rating < 8);
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT f_id FROM song WHERE resolution > (SELECT avg(resolution) FROM song WHERE genre_is = "modern");
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT f_id FROM song WHERE resolution > (SELECT avg(resolution) FROM song WHERE genre_is = "modern");
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.artist_name FROM artist AS t1 JOIN song AS t2 ON t1.artist_name = t2.artist_name WHERE t2.languages = "bangla" GROUP BY t2.artist_name ORDER BY count(*) DESC LIMIT 3;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.artist_name FROM artist AS t1 JOIN song AS t2 ON t1.artist_name = t2.artist_name WHERE t2.languages = "bangla" GROUP BY t2.artist_name ORDER BY count(*) DESC LIMIT 3;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT f_id, genre_is, artist_name FROM song WHERE languages = "english" ORDER BY rating;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT f_id, genre_is, artist_name FROM song WHERE languages = "english" ORDER BY rating;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.duration, t1.file_size, t1.formats FROM files AS t1 JOIN song AS t2 ON t1.f_id = t2.f_id WHERE t2.genre_is = "pop" ORDER BY t2.song_name;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.duration, t1.file_size, t1.formats FROM files AS t1 JOIN song AS t2 ON t1.f_id = t2.f_id WHERE t2.genre_is = "pop" ORDER BY t2.song_name;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT DISTINCT artist_name FROM song WHERE languages = "english" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 8;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT DISTINCT artist_name FROM song WHERE languages = "english" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 8;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT DISTINCT artist_name FROM artist WHERE country = "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT DISTINCT artist_name FROM artist WHERE country = "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.name_full, t1.college_id FROM college AS t1 JOIN player_college AS t2 ON t1.college_id = t2.college_id GROUP BY t1.college_id ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.name_full, t1.college_id FROM college AS t1 JOIN player_college AS t2 ON t1.college_id = t2.college_id GROUP BY t1.college_id ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT avg(t1.salary) FROM salary AS t1 JOIN team AS t2 ON t1.team_id = t2.team_id_br WHERE t2.name = 'Boston Red Stockings';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT avg(t1.salary) FROM salary AS t1 JOIN team AS t2 ON t1.team_id = t2.team_id_br WHERE t2.name = 'Boston Red Stockings';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT name_first, name_last FROM player AS t1 JOIN all_star AS t2 ON t1.player_id = t2.player_id WHERE YEAR = 1998;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT name_first, name_last FROM player AS t1 JOIN all_star AS t2 ON t1.player_id = t2.player_id WHERE YEAR = 1998;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.name_first, t1.name_last, t1.player_id, count(*) FROM player AS t1 JOIN all_star AS t2 ON t1.player_id = t2.player_id GROUP BY t1.player_id ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.name_first, t1.name_last, t1.player_id, count(*) FROM player AS t1 JOIN all_star AS t2 ON t1.player_id = t2.player_id GROUP BY t1.player_id ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT yearid, count(*) FROM hall_of_fame GROUP BY yearid;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT yearid, count(*) FROM hall_of_fame GROUP BY yearid;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT YEAR, avg(attendance) FROM home_game GROUP BY YEAR;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT YEAR, avg(attendance) FROM home_game GROUP BY YEAR;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.team_id, t2.rank FROM home_game AS t1 JOIN team AS t2 ON t1.team_id = t2.team_id WHERE t1.year = 2014 GROUP BY t1.team_id ORDER BY avg(t1.attendance) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.team_id, t2.rank FROM home_game AS t1 JOIN team AS t2 ON t1.team_id = t2.team_id WHERE t1.year = 2014 GROUP BY t1.team_id ORDER BY avg(t1.attendance) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.name_first, t1.name_last, t2.player_id FROM player AS t1 JOIN manager_award AS t2 ON t1.player_id = t2.player_id GROUP BY t2.player_id ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.name_first, t1.name_last, t2.player_id FROM player AS t1 JOIN manager_award AS t2 ON t1.player_id = t2.player_id GROUP BY t2.player_id ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM park WHERE state = 'NY';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM park WHERE state = 'NY';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.name_first, t1.name_last, t1.player_id FROM player AS t1 JOIN player_award AS t2 ON t1.player_id = t2.player_id GROUP BY t1.player_id ORDER BY count(*) DESC LIMIT 3;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.name_first, t1.name_last, t1.player_id FROM player AS t1 JOIN player_award AS t2 ON t1.player_id = t2.player_id GROUP BY t1.player_id ORDER BY count(*) DESC LIMIT 3;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT birth_country FROM player GROUP BY birth_country ORDER BY count(*) ASC LIMIT 3;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT birth_country FROM player GROUP BY birth_country ORDER BY count(*) ASC LIMIT 3;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT name_first, name_last FROM player WHERE death_year = '';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT name_first, name_last FROM player WHERE death_year = '';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM player WHERE birth_country = 'USA' AND bats = 'R';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM player WHERE birth_country = 'USA' AND bats = 'R';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT avg(t1.height) FROM player AS t1 JOIN player_college AS t2 ON t1.player_id = t2.player_id JOIN college AS t3 ON t3.college_id = t2.college_id WHERE t3.name_full = 'Yale University';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT avg(t1.height) FROM player AS t1 JOIN player_college AS t2 ON t1.player_id = t2.player_id JOIN college AS t3 ON t3.college_id = t2.college_id WHERE t3.name_full = 'Yale University';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.name, t1.team_id, max(t2.salary) FROM team AS t1 JOIN salary AS t2 ON t1.team_id = t2.team_id GROUP BY t1.team_id;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.name, t1.team_id, max(t2.salary) FROM team AS t1 JOIN salary AS t2 ON t1.team_id = t2.team_id GROUP BY t1.team_id;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.name, t1.team_id FROM team AS t1 JOIN salary AS t2 ON t1.team_id = t2.team_id GROUP BY t1.team_id ORDER BY avg(t2.salary) ASC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.name, t1.team_id FROM team AS t1 JOIN salary AS t2 ON t1.team_id = t2.team_id GROUP BY t1.team_id ORDER BY avg(t2.salary) ASC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.name_first, t1.name_last FROM player AS t1 JOIN player_award AS t2 WHERE t2.year = 1960 INTERSECT SELECT t1.name_first, t1.name_last FROM player AS t1 JOIN player_award AS t2 WHERE t2.year = 1961;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.name_first, t1.name_last FROM player AS t1 JOIN player_award AS t2 WHERE t2.year = 1960 INTERSECT SELECT t1.name_first, t1.name_last FROM player AS t1 JOIN player_award AS t2 WHERE t2.year = 1961;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT name_first, name_last FROM player WHERE weight > 220 OR height < 75;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT name_first, name_last FROM player WHERE weight > 220 OR height < 75;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT max(t1.wins) FROM postseason AS t1 JOIN team AS t2 ON t1.team_id_winner = t2.team_id_br WHERE t2.name = 'Boston Red Stockings';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT max(t1.wins) FROM postseason AS t1 JOIN team AS t2 ON t1.team_id_winner = t2.team_id_br WHERE t2.name = 'Boston Red Stockings';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM postseason AS t1 JOIN team AS t2 ON t1.team_id_loser = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' AND t1.year = 2009;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM postseason AS t1 JOIN team AS t2 ON t1.team_id_loser = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' AND t1.year = 2009;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.name, t1.team_id_winner FROM postseason AS t1 JOIN team AS t2 ON t1.team_id_winner = t2.team_id_br WHERE t1.year = 2008 GROUP BY t1.team_id_winner ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.name, t1.team_id_winner FROM postseason AS t1 JOIN team AS t2 ON t1.team_id_winner = t2.team_id_br WHERE t1.year = 2008 GROUP BY t1.team_id_winner ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), t1.year FROM postseason AS t1 JOIN team AS t2 ON t1.team_id_winner = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' GROUP BY t1.year;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), t1.year FROM postseason AS t1 JOIN team AS t2 ON t1.team_id_winner = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' GROUP BY t1.year;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM (SELECT * FROM postseason AS t1 JOIN team AS t2 ON t1.team_id_winner = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' UNION SELECT * FROM postseason AS t1 JOIN team AS t2 ON t1.team_id_loser = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' );
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM (SELECT * FROM postseason AS t1 JOIN team AS t2 ON t1.team_id_winner = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' UNION SELECT * FROM postseason AS t1 JOIN team AS t2 ON t1.team_id_loser = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' );
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM postseason WHERE YEAR = 1885 AND ties = 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM postseason WHERE YEAR = 1885 AND ties = 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(t1.salary) FROM salary AS t1 JOIN team AS t2 ON t1.team_id = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' AND t1.year = 2010;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(t1.salary) FROM salary AS t1 JOIN team AS t2 ON t1.team_id = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' AND t1.year = 2010;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM salary AS t1 JOIN team AS t2 ON t1.team_id = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' AND t1.year = 2000;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM salary AS t1 JOIN team AS t2 ON t1.team_id = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' AND t1.year = 2000;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT salary FROM salary WHERE YEAR = 2001 ORDER BY salary DESC LIMIT 3;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT salary FROM salary WHERE YEAR = 2001 ORDER BY salary DESC LIMIT 3;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT salary FROM salary WHERE YEAR = 2010 UNION SELECT salary FROM salary WHERE YEAR = 2001;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT salary FROM salary WHERE YEAR = 2010 UNION SELECT salary FROM salary WHERE YEAR = 2001;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY count(*) ASC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY count(*) ASC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM park WHERE city = 'Atlanta';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM park WHERE city = 'Atlanta';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM home_game AS t1 JOIN park AS t2 ON t1.park_id = t2.park_id WHERE t1.year = 1907 AND t2.park_name = 'Columbia Park';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM home_game AS t1 JOIN park AS t2 ON t1.park_id = t2.park_id WHERE t1.year = 1907 AND t2.park_name = 'Columbia Park';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM home_game AS t1 JOIN park AS t2 ON t1.park_id = t2.park_id WHERE t1.year = 2000 AND t2.city = 'Atlanta';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM home_game AS t1 JOIN park AS t2 ON t1.park_id = t2.park_id WHERE t1.year = 2000 AND t2.city = 'Atlanta';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(t1.attendance) FROM home_game AS t1 JOIN team AS t2 ON t1.team_id = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' AND t1.year BETWEEN 2000 AND 2010;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(t1.attendance) FROM home_game AS t1 JOIN team AS t2 ON t1.team_id = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' AND t1.year BETWEEN 2000 AND 2010;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(t1.salary) FROM salary AS t1 JOIN player AS t2 ON t1.player_id = t2.player_id WHERE t2.name_first = 'Len' AND t2.name_last = 'Barker' AND t1.year BETWEEN 1985 AND 1990;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(t1.salary) FROM salary AS t1 JOIN player AS t2 ON t1.player_id = t2.player_id WHERE t2.name_first = 'Len' AND t2.name_last = 'Barker' AND t1.year BETWEEN 1985 AND 1990;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(t1.games) FROM home_game AS t1 JOIN team AS t2 ON t1.team_id = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' AND t1.year BETWEEN 1990 AND 2000;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(t1.games) FROM home_game AS t1 JOIN team AS t2 ON t1.team_id = t2.team_id_br WHERE t2.name = 'Boston Red Stockings' AND t1.year BETWEEN 1990 AND 2000;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.name FROM home_game AS t1 JOIN team AS t2 ON t1.team_id = t2.team_id_br WHERE t1.year = 1980 ORDER BY t1.attendance ASC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.name FROM home_game AS t1 JOIN team AS t2 ON t1.team_id = t2.team_id_br WHERE t1.year = 1980 ORDER BY t1.attendance ASC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT state FROM park GROUP BY state HAVING count(*) > 2;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT state FROM park GROUP BY state HAVING count(*) > 2;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM team_franchise WHERE active = 'Y';
You are an experienced and professional database administrator.