arcs-bench / tasks /readable /028 /task_readable.sql
anon
Upload tasks/ folder for end-to-end loader reproducibility
02edc38
/*
{
"qid": "028",
"task_type": "ambig",
"has_intended_resolution": true,
"language": "SQLite",
"db": "professional_basketball",
"question": "For each player and each team they played for in the 2007 season, show the post-season playoff status and games played.",
"gold_ambiguity_points": [
{
"id": "A",
"phrase": "post-season playoff status and games played",
"type": "finite",
"ambiguity_type": "syntactic_column",
"interpretations": [
"post-season playoff status and post-season games played",
"post-season playoff status and all games played"
],
"intended_interpretation_idx": 1
}
],
"gold_intended_query_id": "GQRY-A.1",
"extra_info": {}
}
*/
----- START OF GOLD QUERY `GQRY-A.0` -----
/*
{
"id": "GQRY-A.0",
"parameter_names": [],
"parameter_values": {},
"other_exec_results": [],
"required_columns": [
1,
2,
3,
4,
5
],
"required_sorted": false,
"extra_info": {
"ambiguity_resolution": {
"[A] post-season playoff status and games played": "post-season playoff status and post-season games played"
}
}
}
*/
SELECT
p.playerID,
p.firstName,
p.lastName,
t.name,
t.playoff AS post_season_playoff_status,
SUM(COALESCE(pt.PostGP, 0)) AS post_season_games_played
FROM players_teams pt
JOIN players p ON pt.playerID = p.playerID
JOIN teams t ON pt.tmID = t.tmID AND pt.year = t.year
WHERE pt.year = 2007
GROUP BY p.playerID, p.firstName, p.lastName, t.tmID, t.name, t.playoff
ORDER BY p.lastName, p.firstName;
/* EXEC RESULT
playerID firstName lastName name post_season_playoff_status post_season_games_played
abdursh01 Julius Abdur-Rahim Sacramento Kings None 0
afflaar01 Arron Afflalo Detroit Pistons CF 12
agerma01 Maurice Ager Dallas Mavericks C1 0
agerma01 Maurice Ager New Jersey Nets None 0
ahearbl01 Daniel Ahearn Miami Heat None 0
... TRUNCATED ...
wrighlo02 Lorenzen Wright Atlanta Hawks C1 0
wrighlo02 Lorenzen Wright Sacramento Kings None 0
jianlyi01 Jianlian Yi Milwaukee Bucks None 0
youngni01 Nicholas Young Washington Wizards C1 4
youngth01 Thaddeus Young Philadelphia 76ers C1 6
*/
----- END OF GOLD QUERY -----
----- START OF GOLD QUERY `GQRY-A.1` -----
/*
{
"id": "GQRY-A.1",
"parameter_names": [],
"parameter_values": {},
"other_exec_results": [],
"required_columns": [
1,
2,
3,
4,
5
],
"required_sorted": false,
"extra_info": {
"ambiguity_resolution": {
"[A] post-season playoff status and games played": "post-season playoff status and all games played"
}
}
}
*/
SELECT
p.playerID,
p.firstName,
p.lastName,
t.name,
t.playoff AS post_season_playoff_status,
SUM(pt.GP + COALESCE(pt.PostGP, 0)) AS all_games_played
FROM players_teams pt
JOIN players p ON pt.playerID = p.playerID
JOIN teams t ON pt.tmID = t.tmID AND pt.year = t.year
WHERE pt.year = 2007
GROUP BY p.playerID, p.firstName, p.lastName, t.tmID, t.name, t.playoff
ORDER BY p.lastName, p.firstName;
/* EXEC RESULT
playerID firstName lastName name post_season_playoff_status all_games_played
abdursh01 Julius Abdur-Rahim Sacramento Kings None 6
afflaar01 Arron Afflalo Detroit Pistons CF 87
agerma01 Maurice Ager Dallas Mavericks C1 12
agerma01 Maurice Ager New Jersey Nets None 14
ahearbl01 Daniel Ahearn Miami Heat None 10
... TRUNCATED ...
wrighlo02 Lorenzen Wright Atlanta Hawks C1 13
wrighlo02 Lorenzen Wright Sacramento Kings None 5
jianlyi01 Jianlian Yi Milwaukee Bucks None 66
youngni01 Nicholas Young Washington Wizards C1 79
youngth01 Thaddeus Young Philadelphia 76ers C1 80
*/
----- END OF GOLD QUERY -----