text
stringlengths 310
1.28k
|
|---|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "by_clubs" (
"team" text,
"matches" real,
"wins" real,
"wins_pct" text,
"draws" real,
"draws_pct" text,
"losses" real,
"losses_pct" text,
"against" real,
"for_against_ratio" text
);
Question: What are the total losses with 2 matches, 2 against, 0% of draws and less than 1 wins?
<|assistant|>
SELECT SUM("losses") FROM "by_clubs" WHERE "matches"=2 AND "against"=2 AND "draws_pct"='0%' AND "wins"<1;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "by_clubs" (
"team" text,
"matches" real,
"wins" real,
"wins_pct" text,
"draws" real,
"draws_pct" text,
"losses" real,
"losses_pct" text,
"against" real,
"for_against_ratio" text
);
Question: What is the sum on wins with an against ratio of 0.83, and more than 1 loss?
<|assistant|>
SELECT SUM("wins") FROM "by_clubs" WHERE "for_against_ratio"='0.83' AND "losses">1;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "managerial_changes" (
"team" text,
"outgoing_manager" text,
"date_outgoing" text,
"reason_of_departure" text,
"replaced_by" text,
"date_of_replacement" text
);
Question: Why did the manager who departed on August 1, 2008 leave?
<|assistant|>
SELECT "reason_of_departure" FROM "managerial_changes" WHERE "date_outgoing"='august 1, 2008';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "managerial_changes" (
"team" text,
"outgoing_manager" text,
"date_outgoing" text,
"reason_of_departure" text,
"replaced_by" text,
"date_of_replacement" text
);
Question: On what date did the manager for PSIS Semarang take over for the manager that was sacked?
<|assistant|>
SELECT "date_of_replacement" FROM "managerial_changes" WHERE "reason_of_departure"='sacked' AND "team"='psis semarang';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "managerial_changes" (
"team" text,
"outgoing_manager" text,
"date_outgoing" text,
"reason_of_departure" text,
"replaced_by" text,
"date_of_replacement" text
);
Question: Why did the manager who departed on August 1, 2008 leave?
<|assistant|>
SELECT "reason_of_departure" FROM "managerial_changes" WHERE "date_outgoing"='august 1, 2008';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "managerial_changes" (
"team" text,
"outgoing_manager" text,
"date_outgoing" text,
"reason_of_departure" text,
"replaced_by" text,
"date_of_replacement" text
);
Question: When did Peter Butler leave his team?
<|assistant|>
SELECT "date_outgoing" FROM "managerial_changes" WHERE "outgoing_manager"='peter butler';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "managerial_changes" (
"team" text,
"outgoing_manager" text,
"date_outgoing" text,
"reason_of_departure" text,
"replaced_by" text,
"date_of_replacement" text
);
Question: When did the manager take over for the manager that left on August 20, 2008?
<|assistant|>
SELECT "date_of_replacement" FROM "managerial_changes" WHERE "date_outgoing"='august 20, 2008';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "competition_record" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"notes" text
);
Question: In which competition(s) did Iljuštšenko jump 1.90 m?
<|assistant|>
SELECT "competition" FROM "competition_record" WHERE "notes"='1.90 m';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "competition_record" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"notes" text
);
Question: In which position did Iljuštšenko finish in the European Championships held prior to 2008?
<|assistant|>
SELECT "position" FROM "competition_record" WHERE "year"<2008 AND "competition"='european championships';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "competition_record" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"notes" text
);
Question: In what year did Iljuštšenko compete in Barcelona, Spain?
<|assistant|>
SELECT "year" FROM "competition_record" WHERE "venue"='barcelona, spain';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "assembly_segments" (
"constituency_number" text,
"name" text,
"reserved_for_sc_st_none" text,
"district" text,
"number_of_electorates_2009" real
);
Question: What's the number of electorates for constituency number 56?
<|assistant|>
SELECT SUM("number_of_electorates_2009") FROM "assembly_segments" WHERE "constituency_number"='56';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "assembly_segments" (
"constituency_number" text,
"name" text,
"reserved_for_sc_st_none" text,
"district" text,
"number_of_electorates_2009" real
);
Question: What's the constituency number for Damoh with more than 173,217 electorates?
<|assistant|>
SELECT "constituency_number" FROM "assembly_segments" WHERE "number_of_electorates_2009">'173,217' AND "name"='damoh';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "squad" (
"name" text,
"tests" real,
"club" text,
"career_caps" real,
"tour_apps" real,
"position" text
);
Question: What is the tour Apps when the career caps show 15?
<|assistant|>
SELECT "tour_apps" FROM "squad" WHERE "career_caps"=15;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "squad" (
"name" text,
"tests" real,
"club" text,
"career_caps" real,
"tour_apps" real,
"position" text
);
Question: What is the number of career caps for a full back, when tour Apps is smaller than 29?
<|assistant|>
SELECT COUNT("career_caps") FROM "squad" WHERE "position"='full back' AND "tour_apps"<29;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "squad" (
"name" text,
"tests" real,
"club" text,
"career_caps" real,
"tour_apps" real,
"position" text
);
Question: What is the career caps for half-back, when tests is more than 3?
<|assistant|>
SELECT "career_caps" FROM "squad" WHERE "position"='half-back' AND "tests">3;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "squad" (
"name" text,
"tests" real,
"club" text,
"career_caps" real,
"tour_apps" real,
"position" text
);
Question: What name has tour Apps larger than 7, tests larger than 4, and a Career caps of 20?
<|assistant|>
SELECT "name" FROM "squad" WHERE "tour_apps">7 AND "tests">4 AND "career_caps"=20;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "results" (
"driver" text,
"entrant" text,
"constructor" text,
"time_retired" text,
"grid" real
);
Question: What constructor has a grid less than 21, and time/retired of engine?
<|assistant|>
SELECT "constructor" FROM "results" WHERE "grid"<21 AND "time_retired"='engine';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "results" (
"driver" text,
"entrant" text,
"constructor" text,
"time_retired" text,
"grid" real
);
Question: When the entrant is fred saunders what is the driver?
<|assistant|>
SELECT "driver" FROM "results" WHERE "entrant"='fred saunders';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "results" (
"driver" text,
"entrant" text,
"constructor" text,
"time_retired" text,
"grid" real
);
Question: What's the lowest grid with and entrant of fred saunders?
<|assistant|>
SELECT MIN("grid") FROM "results" WHERE "entrant"='fred saunders';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "results" (
"driver" text,
"entrant" text,
"constructor" text,
"time_retired" text,
"grid" real
);
Question: What is the time/retired for the driver emerson fittipaldi?
<|assistant|>
SELECT "time_retired" FROM "results" WHERE "driver"='emerson fittipaldi';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "music" (
"title" text,
"type" text,
"artist" text,
"label" text,
"standard_number" text,
"release_date" text
);
Question: Which Artist has the Label of Columbia and the Standard number of COCC-72073?
<|assistant|>
SELECT "artist" FROM "music" WHERE "label"='columbia' AND "standard_number"='cocc-72073';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "music" (
"title" text,
"type" text,
"artist" text,
"label" text,
"standard_number" text,
"release_date" text
);
Question: What Type has the Artist of Hiroyuki Takami?
<|assistant|>
SELECT "type" FROM "music" WHERE "artist"='hiroyuki takami';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "music" (
"title" text,
"type" text,
"artist" text,
"label" text,
"standard_number" text,
"release_date" text
);
Question: What Title has the Label of Columbia and Standard number of CODC-8760?
<|assistant|>
SELECT "title" FROM "music" WHERE "label"='columbia' AND "standard_number"='codc-8760';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "acquisitions_1885_94" (
"name_pinyin" text,
"name_wade_giles" text,
"characters" text,
"type" text,
"construction" text
);
Question: What is the type of Kuang-Hsing?
<|assistant|>
SELECT "type" FROM "acquisitions_1885_94" WHERE "name_wade_giles"='kuang-hsing';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "acquisitions_1885_94" (
"name_pinyin" text,
"name_wade_giles" text,
"characters" text,
"type" text,
"construction" text
);
Question: What type has the characters 廣丙?
<|assistant|>
SELECT "type" FROM "acquisitions_1885_94" WHERE "characters"='廣丙';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "acquisitions_1885_94" (
"name_pinyin" text,
"name_wade_giles" text,
"characters" text,
"type" text,
"construction" text
);
Question: What's the name that has the characters 廣亨?
<|assistant|>
SELECT "name_wade_giles" FROM "acquisitions_1885_94" WHERE "characters"='廣亨';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "acquisitions_1885_94" (
"name_pinyin" text,
"name_wade_giles" text,
"characters" text,
"type" text,
"construction" text
);
Question: What type has the characters 廣利?
<|assistant|>
SELECT "type" FROM "acquisitions_1885_94" WHERE "characters"='廣利';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "acquisitions_1885_94" (
"name_pinyin" text,
"name_wade_giles" text,
"characters" text,
"type" text,
"construction" text
);
Question: What is the type of Guangjia?
<|assistant|>
SELECT "type" FROM "acquisitions_1885_94" WHERE "name_pinyin"='guangjia';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "top_10_across_all_platforms" (
"rank" real,
"actor" text,
"character" text,
"soap_opera" text,
"years" text,
"duration" text
);
Question: What soap opera has a rank larger than 1, and a Character named Emily Bishop?
<|assistant|>
SELECT "soap_opera" FROM "top_10_across_all_platforms" WHERE "rank">1 AND "character"='emily bishop';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "top_10_across_all_platforms" (
"rank" real,
"actor" text,
"character" text,
"soap_opera" text,
"years" text,
"duration" text
);
Question: What is the highest Rank 1960—?
<|assistant|>
SELECT MAX("rank") FROM "top_10_across_all_platforms" WHERE "years"='1960—';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "top_10_across_all_platforms" (
"rank" real,
"actor" text,
"character" text,
"soap_opera" text,
"years" text,
"duration" text
);
Question: What is the name of the actor with a duration of 61 years?
<|assistant|>
SELECT "actor" FROM "top_10_across_all_platforms" WHERE "duration"='61 years';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "top_10_across_all_platforms" (
"rank" real,
"actor" text,
"character" text,
"soap_opera" text,
"years" text,
"duration" text
);
Question: What are the years for Eileen Derbyshire with a duration of 52 years?
<|assistant|>
SELECT "years" FROM "top_10_across_all_platforms" WHERE "duration"='52 years' AND "actor"='eileen derbyshire';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "top_10_across_all_platforms" (
"rank" real,
"actor" text,
"character" text,
"soap_opera" text,
"years" text,
"duration" text
);
Question: What soap opera was on 1960–1965, 1965–1983, 1984–2010?
<|assistant|>
SELECT "soap_opera" FROM "top_10_across_all_platforms" WHERE "years"='1960–1965, 1965–1983, 1984–2010';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "heat_1" (
"rank" real,
"rowers" text,
"country" text,
"time" text,
"notes" text
);
Question: Who are the rowers for Australia?
<|assistant|>
SELECT "rowers" FROM "heat_1" WHERE "country"='australia';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "heat_1" (
"rank" real,
"rowers" text,
"country" text,
"time" text,
"notes" text
);
Question: What's Italy's rank?
<|assistant|>
SELECT SUM("rank") FROM "heat_1" WHERE "country"='italy';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "game_log" (
"round" real,
"date" text,
"home" text,
"result" text,
"visitor" text,
"venue" text,
"attendance" real
);
Question: Who is the visitor team on Saturday, November 22 when linköpings hc was the home team and there were more than 20 rounds?
<|assistant|>
SELECT "visitor" FROM "game_log" WHERE "home"='linköpings hc' AND "round">20 AND "date"='saturday, november 22';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "game_log" (
"round" real,
"date" text,
"home" text,
"result" text,
"visitor" text,
"venue" text,
"attendance" real
);
Question: What is the lowest attendance on Monday, November 10 when linköpings hc was the home team and there were more than 18 rounds?
<|assistant|>
SELECT MIN("attendance") FROM "game_log" WHERE "home"='linköpings hc' AND "date"='monday, november 10' AND "round">18;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "game_log" (
"round" real,
"date" text,
"home" text,
"result" text,
"visitor" text,
"venue" text,
"attendance" real
);
Question: Who is the visitor at the axa sports center in round 20?
<|assistant|>
SELECT "visitor" FROM "game_log" WHERE "venue"='axa sports center' AND "round"=20;<|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" text
);
Question: What is the Attendance of the game on November 6, 1966?
<|assistant|>
SELECT "attendance" FROM "schedule" WHERE "date"='november 6, 1966';<|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" text
);
Question: What is the Result of the game on November 6, 1966?
<|assistant|>
SELECT "result" FROM "schedule" WHERE "date"='november 6, 1966';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "women" (
"event" text,
"time" text,
"club" text,
"date" text,
"location" text
);
Question: Who is the club with a 4:03.63 time?
<|assistant|>
SELECT "club" FROM "women" WHERE "time"='4:03.63';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "116_seats_needed_for_a_majority" (
"date_released" text,
"institute" text,
"social_democratic" text,
"socialist" text,
"green_communist" text,
"people_s_party" text,
"lead" text
);
Question: What was the Green-Communist percentage in the poll in which the Socialist Party earned 41.0%?
<|assistant|>
SELECT "green_communist" FROM "116_seats_needed_for_a_majority" WHERE "socialist"='41.0%';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "116_seats_needed_for_a_majority" (
"date_released" text,
"institute" text,
"social_democratic" text,
"socialist" text,
"green_communist" text,
"people_s_party" text,
"lead" text
);
Question: What is the Green-Communist percentage in the poll showing a 9.7% lead?
<|assistant|>
SELECT "green_communist" FROM "116_seats_needed_for_a_majority" WHERE "lead"='9.7%';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "116_seats_needed_for_a_majority" (
"date_released" text,
"institute" text,
"social_democratic" text,
"socialist" text,
"green_communist" text,
"people_s_party" text,
"lead" text
);
Question: What is the Social Democratic percentage for the poll with a Green-Communist rate of 9.0%, People's Party of 10.0%, and Socialist of 39.0%?
<|assistant|>
SELECT "social_democratic" FROM "116_seats_needed_for_a_majority" WHERE "green_communist"='9.0%' AND "people_s_party"='10.0%' AND "socialist"='39.0%';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "international_goals" (
"date" text,
"venue" text,
"score" text,
"result" text,
"competition" text
);
Question: what is the result on 9 october 2012?
<|assistant|>
SELECT "result" FROM "international_goals" WHERE "date"='9 october 2012';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "international_goals" (
"date" text,
"venue" text,
"score" text,
"result" text,
"competition" text
);
Question: what is the score when the venue is stade général seyni kountché, niamey, the competition is friendly and the date is 9 october 2012?
<|assistant|>
SELECT "score" FROM "international_goals" WHERE "venue"='stade général seyni kountché, niamey' AND "competition"='friendly' AND "date"='9 october 2012';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "international_goals" (
"date" text,
"venue" text,
"score" text,
"result" text,
"competition" text
);
Question: what is the result when the venue is stade général seyni kountché, niamey, the competition is friendly and the date is 9 october 2012?
<|assistant|>
SELECT "result" FROM "international_goals" WHERE "venue"='stade général seyni kountché, niamey' AND "competition"='friendly' AND "date"='9 october 2012';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "international_goals" (
"date" text,
"venue" text,
"score" text,
"result" text,
"competition" text
);
Question: what is the competition on 10 august 2011?
<|assistant|>
SELECT "competition" FROM "international_goals" WHERE "date"='10 august 2011';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "international_goals" (
"date" text,
"venue" text,
"score" text,
"result" text,
"competition" text
);
Question: what is the date when the venue is stade général seyni kountché , niamey?
<|assistant|>
SELECT "date" FROM "international_goals" WHERE "venue"='stade général seyni kountché , niamey';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "top_all_time_athletes_50_metres_men" (
"rank" real,
"time" text,
"athlete" text,
"date" text,
"place" text
);
Question: What place has manfred kokot as the athlete?
<|assistant|>
SELECT "place" FROM "top_all_time_athletes_50_metres_men" WHERE "athlete"='manfred kokot';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "top_all_time_athletes_50_metres_men" (
"rank" real,
"time" text,
"athlete" text,
"date" text,
"place" text
);
Question: What athlete has reno as the place?
<|assistant|>
SELECT "athlete" FROM "top_all_time_athletes_50_metres_men" WHERE "place"='reno';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "campuses" (
"campus" text,
"year_opened" text,
"students" text,
"size" text,
"location" text
);
Question: What campus opened in 1970?
<|assistant|>
SELECT "campus" FROM "campuses" WHERE "year_opened"='1970';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "campuses" (
"campus" text,
"year_opened" text,
"students" text,
"size" text,
"location" text
);
Question: What year was the school opened that has a size of 10 acres and students of na?
<|assistant|>
SELECT "year_opened" FROM "campuses" WHERE "students"='na' AND "size"='10 acres';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "campuses" (
"campus" text,
"year_opened" text,
"students" text,
"size" text,
"location" text
);
Question: What location was the campus that has a size of 245 acres?
<|assistant|>
SELECT "location" FROM "campuses" WHERE "size"='245 acres';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "campuses" (
"campus" text,
"year_opened" text,
"students" text,
"size" text,
"location" text
);
Question: What campus was opened in 1977?
<|assistant|>
SELECT "campus" FROM "campuses" WHERE "year_opened"='1977';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "campuses" (
"campus" text,
"year_opened" text,
"students" text,
"size" text,
"location" text
);
Question: What location was the campus opened in 2005 with students listed as na?
<|assistant|>
SELECT "location" FROM "campuses" WHERE "students"='na' AND "year_opened"='2005';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "largest_generating_stations" (
"rank" real,
"name" text,
"capacity_mw" real,
"province" text,
"type" text
);
Question: what is the type when the rank is smaller than 70, the province is british columbia and the capacity (mw) is more than 2,480?
<|assistant|>
SELECT "type" FROM "largest_generating_stations" WHERE "rank"<70 AND "province"='british columbia' AND "capacity_mw">'2,480';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "largest_generating_stations" (
"rank" real,
"name" text,
"capacity_mw" real,
"province" text,
"type" text
);
Question: what is the least capacity (mw) when the rank is less than 46 and the province is newfoundland and labrador?
<|assistant|>
SELECT MIN("capacity_mw") FROM "largest_generating_stations" WHERE "rank"<46 AND "province"='newfoundland and labrador';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "largest_generating_stations" (
"rank" real,
"name" text,
"capacity_mw" real,
"province" text,
"type" text
);
Question: what is the lowest rank when the type is hydro, the name is grand rapids generating station and the capacity (mw) is more than 479?
<|assistant|>
SELECT MIN("rank") FROM "largest_generating_stations" WHERE "type"='hydro' AND "name"='grand rapids generating station' AND "capacity_mw">479;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "largest_generating_stations" (
"rank" real,
"name" text,
"capacity_mw" real,
"province" text,
"type" text
);
Question: what is the province when the rank is higher than 24 and the name is laforge-2?
<|assistant|>
SELECT "province" FROM "largest_generating_stations" WHERE "rank">24 AND "name"='laforge-2';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "largest_generating_stations" (
"rank" real,
"name" text,
"capacity_mw" real,
"province" text,
"type" text
);
Question: what is the name when the type is hydro, the capacity (mw) is less than 478, the rank is more than 85 and the province is quebec?
<|assistant|>
SELECT "name" FROM "largest_generating_stations" WHERE "type"='hydro' AND "capacity_mw"<478 AND "rank">85 AND "province"='quebec';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "complete_24_hours_of_le_mans_results" (
"year" real,
"class" text,
"tyres" text,
"team" text,
"co_drivers" text,
"laps" real,
"pos" text
);
Question: How many years have toyota team tom's as the team, with Laps greater than 64?
<|assistant|>
SELECT COUNT("year") FROM "complete_24_hours_of_le_mans_results" WHERE "team"='toyota team tom''s' AND "laps">64;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "anglo_italian_cup" (
"opposing_team" text,
"against" real,
"date" text,
"venue" text,
"round" text
);
Question: What round was on 11/11/1992?
<|assistant|>
SELECT "round" FROM "anglo_italian_cup" WHERE "date"='11/11/1992';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "anglo_italian_cup" (
"opposing_team" text,
"against" real,
"date" text,
"venue" text,
"round" text
);
Question: What is the total against on 08/12/1992?
<|assistant|>
SELECT SUM("against") FROM "anglo_italian_cup" WHERE "date"='08/12/1992';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "anglo_italian_cup" (
"opposing_team" text,
"against" real,
"date" text,
"venue" text,
"round" text
);
Question: What is the venue of 24/11/1992?
<|assistant|>
SELECT "venue" FROM "anglo_italian_cup" WHERE "date"='24/11/1992';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "anglo_italian_cup" (
"opposing_team" text,
"against" real,
"date" text,
"venue" text,
"round" text
);
Question: What round has less than 1 against?
<|assistant|>
SELECT "round" FROM "anglo_italian_cup" WHERE "against"<1;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "medal_table" (
"rank" real,
"nation" text,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
Question: How many gold medals for germany (GER) having a rank less than 15?
<|assistant|>
SELECT COUNT("gold") FROM "medal_table" WHERE "nation"='germany (ger)' AND "rank"<15;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "medal_table" (
"rank" real,
"nation" text,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
Question: How many silver medals when the bronze is more than 2 and having a rank more than 5?
<|assistant|>
SELECT MAX("silver") FROM "medal_table" WHERE "rank">5 AND "bronze">2;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "medal_table" (
"rank" real,
"nation" text,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
Question: What's the average number of silver medals when bronze is less than 0?
<|assistant|>
SELECT AVG("silver") FROM "medal_table" WHERE "bronze"<0;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "medal_table" (
"rank" real,
"nation" text,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
Question: What's the average number of silver medals for germany (GER) having more than 3 bronze?
<|assistant|>
SELECT AVG("silver") FROM "medal_table" WHERE "nation"='germany (ger)' AND "bronze">3;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "semifinal_a_b_1" (
"rank" real,
"rowers" text,
"country" text,
"time" text,
"notes" text
);
Question: What are the notes for 6:31.16?
<|assistant|>
SELECT "notes" FROM "semifinal_a_b_1" WHERE "time"='6:31.16';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "semifinal_a_b_1" (
"rank" real,
"rowers" text,
"country" text,
"time" text,
"notes" text
);
Question: What rowers have a 6:29.56 time?
<|assistant|>
SELECT "rowers" FROM "semifinal_a_b_1" WHERE "time"='6:29.56';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "semifinal_a_b_1" (
"rank" real,
"rowers" text,
"country" text,
"time" text,
"notes" text
);
Question: What is the time with FB notes for Canada?
<|assistant|>
SELECT "time" FROM "semifinal_a_b_1" WHERE "notes"='fb' AND "country"='canada';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "semifinal_a_b_1" (
"rank" real,
"rowers" text,
"country" text,
"time" text,
"notes" text
);
Question: What country has a time of 6:49.28?
<|assistant|>
SELECT "country" FROM "semifinal_a_b_1" WHERE "time"='6:49.28';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "pool_3" (
"team" text,
"tries_for" real,
"tries_against" real,
"try_diff" text,
"points_for" real,
"points_against" real,
"points_diff" text
);
Question: Which Tries for has Points against larger than 87, and Tries against smaller than 28, and Points diff of +63?
<|assistant|>
SELECT AVG("tries_for") FROM "pool_3" WHERE "points_against">87 AND "tries_against"<28 AND "points_diff"='+63';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "pool_3" (
"team" text,
"tries_for" real,
"tries_against" real,
"try_diff" text,
"points_for" real,
"points_against" real,
"points_diff" text
);
Question: Which Points for has Points against smaller than 93, and Tries for larger than 25?
<|assistant|>
SELECT MIN("points_for") FROM "pool_3" WHERE "points_against"<93 AND "tries_for">25;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "pool_3" (
"team" text,
"tries_for" real,
"tries_against" real,
"try_diff" text,
"points_for" real,
"points_against" real,
"points_diff" text
);
Question: Which Tries for has Points against smaller than 124, and Points for smaller than 241, and Tries against smaller than 11?
<|assistant|>
SELECT MAX("tries_for") FROM "pool_3" WHERE "points_against"<124 AND "points_for"<241 AND "tries_against"<11;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "pool_3" (
"team" text,
"tries_for" real,
"tries_against" real,
"try_diff" text,
"points_for" real,
"points_against" real,
"points_diff" text
);
Question: How many Tries against have a Team of dinamo bucureşti, and Tries for smaller than 19?
<|assistant|>
SELECT COUNT("tries_against") FROM "pool_3" WHERE "team"='dinamo bucureşti' AND "tries_for"<19;<|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 week had attendance of 48,667?
<|assistant|>
SELECT COUNT("week") FROM "schedule" WHERE "attendance"='48,667';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "results_of_heat_1" (
"draw" real,
"artist" text,
"song" text,
"percentage" text,
"place" real
);
Question: What Song has a Draw of less than 4 with a Percentage of 32.22%?
<|assistant|>
SELECT "song" FROM "results_of_heat_1" WHERE "draw"<4 AND "percentage"='32.22%';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "results_of_heat_1" (
"draw" real,
"artist" text,
"song" text,
"percentage" text,
"place" real
);
Question: What Artist has a Place of 3 or less with a Percentage of 38.60%?
<|assistant|>
SELECT "artist" FROM "results_of_heat_1" WHERE "place"<3 AND "percentage"='38.60%';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "results_of_heat_1" (
"draw" real,
"artist" text,
"song" text,
"percentage" text,
"place" real
);
Question: What is the Place of Draw 1 by Artist Monika Kirovska?
<|assistant|>
SELECT AVG("place") FROM "results_of_heat_1" WHERE "artist"='monika kirovska' AND "draw"<1;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "2009_ladder" (
"hampden_fl" text,
"wins" real,
"byes" real,
"losses" real,
"draws" real,
"against" real
);
Question: What were the most byes of Terang-Mortlake when they had more than 11 wins and more than 1118 against?
<|assistant|>
SELECT MAX("byes") FROM "2009_ladder" WHERE "wins">11 AND "against">1118 AND "hampden_fl"='terang-mortlake';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "2009_ladder" (
"hampden_fl" text,
"wins" real,
"byes" real,
"losses" real,
"draws" real,
"against" real
);
Question: How many wins did South Warrambool have?
<|assistant|>
SELECT AVG("wins") FROM "2009_ladder" WHERE "hampden_fl"='south warrambool';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "2009_ladder" (
"hampden_fl" text,
"wins" real,
"byes" real,
"losses" real,
"draws" real,
"against" real
);
Question: How many byes when there are more than 16 wins?
<|assistant|>
SELECT AVG("byes") FROM "2009_ladder" WHERE "wins">16;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "2009_ladder" (
"hampden_fl" text,
"wins" real,
"byes" real,
"losses" real,
"draws" real,
"against" real
);
Question: What is the least amount of Byes when there are more than 2 wins and 1946 against?
<|assistant|>
SELECT MIN("byes") FROM "2009_ladder" WHERE "against"=1946 AND "wins">2;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "2009_ladder" (
"hampden_fl" text,
"wins" real,
"byes" real,
"losses" real,
"draws" real,
"against" real
);
Question: How many wins when the draws are less than 1 and more than 4 losses?
<|assistant|>
SELECT AVG("wins") FROM "2009_ladder" WHERE "draws"<1 AND "losses">4;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "s" (
"township" text,
"county" text,
"pop_2010" real,
"land_sqmi" real,
"water_sqmi" real,
"latitude" real,
"longitude" real,
"geo_id" real,
"ansi_code" real
);
Question: What was the lowest population of the GEO ID 3805373380 and the water square mileage smaller than 5.729?
<|assistant|>
SELECT MIN("pop_2010") FROM "s" WHERE "geo_id"=3805373380 AND "water_sqmi"<5.729;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "s" (
"township" text,
"county" text,
"pop_2010" real,
"land_sqmi" real,
"water_sqmi" real,
"latitude" real,
"longitude" real,
"geo_id" real,
"ansi_code" real
);
Question: What is the lowest GEO ID for the longitude of -102.158045 and the water in square miles larger than 0.979?
<|assistant|>
SELECT MIN("geo_id") FROM "s" WHERE "longitude"=-102.158045 AND "water_sqmi">0.979;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "s" (
"township" text,
"county" text,
"pop_2010" real,
"land_sqmi" real,
"water_sqmi" real,
"latitude" real,
"longitude" real,
"geo_id" real,
"ansi_code" real
);
Question: What is the average ANSI code for the town of Sherman and the smaller of the water area in square miles than 0.005?
<|assistant|>
SELECT AVG("ansi_code") FROM "s" WHERE "township"='sherman' AND "water_sqmi"<0.005;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "s" (
"township" text,
"county" text,
"pop_2010" real,
"land_sqmi" real,
"water_sqmi" real,
"latitude" real,
"longitude" real,
"geo_id" real,
"ansi_code" real
);
Question: What is the average longitude for the water area of 0.093 and has a GEO ID tag larger than 3808174460?
<|assistant|>
SELECT AVG("longitude") FROM "s" WHERE "water_sqmi"=0.093 AND "geo_id">3808174460;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "references" (
"play" text,
"author" text,
"company" text,
"base" text,
"country" text
);
Question: Which Country's Author is based on Sophocles and Euripides?
<|assistant|>
SELECT "country" FROM "references" WHERE "author"='based on sophocles and euripides';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "references" (
"play" text,
"author" text,
"company" text,
"base" text,
"country" text
);
Question: Which Author's Company is Ruth Kanner Theatre Group?
<|assistant|>
SELECT "author" FROM "references" WHERE "company"='ruth kanner theatre group';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "references" (
"play" text,
"author" text,
"company" text,
"base" text,
"country" text
);
Question: Which Play is from Cyprus, from the Company Magdalena Zira Theatre?
<|assistant|>
SELECT "play" FROM "references" WHERE "country"='cyprus' AND "company"='magdalena zira theatre';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "references" (
"play" text,
"author" text,
"company" text,
"base" text,
"country" text
);
Question: Which Country is the Play Electra and Orestes, The Trial from?
<|assistant|>
SELECT "country" FROM "references" WHERE "play"='electra and orestes, the trial';<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "semifinal_3" (
"rank" real,
"lane" real,
"athlete" text,
"nationality" text,
"time" real,
"react" real
);
Question: How much total time was in lane 4?
<|assistant|>
SELECT COUNT("time") FROM "semifinal_3" WHERE "lane"=4;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "semifinal_3" (
"rank" real,
"lane" real,
"athlete" text,
"nationality" text,
"time" real,
"react" real
);
Question: Which Rank has a Reaction time larger than 0.20400000000000001, and a Time larger than 45.56?
<|assistant|>
SELECT MAX("rank") FROM "semifinal_3" WHERE "react">0.20400000000000001 AND "time">45.56;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "semifinal_3" (
"rank" real,
"lane" real,
"athlete" text,
"nationality" text,
"time" real,
"react" real
);
Question: How many ranks have more than 7 lanes, and an Athlete of michael mathieu, and a Reaction time larger than 0.203?
<|assistant|>
SELECT SUM("rank") FROM "semifinal_3" WHERE "lane">7 AND "athlete"='michael mathieu' AND "react">0.203;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "semifinal_3" (
"rank" real,
"lane" real,
"athlete" text,
"nationality" text,
"time" real,
"react" real
);
Question: Which Time has a Reaction smaller than 0.20400000000000001, and a Rank of 1?
<|assistant|>
SELECT SUM("time") FROM "semifinal_3" WHERE "react"<0.20400000000000001 AND "rank"=1;<|endoftext|>
|
<|system|>
You are an expert SQL query generator. Only output valid SQL.
<|user|>
### Database Schema
CREATE TABLE "summary" (
"tournament" text,
"wins" real,
"top_5" real,
"top_10" real,
"top_25" real,
"events" real,
"cuts_made" real
);
Question: What's the average Top-25, that has an Events that's smaller than 12, and has a Top-5 that is larger than 0?
<|assistant|>
SELECT AVG("top_25") FROM "summary" WHERE "events"<12 AND "top_5">0;<|endoftext|>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.