instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_204_678 ( id number, "record" text, "athlete" text, "nation" text, "venue" text, "date" text, "#" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which other athlete with the same record 4.08 m -lrb- 13ft . 4 1/2 in
SELECT "athlete" FROM table_204_678 WHERE "record" = '4.08 m (13 ft 41⁄2 in)'
squall
CREATE TABLE table_26765 ( "Borough" text, "County" text, "Franchise type" text, "Members" real, "Voters in 1800" real, "Times contested" real, "Fate in 1832" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most times contested for m...
SELECT MAX("Times contested") FROM table_26765 WHERE "County" = 'Montgomeryshire'
wikisql
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE table_26267607_2 ( circuit VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Round 1 is in what circuit?
SELECT circuit FROM table_26267607_2 WHERE round = "1"
sql_create_context
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId num...
SELECT Q.Id AS "post_link", Q.Score, Q.ViewCount, ShortLInkAnswers.Count AS NumShortLinkAnswers FROM Posts AS Q INNER JOIN (SELECT PH.PostId, PH.PostHistoryTypeId FROM PostHistory AS PH WHERE PostHistoryTypeId IN (1, 10)) AS H ON H.PostId = Q.Id INNER JOIN (SELECT COUNT(*) AS Count, A.ParentId FROM Posts AS A WHERE A.P...
sede
CREATE TABLE table_39898 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Years in Orlando has a School/Club Team of seattle?
SELECT "Years in Orlando" FROM table_39898 WHERE "School/Club Team" = 'seattle'
wikisql
CREATE TABLE table_name_60 ( race VARCHAR, finish VARCHAR, track VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which race had a finish of 1st at Saratoga Race Course?
SELECT race FROM table_name_60 WHERE finish = "1st" AND track = "saratoga race course"
sql_create_context
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 mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '16026423' AND hz_info.YLJGDM = '2797205' AND mzjzjlb.JZKSMC LIKE '%足踝%'
css
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE airline ( airline_code varchar, airline_name ...
SELECT DISTINCT airline.airline_code FROM airline, flight WHERE flight.airline_code = 'DL' AND flight.airline_code = airline.airline_code AND flight.flight_number = 98
atis
CREATE TABLE table_69844 ( "Team" text, "Car No." text, "MNZ SPR" text, "MNZ FEA" text, "SPA SPR" text, "SPA FEA" text, "MON FEA" text, "SIL SPR" text, "SIL FEA" text, "HUN SPR" text, "HUN FEA" text, "LMS SPR" text, "LMS FEA" text, "CAT SPR" text, "CAT FEA" te...
SELECT "LMS SPR" FROM table_69844 WHERE "Car No." = '15'
wikisql
CREATE TABLE table_56118 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the away team at Arden Street Oval?
SELECT "Away team" FROM table_56118 WHERE "Venue" = 'arden street oval'
wikisql
CREATE TABLE table_52105 ( "Superlative" text, "Director" text, "Record Set" text, "Year" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had notes of Prizzi's Honor?
SELECT "Director" FROM table_52105 WHERE "Notes" = 'prizzi''s honor'
wikisql
CREATE TABLE table_26921 ( "Rnd" real, "Date" text, "Race Name" text, "Track" text, "Location" text, "Pole position" text, "Fastest lap" text, "Most Laps Led" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had most...
SELECT "Most Laps Led" FROM table_26921 WHERE "Track" = 'Chicagoland Speedway'
wikisql
CREATE TABLE table_26168687_5 ( vessel_type VARCHAR, vessel_operator VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the vessel type for beluga shipping
SELECT vessel_type FROM table_26168687_5 WHERE vessel_operator = "Beluga Shipping"
sql_create_context
CREATE TABLE table_name_18 ( three_mora_word VARCHAR, one_mora VARCHAR, accented_mora VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the three-mora word with a low tone accented mora and a one mora of 2?
SELECT three_mora_word FROM table_name_18 WHERE NOT accented_mora = "low tone" AND one_mora = "2"
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comme...
SELECT YEAR(sel.CreationDate) AS "year", COUNT(*) AS "count" FROM (SELECT p.Id, p.CreationDate FROM Posts AS p WHERE p.PostTypeId = 1 AND p.ClosedDate IS NULL AND p.AnswerCount = 0) AS sel GROUP BY YEAR(sel.CreationDate) ORDER BY Year
sede
CREATE TABLE table_name_79 ( gwr_nos VARCHAR, quantity VARCHAR, m VARCHAR, swj_nos VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which GWR numbers had a quantity less than 2 when the M&SWJ number was 9?
SELECT gwr_nos FROM table_name_79 WHERE quantity < 2 AND m & swj_nos = "9"
sql_create_context
CREATE TABLE table_name_58 ( _2013_projection VARCHAR, july_1 VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many July 1, 2013 projections have a Rank of 27?
SELECT COUNT(july_1), _2013_projection FROM table_name_58 WHERE rank = "27"
sql_create_context
CREATE TABLE table_name_86 ( overall INTEGER, pick INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Overall number that is the lowest, and has a pick greater than 9?
SELECT MIN(overall) FROM table_name_86 WHERE pick > 9
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Descrip...
SELECT x.position AS RANK_IN_LANKA, x.Id AS USER_ID, x.Reputation, x.DisplayName FROM (SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS position, Id, DisplayName, Reputation FROM Users WHERE Location LIKE '%Sri Lanka%' ORDER BY Reputation DESC LIMIT 1000) AS x WHERE x.Id = 3702886
sede
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM ...
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND ...
css
CREATE TABLE table_2701625_1 ( female_life_expectancy INTEGER, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most female life expectancy for djibouti
SELECT MAX(female_life_expectancy) FROM table_2701625_1 WHERE country = "Djibouti"
sql_create_context
CREATE TABLE table_29077342_19 ( general_classification VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the general classification for mauricio soler
SELECT general_classification FROM table_29077342_19 WHERE winner = "Mauricio Soler"
sql_create_context
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int...
SELECT Country, AVG(Age) FROM artist GROUP BY Country
nvbench
CREATE TABLE table_245801_2 ( end___utc VARCHAR, comments VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When first woman eva is the comment what is the end -utc?
SELECT end___utc FROM table_245801_2 WHERE comments = "First woman EVA"
sql_create_context
CREATE TABLE table_38645 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on April 12?
SELECT "Score" FROM table_38645 WHERE "Date" = 'april 12'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId...
SELECT a.Score, COUNT(*) AS count FROM Posts AS a JOIN Posts AS q ON a.Id = q.AcceptedAnswerId AND q.OwnerUserId != '##UserId##' WHERE a.OwnerUserId = '##UserId##' AND a.PostTypeId = 2 GROUP BY a.Score ORDER BY 1
sede
CREATE TABLE table_38133 ( "Rioplatense" text, "Castilian" text, "Andalusian" text, "Mexican" text, "Chilean" text, "English ( US / UK )" text, "Italian" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Chilean word is used for the Castil...
SELECT "Chilean" FROM table_38133 WHERE "Castilian" = 'ordenador'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CR...
SELECT q.Id AS "post_link", Title FROM Posts AS q INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = '##tagName:string?geometry##' ORDER BY q.CreationDate DESC
sede
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 COUNT(*) 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 txmzjzjlb.JZKSRQ BETWEEN '2001-06-20' AND '2018-02-12' AND txmzjzjlb.YLJGDM = '6233907' UNI...
css
CREATE TABLE table_79082 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the tie no of the game where exeter city was the home team?
SELECT "Tie no" FROM table_79082 WHERE "Home team" = 'exeter city'
wikisql
CREATE TABLE table_14609295_4 ( conference VARCHAR, postseason VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Ram's conference record when they were the CBI champions?
SELECT conference FROM table_14609295_4 WHERE postseason = "CBI Champions"
sql_create_context
CREATE TABLE table_name_94 ( competition VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Competition when the Club was costa rica u-20?
SELECT competition FROM table_name_94 WHERE club = "costa rica u-20"
sql_create_context
CREATE TABLE table_65234 ( "Fish" text, "Guernsey Record" text, "Year" text, "Location" text, "British Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the guernsey record set with a fish caught at Bordeaux Harbour?
SELECT "Guernsey Record" FROM table_65234 WHERE "Location" = 'bordeaux harbour'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "41519"
mimicsql_data
CREATE TABLE table_name_82 ( mascot VARCHAR, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the mascot when the county is 43 kosciusko?
SELECT mascot FROM table_name_82 WHERE county = "43 kosciusko"
sql_create_context
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code A...
atis
CREATE TABLE table_2076533_1 ( founded INTEGER, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least founded for gutenberg college
SELECT MIN(founded) FROM table_2076533_1 WHERE school = "Gutenberg College"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "BACTSSSM"
mimicsql_data
CREATE TABLE table_203_142 ( id number, "pos" text, "no" number, "rider" text, "bike" text, "laps" number, "time" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of non retired riders...
SELECT COUNT("rider") FROM table_203_142 WHERE "time" <> 'retirement'
squall
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-19622')) AND microlab.culturesite = 'bronchial lavage' AND DATETIME(microl...
eicu
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dob_year < "1821"
mimicsql_data
CREATE TABLE table_6925 ( "Office" text, "Democratic ticket" text, "Republican ticket" text, "Conservative ticket" text, "Liberal ticket" text, "Free Libertarian ticket" text, "Socialist Labor ticket" text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT "Liberal ticket" FROM table_6925 WHERE "Free Libertarian ticket" = 'jack a. martin'
wikisql
CREATE TABLE table_29846807_5 ( record VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When boston university is the team what is the record?
SELECT record FROM table_29846807_5 WHERE team = "Boston University"
sql_create_context
CREATE TABLE table_56621 ( "Edition" text, "Round" text, "Date" text, "Partner" text, "Surface" text, "Opponents" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was Manuela Maleeva opponent when she played a match partnere...
SELECT "Opponents" FROM table_56621 WHERE "Partner" = 'michelle strebel'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT Id, PostTypeId, AcceptedAnswerId, AnswerCount, CreationDate, Score, LENGTH(Body) AS QLength FROM Posts WHERE PostTypeId = 2 ORDER BY CreationDate DESC
sede
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'pancreatic tumor - pancreatic ca' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2101')
eicu
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TA...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'SCAND' AND semester.semester = 'Winter'
advising
CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ) CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ) CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool ...
SELECT Party, COUNT(*) FROM people GROUP BY Party ORDER BY COUNT(*) DESC
nvbench
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 COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-18025')) AND STRFTIME('%y', medication.drugstarttime) >= '2101'
eicu
CREATE TABLE table_203_38 ( id number, "#" number, "title" text, "producer(s)" text, "performer(s)" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the first song on the album produced by havoc ?
SELECT "title" FROM table_203_38 WHERE "producer(s)" = 'havoc' ORDER BY "#" LIMIT 1
squall
CREATE TABLE table_63404 ( "Callsign" text, "Network" text, "City of License" text, "D ERP" text, "Owner / Operator" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the network that has a callsign of XHTM and a D ERP of ?
SELECT "Network" FROM table_63404 WHERE "D ERP" = '•' AND "Callsign" = 'xhtm'
wikisql
CREATE TABLE table_65401 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the tournament when 2007 is WTA Premier 5 tournaments?
SELECT "Tournament" FROM table_65401 WHERE "2007" = 'wta premier 5 tournaments'
wikisql
CREATE TABLE table_name_49 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result on october 8, 1961?
SELECT result FROM table_name_49 WHERE date = "october 8, 1961"
sql_create_context
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 qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '20724976' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 7866.88) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '20724976' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMO...
css
CREATE TABLE table_name_88 ( year INTEGER, points VARCHAR, entrant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the earliest year that Scuderia Ferrari was an entrant with 0 points?
SELECT MIN(year) FROM table_name_88 WHERE points = "0" AND entrant = "scuderia ferrari"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( med...
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 = '017-94690')) AND lab.labname = '-basos' AND STRFTIME('%y-%m', lab.labresulttime) = '210...
eicu
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'anemia - iron deficiency anemia secondary to...
eicu
CREATE TABLE table_21431 ( "Episode Number" real, "Air Date" text, "Event 1" text, "Event 2" text, "Event 3" text, "Event 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the episode aired where event 2 was Hang Tough?
SELECT "Air Date" FROM table_21431 WHERE "Event 2" = 'Hang Tough'
wikisql
CREATE TABLE table_30060356_3 ( gt3_pro___am_cup_winner VARCHAR, gt3_pro_cup_winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the gt3 pro / am cup winners when the gt3 pro cup winner was no. 1 vita4one?
SELECT gt3_pro___am_cup_winner FROM table_30060356_3 WHERE gt3_pro_cup_winner = "No. 1 Vita4One"
sql_create_context
CREATE TABLE table_203_688 ( id number, "category" text, "speed\n(km/h)" number, "speed\n(mph)" number, "vehicle" text, "pilot" text, "date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what category does the westland lynx 800 g l ynx fall...
SELECT "category" FROM table_203_688 WHERE "vehicle" = 'westland lynx 800 g-lynx'
squall
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2154" AND procedures.short_title = "Endosc destruc esoph les"
mimicsql_data
CREATE TABLE table_203_770 ( id number, "ages attained (years)" text, "catholic" text, "protestant and other christian" text, "other religion" text, "none or not stated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which age range had the top ...
SELECT "ages attained (years)" FROM table_203_770 ORDER BY "protestant and other christian" DESC LIMIT 1
squall
CREATE TABLE table_name_16 ( year_10_5th_quad VARCHAR, open_1st_viii VARCHAR, year_10_3rd_quad VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Year 10 5th Quads with NC as Open 1st VIII and NC as a Year 10 3rd Quads?
SELECT year_10_5th_quad FROM table_name_16 WHERE open_1st_viii = "nc" AND year_10_3rd_quad = "nc"
sql_create_context
CREATE TABLE table_name_32 ( score_points VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a total of 11, what is the score points?
SELECT score_points FROM table_name_32 WHERE total = "11"
sql_create_context
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 COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9550631' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-02-26' AND '2020-08-03' AND t_kc21.INSURED_STS = '未就业' AND t_kc21.MED_AMOUT >= 5252.43
css
CREATE TABLE table_26721 ( "Pitcher" text, "Strikeouts" real, "Season" real, "Team" text, "League" text, "Overall Rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most season for old hoss radbourn
SELECT MAX("Season") FROM table_26721 WHERE "Pitcher" = 'Old Hoss Radbourn'
wikisql
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 diagnoses.short_title = "Pyelonephritis NOS"
mimicsql_data
CREATE TABLE table_1949994_7 ( start_date VARCHAR, end_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the season that end in July ? start?
SELECT start_date FROM table_1949994_7 WHERE end_date = "July ?"
sql_create_context
CREATE TABLE table_name_75 ( venue VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the venue for score of 1-3
SELECT venue FROM table_name_75 WHERE score = "1-3"
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_gradu...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
advising
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.IN_DIAG_DIS_NM = '矽肺壹期' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.IN_DIAG_DIS...
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-70851')) AND STRFTIME('%y-%m', medication.drugstarttime) <...
eicu
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM ...
css
CREATE TABLE table_2025 ( "Discipline" text, "Degree/Diploma" text, "Total Seats" real, "Recognised Seats" real, "Permitted Seats" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of seats for general surgery
SELECT COUNT("Permitted Seats") FROM table_2025 WHERE "Discipline" = 'General Surgery'
wikisql
CREATE TABLE checking ( custid VARCHAR, balance INTEGER ) CREATE TABLE accounts ( name VARCHAR, custid VARCHAR ) CREATE TABLE savings ( custid VARCHAR, balance INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the names of accounts whose ...
SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT AVG(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM savings)
sql_create_context
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 time_interval ( period text, begin_time int, end_time int ) CREATE TABLE days ( d...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'PHILADELPHIA' AND ground_service.airport_code = airport.airport_code
atis
CREATE TABLE table_203_300 ( id number, "year" number, "tournament" text, "venue" text, "result" text, "extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when was the last time she won first place ?
SELECT MAX("year") FROM table_203_300 WHERE "result" = 1
squall
CREATE TABLE table_18895 ( "Title and Source" text, "Developer(s)/Publisher(s)" text, "JP -210-" text, "NA -350-" text, "PAL -295-" text, "Wii Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the na -350- with title and source being...
SELECT "NA -350-" FROM table_18895 WHERE "Title and Source" = 'Paper Wars: Cannon Fodder'
wikisql
CREATE TABLE table_38022 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Grid for Rubens Barrichello?
SELECT "Grid" FROM table_38022 WHERE "Driver" = 'rubens barrichello'
wikisql
CREATE TABLE table_66036 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the away team on 10 January 1979 who had a tie no of 17?
SELECT "Away team" FROM table_66036 WHERE "Date" = '10 january 1979' AND "Tie no" = '17'
wikisql
CREATE TABLE table_23731 ( "Date" text, "Presenter" text, "Guest 1" text, "Guest 2" text, "Guest 3" text, "Guest 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the guest 2 for colin murray 6 april
SELECT COUNT("Guest 2") FROM table_23731 WHERE "Presenter" = 'Colin Murray' AND "Date" = '6 April'
wikisql
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND lab.itemid = "51032"
mimicsql_data
CREATE TABLE table_35566 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent at the game with a loss of Weaver (1-2)?
SELECT "Opponent" FROM table_35566 WHERE "Loss" = 'weaver (1-2)'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE...
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 = 3369)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit...
mimic_iii
CREATE TABLE table_203_352 ( id number, "position" number, "swara" text, "short name" text, "notation" text, "mnemonic" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of positions listed ?
SELECT COUNT("position") FROM table_203_352
squall
CREATE TABLE table_name_2 ( municipality VARCHAR, population VARCHAR, county VARCHAR, area VARCHAR, area_km² VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which municipality's area is outer circle south and smaller than 368 km in Akershus County...
SELECT municipality FROM table_name_2 WHERE area = "outer circle south" AND area_km² < 368 AND county = "akershus" AND population > 14 OFFSET 398
sql_create_context
CREATE TABLE table_43301 ( "RANK" real, "PLAYER" text, "CLUB" text, "NATIONALITY" text, "POINTS" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club wast he player hristo stoitchkov from?
SELECT "CLUB" FROM table_43301 WHERE "PLAYER" = 'hristo stoitchkov'
wikisql
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANG...
atis
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid tex...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = '20.3 ml cup : acetaminophen 160 mg/5ml po soln' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-5 year'))
eicu
CREATE TABLE table_44966 ( "Pollutant" text, "Type" text, "Standard" text, "Averaging Time" text, "Regulatory Citation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the regulatory citation when the standard is 15 g/m ?
SELECT "Regulatory Citation" FROM table_44966 WHERE "Standard" = '15 μg/m³'
wikisql
CREATE TABLE membership_register_branch ( Member_ID int, Branch_ID text, Register_Year text ) CREATE TABLE branch ( Branch_ID int, Name text, Open_year text, Address_road text, City text, membership_amount text ) CREATE TABLE purchase ( Member_ID int, Branch_ID text, Ye...
SELECT Hometown, COUNT(Hometown) FROM member GROUP BY Hometown ORDER BY COUNT(Hometown)
nvbench
CREATE TABLE Customers ( email_address VARCHAR, date_of_birth VARCHAR, first_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List email address and birthday of customer whose first name as Carole.
SELECT email_address, date_of_birth FROM Customers WHERE first_name = "Carole"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admission_type = "NEWBORN"
mimicsql_data
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
SELECT Id AS "post_link", CreationDate FROM Posts WHERE PostTypeId = 1 AND Body LIKE '%newcommand%' ORDER BY CreationDate DESC
sede
CREATE TABLE table_13909 ( "Rank" real, "Airport" text, "City" text, "Code (IATA/ICAO)" text, "2009" real, "2010" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the value in 2010 for the airport coded OTP/LROP?
SELECT MAX("2010") FROM table_13909 WHERE "Code (IATA/ICAO)" = 'otp/lrop'
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "4" AND lab.label = "Free Calcium"
mimicsql_data
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TA...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN cou...
advising
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT CAST(TIME_TO_STR(Votes.CreationDate, '%Y%m%d') AS TEXT(30)) AS "date", SUM(CASE WHEN PostTypeId = 1 AND VoteTypeId = 1 THEN 2 WHEN PostTypeId = 1 AND VoteTypeId = 2 THEN 5 WHEN PostTypeId = 2 AND VoteTypeId = 1 THEN 15 WHEN PostTypeId = 2 AND VoteTypeId = 2 THEN 10 ELSE 0 END) AS "reputation_earned", SUM(CASE WH...
sede
CREATE TABLE table_27374004_4 ( outgoing_manager VARCHAR, manner_of_departure VARCHAR, position_in_table VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the outgoing manager of the team in 15th position that was sacked?
SELECT outgoing_manager FROM table_27374004_4 WHERE manner_of_departure = "Sacked" AND position_in_table = "15th"
sql_create_context