text
stringlengths 310
1.28k
|
|---|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "performance_by_nation" (
"rank" real,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
Question: Name the average total for gold less than 1 and rank less than 5
<|assistant|>
SELECT AVG("total") FROM "performance_by_nation" WHERE "gold"<1 AND "rank"<5;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "performance_by_nation" (
"rank" real,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
Question: Name the sum of silver when total is mor ethan 1, bronze is 1 and gold is les than 0
<|assistant|>
SELECT SUM("silver") FROM "performance_by_nation" WHERE "total">1 AND "bronze"=1 AND "gold"<0;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "performance_by_nation" (
"rank" real,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
Question: Name the most gold when bronze is more than 0 and rank is more than 5 with total more than 2
<|assistant|>
SELECT MAX("gold") FROM "performance_by_nation" WHERE "bronze">0 AND "rank">5 AND "total">2;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "performance_by_nation" (
"rank" real,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
Question: Name the average bronze with silver more than 0, total of 6 and gold more than 0
<|assistant|>
SELECT AVG("bronze") FROM "performance_by_nation" WHERE "silver">0 AND "total"=6 AND "gold">0;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "performance_by_nation" (
"rank" real,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
Question: Name the sum of total with gold more than 1 and bronze more than 0
<|assistant|>
SELECT SUM("total") FROM "performance_by_nation" WHERE "gold">1 AND "bronze">0;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "2005" (
"category" text,
"film" text,
"director_s" text,
"country" text,
"nominating_festival" text
);
Question: What country did Jonas Geirnaert direct a film in?
<|assistant|>
SELECT "country" FROM "2005" WHERE "director_s"='jonas geirnaert';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "2005" (
"category" text,
"film" text,
"director_s" text,
"country" text,
"nominating_festival" text
);
Question: What Nominating Festival took place in Germany?
<|assistant|>
SELECT "nominating_festival" FROM "2005" WHERE "country"='germany';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "2005" (
"category" text,
"film" text,
"director_s" text,
"country" text,
"nominating_festival" text
);
Question: What is the category of the film made in Switzerland?
<|assistant|>
SELECT "category" FROM "2005" WHERE "country"='switzerland';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "2005" (
"category" text,
"film" text,
"director_s" text,
"country" text,
"nominating_festival" text
);
Question: What film was directed by Sandro Aguilar?
<|assistant|>
SELECT "film" FROM "2005" WHERE "director_s"='sandro aguilar';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "language" (
"language" text,
"number" text,
"percentage_pct" text,
"males" text,
"females" text
);
Question: Name the language that has number of 14
<|assistant|>
SELECT "language" FROM "language" WHERE "number"='14';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "language" (
"language" text,
"number" text,
"percentage_pct" text,
"males" text,
"females" text
);
Question: Name the number which has language of other
<|assistant|>
SELECT "number" FROM "language" WHERE "language"='other';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "final_table" (
"position" real,
"club" text,
"played" real,
"points" text,
"wins" real,
"draws" real,
"losses" real,
"goals_for" real,
"goals_against" real,
"goal_difference" real
);
Question: Tell me the average goals for losses of 19 and goals against more than 59
<|assistant|>
SELECT AVG("goals_for") FROM "final_table" WHERE "losses"=19 AND "goals_against">59;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "final_table" (
"position" real,
"club" text,
"played" real,
"points" text,
"wins" real,
"draws" real,
"losses" real,
"goals_for" real,
"goals_against" real,
"goal_difference" real
);
Question: Name the average position when the goals against are more than 42 and draws less than 16 with goals of 44
<|assistant|>
SELECT AVG("position") FROM "final_table" WHERE "goals_against">42 AND "goals_for"=44 AND "draws"<16;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "year_by_year" (
"year" real,
"division" text,
"league" text,
"regular_season" text,
"playoffs" text,
"u_s_open_cup" text,
"avg_attendance" text
);
Question: Which regular season was 2013 in?
<|assistant|>
SELECT "regular_season" FROM "year_by_year" WHERE "year"=2013;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "year_by_year" (
"year" real,
"division" text,
"league" text,
"regular_season" text,
"playoffs" text,
"u_s_open_cup" text,
"avg_attendance" text
);
Question: What year did the team make conference semifinals?
<|assistant|>
SELECT COUNT("year") FROM "year_by_year" WHERE "playoffs"='conference semifinals';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "list_of_the_50_largest_country_subdivisi" (
"rank" real,
"subdivision_name" text,
"country" text,
"area_km" real,
"population" real
);
Question: What's the name of a subdivision in Denmark ranked less than 24 with an area greater than 1,420,968?
<|assistant|>
SELECT "subdivision_name" FROM "list_of_the_50_largest_country_subdivisi" WHERE "rank"<24 AND "area_km">'1,420,968' AND "country"='denmark';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "list_of_the_50_largest_country_subdivisi" (
"rank" real,
"subdivision_name" text,
"country" text,
"area_km" real,
"population" real
);
Question: What's the smallest area in Russia that is ranked 23 with a population more than 522,800?
<|assistant|>
SELECT MIN("area_km") FROM "list_of_the_50_largest_country_subdivisi" WHERE "country"='russia' AND "rank"=23 AND "population">'522,800';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "game_log" (
"date" text,
"opponent" text,
"score" text,
"loss" text,
"record" text
);
Question: On the date of June 8 what was the record?
<|assistant|>
SELECT "record" FROM "game_log" WHERE "date"='june 8';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "game_log" (
"date" text,
"opponent" text,
"score" text,
"loss" text,
"record" text
);
Question: On the date of June 15 what was the score?
<|assistant|>
SELECT "score" FROM "game_log" WHERE "date"='june 15';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "round_seven" (
"pick_num" text,
"player" text,
"position" text,
"nationality" text,
"nhl_team" text,
"college_junior_club_team" text
);
Question: What College/junior/club had a player of United States nationality drafted by the Toronto Maple Leafs?
<|assistant|>
SELECT "college_junior_club_team" FROM "round_seven" WHERE "nhl_team"='toronto maple leafs' AND "nationality"='united states';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "round_seven" (
"pick_num" text,
"player" text,
"position" text,
"nationality" text,
"nhl_team" text,
"college_junior_club_team" text
);
Question: What is the college/junior/club team of the defence player drafted by the New York Rangers?
<|assistant|>
SELECT "college_junior_club_team" FROM "round_seven" WHERE "nhl_team"='new york rangers' AND "position"='defence';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_american_le_mans_series_results" (
"year" real,
"entrant" text,
"class" text,
"chassis" text,
"engine" text,
"tyres" text,
"rank" text,
"points" real
);
Question: What is the rank of the cadillac northstar lmp02 chassis?
<|assistant|>
SELECT "rank" FROM "complete_american_le_mans_series_results" WHERE "chassis"='cadillac northstar lmp02';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_american_le_mans_series_results" (
"year" real,
"entrant" text,
"class" text,
"chassis" text,
"engine" text,
"tyres" text,
"rank" text,
"points" real
);
Question: What is the entrant for the audi 3.6l turbo v8 engine and ranked 3rd with 163 points?
<|assistant|>
SELECT "entrant" FROM "complete_american_le_mans_series_results" WHERE "engine"='audi 3.6l turbo v8' AND "rank"='3rd' AND "points"=163;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_american_le_mans_series_results" (
"year" real,
"entrant" text,
"class" text,
"chassis" text,
"engine" text,
"tyres" text,
"rank" text,
"points" real
);
Question: What is the rank with more than 123 points, an audi r8 chassis, and a lmp900 class?
<|assistant|>
SELECT "rank" FROM "complete_american_le_mans_series_results" WHERE "points">123 AND "chassis"='audi r8' AND "class"='lmp900';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_american_le_mans_series_results" (
"year" real,
"entrant" text,
"class" text,
"chassis" text,
"engine" text,
"tyres" text,
"rank" text,
"points" real
);
Question: What is the engine for the bmw motorsport entrant with 123 points before 2004?
<|assistant|>
SELECT "engine" FROM "complete_american_le_mans_series_results" WHERE "year"<2004 AND "entrant"='bmw motorsport' AND "points"=123;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "bt_global_challenge_2000_1" (
"overall_place" text,
"yacht_name" text,
"skipper" text,
"points" text,
"combined_elapsed_time" text
);
Question: Which points have a Combined elapsed time of 175d 20h 46m 04s?
<|assistant|>
SELECT "points" FROM "bt_global_challenge_2000_1" WHERE "combined_elapsed_time"='175d 20h 46m 04s';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "bt_global_challenge_2000_1" (
"overall_place" text,
"yacht_name" text,
"skipper" text,
"points" text,
"combined_elapsed_time" text
);
Question: Which yacht name has a Combined elapsed time of 179d 11h 58m 14s?
<|assistant|>
SELECT "yacht_name" FROM "bt_global_challenge_2000_1" WHERE "combined_elapsed_time"='179d 11h 58m 14s';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "bt_global_challenge_2000_1" (
"overall_place" text,
"yacht_name" text,
"skipper" text,
"points" text,
"combined_elapsed_time" text
);
Question: Which skipper has 78 points?
<|assistant|>
SELECT "skipper" FROM "bt_global_challenge_2000_1" WHERE "points"='78';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "bt_global_challenge_2000_1" (
"overall_place" text,
"yacht_name" text,
"skipper" text,
"points" text,
"combined_elapsed_time" text
);
Question: Which points have an Overall place of 9=, and a Skipper of nick fenton?
<|assistant|>
SELECT "points" FROM "bt_global_challenge_2000_1" WHERE "overall_place"='9=' AND "skipper"='nick fenton';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "bt_global_challenge_2000_1" (
"overall_place" text,
"yacht_name" text,
"skipper" text,
"points" text,
"combined_elapsed_time" text
);
Question: Which Overall place has a Yacht name of lg flatron?
<|assistant|>
SELECT "overall_place" FROM "bt_global_challenge_2000_1" WHERE "yacht_name"='lg flatron';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "bt_global_challenge_2000_1" (
"overall_place" text,
"yacht_name" text,
"skipper" text,
"points" text,
"combined_elapsed_time" text
);
Question: Which Combined elapsed time has a Skipper of stephen wilkins?
<|assistant|>
SELECT "combined_elapsed_time" FROM "bt_global_challenge_2000_1" WHERE "skipper"='stephen wilkins';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_formula_one_results" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
Question: Before the year 1988, what is the lowest number of points that entrant Coloni SpA scored?
<|assistant|>
SELECT MIN("points") FROM "complete_formula_one_results" WHERE "entrant"='coloni spa' AND "year"<1988;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_formula_one_results" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
Question: Which chassis used by the entrant Automobiles Gonfaronnaises Sportives scored 0 points?
<|assistant|>
SELECT "chassis" FROM "complete_formula_one_results" WHERE "points"=0 AND "entrant"='automobiles gonfaronnaises sportives';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_formula_one_results" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
Question: Who was the entrant before 1988?
<|assistant|>
SELECT "entrant" FROM "complete_formula_one_results" WHERE "year"<1988;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_formula_one_results" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
Question: Which engine was used in 1987?
<|assistant|>
SELECT "engine" FROM "complete_formula_one_results" WHERE "year"=1987;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "year_by_year" (
"year" real,
"division" text,
"league" text,
"reg_season" text,
"playoffs" text,
"open_cup" text
);
Question: What league did they play in 2001?
<|assistant|>
SELECT "league" FROM "year_by_year" WHERE "year"=2001;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "year_by_year" (
"year" real,
"division" text,
"league" text,
"reg_season" text,
"playoffs" text,
"open_cup" text
);
Question: What open cup did they play in when they finished 2nd, northeast in the reg. season?
<|assistant|>
SELECT "open_cup" FROM "year_by_year" WHERE "reg_season"='2nd, northeast';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "schedule" (
"week" real,
"date" text,
"opponent" text,
"result" text,
"attendance" real
);
Question: What is the week with a date of October 9, 1983, and attendance smaller than 40,492?
<|assistant|>
SELECT COUNT("week") FROM "schedule" WHERE "date"='october 9, 1983' AND "attendance"<'40,492';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "schedule" (
"week" real,
"date" text,
"opponent" text,
"result" text,
"attendance" real
);
Question: What is the lowest attendance with week 14?
<|assistant|>
SELECT MIN("attendance") FROM "schedule" WHERE "week"=14;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "schedule" (
"week" real,
"opponent" text,
"result" text,
"game_site" text,
"attendance" real
);
Question: Where did the Oakland Raiders play in week 12 of their 1976 season?
<|assistant|>
SELECT "game_site" FROM "schedule" WHERE "week"=12;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_formula_one_world_championship_" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
Question: How many years did Barclay Nordica Arrows BMW enter with Cosworth v8 engine?
<|assistant|>
SELECT SUM("year") FROM "complete_formula_one_world_championship_" WHERE "entrant"='barclay nordica arrows bmw' AND "engine"='cosworth v8';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_formula_one_world_championship_" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
Question: How many years did barclay nordica arrows bmw enter with a bmw str-4 t/c engine with less than 1 point?
<|assistant|>
SELECT SUM("year") FROM "complete_formula_one_world_championship_" WHERE "engine"='bmw str-4 t/c' AND "entrant"='barclay nordica arrows bmw' AND "points"<1;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_formula_one_world_championship_" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
Question: How many years was ensign n180b a Chassis with 4 points?
<|assistant|>
SELECT SUM("year") FROM "complete_formula_one_world_championship_" WHERE "points"=4 AND "chassis"='ensign n180b';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "2011_regular_season_football_standings" (
"school" text,
"team" text,
"division_record" text,
"overall_record" text,
"season_outcome" text
);
Question: What is the division record for the Indians?
<|assistant|>
SELECT "division_record" FROM "2011_regular_season_football_standings" WHERE "team"='indians';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "2011_regular_season_football_standings" (
"school" text,
"team" text,
"division_record" text,
"overall_record" text,
"season_outcome" text
);
Question: What is the overall record of Indian River?
<|assistant|>
SELECT "overall_record" FROM "2011_regular_season_football_standings" WHERE "school"='indian river';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "2011_regular_season_football_standings" (
"school" text,
"team" text,
"division_record" text,
"overall_record" text,
"season_outcome" text
);
Question: What was the season outcome of Lake Forest?
<|assistant|>
SELECT "season_outcome" FROM "2011_regular_season_football_standings" WHERE "school"='lake forest';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "kawerau_district" (
"name" text,
"years" text,
"gender" text,
"area" text,
"authority" text,
"decile" real
);
Question: How many Deciles are coed?
<|assistant|>
SELECT COUNT("decile") FROM "kawerau_district" WHERE "gender"='coed';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "kawerau_district" (
"name" text,
"years" text,
"gender" text,
"area" text,
"authority" text,
"decile" real
);
Question: Which is the lowest Decile that is coed?
<|assistant|>
SELECT MIN("decile") FROM "kawerau_district" WHERE "gender"='coed';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "kawerau_district" (
"name" text,
"years" text,
"gender" text,
"area" text,
"authority" text,
"decile" real
);
Question: What are the years for Kawerau Putauaki School?
<|assistant|>
SELECT "years" FROM "kawerau_district" WHERE "name"='kawerau putauaki school';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "calendar" (
"round_race" text,
"circuit" text,
"date" text,
"pole_position" text,
"fastest_lap" text,
"winning_driver" text,
"winning_team" text
);
Question: What is the round or race of the winning driver Charles Hollings and what was his pole position?
<|assistant|>
SELECT "round_race" FROM "calendar" WHERE "winning_driver"='charles hollings' AND "pole_position"='charles hollings';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "achievements" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"performance" text
);
Question: What was the earliest year in which long jump was performed in the world indoor Championships in 5th position?
<|assistant|>
SELECT MIN("year") FROM "achievements" WHERE "performance"='long jump' AND "competition"='world indoor championships' AND "position"='5th';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "achievements" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"performance" text
);
Question: What was the latest year in which she took 4th position in Budapest, Hungary?
<|assistant|>
SELECT MAX("year") FROM "achievements" WHERE "position"='4th' AND "venue"='budapest, hungary';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "apollo_astronauts_who_walked_on_the_moon" (
"name" text,
"born" text,
"age_at_first_step" text,
"mission" text,
"lunar_eva_dates" text,
"service" text
);
Question: Which astronaut went on the Apollo 16 mission at the age of 36y 6m 18d to step on the moon?
<|assistant|>
SELECT "name" FROM "apollo_astronauts_who_walked_on_the_moon" WHERE "mission"='apollo 16' AND "age_at_first_step"='36y 6m 18d';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "apollo_astronauts_who_walked_on_the_moon" (
"name" text,
"born" text,
"age_at_first_step" text,
"mission" text,
"lunar_eva_dates" text,
"service" text
);
Question: David Scott went on which mission?
<|assistant|>
SELECT "mission" FROM "apollo_astronauts_who_walked_on_the_moon" WHERE "name"='david scott';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "apollo_astronauts_who_walked_on_the_moon" (
"name" text,
"born" text,
"age_at_first_step" text,
"mission" text,
"lunar_eva_dates" text,
"service" text
);
Question: The astronaut who was 37y 8m 4d when making a first step on the moon was in which service?
<|assistant|>
SELECT "service" FROM "apollo_astronauts_who_walked_on_the_moon" WHERE "age_at_first_step"='37y 8m 4d';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "apollo_astronauts_who_walked_on_the_moon" (
"name" text,
"born" text,
"age_at_first_step" text,
"mission" text,
"lunar_eva_dates" text,
"service" text
);
Question: Pete Conrad was on the Apollo 12 mission but also had what Lunar EVA dates?
<|assistant|>
SELECT "lunar_eva_dates" FROM "apollo_astronauts_who_walked_on_the_moon" WHERE "mission"='apollo 12' AND "name"='pete conrad';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "apollo_astronauts_who_walked_on_the_moon" (
"name" text,
"born" text,
"age_at_first_step" text,
"mission" text,
"lunar_eva_dates" text,
"service" text
);
Question: The Apollo astronaut who was 38y 9m 7d when first stepping on the moon is who?
<|assistant|>
SELECT "born" FROM "apollo_astronauts_who_walked_on_the_moon" WHERE "age_at_first_step"='38y 9m 7d';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_american_le_mans_series_results" (
"year" real,
"entrant" text,
"class" text,
"chassis" text,
"engine" text,
"rank" text,
"points" text
);
Question: Which class has a year prior to 2011 and audi r15 tdi as the chassis?
<|assistant|>
SELECT "class" FROM "complete_american_le_mans_series_results" WHERE "year"<2011 AND "chassis"='audi r15 tdi';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_american_le_mans_series_results" (
"year" real,
"entrant" text,
"class" text,
"chassis" text,
"engine" text,
"rank" text,
"points" text
);
Question: Which engine has a year later than 2006 and 60 as the points?
<|assistant|>
SELECT "engine" FROM "complete_american_le_mans_series_results" WHERE "year">2006 AND "points"='60';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_american_le_mans_series_results" (
"year" real,
"entrant" text,
"class" text,
"chassis" text,
"engine" text,
"rank" text,
"points" text
);
Question: How many years has an engine of audi 3.6l turbo v8 and 1st as the rank with an audi r8r as the chassis?
<|assistant|>
SELECT COUNT("year") FROM "complete_american_le_mans_series_results" WHERE "engine"='audi 3.6l turbo v8' AND "rank"='1st' AND "chassis"='audi r8r';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_american_le_mans_series_results" (
"year" real,
"entrant" text,
"class" text,
"chassis" text,
"engine" text,
"rank" text,
"points" text
);
Question: Which entrant has 25th as the rank?
<|assistant|>
SELECT "entrant" FROM "complete_american_le_mans_series_results" WHERE "rank"='25th';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "missed_the_cut" (
"player" text,
"country" text,
"year_won" real,
"total" real,
"to_par" real
);
Question: What is the average year Rich Beem had a to par less than 17?
<|assistant|>
SELECT AVG("year_won") FROM "missed_the_cut" WHERE "player"='rich beem' AND "to_par"<17;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "missed_the_cut" (
"player" text,
"country" text,
"year_won" real,
"total" real,
"to_par" real
);
Question: What is the earliest year won with a total bigger than 156?
<|assistant|>
SELECT MIN("year_won") FROM "missed_the_cut" WHERE "total">156;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "missed_the_cut" (
"player" text,
"country" text,
"year_won" real,
"total" real,
"to_par" real
);
Question: What is the total for Bob Tway for the year won before 2002 with a to par bigger than 7?
<|assistant|>
SELECT COUNT("total") FROM "missed_the_cut" WHERE "year_won"<2002 AND "player"='bob tway' AND "to_par">7;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "missed_the_cut" (
"player" text,
"country" text,
"year_won" real,
"total" real,
"to_par" real
);
Question: What is the to par for Paul Azinger from the United States after 1986 for a total bigger than 145?
<|assistant|>
SELECT COUNT("to_par") FROM "missed_the_cut" WHERE "country"='united states' AND "year_won">1986 AND "player"='paul azinger' AND "total">145;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "missed_the_cut" (
"player" text,
"country" text,
"year_won" real,
"total" real,
"to_par" real
);
Question: What is the earliest year won Paul Azinger had with a to par higher than 5?
<|assistant|>
SELECT MIN("year_won") FROM "missed_the_cut" WHERE "player"='paul azinger' AND "to_par">5;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "missed_the_cut" (
"player" text,
"country" text,
"year_won" real,
"total" real,
"to_par" real
);
Question: What is the year won by Australia with a to par bigger than 16?
<|assistant|>
SELECT COUNT("year_won") FROM "missed_the_cut" WHERE "country"='australia' AND "to_par">16;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "references" (
"representative" text,
"years" text,
"state" text,
"party" text,
"lifespan" text
);
Question: What is the Lifespan when the Representative is Theodore F. Kluttz?
<|assistant|>
SELECT "lifespan" FROM "references" WHERE "representative"='theodore f. kluttz';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "schedule" (
"week" real,
"opponent" text,
"result" text,
"game_site" text,
"attendance" real
);
Question: What week's game had a result of l 35–37?
<|assistant|>
SELECT "week" FROM "schedule" WHERE "result"='l 35–37';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_formula_one_world_championship_" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
Question: What year was trio brdeact wind allass the entrant?
<|assistant|>
SELECT "year" FROM "complete_formula_one_world_championship_" WHERE "entrant"='trio brdeact wind allass';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_formula_one_world_championship_" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
Question: What is the year when kurtis kraft 500f was the chassis?
<|assistant|>
SELECT SUM("year") FROM "complete_formula_one_world_championship_" WHERE "chassis"='kurtis kraft 500f';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_formula_one_world_championship_" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
Question: What is the earliest year when the points were more than 0?
<|assistant|>
SELECT MIN("year") FROM "complete_formula_one_world_championship_" WHERE "points">0;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "clutha_district" (
"name" text,
"years" text,
"gender" text,
"area" text,
"authority" text,
"decile" real,
"roll" real
);
Question: What's the school name in Balclutha that has a Decile of 7 and a roll larger than 186?
<|assistant|>
SELECT "name" FROM "clutha_district" WHERE "area"='balclutha' AND "decile"<7 AND "roll">186;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "clutha_district" (
"name" text,
"years" text,
"gender" text,
"area" text,
"authority" text,
"decile" real,
"roll" real
);
Question: Which school in Balclutha has a roll smaller than 55?
<|assistant|>
SELECT "name" FROM "clutha_district" WHERE "area"='balclutha' AND "roll"<55;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "edmonton_oilers_4_winnipeg_jets_1" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"record" text
);
Question: When has winnipeg jets with a Score of 4–6?
<|assistant|>
SELECT "date" FROM "edmonton_oilers_4_winnipeg_jets_1" WHERE "home"='winnipeg jets' AND "score"='4–6';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "edmonton_oilers_4_winnipeg_jets_1" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"record" text
);
Question: When is Edmonton Oilers in?
<|assistant|>
SELECT "date" FROM "edmonton_oilers_4_winnipeg_jets_1" WHERE "home"='edmonton oilers';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "edmonton_oilers_4_winnipeg_jets_1" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"record" text
);
Question: What is the Score that has a Winnipeg Jets as Visitor on april 7?
<|assistant|>
SELECT "score" FROM "edmonton_oilers_4_winnipeg_jets_1" WHERE "visitor"='winnipeg jets' AND "date"='april 7';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "edmonton_oilers_4_winnipeg_jets_1" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"record" text
);
Question: What is the Score on April 6?
<|assistant|>
SELECT "score" FROM "edmonton_oilers_4_winnipeg_jets_1" WHERE "date"='april 6';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "edmonton_oilers_4_winnipeg_jets_1" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"record" text
);
Question: When has a Record of 1–0?
<|assistant|>
SELECT "date" FROM "edmonton_oilers_4_winnipeg_jets_1" WHERE "record"='1–0';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "llws_results" (
"year" real,
"champion" text,
"city" text,
"llws" text,
"record" text
);
Question: What is the LLWS when the Year is 2003?
<|assistant|>
SELECT "llws" FROM "llws_results" WHERE "year"=2003;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "llws_results" (
"year" real,
"champion" text,
"city" text,
"llws" text,
"record" text
);
Question: What is the earliest Year when the City is Peabody?
<|assistant|>
SELECT MIN("year") FROM "llws_results" WHERE "city"='peabody';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "llws_results" (
"year" real,
"champion" text,
"city" text,
"llws" text,
"record" text
);
Question: What is the total number of Years when the LLWS is 4th place, and when the City is Westport?
<|assistant|>
SELECT COUNT("year") FROM "llws_results" WHERE "llws"='4th place' AND "city"='westport';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "personnel_and_kits" (
"team" text,
"manager_1" text,
"captain" text,
"kit_manufacturer" text,
"shirt_sponsor" text
);
Question: What team has Pony as the kit manufacturer and Gary Mabbutt as the captain?
<|assistant|>
SELECT "team" FROM "personnel_and_kits" WHERE "kit_manufacturer"='pony' AND "captain"='gary mabbutt';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "personnel_and_kits" (
"team" text,
"manager_1" text,
"captain" text,
"kit_manufacturer" text,
"shirt_sponsor" text
);
Question: Who is the manager 1 for Leeds United?
<|assistant|>
SELECT "manager_1" FROM "personnel_and_kits" WHERE "team"='leeds united';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "personnel_and_kits" (
"team" text,
"manager_1" text,
"captain" text,
"kit_manufacturer" text,
"shirt_sponsor" text
);
Question: What is the team with a Pony kit manufacturer and Julian Dicks as the captain?
<|assistant|>
SELECT "team" FROM "personnel_and_kits" WHERE "kit_manufacturer"='pony' AND "captain"='julian dicks';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "personnel_and_kits" (
"team" text,
"manager_1" text,
"captain" text,
"kit_manufacturer" text,
"shirt_sponsor" text
);
Question: What team has a kit manufacturer of Umbro and Eric Cantona as captain?
<|assistant|>
SELECT "team" FROM "personnel_and_kits" WHERE "kit_manufacturer"='umbro' AND "captain"='eric cantona';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "personnel_and_kits" (
"team" text,
"manager_1" text,
"captain" text,
"kit_manufacturer" text,
"shirt_sponsor" text
);
Question: Who is the manager 1 with Puma as the kit manufacturer and Puma as the shirt sponsor?
<|assistant|>
SELECT "manager_1" FROM "personnel_and_kits" WHERE "kit_manufacturer"='puma' AND "shirt_sponsor"='puma';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "personnel_and_kits" (
"team" text,
"manager_1" text,
"captain" text,
"kit_manufacturer" text,
"shirt_sponsor" text
);
Question: What is the kit manufacturer with Walkers as the shirt sponsor?
<|assistant|>
SELECT "kit_manufacturer" FROM "personnel_and_kits" WHERE "shirt_sponsor"='walkers';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_international_formula_3000_resu" (
"year" real,
"chassis" text,
"engine" text,
"tyres" text,
"points" real
);
Question: Name the average points for dallara 3087 lola t88/50 and year before 1988
<|assistant|>
SELECT AVG("points") FROM "complete_international_formula_3000_resu" WHERE "chassis"='dallara 3087 lola t88/50' AND "year"<1988;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_international_formula_3000_resu" (
"year" real,
"chassis" text,
"engine" text,
"tyres" text,
"points" real
);
Question: Name the sum of points for 1992
<|assistant|>
SELECT SUM("points") FROM "complete_international_formula_3000_resu" WHERE "year"=1992;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_international_formula_3000_resu" (
"year" real,
"chassis" text,
"engine" text,
"tyres" text,
"points" real
);
Question: Name the points for year more than 1987
<|assistant|>
SELECT "points" FROM "complete_international_formula_3000_resu" WHERE "year">1987;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_international_formula_3000_resu" (
"year" real,
"chassis" text,
"engine" text,
"tyres" text,
"points" real
);
Question: Name the year for points less than 20 and chassis of dallara 3087
<|assistant|>
SELECT "year" FROM "complete_international_formula_3000_resu" WHERE "points"<20 AND "chassis"='dallara 3087';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "international" (
"national_team" text,
"club" text,
"season" text,
"apps" real,
"goals" real
);
Question: What is the most apps that a has a total season and 3 goals?
<|assistant|>
SELECT MAX("apps") FROM "international" WHERE "season"='total' AND "goals">3;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "international" (
"national_team" text,
"club" text,
"season" text,
"apps" real,
"goals" real
);
Question: What is the final number of apps with 2 goals?
<|assistant|>
SELECT COUNT("apps") FROM "international" WHERE "goals"=2;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "series_4" (
"episode_no" real,
"airdate" text,
"total_viewers" real,
"share" text,
"bbc_one_weekly_ranking" real
);
Question: What date did the episode with a weekly ranking of 14 air?
<|assistant|>
SELECT "airdate" FROM "series_4" WHERE "bbc_one_weekly_ranking"=14;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "series_4" (
"episode_no" real,
"airdate" text,
"total_viewers" real,
"share" text,
"bbc_one_weekly_ranking" real
);
Question: What is the total number of total viewers with a share of 18.8% and a weekly ranking under 16?
<|assistant|>
SELECT COUNT("total_viewers") FROM "series_4" WHERE "share"='18.8%' AND "bbc_one_weekly_ranking"<16;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "125cc_classification" (
"rider" text,
"manufacturer" text,
"laps" real,
"time_retired" text,
"grid" real
);
Question: Who has 37 grids?
<|assistant|>
SELECT "rider" FROM "125cc_classification" WHERE "grid"=37;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "125cc_classification" (
"rider" text,
"manufacturer" text,
"laps" real,
"time_retired" text,
"grid" real
);
Question: What is the average grid with more than 23 laps?
<|assistant|>
SELECT AVG("grid") FROM "125cc_classification" WHERE "laps">23;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "125cc_classification" (
"rider" text,
"manufacturer" text,
"laps" real,
"time_retired" text,
"grid" real
);
Question: What is the average grid with more than 23 laps?
<|assistant|>
SELECT AVG("grid") FROM "125cc_classification" WHERE "laps">23;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "thames_coromandel_district" (
"name" text,
"years" text,
"gender" text,
"area" text,
"authority" text,
"decile" real,
"roll" real
);
Question: What is the average decile for te puru school?
<|assistant|>
SELECT AVG("decile") FROM "thames_coromandel_district" WHERE "name"='te puru school';<|endoftext|>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.