instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_26 ( outcome VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the outcome on 2 December 2012?
SELECT outcome FROM table_name_26 WHERE date = "2 december 2012"
sql_create_context
CREATE TABLE table_name_11 ( date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date did the Away team essendon play?
SELECT date FROM table_name_11 WHERE away_team = "essendon"
sql_create_context
CREATE TABLE table_name_46 ( points INTEGER, draw VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points have a Draw of 2?
SELECT AVG(points) FROM table_name_46 WHERE draw = 2
sql_create_context
CREATE TABLE table_name_8 ( sites INTEGER, screens VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of sites when the number of screens is 687 and rank is more than 7?
SELECT AVG(sites) FROM table_name_8 WHERE screens = 687 AND rank > 7
sql_create_context
CREATE TABLE table_32009 ( "Name" text, "Circuit" text, "Date" text, "Winning drivers" text, "Winning constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the race that was won by a Maserati being driven by Giusepp...
SELECT "Circuit" FROM table_32009 WHERE "Winning constructor" = 'maserati' AND "Winning drivers" = 'giuseppe campari'
wikisql
CREATE TABLE table_name_59 ( score VARCHAR, game VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game against montreal canadiens after game 26?
SELECT score FROM table_name_59 WHERE game > 26 AND opponent = "montreal canadiens"
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
SELECT v.CreationDate AS "Date", t.Name FROM Votes AS v INNER JOIN VoteTypes AS t ON v.VoteTypeId = t.Id WHERE v.UserId = @user ORDER BY 'Date' DESC
sede
CREATE TABLE table_1342149_18 ( candidates VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the candidate in the election in the Louisiana 2 district?
SELECT candidates FROM table_1342149_18 WHERE district = "Louisiana 2"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
SELECT MAX(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-42115')) AND NOT vitalperiodic.respiration IS ...
eicu
CREATE TABLE table_5087 ( "Station Code" text, "Station Name" text, "Arrival" text, "Departure" text, "Platform" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Departure time at Rajendranagar Terminal?
SELECT "Departure" FROM table_5087 WHERE "Station Name" = 'rajendranagar terminal'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, ...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3273) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CU...
mimic_iii
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE 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 ...
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8274481' AND t_kc21.OUT_DIAG_DIS_CD = 'S71.183')
css
CREATE TABLE table_30820 ( "Pick" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player was picked for Buffalo Sabres?
SELECT "Player" FROM table_30820 WHERE "NHL team" = 'Buffalo Sabres'
wikisql
CREATE TABLE table_name_27 ( total INTEGER, rank VARCHAR, silver VARCHAR, bronze VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Total has a Bronze larger than 2, a Gold smaller than 16, a Silver of 0, and a Rank of 13?
SELECT AVG(total) FROM table_name_27 WHERE bronze > 2 AND gold < 16 AND silver = 0 AND rank = "13"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiolo...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 93078) AND microbiologyevents.spec_type_desc = 'sputum' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of year') = DATET...
mimic_iii
CREATE TABLE table_name_68 ( team_nickname VARCHAR, team_website VARCHAR, joined_tschl VARCHAR, home_arena VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the team nickname when joined tschl is 2010 and home arena is kettering rec center and t...
SELECT team_nickname FROM table_name_68 WHERE joined_tschl = 2010 AND home_arena = "kettering rec center" AND team_website = "dayton hockey"
sql_create_context
CREATE TABLE table_67726 ( "Peak" text, "Elevation (m)" real, "Prominence (m)" real, "Isolation (km)" real, "Municipality" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest elevation for the peak daurm l, and an I...
SELECT MAX("Elevation (m)") FROM table_67726 WHERE "Peak" = 'daurmål' AND "Isolation (km)" > '4'
wikisql
CREATE TABLE table_29294 ( "Episode No. Episode No. refers to the episodes number in the overall series, whereas Series No. refers to the episodes number in this particular series." real, "Series No." real, "Episode" text, "Director" text, "Writer(s)" text, "Original airdate" text ) -- Using v...
SELECT COUNT("Episode") FROM table_29294 WHERE "Series No." = '14'
wikisql
CREATE TABLE table_20704243_3 ( series__number INTEGER, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What series was directed by Mark Roskin?
SELECT MIN(series__number) FROM table_20704243_3 WHERE directed_by = "Mark Roskin"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT mzjzjlb.JZKSBM, mzjzjlb.JZKSMC FROM mzjzjlb WHERE mzjzjlb.JZLSH = '06908223301'
css
CREATE TABLE table_35975 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Loss of peavy (4 3) is what score?
SELECT "Score" FROM table_35975 WHERE "Loss" = 'peavy (4–3)'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT CYKSDM, CYKSMC FROM zyjzjlb WHERE JZLSH = '51106126836'
css
CREATE TABLE table_name_95 ( fuel_system VARCHAR, years VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What fuel system was used in 1960-62?
SELECT fuel_system FROM table_name_95 WHERE years = "1960-62"
sql_create_context
CREATE TABLE table_51080 ( "American name" text, "British name" text, "Value" text, "Dotted Value" text, "Double Dotted Value" text, "Triple Dotted Value" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the american name when the triple d...
SELECT "American name" FROM table_51080 WHERE "Triple Dotted Value" = '15/2 or 7 1/2'
wikisql
CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) -- Using valid SQLite, answer the following questions ...
SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country ORDER BY COUNT(Country)
nvbench
CREATE TABLE table_name_87 ( year INTEGER, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the year when the driver was kevin lepage?
SELECT SUM(year) FROM table_name_87 WHERE driver = "kevin lepage"
sql_create_context
CREATE TABLE hosting_city ( year number, match_id number, host_city text ) CREATE TABLE match ( match_id number, date text, venue text, score text, result text, competition text ) CREATE TABLE temperature ( city_id number, jan number, feb number, mar number, apr...
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.mar < T2.dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
spider
CREATE TABLE table_56571 ( "County" text, "Year Founded" text, "County Seat" text, "2010 Census Population" real, "July 1, 2012 Population Estimate." real, "Area (Sq. Mi.)" real, "Land Area (Sq. Mi.)" real ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT SUM("Area (Sq. Mi.)") FROM table_56571 WHERE "Year Founded" = '1785' AND "County Seat" = 'spartanburg' AND "Land Area (Sq. Mi.)" > '811'
wikisql
CREATE TABLE table_name_60 ( rank VARCHAR, code__iata_icao_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of the airport with the BKK/VTBS code?
SELECT rank FROM table_name_60 WHERE code__iata_icao_ = "bkk/vtbs"
sql_create_context
CREATE TABLE table_51246 ( "Country" text, "Total" real, "Marathon (men's)" real, "Marathon (women's)" real, "Half Marathon (men's)" real, "Half Marathon (women's)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the total winners was smalle...
SELECT AVG("Half Marathon (men's)") FROM table_51246 WHERE "Marathon (women's)" = '2' AND "Total" < '2'
wikisql
CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE degrees ( year number, campus number, degrees number ) CREATE TABLE ...
SELECT SUM(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = "San Francisco State University"
spider
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, ...
SELECT unprotected.PostId AS "post_link", Posts.OwnerUserId AS "user_link", Posts.CreationDate, Posts.LastActivityDate, Posts.Score FROM Posts, (SELECT DISTINCT PostId FROM PostHistory WHERE PostHistoryTypeId != 19) AS unprotected WHERE unprotected.PostId = Posts.Id AND DATEDIFF(day, Posts.CreationDate, CURRENT_TIMESTA...
sede
CREATE TABLE table_17118657_7 ( high_points VARCHAR, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players received high points where location/attendance was UIC Pavilion 6,304 respectively?
SELECT COUNT(high_points) FROM table_17118657_7 WHERE location_attendance = "UIC Pavilion 6,304"
sql_create_context
CREATE TABLE table_65361 ( "Place" text, "Code" real, "Area (km 2 )" real, "Population" real, "Most spoken language" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Population of Tshepiso with a Code of 70409 or smaller and an Area (km 2)...
SELECT MIN("Population") FROM table_65361 WHERE "Code" < '70409' AND "Area (km 2 )" < '5.97' AND "Place" = 'tshepiso'
wikisql
CREATE TABLE constructors ( constructorId INTEGER, constructorRef TEXT, name TEXT, nationality TEXT, url TEXT ) CREATE TABLE pitStops ( raceId INTEGER, driverId INTEGER, stop INTEGER, lap INTEGER, time TEXT, duration TEXT, milliseconds INTEGER ) CREATE TABLE seasons ( ...
SELECT year, COUNT(year) FROM results AS T1 JOIN races AS T2 ON T1.raceId = T2.raceId JOIN drivers AS T3 ON T1.driverId = T3.driverId WHERE T3.forename = "Lewis" ORDER BY year DESC
nvbench
CREATE TABLE table_4669 ( "Region" text, "Host" text, "Venue" text, "City" text, "State" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What region is William R. Johnson Coliseum in?
SELECT "Region" FROM table_4669 WHERE "Venue" = 'william r. johnson coliseum'
wikisql
CREATE TABLE table_63341 ( "Title" text, "Series" text, "Director" text, "Production Number" text, "Release date" text, "reissue?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Production Number with a Director of friz freleng, and a T...
SELECT "Production Number" FROM table_63341 WHERE "Director" = 'friz freleng' AND "Title" = 'wacky worm, the'
wikisql
CREATE TABLE table_name_34 ( events INTEGER, cuts_made VARCHAR, top_25 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of events with 24 cuts and less than 11 in the top-25?
SELECT MIN(events) FROM table_name_34 WHERE cuts_made = 24 AND top_25 < 11
sql_create_context
CREATE TABLE table_train_238 ( "id" int, "hemoglobin_a1c_hba1c" float, "fasting_c_peptide" float, "hba1c" float, "allergy_to_mammalian_derived_drug_preparations" bool, "body_mass_index_bmi" float, "renal_transplantation" bool, "NOUSE" float ) -- Using valid SQLite, answer the following...
SELECT * FROM table_train_238 WHERE renal_transplantation = 1
criteria2sql
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 demographic.diagnosis, prescriptions.icustay_id FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "52012"
mimicsql_data
CREATE TABLE table_name_89 ( winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2nd runner-up for yuming lai ( )
SELECT 2 AS nd_runner_up FROM table_name_89 WHERE winner = "yuming lai (賴銘偉)"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home
nvbench
CREATE TABLE table_44295 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Falcons points" real, "Opponents" real, "Record" text, "Streak" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was ...
SELECT "Date" FROM table_44295 WHERE "Streak" = 'lost 7'
wikisql
CREATE TABLE table_39979 ( "Species" text, "Indole" text, "Methyl Red" text, "Voges-Proskauer" text, "Citrate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the methyl red reading for the species that tests positive for indole?
SELECT "Methyl Red" FROM table_39979 WHERE "Indole" = 'positive'
wikisql
CREATE TABLE table_name_37 ( college VARCHAR, name VARCHAR, round VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which College has a Round smaller than 7, and a Pick # smaller than 27, and a Name of anthony maddox?
SELECT college FROM table_name_37 WHERE round < 7 AND pick__number < 27 AND name = "anthony maddox"
sql_create_context
CREATE TABLE table_name_16 ( class VARCHAR, quantity_made VARCHAR, type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the class of the locomotive with a quantity made of 1 and a 0-6-0t type?
SELECT class FROM table_name_16 WHERE quantity_made = "1" AND type = "0-6-0t"
sql_create_context
CREATE TABLE table_name_16 ( team_f VARCHAR, team_a VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is team f when Aida Gagaring is team A?
SELECT team_f FROM table_name_16 WHERE team_a = "aida gagaring"
sql_create_context
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE instructor ( ...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Sustainable Cities%' OR course.description LIKE '%Sustainable Cities%' OR course.name LIKE '%Sus...
advising
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-11360')) AND NOT vitalperiodic.respiration ...
eicu
CREATE TABLE table_name_14 ( result VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the result for 2000 afc asian cup qualification
SELECT result FROM table_name_14 WHERE competition = "2000 afc asian cup qualification"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostHistory ( Id number, Po...
SELECT TagName, COUNT(Id) AS numUsers FROM (SELECT t.TagName, u.Id FROM Users AS u INNER JOIN Posts AS answer ON u.Id = answer.OwnerUserId INNER JOIN Posts AS question ON answer.ParentId = question.Id INNER JOIN PostTags AS m ON question.Id = m.PostId INNER JOIN Tags AS t ON m.TagId = t.Id WHERE question.AnswerCount > ...
sede
CREATE TABLE table_204_807 ( id number, "date" text, "winner" text, "runner-up" text, "result" text, "site" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the first team to be champion of the tournament ?
SELECT "winner" FROM table_204_807 ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_27755784_11 ( date VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of date for stephen curry , dorell wright (27)
SELECT COUNT(date) FROM table_27755784_11 WHERE high_points = "Stephen Curry , Dorell Wright (27)"
sql_create_context
CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id ...
SELECT lot_details, COUNT(lot_details) FROM Lots GROUP BY lot_details ORDER BY COUNT(lot_details) DESC
nvbench
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_icd ( ...
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88659) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-20 month') GROUP BY prescriptions.dru...
mimic_iii
CREATE TABLE table_name_56 ( number_of_electorates__2009_ INTEGER, district VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Number of electorates (2009) has a District of mathura, and a Name of mant?
SELECT MIN(number_of_electorates__2009_) FROM table_name_56 WHERE district = "mathura" AND name = "mant"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'creatinine')
eicu
CREATE TABLE table_name_41 ( poll_source VARCHAR, date VARCHAR, republican VARCHAR, democrat VARCHAR, margin_of_error VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the poll source when Hillary clinton was the democrat, john mccain was t...
SELECT poll_source FROM table_name_41 WHERE democrat = "hillary clinton" AND margin_of_error < 4.5 AND republican = "john mccain" AND date = "may 2-7, 2007"
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TAB...
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight, flight_stop WHERE city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND flight_stop.stop_airport = airport_service.airport_code AND flight.airline_code = 'UA' AND flight.flight_id = flight_stop.flight_id
atis
CREATE TABLE table_7701 ( "Name/ designation" text, "Year of intro" real, "Country of origin" text, "Primary cartridge" text, "Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country of Origin, when Type is Disposable, when Primary Cart...
SELECT "Country of origin" FROM table_7701 WHERE "Type" = 'disposable' AND "Primary cartridge" = '105mm' AND "Year of intro" < '2008'
wikisql
CREATE TABLE table_55279 ( "Film title" text, "Director" text, "Writer" text, "Voiced character(s)" text, "Producer/Executive Producer" text, "Sound" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which writer had a producer DKA, JL, AS?
SELECT "Writer" FROM table_55279 WHERE "Producer/Executive Producer" = 'dka, jl, as'
wikisql
CREATE TABLE table_1341604_11 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the districk for larry mcdonald
SELECT district FROM table_1341604_11 WHERE incumbent = "Larry McDonald"
sql_create_context
CREATE TABLE table_71096 ( "Election" text, "1st Member" text, "1st Party" text, "2nd Member" text, "2nd Party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the 2nd member during 1885 election?
SELECT "2nd Member" FROM table_71096 WHERE "Election" = '1885'
wikisql
CREATE TABLE mzb ( 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 SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_SEX = '昌阳辉' AND t_kc22.STA_DATE BETWEEN '2004-01-10' AND '2008-08-12' AND t_kc22.MED_INV_ITEM_TYPE = '手术费'
css
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserD...
SELECT Id, DisplayName, Age, Reputation, CreationDate, LastAccessDate, 'http://stackoverflow.com/users/' + CAST(Id AS TEXT) AS Url FROM Users WHERE Reputation > 10000 ORDER BY CreationDate, Reputation DESC, LastAccessDate DESC LIMIT 1000
sede
CREATE TABLE table_67875 ( "Year" real, "Venue" text, "Winner" text, "Runner-Up" text, "Third" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the venue when Jack Hargreaves finished third?
SELECT "Venue" FROM table_67875 WHERE "Third" = 'jack hargreaves'
wikisql
CREATE TABLE table_name_61 ( score VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the match with a 3-2 result?
SELECT score FROM table_name_61 WHERE result = "3-2"
sql_create_context
CREATE TABLE table_name_78 ( venue VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where does the home team fitzroy play?
SELECT venue FROM table_name_78 WHERE home_team = "fitzroy"
sql_create_context
CREATE TABLE table_36401 ( "Race" text, "Length" text, "Class" text, "Circuit" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What race is 12 hours in length?
SELECT "Race" FROM table_36401 WHERE "Length" = '12 hours'
wikisql
CREATE TABLE table_23248420_1 ( rank VARCHAR, city_town VARCHAR, country VARCHAR, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When birkenhead is the city/town and merseyside is the county and england is the country how many ranks are there?...
SELECT COUNT(rank) FROM table_23248420_1 WHERE country = "England" AND county = "Merseyside" AND city_town = "Birkenhead"
sql_create_context
CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Pr...
SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE NOT Company_ID IN (SELECT Company_ID FROM station_company) GROUP BY Main_Industry ORDER BY COUNT(Main_Industry)
nvbench
CREATE TABLE table_203_614 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many games played where the combined score of b...
SELECT COUNT(*) FROM table_203_614 WHERE "score" + "score" >= 3
squall
CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) -- Using valid SQLite, answer the following questions fo...
SELECT Type, COUNT(Type) FROM ship GROUP BY Type ORDER BY COUNT(Type) DESC
nvbench
CREATE TABLE Customers ( customer_id VARCHAR, customer_first_name VARCHAR ) CREATE TABLE Accounts ( account_id VARCHAR, date_account_opened VARCHAR, account_name VARCHAR, other_account_details VARCHAR, customer_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tab...
SELECT T1.account_id, T1.date_account_opened, T1.account_name, T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan'
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number...
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17462 AND admissions.dischtime IS NULL)
mimic_iii
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_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '57086830' AND t_kc21.MED_SER_ORG_NO = '1629085' AND t_kc21.OUT_DIAG_DIS_NM LIKE '%瘙痒症%'
css
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855) AND prescriptions.drug = 'metoclopramide' AND STRFTIME('%y', prescriptions.startdate) = '2105'
mimic_iii
CREATE TABLE table_27085 ( "Round" real, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did Mike Rockenfeller have the fas...
SELECT "Date" FROM table_27085 WHERE "Fastest lap" = 'Mike Rockenfeller'
wikisql
CREATE TABLE ship ( ship_id number, name text, type text, built_year number, class text, flag text ) CREATE TABLE captain ( captain_id number, name text, ship_id number, age text, class text, rank text ) -- Using valid SQLite, answer the following questions for the tab...
SELECT AVG(age), MIN(age), class FROM captain GROUP BY class
spider
CREATE TABLE table_14871601_1 ( wins INTEGER, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest win for the team Nacional?
SELECT MAX(wins) FROM table_14871601_1 WHERE team = "Nacional"
sql_create_context
CREATE TABLE table_29510 ( "Period" text, "Live births per year" text, "Deaths per year" text, "Natural change per year" text, "CBR*" text, "CDR*" text, "NC*" text, "TFR*" text, "IMR*" real, "Life expectancy total" text, "Life expectancy males" text, "Life expectancy fema...
SELECT "Period" FROM table_29510 WHERE "Life expectancy total" = '62.4'
wikisql
CREATE TABLE routes ( rid integer, dst_apid integer, dst_ap varchar(4), src_apid bigint, src_ap varchar(4), alid bigint, airline varchar(4), codeshare text ) CREATE TABLE airlines ( alid integer, name text, iata varchar(2), icao varchar(3), callsign text, country...
SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country
nvbench
CREATE TABLE table_17703 ( "Rank in Nyagatare Sectors, 2012" real, "Sector" text, "Area in sqkm" real, "Population August 15, 2012" real, "Population, August 15, 2002" real, "Population Change 2002-2012 (%)" text, "Population Density 2012 (km 2 )" real ) -- Using valid SQLite, answer the f...
SELECT MAX("Population, August 15, 2002") FROM table_17703
wikisql
CREATE TABLE table_15216 ( "Field" text, "Geological Trend" text, "Reserves" text, "Discovery" text, "Operator(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Discoveryhas an Operator(s) of lundin?
SELECT "Discovery" FROM table_15216 WHERE "Operator(s)" = 'lundin'
wikisql
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.itemid = "50802"
mimicsql_data
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT a.ParentId AS "post_link" FROM Posts AS a JOIN Posts AS b ON b.ParentId = a.ParentId WHERE a.PostTypeId = 2 AND b.PostTypeId = 2 AND a.OwnerUserId = '##userid:int##' AND b.OwnerUserId = 9003
sede
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-248902' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmi...
eicu
CREATE TABLE table_19526911_1 ( arena__capacity_ VARCHAR, head_coach VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the arena capacity of the arena in the town whose head coach is Yuriy Korotkevich?
SELECT COUNT(arena__capacity_) FROM table_19526911_1 WHERE head_coach = "Yuriy Korotkevich"
sql_create_context
CREATE TABLE table_name_49 ( noaa VARCHAR, darwin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the NOAA of the higher harmonics that have a Darwin of mn 4?
SELECT noaa FROM table_name_49 WHERE darwin = "mn 4"
sql_create_context
CREATE TABLE table_7142 ( "RANK" real, "NAME" text, "TEAM" text, "COUNTRY" text, "POINTS" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank was Peter Schmeichel?
SELECT SUM("RANK") FROM table_7142 WHERE "NAME" = 'peter schmeichel'
wikisql
CREATE TABLE table_53577 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was th...
SELECT "Winning driver" FROM table_53577 WHERE "Date" = '30 may'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT zyjzjlb.ZYBMLX, zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '84637412405'
css
CREATE TABLE table_39006 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on 7 february 2008?
SELECT "Score" FROM table_39006 WHERE "Date" = '7 february 2008'
wikisql
CREATE TABLE table_1342149_13 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the candidates for noah m. mason?
SELECT COUNT(candidates) FROM table_1342149_13 WHERE incumbent = "Noah M. Mason"
sql_create_context
CREATE TABLE table_74795 ( "Incident No." text, "Date" text, "Place" text, "Killed" real, "Injured" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people were injured in total in East Champaran, Bihar with more than 2 people killed?
SELECT COUNT("Injured") FROM table_74795 WHERE "Place" = 'east champaran, bihar' AND "Killed" > '2'
wikisql
CREATE TABLE table_5442 ( "Driver" text, "Seasons" text, "Entries" real, "3rd places" real, "Percentage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which driver has 210 as entries?
SELECT "Driver" FROM table_5442 WHERE "Entries" = '210'
wikisql
CREATE TABLE table_name_73 ( team VARCHAR, kitmaker VARCHAR, shirt_sponsor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team uses the kitmaker Saller and has Krombacher as their shirt sponsor?
SELECT team FROM table_name_73 WHERE kitmaker = "saller" AND shirt_sponsor = "krombacher"
sql_create_context
CREATE TABLE table_64551 ( "Country" text, "Tourist arrivals (2011) (Millions)" real, "Tourism receipts (2011) (Millions of US$)" real, "Tourism receipts (2011) (US$ per arrival)" real, "Tourism receipts (2011) (US$ per capita)" real, "Tourism receipts (2003) (as % of GDP)" text, "Tourism re...
SELECT MIN("Tourist arrivals (2011) (Millions)") FROM table_64551 WHERE "Tourism receipts (2011) (US$ per arrival)" = '507' AND "Tourism receipts (2011) (Millions of US$)" < '11,869'
wikisql
CREATE TABLE projects ( hours INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the total hours of all projects.
SELECT SUM(hours) FROM projects
sql_create_context
CREATE TABLE table_66901 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the least year for 4 points?
SELECT MIN("Year") FROM table_66901 WHERE "Points" = '4'
wikisql