Chinastark/bird_dataset huggingface dataset:
Database: retails
Note: quantity refers to l_quantity; part "burnished seashell gainsboro navajo chocolate" refers to p_name = 'burnished seashell gainsboro navajo chocolate'; order no.1 refers to l_orderkey = 1;
Question: What is the quantity of the part "burnished seashell gainsboro navajo chocolate" ordered in order no.1?
SQL: SELECT lineitem.l_quantity FROM lineitem INNER JOIN part ON lineitem.l_partkey = part.p_partkey WHERE lineitem.l_orderkey = 1 AND part.p_name = 'burnished seashell gainsboro navajo chocolate'
Database: retails
Note: amount refers to sum(l_quantity); order no.1 refers to l_orderkey = 1; "burnished seashell gainsboro navajo chocolate" or "salmon white grey tan navy" refers to p_name IN ('salmon white grey tan navy', 'burnished seashell gainsboro navajo chocolate');
Question: Which part is ordered in a bigger amount in order no.1, "burnished seashell gainsboro navajo chocolate" or "salmon white grey tan navy"?
SQL: SELECT t.p_name FROM ( SELECT part.p_name, sum(lineitem.l_quantity) AS num FROM lineitem INNER JOIN part ON lineitem.l_partkey = part.p_partkey WHERE part.p_name IN ('salmon white grey tan navy', 'burnished seashell gainsboro navajo chocolate') GROUP BY lineitem.l_partkey ) AS t ORDER BY t.num DESC LIMIT 1
Database: retails
Note: the biggest discount refers to max(l_discount); part "burnished seashell gainsboro navajo chocolate" refers to p_name = 'burnished seashell gainsboro navajo chocolate';
Question: What is the biggest discount among all orders for the part "burnished seashell gainsboro navajo chocolate"?
SQL: SELECT max(lineitem.l_discount) FROM lineitem INNER JOIN part ON lineitem.l_partkey = part.p_partkey WHERE part.p_name = 'burnished seashell gainsboro navajo chocolate'
Database: retails
Note: mode of shipping refers to l_shipmode; part "burnished seashell gainsboro navajo chocolate" refers to p_name = 'burnished seashell gainsboro navajo chocolate';
Question: Please list all the modes of shipping for the part "burnished seashell gainsboro navajo chocolate".
SQL: SELECT DISTINCT lineitem.l_shipmode FROM lineitem INNER JOIN part ON lineitem.l_partkey = part.p_partkey WHERE part.p_name = 'burnished seashell gainsboro navajo chocolate'
Database: retails
Note: average supply cost refers to avg(ps_supplycost); part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light';
Question: What is the average supply cost for the part "hot spring dodger dim light"?
SQL: SELECT avg(partsupp.ps_supplycost) FROM partsupp INNER JOIN supplier ON partsupp.ps_suppkey = supplier.s_suppkey INNER JOIN part ON partsupp.ps_partkey = part.p_partkey WHERE part.p_name = 'hot spring dodger dim light'
Database: retails
Note: part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light'; percentage = divide(subtract(max(ps_supplycost), min(ps_supplycost)), min(ps_supplycost)) * 100%;
Question: How much higher in percentage is the highest supply cost of the part "hot spring dodger dim light" than the lowest supply cost?
SQL: SELECT cast((max(partsupp.ps_supplycost) - min(partsupp.ps_supplycost)) AS REAL) * 100 / min(partsupp.ps_supplycost) FROM partsupp INNER JOIN supplier ON partsupp.ps_suppkey = supplier.s_suppkey INNER JOIN part ON partsupp.ps_partkey = part.p_partkey WHERE part.p_name = 'hot spring dodger dim light'
Database: retails
Note: part no.98768 refers to l_partkey = 98768; order no.1 refers to l_orderkey = 1; profit = subtract(multiply(l_extendedprice, subtract(1, l_discount)), multiply(ps_supplycost, l_quantity));
Question: What is the profit for part no.98768 in order no.1?
SQL: SELECT lineitem.l_extendedprice * (1 - lineitem.l_discount) - partsupp.ps_supplycost * lineitem.l_quantity FROM lineitem INNER JOIN partsupp ON lineitem.l_suppkey = partsupp.ps_suppkey WHERE lineitem.l_orderkey = 1 AND lineitem.l_partkey = 98768
Database: retails
Note: part "burnished seashell gainsboro navajo chocolate" refers to p_name = 'burnished seashell gainsboro navajo chocolate'; order no.1 refers to l_orderkey = 1; discounted price refers to multiply(l_extendedprice, subtract(1, l_discount));
Question: What is the discounted price of the part "burnished seashell gainsboro navajo chocolate" in order no.1?
SQL: SELECT lineitem.l_extendedprice * (1 - lineitem.l_discount) FROM lineitem INNER JOIN part ON lineitem.l_partkey = part.p_partkey WHERE part.p_name = 'burnished seashell gainsboro navajo chocolate' AND lineitem.l_orderkey = 1
Database: retails
Note: market segment refers to c_mktsegment; the highest amount of debt refers to max(c_acctbal);
Question: Which market segment does the customer with the highest amount of debt belongs to?
SQL: SELECT c_mktsegment FROM customer WHERE c_acctbal = ( SELECT min(c_acctbal) FROM customer )
Database: retails
Note: 1997 refers to year(l_shipdate) = 1997; shipped via mail refers to l_shipmode = 'MAIL';
Question: In 1997, how many orders were shipped via mail?
SQL: SELECT count(l_orderkey) FROM lineitem WHERE strftime('%Y', l_shipdate) = '1997' AND l_shipmode = 'MAIL'
Database: retails
Note: furniture segment refers to c_mktsegment = 'FURNITURE';
Question: How many customers are in the furniture segment?
SQL: SELECT count(c_custkey) FROM customer WHERE c_mktsegment = 'FURNITURE'
Database: retails
Note: 1994 refers to year(l_shipdate) = 1994; via truck refers to l_shipmode = 'TRUCK'; returned refers to l_returnflag = 'R';
Question: Among the items shipped in 1994 via truck, how many items were returned?
SQL: SELECT count(l_orderkey) FROM lineitem WHERE strftime('%Y', l_shipdate) = '1994' AND l_returnflag = 'R' AND l_shipmode = 'TRUCK'
Database: retails
Note: machinery segment refers to c_mktsegment = 'MACHINERY'; in debt refers to c_acctbal < 0;
Question: How many customers in the machinery segment are in debt?
SQL: SELECT count(c_custkey) FROM customer WHERE c_acctbal < 0 AND c_mktsegment = 'MACHINERY'
Database: retails
Note: urgent order refers to o_orderpriority = '1-URGENT'; Clerk#000000001 refers to o_clerk = 'Clerk#000000001'; 1997 refers to year(o_orderdate) = 1997;
Question: How many urgent orders did Clerk#000000001 handle in 1997?
SQL: SELECT count(o_orderkey) FROM orders WHERE strftime('%Y', o_orderdate) = '1997' AND o_clerk = 'Clerk#000000001' AND o_orderpriority = '1-URGENT'
Database: retails
Note: name of the customer refers to c_name; delivered the longest refers to max(subtract(l_receiptdate, l_commitdate));
Question: What is the name of the customer whose order was delivered the longest?
SQL: SELECT customer.c_name FROM orders INNER JOIN lineitem ON orders.o_orderkey = lineitem.l_orderkey INNER JOIN customer ON orders.o_custkey = customer.c_custkey ORDER BY (julianday(lineitem.l_receiptdate) - julianday(lineitem.l_commitdate)) DESC LIMIT 1
Database: retails
Note: total price = sum(o_totalprice); Argentina refers to n_name = 'Argentina';
Question: How much is the total price of all the orders shipped to customers in Argentina?
SQL: SELECT sum(orders.o_totalprice) FROM customer INNER JOIN nation ON customer.c_nationkey = nation.n_nationkey INNER JOIN orders ON customer.c_custkey = orders.o_custkey WHERE nation.n_name = 'ARGENTINA'
Database: retails
Note: building segment refers to c_mktsegment = 'BUILDING'; a total price of no less than 50,000 refers to o_totalprice > 50000;
Question: How many customers in the building segments have orders with a total price of no less than 50,000?
SQL: SELECT count(customer.c_name) FROM orders INNER JOIN customer ON orders.o_custkey = customer.c_custkey WHERE customer.c_mktsegment = 'BUILDING' AND orders.o_totalprice > 50000
Database: retails
Note: country refers to n_name; the least number of suppliers refers to min(count(s_name));
Question: Which country has the least number of suppliers?
SQL: SELECT nation.n_name FROM supplier INNER JOIN nation ON supplier.s_nationkey = nation.n_nationkey GROUP BY supplier.s_nationkey ORDER BY count(supplier.s_name) LIMIT 1
Database: retails
Note: part supply cost refers to ps_supplycost; medium metallic grey dodger linen refers to p_name = 'medium metallic grey dodger linen';
Question: How much is the part supply cost for the medium metallic grey dodger linen?
SQL: SELECT partsupp.ps_supplycost FROM part INNER JOIN partsupp ON part.p_partkey = partsupp.ps_partkey WHERE part.p_name = 'medium metallic grey dodger linen'
Database: retails
Note: country refers to c_name; highest number of indebted refers to max(sum(acctbal)) where s_acctbal < 0;
Question: What are the top 2 countries with the highest number of indebted suppliers?
SQL: SELECT t.n_name FROM ( SELECT nation.n_name, sum(supplier.s_acctbal) AS num FROM supplier INNER JOIN nation ON supplier.s_nationkey = nation.n_nationkey WHERE supplier.s_acctbal < 0 GROUP BY supplier.s_nationkey ) AS t ORDER BY t.num LIMIT 2
Database: retails
Note: name of the part refers to p_name; part supply cost of at least 1,000 refers to ps_supplycost > 1000;
Question: What are the names of the parts that have a part supply cost of at least 1,000?
SQL: SELECT part.p_name FROM part INNER JOIN partsupp ON part.p_partkey = partsupp.ps_partkey WHERE partsupp.ps_supplycost > 1000
Database: retails
Note: name of the country refers to n_name; the highest debt refers to min(s_acctbal);
Question: What is the name of the country of the supplier with the highest debt?
SQL: SELECT nation.n_name FROM supplier INNER JOIN nation ON supplier.s_nationkey = nation.n_nationkey ORDER BY supplier.s_suppkey DESC LIMIT 1
Database: retails
Note: clerk refers to o_clerk; the highest amount of extended price refers to max(l_extendedprice);
Question: Who is the clerk in charge of handling the item with the highest amount of extended price?
SQL: SELECT orders.o_clerk FROM orders INNER JOIN lineitem ON orders.o_orderkey = lineitem.l_orderkey ORDER BY lineitem.l_extendedprice DESC LIMIT 1
Database: retails
Note: total quantity refers to sum(l_quantity); customer 101660 refers to o_custkey = 101660; on 10/5/1995 refers to o_orderdate = '1995-10-05';
Question: What are the total quantities of the items ordered by customer 101660 on 10/5/1995?
SQL: SELECT sum(lineitem.l_quantity) FROM orders INNER JOIN lineitem ON orders.o_orderkey = lineitem.l_orderkey WHERE orders.o_orderdate = '1995-10-05' AND orders.o_custkey = 101660
Database: retails
Note: total amount of tax refers to sum(multiply(multiply(l_extendedprice, subtract(1, l_discount)), add(1, l_tax))); customer 88931 refers to o_custkey = 88931; on 7/13/1994 refers to o_orderdate = '1994-07-13';
Question: What is the total amount of tax charged for the order placed by customer 88931 on 7/13/994?
SQL: SELECT sum(lineitem.l_extendedprice * (1 - lineitem.l_discount) * (1 + lineitem.l_tax)) FROM orders INNER JOIN lineitem ON orders.o_orderkey = lineitem.l_orderkey WHERE orders.o_custkey = 88931 AND orders.o_orderdate = '1994-07-13'
Database: retails
Note: name of the part refers to p_name; customer 110942 refers to o_custkey = 110942;
Question: What are the names of the parts that were ordered by customer 110942?
SQL: SELECT part.p_name FROM orders INNER JOIN lineitem ON orders.o_orderkey = lineitem.l_orderkey INNER JOIN part ON lineitem.l_partkey = part.p_partkey WHERE orders.o_custkey = 110942
Database: retails
Note: discounted price refers to multiply(l_extendedprice, subtract(1, l_discount)); customer 111511 refers to o_custkey = 111511; order 53159 refers to o_orderkey = 53159; name of the part refers to p_name;
Question: How much is the discounted price of every item that customer 111511 ordered in order 53159? List the names of the parts of every item.
SQL: SELECT lineitem.l_extendedprice * (1 - lineitem.l_discount), part.p_name FROM orders INNER JOIN lineitem ON orders.o_orderkey = lineitem.l_orderkey INNER JOIN part ON lineitem.l_partkey = part.p_partkey WHERE orders.o_custkey = 111511 AND orders.o_orderkey = 53159
Database: ice_hockey_draft
Note: heigh in inches refers to height_in_inch;
Question: What is the height of David Bornhammar in inches?
SQL: SELECT height_info.height_in_inch FROM playerinfo INNER JOIN height_info ON playerinfo.height = height_info.height_id WHERE playerinfo.playername = 'David Bornhammar'
Database: ice_hockey_draft
Note: name of the players refers to playername; height of over 6'2" inches refers to height_in_inch > '6''2"' ;
Question: Please list the names of all the players with a height of over 6'2" inches.
SQL: SELECT DISTINCT playerinfo.playername FROM playerinfo INNER JOIN height_info ON playerinfo.height = height_info.height_id WHERE height_info.height_in_inch > '6''2"'
Database: ice_hockey_draft
Note: height of over 6'2" inches refers to height_in_inch > '6''2"'; born in Sweden refers to nation = 'Sweden' ;
Question: Among the players with a height of over 6'2" inches, how many of them were born in Sweden?
SQL: SELECT count(playerinfo.eliteid) FROM playerinfo INNER JOIN height_info ON playerinfo.height = height_info.height_id WHERE height_info.height_in_inch > '6''2"' AND playerinfo.nation = 'Sweden'
Database: ice_hockey_draft
Note: tallest player refers to MaX(height_in_cm);
Question: What is the name of the tallest player?
SQL: SELECT playerinfo.playername FROM playerinfo INNER JOIN height_info ON playerinfo.height = height_info.height_id ORDER BY height_info.height_in_cm DESC LIMIT 1
Database: ice_hockey_draft
Note: weigh in kilograms refers to weight_in_kg;
Question: How much does David Bornhammar weigh in kilograms?
SQL: SELECT weight_info.weight_in_kg FROM playerinfo INNER JOIN weight_info ON playerinfo.weight = weight_info.weight_id WHERE playerinfo.playername = 'David Bornhammar'
Database: ice_hockey_draft
Note: weigh more than 90 kg refers to weight_in_kg > 90;
Question: How many players weigh more than 90 kg?
SQL: SELECT count(playerinfo.eliteid) FROM playerinfo INNER JOIN weight_info ON playerinfo.weight = weight_info.weight_id WHERE weight_info.weight_in_kg > 90
Database: ice_hockey_draft
Note: weigh more than 90 kg refers to weight_in_kg > 90; position of defense refers to position_info = 'D' ;
Question: Among the players that weigh more than 90 kg, how many of them have a position of defense?
SQL: SELECT count(playerinfo.eliteid) FROM playerinfo INNER JOIN weight_info ON playerinfo.weight = weight_info.weight_id WHERE weight_info.weight_in_kg > 90 AND playerinfo.position_info = 'D'
Database: ice_hockey_draft
Note: weigh more than 90 kg refers to weight_in_kg > 90; name of the player refers to playername; most attendance in the player's first 7 years of NHL career refers to MaX(sum_7yr_gp);
Question: Among the players that weigh more than 90 kg, what is the name of the player that has the most attendance in the player's first 7 years of NHL career?
SQL: SELECT playerinfo.playername FROM playerinfo INNER JOIN weight_info ON playerinfo.weight = weight_info.weight_id WHERE weight_info.weight_in_kg > 90 AND playerinfo.sum_7yr_gp = ( SELECT max(playerinfo.sum_7yr_gp) FROM playerinfo INNER JOIN weight_info ON playerinfo.weight = weight_info.weight_id WHERE weight_info.weight_in_kg > 90 )
Database: ice_hockey_draft
Note: weight in kilograms refers to weight_in_kg; longest time on ice in the player's first 7 years of NHL career refers to MaX(sum_7yr_toi);
Question: What is the weight of the player with the longest time on ice in the player’s first 7 years of NHL career in kilograms?
SQL: SELECT weight_info.weight_in_kg FROM playerinfo INNER JOIN weight_info ON playerinfo.weight = weight_info.weight_id WHERE playerinfo.sum_7yr_toi = ( SELECT max(t.sum_7yr_toi) FROM playerinfo t )
Database: ice_hockey_draft
Note: how much taller = SUBTRaCT(SUM(height_in_cm WHERE playername = 'David Bornhammar'), SUM(height_in_cm WHERE playername = 'pauli Levokari')); height in centimeters refers to height_in_cm;
Question: How much taller is David Bornhammar than Pauli Levokari in centimeters?
SQL: SELECT ( SELECT height_info.height_in_cm FROM playerinfo INNER JOIN height_info ON playerinfo.height = height_info.height_id WHERE playerinfo.playername = 'David Bornhammar' ) - ( SELECT height_info.height_in_cm FROM playerinfo INNER JOIN height_info ON playerinfo.height = height_info.height_id WHERE playerinfo.playername = 'Pauli Levokari' )
Database: ice_hockey_draft
Note: right-shooted refers to shoots = 'R'; weigh over 90 kg refers to weight_in_kg > 90;
Question: Among all the players that are right-shooted, how many of them weigh over 90 kg?
SQL: SELECT count(playerinfo.eliteid) FROM playerinfo INNER JOIN weight_info ON playerinfo.weight = weight_info.weight_id WHERE weight_info.weight_in_kg > 90 AND playerinfo.shoots = 'R'
Database: ice_hockey_draft
Note: names of the players refers to playername; over 90 kg refers to weight_in_kg > 90; right-shooted refers to shoots = 'R';
Question: Please list the names of all the players that are over 90 kg and are right-shooted.
SQL: SELECT playerinfo.playername FROM playerinfo INNER JOIN weight_info ON playerinfo.weight = weight_info.weight_id WHERE weight_info.weight_in_kg > 90 AND playerinfo.shoots = 'R'
Database: ice_hockey_draft
Note: BMI = DIVIDE(weight_in_kg, power(DIVIDE(height_in_cm, 100), 2));
Question: What is the BMI of David Bornhammar?
SQL: SELECT cast(weight_info.weight_in_kg AS REAL) / (cast(height_info.height_in_cm AS REAL) / 100 * (cast(height_info.height_in_cm AS REAL) / 100)) FROM playerinfo INNER JOIN weight_info ON playerinfo.weight = weight_info.weight_id INNER JOIN height_info ON playerinfo.height = height_info.height_id WHERE playerinfo.playername = 'David Bornhammar'
Database: ice_hockey_draft
Note: average = aVg(height_in_cm); players refers to playername; position of defense refers to position_info = 'D' ;
Question: What is the average height in centimeters of all the players in the position of defense?
SQL: SELECT cast(sum(height_info.height_in_cm) AS REAL) / count(playerinfo.eliteid) FROM playerinfo INNER JOIN height_info ON playerinfo.height = height_info.height_id WHERE playerinfo.position_info = 'D'
Database: ice_hockey_draft
Note: weight in pounds refers to weight_in_lbs; heaviest player refers to MaX(weight_in_lbs);
Question: What is the weight in pounds of the heaviest player?
SQL: SELECT max(weight_info.weight_in_lbs) FROM playerinfo INNER JOIN weight_info ON playerinfo.weight = weight_info.weight_id
Database: ice_hockey_draft
Note: right-shooted players refers to shoots = 'R'; height of 5'7'' refers to height_in_inch = '5''7"';
Question: How many right-shooted players have a height of 5'7''?
SQL: SELECT count(playerinfo.eliteid) FROM playerinfo INNER JOIN height_info ON playerinfo.height = height_info.height_id WHERE height_info.height_in_inch = '5''7"' AND playerinfo.shoots = 'R'
Database: ice_hockey_draft
Note: total NHL games played in their first 7 years of NHL career is no less than 500 refers to sum_7yr_gp > 500; name of the player refers to playername; committed the most rule violations refers to MaX(pim);
Question: Among the players whose total NHL games played in their first 7 years of NHL career is no less than 500, what is the name of the player who committed the most rule violations?
SQL: SELECT playerinfo.playername FROM playerinfo INNER JOIN seasonstatus ON playerinfo.eliteid = seasonstatus.eliteid WHERE playerinfo.sum_7yr_gp > 500 ORDER BY seasonstatus.pim DESC LIMIT 1
Database: ice_hockey_draft
Note: height in centimeter refers to height_in_cm; tallest player refers to MaX(height_in_cm); born in Edmonton, alberta, Canada refers to birthplace = 'Edmonton, aB, CaN';
Question: What is the height in centimeter of the tallest player born in Edmonton, Alberta, Canada?
SQL: SELECT height_info.height_in_cm FROM playerinfo INNER JOIN height_info ON playerinfo.height = height_info.height_id WHERE playerinfo.birthplace = 'Edmonton, AB, CAN' ORDER BY height_info.height_in_cm DESC LIMIT 1
Database: ice_hockey_draft
Note: drafted by anaheim Ducks refers to overallby = 'anaheim Ducks'; in 2008 refers to draftyear = 2008; played for U.S. national U18 team refers to team = 'U.S. national U18 team';
Question: How many players, who were drafted by Anaheim Ducks in 2008, have played for U.S. National U18 Team?
SQL: SELECT count(DISTINCT playerinfo.eliteid) FROM playerinfo INNER JOIN seasonstatus ON playerinfo.eliteid = seasonstatus.eliteid WHERE playerinfo.overallby = 'Anaheim Ducks' AND playerinfo.draftyear = 2008 AND seasonstatus.team = 'U.S. National U18 Team'
Database: ice_hockey_draft
Note: weight in kilograms refers to weight_in_kg; highest number of goal differential of all time refers to MaX(plusminus);
Question: What is the weight in kilograms of the player with the highest number of goal differential of all time?
SQL: SELECT weight_info.weight_in_kg FROM seasonstatus INNER JOIN playerinfo ON seasonstatus.eliteid = playerinfo.eliteid INNER JOIN weight_info ON playerinfo.weight = weight_info.weight_id ORDER BY seasonstatus.plusminus DESC LIMIT 1
Database: ice_hockey_draft
Note: most valuable player refers to MaX(p); QMJHL league refers to league = 'QMJHL'; 2004-2005 season refers to season = '2004-2005';
Question: Who is the most valuable player in QMJHL league during the 2004-2005 season?
SQL: SELECT playerinfo.playername FROM seasonstatus INNER JOIN playerinfo ON seasonstatus.eliteid = playerinfo.eliteid WHERE seasonstatus.season BETWEEN '2004' AND '2005' AND seasonstatus.league = 'QMJHL' ORDER BY seasonstatus.p DESC LIMIT 1
Database: ice_hockey_draft
Note: names of the players refers to playername; played for acadie-Bathurst Titan refers to team = 'acadieandBathurst Titan'; regular season refers to gametype = 'Regular season'; in 1998-1999 refers to season = '1998-1999';
Question: What are the names of the players who played for Acadie-Bathurst Titan during the regular season in 1998-1999?
SQL: SELECT playerinfo.playername FROM seasonstatus INNER JOIN playerinfo ON seasonstatus.eliteid = playerinfo.eliteid WHERE seasonstatus.season = '1998-1999' AND seasonstatus.gametype = 'Regular Season' AND seasonstatus.team = 'Acadie-Bathurst Titan'
Database: ice_hockey_draft
Note: tallest player refers to MaX(height_in_cm);
Question: How many games did the tallest player have ever played?
SQL: SELECT seasonstatus.gp FROM seasonstatus INNER JOIN playerinfo ON seasonstatus.eliteid = playerinfo.eliteid WHERE playerinfo.eliteid = ( SELECT t.eliteid FROM playerinfo t ORDER BY t.height DESC LIMIT 1 )
Database: ice_hockey_draft
Note: youngest player refers to MaX(birthdate); 1997-1998 season refers to season = '1997-1998'; OHL league refers to league = 'OHL';
Question: Who is the youngest player to have played during the 1997-1998 season for OHL League?
SQL: SELECT DISTINCT playerinfo.playername FROM seasonstatus INNER JOIN playerinfo ON seasonstatus.eliteid = playerinfo.eliteid WHERE seasonstatus.season = '1997-1998' AND seasonstatus.league = 'OHL' ORDER BY playerinfo.birthdate DESC LIMIT 1
Database: ice_hockey_draft
Note: played 72 games refers to gp = 72; left-shooters refers to shoots = 'L';
Question: Among the players who played 72 games, how many are left-shooters?
SQL: SELECT count(playerinfo.eliteid) FROM seasonstatus INNER JOIN playerinfo ON seasonstatus.eliteid = playerinfo.eliteid WHERE seasonstatus.gp = 72 AND playerinfo.shoots = 'L'
Database: ice_hockey_draft
Note: difference = SUBTRaCT(SUM(g WHERE gametype = 'Regular season'), SUM(g WHERE gametype = 'playoffs') WHERE season = '1998-1999'); number of goals scored refers to g; regular season refers to gametype = 'Regular season'; playoffs refers to gametype = 'playoffs'; 1998-1999 season refers to season = '1998-1999';
Question: What is the difference in the number of goals scored by Pavel Brendl during the regular season versus the playoffs in the 1998-1999 season?
SQL: SELECT t3.rs_g - t4.pf_g AS diff FROM ( SELECT playerinfo.playername, seasonstatus.g AS rs_g FROM seasonstatus INNER JOIN playerinfo ON seasonstatus.eliteid = playerinfo.eliteid WHERE playerinfo.playername = 'Pavel Brendl' AND seasonstatus.season = '1998-1999' AND seasonstatus.gametype = 'Regular Season' ) AS t3 INNER JOIN ( SELECT playerinfo.playername, seasonstatus.g AS pf_g FROM seasonstatus INNER JOIN playerinfo ON seasonstatus.eliteid = playerinfo.eliteid WHERE playerinfo.playername = 'Pavel Brendl' AND seasonstatus.season = '1998-1999' AND seasonstatus.gametype = 'Playoffs' ) AS t4 ON t3.playername = t4.playername