instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_78942 ( "City" text, "Country" text, "Airport" text, "IATA" text, "ICAO" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Country has a ICAO of EKCH?
SELECT "Country" FROM table_78942 WHERE "ICAO" = 'ekch'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskResultTypes ( Id number, Na...
SELECT COUNT(*) FROM Posts WHERE Posts.ViewCount > 10000 AND Posts.ViewCount < 20000
sede
CREATE TABLE table_52396 ( "Rank" real, "Movie" text, "Year" real, "Studio(s)" text, "Opening Week Nett Gross" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest rank of the movie with an opening week net gross less than 80,87,00,000...
SELECT MAX("Rank") FROM table_52396 WHERE "Year" < '2011' AND "Opening Week Nett Gross" < '80,87,00,000'
wikisql
CREATE TABLE table_61108 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a Total smaller than 284?
SELECT "Country" FROM table_61108 WHERE "Total" < '284'
wikisql
CREATE TABLE table_name_85 ( class VARCHAR, vessel_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the class of vessel of the ship Hyundai Smart?
SELECT class FROM table_name_85 WHERE vessel_name = "hyundai smart"
sql_create_context
CREATE TABLE table_49951 ( "Driver" text, "Race 1" text, "Race 2" text, "Race 3" text, "Race 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Race 2, when Driver is John Faulkner?
SELECT "Race 2" FROM table_49951 WHERE "Driver" = 'john faulkner'
wikisql
CREATE TABLE table_name_80 ( loss INTEGER, name VARCHAR, gain VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest loss that Jarius Wright has had where he also has had a gain bigger than 1.
SELECT MIN(loss) FROM table_name_80 WHERE name = "jarius wright" AND gain > 1
sql_create_context
CREATE TABLE table_2140 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the nickname for enrollment being 9000
SELECT "Nickname" FROM table_2140 WHERE "Enrollment" = '9000'
wikisql
CREATE TABLE table_58475 ( "Player" text, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player has a nationality of spain?
SELECT "Player" FROM table_58475 WHERE "Nationality" = 'spain'
wikisql
CREATE TABLE table_name_32 ( res VARCHAR, round VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result with a Round of 3, and an Opponent of keith wisniewski?
SELECT res FROM table_name_32 WHERE round = "3" AND opponent = "keith wisniewski"
sql_create_context
CREATE TABLE table_18311 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district did Dave Treen serve?
SELECT "District" FROM table_18311 WHERE "Incumbent" = 'Dave Treen'
wikisql
CREATE TABLE table_24622 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Final Score" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During what week was the July 10 game played?
SELECT "Week" FROM table_24622 WHERE "Date" = 'July 10'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-48470')) AND vitalperiodic.heartrate BETWEEN heart_rate_lower AN...
eicu
CREATE TABLE table_name_87 ( year INTEGER, co_singer VARCHAR, film_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year has the Co-singer solo and a Film name of bhagya debata?
SELECT MIN(year) FROM table_name_87 WHERE co_singer = "solo" AND film_name = "bhagya debata"
sql_create_context
CREATE TABLE table_name_2 ( opponent VARCHAR, game VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent when they played after Game 26 and their record was 23-4?
SELECT opponent FROM table_name_2 WHERE game > 26 AND record = "23-4"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT demographic.days_stay, demographic.admission_location FROM demographic WHERE demographic.subject_id = "65759"
mimicsql_data
CREATE TABLE table_23680576_3 ( week_37 VARCHAR, week_33 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all week 37 results when week 33 is 14.3%.
SELECT week_37 FROM table_23680576_3 WHERE week_33 = "14.3%"
sql_create_context
CREATE TABLE table_name_78 ( years VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the years for elsthorpe school
SELECT years FROM table_name_78 WHERE name = "elsthorpe school"
sql_create_context
CREATE TABLE table_60789 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player who won in 1993?
SELECT "Player" FROM table_60789 WHERE "Year(s) won" = '1993'
wikisql
CREATE TABLE table_22078691_2 ( title VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title that has 14.59 u.s. viewers (millions)?
SELECT title FROM table_22078691_2 WHERE us_viewers__millions_ = "14.59"
sql_create_context
CREATE TABLE table_7042 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest rank of a nation with fewer than 3 gold medals, more than 2 bronze medals,...
SELECT MIN("Rank") FROM table_7042 WHERE "Gold" < '3' AND "Silver" = '0' AND "Bronze" > '2'
wikisql
CREATE TABLE table_79098 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT COUNT("Lost") FROM table_79098 WHERE "Drawn" = '7' AND "Points 1" < '33'
wikisql
CREATE TABLE table_67628 ( "Club" text, "Sport" text, "League" text, "Venue" text, "Championships (Years)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Venue has a Sport of baseball, Championships (Years) of 0, a League of milb, florida stat...
SELECT "Venue" FROM table_67628 WHERE "Sport" = 'baseball' AND "Championships (Years)" = '0' AND "League" = 'milb, florida state league' AND "Club" = 'jupiter hammerheads'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '马嘉胜' AND MED_SER_ORG_NO = '0046679' AND IN_DIAG_DIS_NM LIKE '%增生%'
css
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions...
mimic_iii
CREATE TABLE table_46296 ( "Rank" real, "Heat" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time when the rank is 14?
SELECT "Time" FROM table_46296 WHERE "Rank" = '14'
wikisql
CREATE TABLE gyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '4883889' AND qtb.IN_HOSP_DATE BETWEEN '2004-08-03' AND '2009-12-16' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '4883889' AND gyb.IN_HOSP_DATE BETWEEN '2004-08-03' AND '2009-12-16' AND g...
css
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi...
mimic_iii
CREATE TABLE table_name_43 ( kaz_hayashi VARCHAR, block_a VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the kaz hayashi for block A being bushi
SELECT kaz_hayashi FROM table_name_43 WHERE block_a = "bushi"
sql_create_context
CREATE TABLE table_60153 ( "Team" text, "Opponent" text, "Score" text, "Venue" text, "Round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round was in canberra stadium?
SELECT "Round" FROM table_60153 WHERE "Venue" = 'canberra stadium'
wikisql
CREATE TABLE table_name_94 ( year INTEGER, seats VARCHAR, _percentage_votes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Year were there 48 of 120 Seats and a % votes larger than 34.18?
SELECT SUM(year) FROM table_name_94 WHERE seats = "48 of 120" AND _percentage_votes > 34.18
sql_create_context
CREATE TABLE table_name_62 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 2009, when 2011 is 'Q2'?
SELECT 2009 FROM table_name_62 WHERE 2011 = "q2"
sql_create_context
CREATE TABLE table_name_89 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the away team from st kilda?
SELECT away_team FROM table_name_89 WHERE home_team = "st kilda"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MED_ORG_DEPT_CD, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '4355063' GROUP BY MED_ORG_DEPT_CD, OUT_DIAG_DIS_NM
css
CREATE TABLE table_name_65 ( type VARCHAR, species VARCHAR, genes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type has an unspecified species and less than 367 genes?
SELECT type FROM table_name_65 WHERE species = "unspecified" AND genes < 367
sql_create_context
CREATE TABLE table_24192031_2 ( hometown VARCHAR, height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many hometowns have a height of m (ft 10 1 2 in)?
SELECT COUNT(hometown) FROM table_24192031_2 WHERE height = "m (ft 10 1⁄2 in)"
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, ...
SELECT DATEFROMPARTS(YEAR(p.CreationDate), MONTH(p.CreationDate), 1) AS "date", t.TagName, COUNT(*) FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE DATEFROMPARTS(YEAR(p.CreationDate), MONTH(p.CreationDate), 1) < DATEFROMPARTS(YEAR(CURRENT_TIMESTAMP()), MONTH(CURRENT_TIMES...
sede
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "NEWBORN" AND prescriptions.drug = "Cetylpyridinium Chl (Cepacol)"
mimicsql_data
CREATE TABLE table_name_6 ( socialist_ticket VARCHAR, democratic_ticket VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name on the Socialist ticket when the Democratic ticket is george k. shuler?
SELECT socialist_ticket FROM table_name_6 WHERE democratic_ticket = "george k. shuler"
sql_create_context
CREATE TABLE table_name_2 ( heat INTEGER, nationality VARCHAR, lane VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest heat of the athlete from spain with a lane less than 7?
SELECT MAX(heat) FROM table_name_2 WHERE nationality = "spain" AND lane < 7
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text...
SELECT JZKSDM, JZKSMC FROM zyjzjlb WHERE JZLSH = '24800969033'
css
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSB...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers...
css
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE treatment ( treat...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-12480')) AND treatment.treatmentname = 'splinting - stabilizi...
eicu
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId ...
SELECT COUNT(Id) AS "#_of_posts", COUNT(OwnerDisplayName) AS "ownerdisplayname_is_not_nul", ROUND((CAST(COUNT(OwnerDisplayName) AS FLOAT)) * 100.0 / (CAST(COUNT(Id) AS FLOAT)), 5) AS Percentage FROM Posts WHERE (NOT OwnerUserId IS NULL)
sede
CREATE TABLE table_12570759_2 ( us_viewers__millions_ VARCHAR, directed_by VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many millions of U.S. viewers watched the episode directed by Rob Bailey and written by Pam Veasey?
SELECT us_viewers__millions_ FROM table_12570759_2 WHERE directed_by = "Rob Bailey" AND written_by = "Pam Veasey"
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), ...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(SALARY)
nvbench
CREATE TABLE table_204_964 ( id number, "team" text, "seasons" number, "games" number, "wins" number, "ties" number, "losses" number, "goals\nfor" number, "goals\nagainst" number, "goal\ndiff" number, "points" number ) -- Using valid SQLite, answer the following questions f...
SELECT "team" FROM table_204_964 ORDER BY "points" LIMIT 1
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-32921')) AND lab.labname = 'protein c' AND DATETIME(lab.labresulttime, 'start of yea...
eicu
CREATE TABLE table_204_823 ( id number, "dates" text, "location" text, "attendance" text, "official guests" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- where was the last date held ?
SELECT "location" FROM table_204_823 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_41422 ( "Player" text, "Club" text, "League" real, "Play-offs" real, "FA Cup" real, "FA Trophy" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which league has an FA cup greater than 0, with a total greater t...
SELECT "League" FROM table_41422 WHERE "FA Cup" > '0' AND "Total" > '21'
wikisql
CREATE TABLE table_name_5 ( player VARCHAR, to_par VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a To par of 5, and a Country of england?
SELECT player FROM table_name_5 WHERE to_par = "–5" AND country = "england"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p thoracotomy...
eicu
CREATE TABLE table_73372 ( "Election" text, "Mayor" text, "Seat no 1" text, "Seat no 2" text, "Seat no 3" text, "Seat no 4" text, "Seat no 5" text, "Seat no 6" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which election had seat no 1 f...
SELECT "Election" FROM table_73372 WHERE "Seat no 1" = 'Jacques Lachapelle' AND "Seat no 5" = 'G. Sanscartier'
wikisql
CREATE TABLE table_name_50 ( silver INTEGER, gold VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest amount of silver when gold is 0 for soviet union?
SELECT MAX(silver) FROM table_name_50 WHERE gold = 0 AND nation = "soviet union"
sql_create_context
CREATE TABLE table_70258 ( "Institution" text, "Main Campus Location" text, "Founded" real, "Mascot" text, "School Colors" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total Founded with a Main Campus Location of liberal?
SELECT COUNT("Founded") FROM table_70258 WHERE "Main Campus Location" = 'liberal'
wikisql
CREATE TABLE table_62075 ( "Dam constructed" text, "Year completed" real, "Impounded body of water" text, "Reservoir capacity" text, "Dam wall height" text, "Dam type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which dam type was completed i...
SELECT "Dam type" FROM table_62075 WHERE "Year completed" = '1961'
wikisql
CREATE TABLE table_name_73 ( label VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the label for December 2004?
SELECT label FROM table_name_73 WHERE date = "december 2004"
sql_create_context
CREATE TABLE table_79599 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time in a heat smaller than 5, in Lane 5, for Vietnam?
SELECT "Time" FROM table_79599 WHERE "Heat" < '5' AND "Lane" = '5' AND "Nationality" = 'vietnam'
wikisql
CREATE TABLE table_name_5 ( viewers__in_millions_ VARCHAR, run_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On the episode that had a run time of 24:57, how many million viewers were there?
SELECT viewers__in_millions_ FROM table_name_5 WHERE run_time = "24:57"
sql_create_context
CREATE TABLE table_name_91 ( venue VARCHAR, against VARCHAR, opposing_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue has an against value larger than 21 and had Argentina as an opposing team.
SELECT venue FROM table_name_91 WHERE against > 21 AND opposing_team = "argentina"
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, depart...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SAN FRANCISCO' AND ground_service.city_code = city.city_code
atis
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.short_title = "Myopia"
mimicsql_data
CREATE TABLE table_name_66 ( team VARCHAR, points INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team has fewer than 203 points?
SELECT team FROM table_name_66 WHERE points < 203
sql_create_context
CREATE TABLE table_48880 ( "SECR No." real, "SR No." real, "BR No." real, "Builder" text, "Date Delivered" text, "Date Withdrawn" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest BR number with a SECR number of 765?
SELECT MAX("BR No.") FROM table_48880 WHERE "SECR No." = '765'
wikisql
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDSM = '酒精性肝硬化' AND jyjgzbb.JCZBDM = '200010' UNION SELECT jyjgzbb.CKZFWXX...
css
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperfield ( fieldid int, paperid int...
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'Christopher D Manning' AND writes.authorid = author.authorid
scholar
CREATE TABLE table_name_53 ( right_ascension___j2000__ VARCHAR, constellation VARCHAR, declination___j2000__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the right ascension (j2000) when the constellation is sextans and the declination (j2000) ...
SELECT right_ascension___j2000__ FROM table_name_53 WHERE constellation = "sextans" AND declination___j2000__ = "°28′01″"
sql_create_context
CREATE TABLE table_name_55 ( championship VARCHAR, outcome VARCHAR, opponents_in_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Championship, when Outcome is 'runner-up', and when Opponents In Final is 'Gigi Fern ndez Natalia Zvereva'?
SELECT championship FROM table_name_55 WHERE outcome = "runner-up" AND opponents_in_final = "gigi fernández natalia zvereva"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '030-42006' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '030-42006' AND patient.hospitaldischargetime IS NULL)) AND tr...
eicu
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_ca...
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*)
nvbench
CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End_Date DAT...
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Settlements ORDER BY COUNT(Date_Claim_Made) DESC
nvbench
CREATE TABLE table_name_29 ( time_retired VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value of time/retired for Jean Alesi?
SELECT time_retired FROM table_name_29 WHERE driver = "jean alesi"
sql_create_context
CREATE TABLE table_43738 ( "Year" real, "Number" real, "Team" text, "Co-driver" text, "Position" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Position, when Laps is 156?
SELECT "Position" FROM table_43738 WHERE "Laps" = '156'
wikisql
CREATE TABLE table_19033 ( "Rank" real, "Islands Name" text, "Area (sqmi)" real, "Area (km 2 )" real, "Location" text, "Population (2000)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest rank number of those used to rank the ...
SELECT MIN("Rank") FROM table_19033
wikisql
CREATE TABLE table_58108 ( "Number" text, "Builder" text, "Type" text, "Date" text, "Works number" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date was the Works Number 12?
SELECT "Date" FROM table_58108 WHERE "Works number" = '12'
wikisql
CREATE TABLE table_25703 ( "Player" text, "Games Played" real, "Minutes" real, "Field Goals" real, "Three Pointers" real, "Free Throws" real, "Rebounds" real, "Assists" real, "Blocks" real, "Steals" real, "Points" real ) -- Using valid SQLite, answer the following questions...
SELECT COUNT("Player") FROM table_25703 WHERE "Field Goals" = '25' AND "Blocks" = '6'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '昌和志' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT > 7632.77)
css
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Price DESC
nvbench
CREATE TABLE table_203_193 ( id number, "ship name" text, "in service" number, "project number" text, "type" text, "class" text, "comments" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the next ship after yamal ?
SELECT "ship name" FROM table_203_193 WHERE id = (SELECT id FROM table_203_193 WHERE "ship name" = 'yamal') + 1
squall
CREATE TABLE customer ( cust_name VARCHAR, acc_type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of customers who have both saving and checking account types.
SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking'
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE diagnoses_i...
SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32026)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admi...
mimic_iii
CREATE TABLE table_20829 ( "Children/Women over 15" real, "Oblast\\Age of women" text, "15 to 17" real, "18 to 19" real, "20 to 24" real, "25 to 29" real, "30 to 34" real, "35 to 39" real, "40 to 44" real, "45 to 49" real, "50 to 54" real, "55 to 59" real, "60 to 64" ...
SELECT MIN("25 to 29") FROM table_20829 WHERE "30 to 34" = '1357'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2892777' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 22
css
CREATE TABLE table_name_1 ( _percentage_wt_comp_1 VARCHAR, _percentage_wt_comp_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the total number of % wt comp 1 foR % wt comp 2 or 27
SELECT COUNT(_percentage_wt_comp_1) FROM table_name_1 WHERE _percentage_wt_comp_2 = 27
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT * FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '范梦竹' AND hz_info.YLJGDM = '4362119' AND txmzjzjlb.JZZDSM LIKE '%牙髓炎%' UNION SELECT * FROM person_info JOIN ...
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '17045983' AND jyjgzbb.JYRQ BETWEEN...
css
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4718)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit...
mimic_iii
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description...
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'MONTREAL' AND flight.from_airport = airport_service.airport_code
atis
CREATE TABLE table_52883 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the grid total that had a retired for engine, teo fabi driving, and under 39 laps?
SELECT SUM("Grid") FROM table_52883 WHERE "Time/Retired" = 'engine' AND "Driver" = 'teo fabi' AND "Laps" < '39'
wikisql
CREATE TABLE table_name_73 ( years VARCHAR, jersey_number_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Years of the player with Jersey Number(s) of 44?
SELECT years FROM table_name_73 WHERE jersey_number_s_ = 44
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "LEFT COLON CANCER" AND procedures.icd9_code = "3950"
mimicsql_data
CREATE TABLE table_name_43 ( to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par that has ernie els as the player?
SELECT to_par FROM table_name_43 WHERE player = "ernie els"
sql_create_context
CREATE TABLE table_41665 ( "20 years" text, "2400 kWh/kW p y" real, "2200 kWh/kW p y" real, "2000 kWh/kW p y" real, "1800 kWh/kW p y" real, "1600 kWh/kW p y" real, "1400 kWh/kW p y" real, "1200 kWh/kW p y" real, "1000 kWh/kW p y" real, "800 kWh/kW p y" real ) -- Using valid SQL...
SELECT AVG("2400 kWh/kW p y") FROM table_41665 WHERE "1400 kWh/kW p y" > '12.9' AND "1200 kWh/kW p y" > '21.7' AND "1600 kWh/kW p y" > '18.8'
wikisql
CREATE TABLE player_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first text ) CREATE TABLE player_award ( player_id text, award_id text, year number, league_id text, tie text, notes text ) CREAT...
SELECT AVG(T1.weight) FROM player AS T1 JOIN player_award AS T2 ON T1.player_id = T2.player_id WHERE T2.award_id = "TSN All-Star" AND notes = "3B"
thehistoryofbaseball
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, ...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '彭嘉怡' AND t_kc21.IN_HOSP_DATE BETWEEN '2015-03-27' AND '2015-11-09'
css
CREATE TABLE table_2223 ( "Team" text, "Location" text, "Head Coach" text, "Team Captain" text, "Venue" text, "Capacity" real, "Position in 2008" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the team Saturn?
SELECT "Location" FROM table_2223 WHERE "Team" = 'Saturn'
wikisql
CREATE TABLE table_name_12 ( norwegian__nynorsk_ VARCHAR, danish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Norwegian (nynorsk) has a Danish of farvel?
SELECT norwegian__nynorsk_ FROM table_name_12 WHERE danish = "farvel"
sql_create_context
CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_cit...
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY Name
nvbench
CREATE TABLE product_characteristics ( product_id number, characteristic_id number, product_characteristic_value text ) CREATE TABLE ref_product_categories ( product_category_code text, product_category_description text, unit_of_measure text ) CREATE TABLE characteristics ( characteristic_...
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "white" OR t3.characteristic_name = "hot"
spider