text
stringlengths
411
1.74k
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "fed_cup_singles_performances_9" ( "edition" real, "zone" text, "round" text, "date" text, "against" text, "surface" text, "opponent" text, "outcome" text, "result" text );. Question: "Provide the count of each outcome for round '2R' sorted in descending order and display the top 5.". [/INST] SELECT "outcome", COUNT("outcome") as Count FROM "fed_cup_singles_performances_9" WHERE "round"='2R' GROUP BY "outcome" ORDER BY Count DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "weekly_ratings" ( "num" real, "episode" text, "air_date" text, "rating" text, "share" real, "rating_share_18_49" text, "viewers_m" text, "timeslot_rank" real, "night_rank" text, "overall_rank" real );. Question: "How many episodes were aired on the night rank with viewers (m) of 6.63, order them by air date and limit to 5 results". [/INST] SELECT COUNT("episode"), "air_date" FROM "weekly_ratings" WHERE "viewers_m"='6.63' GROUP BY "night_rank" ORDER BY "air_date" LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "weekly_ratings" ( "num" real, "episode" text, "air_date" text, "rating" text, "share" real, "rating_share_18_49" text, "viewers_m" text, "timeslot_rank" real, "night_rank" text, "overall_rank" real );. Question: "How many episodes have an overall rank equal to or less than that of the episode with viewer count of 7.44 and sort them based on their airing date?". [/INST] SELECT COUNT("episode"), "air_date" FROM "weekly_ratings" WHERE "overall_rank" <= (SELECT "overall_rank" FROM "weekly_ratings" WHERE "viewers_m"='7.44') GROUP BY "air_date" ORDER BY "air_date" DESC LIMIT 10;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "weekly_ratings" ( "num" real, "episode" text, "air_date" text, "rating" text, "share" real, "rating_share_18_49" text, "viewers_m" text, "timeslot_rank" real, "night_rank" text, "overall_rank" real );. Question: "What are the top 5 overall ranks and corresponding episodes with a rating/share 18-49 of '2.1/5', and how many times they aired?". [/INST] SELECT "overall_rank", "episode", COUNT("air_date") FROM "weekly_ratings" WHERE "rating_share_18_49"='2.1/5' GROUP BY "overall_rank", "episode" ORDER BY "overall_rank" ASC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "weekly_ratings" ( "num" real, "episode" text, "air_date" text, "rating" text, "share" real, "rating_share_18_49" text, "viewers_m" text, "timeslot_rank" real, "night_rank" text, "overall_rank" real );. Question: "What's the maximum and minimum overall rank of episodes that had a rating of 6.2, and how many such episodes exist per each unique night rank?". [/INST] SELECT "night_rank", MAX("overall_rank"), MIN("overall_rank"), COUNT("episode") FROM "weekly_ratings" WHERE "rating"='6.2' GROUP BY "night_rank";</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "weekly_ratings" ( "num" real, "episode" text, "air_date" text, "rating" text, "share" real, "rating_share_18_49" text, "viewers_m" text, "timeslot_rank" real, "night_rank" text, "overall_rank" real );. Question: "What's the average viewers (m) and maximum timeslot rank for episodes with the keyword 'legacy' in descending order of air date with a limit of 5 records.". [/INST] SELECT AVG("viewers_m"), MAX("timeslot_rank") FROM "weekly_ratings" WHERE "episode" LIKE '%Legacy%' GROUP BY "air_date" ORDER BY "air_date" DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "table1_1137142_1" ( "season" text, "group_a_winner" text, "group_b_winner" text, "group_c_winner" text, "group_d_winner" text );. Question: "What is the total number of occurrences of each group b winner when Francavilla won as the group c winner, ordered in descending order, and display only the top 5.". [/INST] SELECT "group_b_winner", COUNT("group_b_winner") AS Count FROM "table1_1137142_1" WHERE "group_c_winner"='Francavilla' GROUP BY "group_b_winner" ORDER BY Count DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "table1_1137142_1" ( "season" text, "group_a_winner" text, "group_b_winner" text, "group_c_winner" text, "group_d_winner" text );. Question: "How many unique season winners are there for each 'group a winner' where the 'group b winner' is 'Modena'?". [/INST] SELECT COUNT(DISTINCT "season") FROM "table1_1137142_1" WHERE "group_b_winner"='Modena' GROUP BY "group_a_winner";</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "table1_1137142_1" ( "season" text, "group_a_winner" text, "group_b_winner" text, "group_c_winner" text, "group_d_winner" text );. Question: "What is the count of distinct winning seasons for each 'Group A' winner when 'Vis Pesaro' was the 'Group C' winner, sorted by the number of winning seasons in descending order, and limit the result to the top 5?". [/INST] SELECT "group_a_winner", COUNT(DISTINCT "season") as "Winning_Seasons" FROM "table1_1137142_1" WHERE "group_c_winner"='Vis Pesaro' GROUP BY "group_a_winner" ORDER BY "Winning_Seasons" DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "table1_1137142_1" ( "season" text, "group_a_winner" text, "group_b_winner" text, "group_c_winner" text, "group_d_winner" text );. Question: "Count the frequency of victories for each team in group a , ordered by the number of victories and listing the team with the most victories first. Limit the result to top 10.". [/INST] SELECT "group_a_winner", COUNT("group_a_winner") as frequency FROM "table1_1137142_1" GROUP BY "group_a_winner" ORDER BY COUNT("group_a_winner") DESC LIMIT 10;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "table1_1137142_1" ( "season" text, "group_a_winner" text, "group_b_winner" text, "group_c_winner" text, "group_d_winner" text );. Question: "What were the distinct seasons when Modena won in group B and order them based on season?". [/INST] SELECT DISTINCT "season" FROM "table1_1137142_1" WHERE "group_b_winner"='Modena' ORDER BY "season" ASC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "grands_prix" ( "round" real, "grand_prix" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "winning_constructor" text, "report" text );. Question: "How many unique drivers achieved the fastest lap in ascending order of occurrence, for the top 3, at the Brazilian Grand Prix?". [/INST] SELECT "fastest_lap", COUNT(*) AS count FROM "grands_prix" WHERE "grand_prix"='Brazilian Grand Prix' GROUP BY "fastest_lap" ORDER BY count ASC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "grands_prix" ( "round" real, "grand_prix" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "winning_constructor" text, "report" text );. Question: "For each Grand Prix, who held the pole position in the maximum round and how many times have they held it?". [/INST] SELECT "grand_prix", "pole_position", MAX("round"), COUNT(*) FROM "grands_prix" GROUP BY "grand_prix", "pole_position" ORDER BY COUNT(*) DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "grands_prix" ( "round" real, "grand_prix" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "winning_constructor" text, "report" text );. Question: "How many times each driver won when Michael Schumacher had the pole and the fastest lap, ordered by the number of victories in descending order and only showing the top 3?". [/INST] SELECT "winning_driver", COUNT("winning_driver") AS victories FROM "grands_prix" WHERE "fastest_lap"='Michael Schumacher' AND "pole_position"='Michael Schumacher' GROUP BY "winning_driver" ORDER BY victories DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "grands_prix" ( "round" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "winning_constructor" text, "report" text );. Question: "What is the most frequented location for grands prix held on 5th April, and how many times has it been held there in total?". [/INST] SELECT "location", COUNT("location") as "frequency" FROM "grands_prix" WHERE "date"='5 April' GROUP BY "location" ORDER BY "frequency" DESC LIMIT 1;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "grands_prix" ( "round" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "winning_constructor" text, "report" text );. Question: "Which driver has claimed the most pole positions on races held on the 26th of July and how many such pole positions has this driver achieved?". [/INST] SELECT "pole_position", COUNT("pole_position") AS "pole_position_count" FROM "grands_prix" WHERE "date"='26 July' GROUP BY "pole_position" ORDER BY "pole_position_count" DESC LIMIT 1;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "grands_prix" ( "round" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "winning_constructor" text, "report" text );. Question: "Count the number of times each constructor has won where fastest lap was achieved by Riccardo Patrese at the location Interlagos, and list them in descending order, and only show top 5 results.". [/INST] SELECT "winning_constructor", COUNT("winning_constructor") as Wins FROM "grands_prix" WHERE "fastest_lap"='Riccardo Patrese' AND "location"='Interlagos' GROUP BY "winning_constructor" ORDER BY Wins DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "grands_prix" ( "round" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "winning_constructor" text, "report" text );. Question: "Find the number of unique winning drivers for each date where the winning constructor was 'Williams - Renault' and the Grand Prix was 'South African Grand Prix', and sort them by the date in ascending order. Limit the results to the top 5.". [/INST] SELECT "date", COUNT(DISTINCT "winning_driver") FROM "grands_prix" WHERE "winning_constructor"='Williams - Renault' AND "grand_prix"='South African Grand Prix' GROUP BY "date" ORDER BY "date" ASC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "grands_prix" ( "round" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "winning_constructor" text, "report" text );. Question: "What is the minimum round where the grand prix is 'German Grand Prix', grouped by 'location' and 'winning_constructor', ordered by 'winning_constructor' and limited to the top 5 results?". [/INST] SELECT MIN("round"), "location", "winning_constructor" FROM "grands_prix" WHERE "grand_prix"='German Grand Prix' GROUP BY "location", "winning_constructor" ORDER BY "winning_constructor" LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "grands_prix" ( "round" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "winning_constructor" text, "report" text );. Question: "What is the maximum number of races won by a driver in a Portuguese Grand Prix, ordered by the winning driver's name in ascending order, and display the top 3 records?". [/INST] SELECT "winning_driver", COUNT("date") as races_won FROM "grands_prix" WHERE "grand_prix"='Portuguese Grand Prix' GROUP BY "winning_driver" ORDER BY "winning_driver" ASC, races_won DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "round" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "winning_constructor" text, "report" text );. Question: "What is the number of unique pole position per grand prix with a round equal to or less than 15, and provide the top 5 grand prix with the most pole positions?". [/INST] SELECT "grand_prix", COUNT(DISTINCT "pole_position") as number_of_pole_positions FROM "season_review" WHERE "round"<=15 GROUP BY "grand_prix" ORDER BY number_of_pole_positions DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "round" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "winning_constructor" text, "report" text );. Question: "What is the earliest and latest date that the circuit gilles villeneuve has taken place, and how many races has each winning constructor won there?". [/INST] SELECT MIN("date"), MAX("date"), COUNT("winning_constructor") FROM "season_review" WHERE "location"='Circuit Gilles Villeneuve' GROUP BY "winning_constructor" ORDER BY COUNT("winning_constructor") DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "round" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "winning_constructor" text, "report" text );. Question: "How many grand prix events did Thierry Boutsen record the fastest lap, and arrange them in order of location with the most frequent at the top?". [/INST] SELECT "location", COUNT("grand_prix") AS "num_of_events" FROM "season_review" WHERE "fastest_lap"='Thierry Boutsen' GROUP BY "location" ORDER BY "num_of_events" DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rd" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "constructor" text, "report" text );. Question: "How many times each driver has taken the pole position in the German Grand Prix, sorted by the number of pole positions in descending order, and limiting the results to the top 5.". [/INST] SELECT "pole_position", COUNT("pole_position") AS "Number of Poles" FROM "season_review" WHERE "grand_prix"='German Grand Prix' GROUP BY "pole_position" ORDER BY COUNT("pole_position") DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rd" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "constructor" text, "report" text );. Question: "How many Grand Prix took place on each location given that the rd occured on 22 October?". [/INST] SELECT "location", COUNT("grand_prix") FROM "season_review" WHERE "date"='22 October' GROUP BY "location";</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rd" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "constructor" text, "report" text );. Question: "Count the number of wins for each winning driver on all dates before 13 August, sorted by the number of wins in descending order and limited to the top 5.". [/INST] SELECT "winning_driver", COUNT(*) AS "number_of_wins" FROM "season_review" WHERE "date" <= '13 August' GROUP BY "winning_driver" ORDER BY "number_of_wins" DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rd" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "constructor" text, "report" text );. Question: "How many different constructors had the fastest lap at different Grand Prixs, including the Mexican Grand Prix, sorted by the count in descending order and limit to the top 5.". [/INST] SELECT COUNT("fastest_lap"), "constructor" FROM "season_review" WHERE "grand_prix" IN ('Mexican Grand Prix') GROUP BY "constructor" ORDER BY COUNT("fastest_lap") DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rd" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "constructor" text, "report" text );. Question: "How many unique constructors participated and who had the fastest lap at each rd. that took place at Hockenheimring, and list them in descending order of rd.". [/INST] SELECT "rd", "fastest_lap", COUNT(DISTINCT "constructor") FROM "season_review" WHERE "location"='Hockenheimring' GROUP BY "rd", "fastest_lap" ORDER BY "rd" DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rd" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "constructor" text, "report" text );. Question: "How many times each driver had the fastest lap at Silverstone, listed from most to least occurrences?". [/INST] SELECT "fastest_lap", COUNT(*) FROM "season_review" WHERE "location"='Silverstone' GROUP BY "fastest_lap" ORDER BY COUNT(*) DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "table1_11381701_3" ( "source" text, "date" text, "method" text, "i_os" text, "android" text, "black_berry" text, "symbian_series_40" text, "bada" text, "windows" text, "other" text );. Question: "What is the average percentage of Android use and the highest and lowest percentages of IOS use when Windows has been used more than 1.15%, for each source and method, from the latest to the oldest date, limit results to 5?". [/INST] SELECT "source", "method", AVG("android"), MAX("i_os"), MIN("i_os") FROM "table1_11381701_3" WHERE "windows" > '1.15%' GROUP BY "source", "method" ORDER BY "date" DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "table1_11381701_3" ( "source" text, "date" text, "method" text, "i_os" text, "android" text, "black_berry" text, "symbian_series_40" text, "bada" text, "windows" text, "other" text );. Question: "How many times was each method used where the value of Bada was 0.05%, ordered by the count in descending order, and limit the output to the top 10 results ?". [/INST] SELECT "method", COUNT(*) AS Count FROM "table1_11381701_3" WHERE "bada"='0.05%' GROUP BY "method" ORDER BY Count DESC LIMIT 10;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "table1_11381701_3" ( "source" text, "date" text, "method" text, "i_os" text, "android" text, "black_berry" text, "symbian_series_40" text, "bada" text, "windows" text, "other" text );. Question: "For all sources, what is the maximum percentage for Windows when the value of "other" is 0.7%, and also list the corresponding dates? Order the result by the date in descending order and limit the output to the top 5 records.". [/INST] SELECT "source", "date", MAX("windows") as max_windows FROM "table1_11381701_3" WHERE "other"='0.7%' GROUP BY "source", "date" ORDER BY "date" DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "table1_11381701_3" ( "source" text, "date" text, "method" text, "i_os" text, "android" text, "black_berry" text, "symbian_series_40" text, "bada" text, "windows" text, "other" text );. Question: "What is the average percentage of "other" operating systems when the method used is the one with the highest frequency of Symbian/Series 40 at 0.40%?". [/INST] SELECT AVG("other") FROM "table1_11381701_3" WHERE "symbian_series_40"='0.40%' GROUP BY "method" ORDER BY COUNT("method") DESC LIMIT 1;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "table1_11381701_3" ( "source" text, "date" text, "method" text, "i_os" text, "android" text, "black_berry" text, "symbian_series_40" text, "bada" text, "windows" text, "other" text );. Question: "Provide the top three sources that have the highest bada and Blackberry percentages combined, and list them in descending order.". [/INST] SELECT "source",("bada"+"black_berry") AS "Sum_Percentage" FROM "table1_11381701_3" ORDER BY "Sum_Percentage" DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "administered_by_independent_administrati" ( "english_name" text, "japanese_orthography" text, "pronouciation" text, "abbreviation" text, "provider_iai" text, "foundation" real );. Question: "What's the average foundation year of all colleges that have the English abbreviation 'MTC' grouped by the provider, and list them in descending order?". [/INST] SELECT "provider_iai", AVG("foundation") FROM "administered_by_independent_administrati" WHERE "abbreviation"='MTC' GROUP BY "provider_iai" ORDER BY AVG("foundation") DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "administered_by_independent_administrati" ( "english_name" text, "japanese_orthography" text, "pronouciation" text, "abbreviation" text, "provider_iai" text, "foundation" real );. Question: "How many different providers provided the National Farmers Academy and list their Japanese orthography in ascending order?". [/INST] SELECT COUNT("provider_iai"), "japanese_orthography" FROM "administered_by_independent_administrati" WHERE "english_name"='National Farmers Academy' GROUP BY "provider_iai" ORDER BY "japanese_orthography" ASC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "administered_by_independent_administrati" ( "english_name" text, "japanese_orthography" text, "pronouciation" text, "abbreviation" text, "provider_iai" text, "foundation" real );. Question: "What is the oldest established college with the pronunciation "kōkū daigakkō" and its abbreviation? Also, how many other colleges have the same pronunciation?". [/INST] SELECT MIN("foundation"), "abbreviation", COUNT("pronouciation") FROM "administered_by_independent_administrati" WHERE "pronouciation"='Kōkū Daigakkō' GROUP BY "pronouciation";</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "administered_by_independent_administrati" ( "english_name" text, "japanese_orthography" text, "pronouciation" text, "abbreviation" text, "provider_iai" text, "foundation" real );. Question: "What's the yearly distribution of the number of providers founded from 1960 to 1970, sorted by years, displaying only top 5 records?". [/INST] SELECT COUNT("provider_iai"), "foundation" FROM "administered_by_independent_administrati" WHERE "foundation" BETWEEN 1960 AND 1970 GROUP BY "foundation" ORDER BY COUNT("provider_iai") DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "administered_by_independent_administrati" ( "english_name" text, "japanese_orthography" text, "pronouciation" text, "abbreviation" text, "provider_iai" text, "foundation" real );. Question: "For each provider, how many different abbreviations exist for institutions with the Japanese orthography for National Fisheries University, ordered by the number of abbreviations?". [/INST] SELECT "provider_iai", COUNT("abbreviation") FROM "administered_by_independent_administrati" WHERE "japanese_orthography"=(SELECT "japanese_orthography" FROM "administered_by_independent_administrati" WHERE "english_name"='National Fisheries University') GROUP BY "provider_iai" ORDER BY COUNT("abbreviation") DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "winners_by_country" ( "country" text, "total" real, "marathon_mens" real, "marathon_womens" real, "half_marathon_mens" real, "half_marathon_womens" real );. Question: "What are the top 10 countries with the minimal records in women's half marathon, including the total number of marathons won by these countries?". [/INST] SELECT "country", MIN("half_marathon_womens"), "total" FROM "winners_by_country" GROUP BY "country" ORDER BY MIN("half_marathon_womens") ASC LIMIT 10;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "winners_by_country" ( "country" text, "total" real, "marathon_mens" real, "marathon_womens" real, "half_marathon_mens" real, "half_marathon_womens" real );. Question: "What are the top 3 countries with the highest total of half marathons (both mens and womens) and how many of them are there for each country?". [/INST] SELECT "country", SUM("half_marathon_mens" + "half_marathon_womens") as "total_half_marathons" FROM "winners_by_country" GROUP BY "country" ORDER BY "total_half_marathons" DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "winners_by_country" ( "country" text, "total" real, "marathon_mens" real, "marathon_womens" real, "half_marathon_mens" real, "half_marathon_womens" real );. Question: "What are the top 5 countries where the total wins in women's half marathons is over 1.0, ordered by the number of wins in the descending order?". [/INST] SELECT "country", COUNT("half_marathon_womens") FROM "winners_by_country" WHERE "half_marathon_womens">1.0 GROUP BY "country" ORDER BY COUNT("half_marathon_womens") DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "winners_by_country" ( "country" text, "total" real, "marathon_mens" real, "marathon_womens" real, "half_marathon_mens" real, "half_marathon_womens" real );. Question: "What is the maximum, minimum and average number of times countries have won the women's half marathon, grouping the counts by country and only displaying the top 5 with the most wins?". [/INST] SELECT "country", MAX("half_marathon_womens"), MIN("half_marathon_womens"), AVG("half_marathon_womens") FROM "winners_by_country" GROUP BY "country" ORDER BY COUNT("half_marathon_womens") DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "winners_by_country" ( "country" text, "total" real, "marathon_mens" real, "marathon_womens" real, "half_marathon_mens" real, "half_marathon_womens" real );. Question: "What are the top 5 countries with the highest average scores in both men's and women's half marathon categories, where the women's score exceeds 1.0?". [/INST] SELECT "country", AVG("half_marathon_mens"), AVG("half_marathon_womens") FROM "winners_by_country" WHERE "half_marathon_womens" >1.0 GROUP BY "country" ORDER BY AVG("half_marathon_mens") DESC, AVG("half_marathon_womens") DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rd" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "constructor" text, "report" text );. Question: "How many times each constructor won the Grand Prix in Brazil and who was the driver who achieved the fastest lap?". [/INST] SELECT "constructor", COUNT("winning_driver"), MAX("fastest_lap") FROM "season_review" WHERE "grand_prix"='Brazilian Grand Prix' GROUP BY "constructor";</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rd" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "constructor" text, "report" text );. Question: "Which location had the most occurrences of a driver driving the fastest lap for the top 5 rounds sorted in descending order?". [/INST] SELECT "location", COUNT("fastest_lap") AS "count_fastest_lap" FROM "season_review" WHERE "rd"<=5 GROUP BY "location" ORDER BY "count_fastest_lap" DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rd" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "constructor" text, "report" text );. Question: "Count the number of Grand Prix held at each location, sorted by the count in descending order and limit the result to top 5 locations. For these locations, also identify which driver took the fastest lap and sort these drivers alphabetically.". [/INST] SELECT "location", COUNT(*) as grand_prix_count, GROUP_CONCAT(DISTINCT "fastest_lap" ORDER BY "fastest_lap" ASC) as fastest_lap_drivers FROM "season_review" GROUP BY "location" ORDER BY grand_prix_count DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rd" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "constructor" text, "report" text );. Question: "What was the maximum number of events held at a particular location, and show the top 5 locations with the highest number of events over the years.". [/INST] SELECT "location", COUNT("grand_prix") as number_of_events FROM "season_review" GROUP BY "location" ORDER BY number_of_events DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rd" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "constructor" text, "report" text );. Question: "Identify the top 5 Grand Prix events hosted at different locations where Nigel Mansell drove the fastest and a race was won by McLaren-Honda, ordered by the dates in descending order.". [/INST] SELECT "grand_prix", "location", "date" FROM "season_review" WHERE "constructor"='McLaren - Honda' AND "fastest_lap"='Nigel Mansell' ORDER BY "date" DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rd" real, "grand_prix" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "winning_driver" text, "constructor" text, "report" text );. Question: "Count the number of different winning drivers for each constructor in French Grand Prix and order the result by the count in descending order. Limit the result to top 5.". [/INST] SELECT "constructor", COUNT(DISTINCT "winning_driver") as driver_count FROM "season_review" WHERE "grand_prix"='French Grand Prix' GROUP BY "constructor" ORDER BY driver_count DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "night_series_winners_1977_1987" ( "year" real, "winners" text, "grand_finalist" text, "scores" text, "venue" text, "crowd" real, "margin" real, "season_result" text );. Question: "What's the average crowd size for each venue in years the season result was 7th, ordered by crowd size descending, with the three highest averages displayed?". [/INST] SELECT "venue", AVG("crowd") AS "average_crowd" FROM "night_series_winners_1977_1987" WHERE "season_result" = '7th' GROUP BY "venue" ORDER BY "average_crowd" DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "night_series_winners_1977_1987" ( "year" real, "winners" text, "grand_finalist" text, "scores" text, "venue" text, "crowd" real, "margin" real, "season_result" text );. Question: "What was the maximum, minimum and average crowd for each venue where the season result was 9th, ordered by average crowd in descending order, limited to top 5 results?". [/INST] SELECT "venue", MAX("crowd"), MIN("crowd"), AVG("crowd") FROM "night_series_winners_1977_1987" WHERE "season_result"='9th' GROUP BY "venue" ORDER BY AVG("crowd") DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "night_series_winners_1977_1987" ( "year" real, "winners" text, "grand_finalist" text, "scores" text, "venue" text, "crowd" real, "margin" real, "season_result" text );. Question: "How many times did each grand finalist lose against Collingwood in descending order?". [/INST] SELECT "grand_finalist", COUNT(*) FROM "night_series_winners_1977_1987" WHERE "winners"='Collingwood' GROUP BY "grand_finalist" ORDER BY COUNT(*) DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "night_series_winners_1977_1987" ( "year" real, "winners" text, "grand_finalist" text, "scores" text, "venue" text, "crowd" real, "margin" real, "season_result" text );. Question: "What is the average margin and total crowd for each venue, for seasons resulting in a win, sorted by average margin in descending order and limited to 5 records?". [/INST] SELECT "venue", AVG("margin") as Average_Margin, SUM("crowd") as Total_Crowd FROM "night_series_winners_1977_1987" WHERE "season_result"='win' GROUP BY "venue" ORDER BY Average_Margin DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "night_series_winners_1977_1987" ( "year" real, "winners" text, "grand_finalist" text, "scores" text, "venue" text, "crowd" real, "margin" real, "season_result" text );. Question: "What is the average crowd size at the venues where the grand finalist scored 11.11 (77) – 10.8 (68), ordered from highest to lowest and limit to the top 5?". [/INST] SELECT "venue", AVG("crowd") AS "average_crowd" FROM "night_series_winners_1977_1987" WHERE "scores"='11.11 (77) – 10.8 (68)' GROUP BY "venue" ORDER BY "average_crowd" DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "night_series_winners_1977_1987" ( "year" real, "winners" text, "grand_finalist" text, "scores" text, "venue" text, "crowd" real, "margin" real, "season_result" text );. Question: "What was the maximum crowd size and corresponding venue during the years where the scores were 8.9 (57) – 7.12 (54), grouped by the grand finalists and sorted by the crowd size in descending order, only including top 5 records.". [/INST] SELECT "grand_finalist", MAX("crowd"), "venue" FROM "night_series_winners_1977_1987" WHERE "scores"='8.9 (57) – 7.12 (54)' GROUP BY "grand_finalist" ORDER BY MAX("crowd") DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "consolation_night_series_lake_oval_winne" ( "year" real, "winners" text, "grand_finalist" text, "scores" text, "venue" text, "crowd" real, "margin" real, "season_result" text );. Question: "What was the smallest and largest crowds for each venue when the scores are 10.12 (72) – 8.11 (59), and display them sorted by the largest crowd in descending order?". [/INST] SELECT "venue", MIN("crowd") AS smallest_crowd, MAX("crowd") AS largest_crowd FROM "consolation_night_series_lake_oval_winne" WHERE "scores"='10.12 (72) – 8.11 (59)' GROUP BY "venue" ORDER BY "largest_crowd" DESC LIMIT 10;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "consolation_night_series_lake_oval_winne" ( "year" real, "winners" text, "grand_finalist" text, "scores" text, "venue" text, "crowd" real, "margin" real, "season_result" text );. Question: "What is the average crowd size and maximum margin for each venue where the scores are either '15.13 (103) – 8.4 (52)' or '12.10 (82) – 10.8 (68)', grouped by the venue and ordered by the average crowd size descending. Return the first five records.". [/INST] SELECT "venue", AVG("crowd") AS crowd_average, MAX("margin") AS max_margin FROM "consolation_night_series_lake_oval_winne" WHERE "scores" IN ('15.13 (103) – 8.4 (52)', '12.10 (82) – 10.8 (68)') GROUP BY "venue" ORDER BY AVG("crowd") DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "consolation_night_series_lake_oval_winne" ( "year" real, "winners" text, "grand_finalist" text, "scores" text, "venue" text, "crowd" real, "margin" real, "season_result" text );. Question: "For each venue, what is the maximum, minimum, and average margin, and how many games have been played, with a result where the margin is 4 or less and the crowd is more than 1000, order these venues in descending order based on the number of games?". [/INST] SELECT "venue", MAX("margin"), MIN("margin"), AVG("margin"), COUNT(*) FROM "consolation_night_series_lake_oval_winne" WHERE "margin" <= 4 AND "crowd" > 1000 GROUP BY "venue" ORDER BY COUNT(*) DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "consolation_night_series_lake_oval_winne" ( "year" real, "winners" text, "grand_finalist" text, "scores" text, "venue" text, "crowd" real, "margin" real, "season_result" text );. Question: "What is the maximum, minimum, and average crowd when "South Melbourne" was the grand finalist, grouping by the year, and provide the top 5 years based on the highest average crowds?". [/INST] SELECT "year", MAX("crowd"), MIN("crowd"), AVG("crowd") FROM "consolation_night_series_lake_oval_winne" WHERE "grand_finalist"='South Melbourne' GROUP BY "year" ORDER BY AVG("crowd") DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "List the top 3 races that had the most winners from different constructors sorted by date of race.". [/INST] SELECT "race", COUNT(DISTINCT "constructor") as num_constructors FROM "season_review" GROUP BY "race" ORDER BY num_constructors DESC, "date" ASC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "How many races did Alain Prost hold pole position and who were the corresponding race winners, sorted by date?". [/INST] SELECT COUNT("race"), "race_winner", "date" FROM "season_review" WHERE "pole_position"='Alain Prost' GROUP BY "race_winner" ORDER BY "date";</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "How many times each constructor has won the Portuguese Grand Prix, and list them in descending order of their victories?". [/INST] SELECT "constructor", COUNT(*) as victory_count FROM "season_review" WHERE "race"='Portuguese Grand Prix' AND "race_winner" = "constructor" GROUP BY "race_winner" ORDER BY victory_count DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "Determine the number of wins for each constructor on the date of 12 June, ordered by the number of wins in descending order, but limited to the top 10.". [/INST] SELECT "constructor", COUNT("race_winner") AS "Number_Of_Wins" FROM "season_review" WHERE "date"='12 June' GROUP BY "constructor" ORDER BY "Number_Of_Wins" DESC LIMIT 10;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "What is the count of different race winners per constructor at the location Hockenheimring, ordered by the count in descending order and display the top 5?". [/INST] SELECT "constructor", COUNT(DISTINCT "race_winner") FROM "season_review" WHERE "location"='Hockenheimring' GROUP BY "constructor" ORDER BY COUNT(DISTINCT "race_winner") DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "Who are the top 3 race winners at Jacarepaguá and how many times did they win, sorted from the most wins to least?". [/INST] SELECT "race_winner", COUNT("race_winner") AS wins FROM "season_review" WHERE "location"='Jacarepaguá' GROUP BY "race_winner" ORDER BY wins DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "What is the total number of unique constructors whose race_winner had won the race, with the race having a round number of 10, sorted by the number of wins and limited to the top 10?". [/INST] SELECT "constructor", COUNT(DISTINCT "race_winner") as number_of_wins FROM "season_review" WHERE "rnd"=10 GROUP BY "constructor" ORDER BY number_of_wins DESC LIMIT 10;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "What's the frequency count of each pole_position where location is hockenheimring, and order it from the most to the least frequent?". [/INST] SELECT "pole_position", COUNT (*) as "frequency" FROM "season_review" WHERE "location"='Hockenheimring' GROUP BY "pole_position" ORDER BY "frequency" DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "What is the race winner, and how many times each constructor has won a race if the round is 4?". [/INST] SELECT "race_winner", COUNT("constructor") FROM "season_review" WHERE "rnd"=4 GROUP BY "constructor" ORDER BY COUNT("constructor") DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "double_premiership_teams" ( "season" real, "premier" text, "runner_up" text, "score" text, "venue" text, "attendance" real, "premiership" text );. Question: "What's the average season when Essendon being the premier had an attendance of at least 30824 per venue, and ordered this from the highest to lowest average season?". [/INST] SELECT AVG("season") AS "Average_Season", "venue" FROM "double_premiership_teams" WHERE "premier"='Essendon' AND "attendance" >=30824 GROUP BY "venue" ORDER BY "Average_Season" DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "double_premiership_teams" ( "season" real, "premier" text, "runner_up" text, "score" text, "venue" text, "attendance" real, "premiership" text );. Question: "What are the top three seasons where Hawthorn had the highest attendance as a runner up, ordered by attendance in descending order?". [/INST] SELECT "season", MAX("attendance") FROM "double_premiership_teams" WHERE "runner_up"='Hawthorn' GROUP BY "season" ORDER BY "attendance" DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "double_premiership_teams" ( "season" real, "premier" text, "runner_up" text, "score" text, "venue" text, "attendance" real, "premiership" text );. Question: "What are the top 3 seasons with highest attendance when Geelong was the runner up, and also list the corresponding premierships and scores in descending order of attendance?". [/INST] SELECT "season", "premiership", "score" FROM "double_premiership_teams" WHERE "runner_up"='Geelong' ORDER BY "attendance" DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "double_premiership_teams" ( "season" real, "premier" text, "runner_up" text, "score" text, "venue" text, "attendance" real, "premiership" text );. Question: "Which venue had the highest number of attendees for the games with score '9.12 (66) – 5.6 (36)', and how many such games were there?". [/INST] SELECT "venue", COUNT(*) as count_games, MAX("attendance") as max_attendance FROM "double_premiership_teams" WHERE "score"='9.12 (66) – 5.6 (36)' GROUP BY "venue" ORDER BY max_attendance DESC LIMIT 1;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "In all locations where Patrick Tambay was on the pole, how many different race winners and the corresponding fastest lap holders were there, and who had the most wins?". [/INST] SELECT "race_winner", "fastest_lap", COUNT(*) AS "number_of_wins" FROM "season_review" WHERE "pole_position"='Patrick Tambay' GROUP BY "race_winner", "fastest_lap" ORDER BY COUNT(*) DESC LIMIT 1;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "What are the top 5 races where Nelson Piquet had the fastest lap time and were located in Nürburgring, along with the number of times he appeared as a constructor in those races in descending order?". [/INST] SELECT "race", COUNT("constructor") AS "constructor_count" FROM "season_review" WHERE "fastest_lap"='Nelson Piquet' AND "location"='Nürburgring' GROUP BY "race" ORDER BY "constructor_count" DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "In which location did Patrick Tambay record the most number of fastest laps and how many were those? Also, display the list in descending order of the count with a limit of 3 locations.". [/INST] SELECT "location", COUNT("rnd") as count FROM "season_review" WHERE "fastest_lap"='Patrick Tambay' GROUP BY "location" ORDER BY count DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "How many different constructors participated in the race located in Kyalami and who set the fastest lap for each constructor? Order the result by constructor name, and limit the output to 5 records.". [/INST] SELECT "constructor", "fastest_lap" FROM "season_review" WHERE "location"='Kyalami' GROUP BY "constructor", "fastest_lap" ORDER BY "constructor" LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "On which dates and locations did Gilles Villeneuve secure the pole position and recorded the fastest laps? Order the results by dates where the most recent one is shown first, limit the list to 5 records.". [/INST] SELECT "date", "location", COUNT("fastest_lap") FROM "season_review" WHERE "pole_position"='Gilles Villeneuve' GROUP BY "date", "location" ORDER BY "date" DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "Can you provide the list of the top 5 race winners who accomplished the fastest laps the most times in the Dutch Grand Prix, sorted in descending order and limit to the top 5 results?". [/INST] SELECT "race_winner", COUNT(*) as count FROM "season_review" WHERE "race"='Dutch Grand Prix' AND "fastest_lap"= "race_winner" GROUP BY "race_winner" ORDER BY count DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "How many times was each constructor associated with the fastest lap when John Watson was the race winner and what is the earliest and latest date these occurred?". [/INST] SELECT "constructor", COUNT("fastest_lap"), MIN("date"), MAX("date") FROM "season_review" WHERE "race_winner"='John Watson' GROUP BY "constructor" ORDER BY COUNT("fastest_lap") DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "What are the top 5 occasions with the most number of unique race stances by constructors occurred on 9 May?". [/INST] SELECT "constructor", COUNT(DISTINCT "race") as "unique_race_count" FROM "season_review" WHERE "date"='9 May' GROUP BY "constructor" ORDER BY "unique_race_count" DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "Which constructor has the most number of fastest laps by Nelson Piquet and what is the corresponding pole position in those races, list the top 3 constructors?". [/INST] SELECT "constructor", "pole_position", COUNT("fastest_lap") AS Count_Fastest_Lap FROM "season_review" WHERE "fastest_lap"='Nelson Piquet' GROUP BY "constructor", "pole_position" ORDER BY Count_Fastest_Lap DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "How many races were won by each constructor in San Marino Grand Prix, ordered by the number of wins in descending order, limit to top 5?". [/INST] SELECT "constructor", COUNT("race_winner") AS "number_of_wins" FROM "season_review" WHERE "race"='San Marino Grand Prix' GROUP BY "constructor" ORDER BY "number_of_wins" DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "What are the top 3 most frequent race winners and their respective counts for the location Monza?". [/INST] SELECT "race_winner", COUNT("race_winner") AS Winner_Count FROM "season_review" WHERE "location"= 'Monza' GROUP BY "race_winner" ORDER BY Winner_Count DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "Which constructor was involved the most when Alain Prost was in pole position and Keke Rosberg won the race, list top 3 along with their count, sorted in descending order?". [/INST] SELECT "constructor", COUNT("race") AS "race_count" FROM "season_review" WHERE "pole_position"='Alain Prost' AND "race_winner"='Keke Rosberg' GROUP BY "constructor" ORDER BY "race_count" DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "How many times each constructor won a race at Österreichring?". [/INST] SELECT "constructor", COUNT("race_winner") FROM "season_review" WHERE "location"='Österreichring' GROUP BY "constructor" ORDER BY COUNT("race_winner") DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "What's the constructor that won the most races in the location of the 'Argentine Grand Prix', and how many races have they won?". [/INST] SELECT "constructor", COUNT("race_winner") as wins FROM "season_review" WHERE "race"='Argentine Grand Prix' GROUP BY "constructor" ORDER BY wins DESC LIMIT 1;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "Which date had the minimum round number for the 'Italian Grand Prix' and who was the race winner and the constructor for that race?". [/INST] SELECT MIN("rnd"), "date", "race_winner", "constructor" FROM "season_review" WHERE "race"='Italian Grand Prix' GROUP BY "date", "race_winner", "constructor" ORDER BY "rnd" ASC LIMIT 1;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "What are the top 3 dates with the highest number of reports, excluding '29 April'?". [/INST] SELECT "date", COUNT("report") as "Number of reports" FROM "season_review" WHERE "date" != '29 April' GROUP BY "date" ORDER BY COUNT("report") DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "What is the count of races won by each race winner with Renault as the constructor, and order them in descending order by their count.". [/INST] SELECT "race_winner", COUNT("race") FROM "season_review" WHERE "constructor"='Renault' GROUP BY "race_winner" ORDER BY COUNT("race") DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "What are the top 3 dates where the race was won by the same constructor in round 1, ordered by date?". [/INST] SELECT "date", COUNT(*) as count FROM "season_review" WHERE "rnd" = 1 GROUP BY "constructor", "date" ORDER BY count DESC, "date" ASC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "Which constructor has won the most races at the Monaco Grand Prix, ordered from highest number of wins to lowest, and limit the result to top 5?". [/INST] SELECT "constructor", COUNT("race_winner") as wins FROM "season_review" WHERE "race"='Monaco Grand Prix' GROUP BY "constructor" ORDER BY wins DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "How many rounds were won with James Hunt as pole position and John Watson as fastest lap per constructor, ordered by the most wins and show only top 5?". [/INST] SELECT "constructor", COUNT("rnd") FROM "season_review" WHERE "pole_position"='James Hunt' AND "fastest_lap"='John Watson' GROUP BY "constructor" ORDER BY COUNT("rnd") DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "Who won the maximum number of races at Dijon-Prenois and how many such races have they won, sorted in descending order of the number of wins and limited to the top 10?". [/INST] SELECT "race_winner", COUNT("race_winner") AS number_of_wins FROM "season_review" WHERE "location"='Dijon-Prenois' GROUP BY "race_winner" ORDER BY number_of_wins DESC LIMIT 10;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "How many times each constructor won the race for all rounds and list them in descending order?". [/INST] SELECT "constructor", COUNT("race_winner") as Winner_Count FROM "season_review" GROUP BY "constructor" ORDER BY Winner_Count DESC;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "non_championship_race_results" ( "race_name" text, "circuit" text, "date" text, "winning_driver" text, "constructor" text, "report" text );. Question: "List the top 3 constructors who have the most number of wins on Brands Hatch circuit, along with their count of wins.". [/INST] SELECT "constructor", COUNT("winning_driver") as "number_of_wins" FROM "non_championship_race_results" WHERE "circuit"='Brands Hatch' GROUP BY "constructor" ORDER BY "number_of_wins" DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "non_championship_race_results" ( "race_name" text, "circuit" text, "date" text, "winning_driver" text, "constructor" text, "report" text );. Question: "Count how many races each constructor had won, and order them from the one who has won the most races to the least, with the top 3 results only.". [/INST] SELECT "constructor", COUNT("winning_driver") AS "number_of_wins" FROM "non_championship_race_results" GROUP BY "constructor" ORDER BY "number_of_wins" DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "non_championship_race_results" ( "race_name" text, "circuit" text, "date" text, "winning_driver" text, "constructor" text, "report" text );. Question: "What are the top 3 most common winning drivers for races held at Oulton Park, and how many times each has won?". [/INST] SELECT "winning_driver", COUNT(*) FROM "non_championship_race_results" WHERE "circuit"='Oulton Park' GROUP BY "winning_driver" ORDER BY COUNT(*) DESC LIMIT 3;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "non_championship_race_results" ( "race_name" text, "circuit" text, "date" text, "winning_driver" text, "constructor" text, "report" text );. Question: "How many different constructors won the I Brazilian Grand Prix, ordered by the date of their victories, and limit it to the 5 most recent victories?". [/INST] SELECT "constructor", COUNT("winning_driver") FROM "non_championship_race_results" WHERE "race_name"='I Brazilian Grand Prix' GROUP BY "constructor" ORDER BY "date" DESC LIMIT 5;</s>
<s>[INST] <<SYS>> You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question. <</SYS>> CREATE TABLE statement: CREATE TABLE "season_review" ( "rnd" real, "race" text, "date" text, "location" text, "pole_position" text, "fastest_lap" text, "race_winner" text, "constructor" text, "report" text );. Question: "How many unique constructors has Niki Lauda competed for in all the races he took the pole position on or before 27th April?". [/INST] SELECT COUNT(DISTINCT "constructor") FROM "season_review" WHERE "pole_position"='Niki Lauda' AND "date"<='27 April';</s>