instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_30 ( model VARCHAR, total_production VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the model for total production of 1347
SELECT model FROM table_name_30 WHERE total_production = 1347
sql_create_context
CREATE TABLE table_204_887 ( id number, "district" number, "representative" text, "party" text, "residence" text, "counties represented" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- gerald geis represents how many counties in total ?
SELECT "counties represented" FROM table_204_887 WHERE "representative" = 'gerald geis'
squall
CREATE TABLE table_32590 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Kickoff Time" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day did they play on week 4?
SELECT "Date" FROM table_32590 WHERE "Week" = '4'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "20" AND demographic.days_stay > "20"
mimicsql_data
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_zone ( time_zone_cod...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'ATLANTA' AND ground_service.city_code = city.city_code
atis
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.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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.JZL...
css
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "34982"
mimicsql_data
CREATE TABLE table_name_58 ( rank INTEGER, silver VARCHAR, gold VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank when there is 0 gold, the total is more than 1, and silver is more than 0?
SELECT MAX(rank) FROM table_name_58 WHERE gold = 0 AND total > 1 AND silver > 0
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
SELECT * FROM Comments WHERE Score IN (SELECT Score FROM Comments ORDER BY Score DESC LIMIT 1000) ORDER BY Score DESC
sede
CREATE TABLE table_name_79 ( week VARCHAR, venue VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of weeks with a game at the Milwaukee County Stadium attended by 47,897?
SELECT COUNT(week) FROM table_name_79 WHERE venue = "milwaukee county stadium" AND attendance = 47 OFFSET 897
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 transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 82159 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'ezetimibe' ORDER BY prescriptions.startdate DESC LI...
mimic_iii
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure - due to inability to clear secretions') AS t1) - (SELECT COUNT(DISTINCT t...
eicu
CREATE TABLE table_name_49 ( qual_1 VARCHAR, best VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the qual 1 for the best of 1:18.067?
SELECT qual_1 FROM table_name_49 WHERE best = "1:18.067"
sql_create_context
CREATE TABLE table_1533 ( "Urban area (locality)" text, "Municipality" text, "Population" real, "Land area (hectares)" text, "Density (inh./km\u00b2)" text, "Code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many codes have a population o...
SELECT COUNT("Code") FROM table_1533 WHERE "Municipality" = 'Vellinge Municipality' AND "Population" = '598'
wikisql
CREATE TABLE table_25424 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the successor for massachusetts 8th?
SELECT "Successor" FROM table_25424 WHERE "District" = 'Massachusetts 8th'
wikisql
CREATE TABLE table_73421 ( "Year" real, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT "Date" FROM table_73421 WHERE "Year" = '1968'
wikisql
CREATE TABLE weather ( date text, max_temperature_f number, mean_temperature_f number, min_temperature_f number, max_dew_point_f number, mean_dew_point_f number, min_dew_point_f number, max_humidity number, mean_humidity number, min_humidity number, max_sea_level_pressure_inc...
SELECT COUNT(*) FROM station WHERE city = "Mountain View"
spider
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT p.Id, p.Title, p.Score FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'econometrics' AND p.AnswerCount = 0 AND p.PostTypeId = 1 ORDER BY -p.Score
sede
CREATE TABLE table_name_42 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played Fitzroy at their own home?
SELECT home_team AS score FROM table_name_42 WHERE away_team = "fitzroy"
sql_create_context
CREATE TABLE table_203_336 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "attendance" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many games did...
SELECT COUNT(*) FROM table_203_336 WHERE "date" = 7
squall
CREATE TABLE table_204_853 ( id number, "pos" number, "grid" number, "no." number, "driver" text, "team" text, "manufacturer" text, "laps" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which driver placed highest ...
SELECT "driver" FROM table_204_853 WHERE "team" = 'roush racing' ORDER BY "pos" LIMIT 1
squall
CREATE TABLE table_7945 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country, when Player is 'Jimmy Demaret'?
SELECT "Country" FROM table_7945 WHERE "Player" = 'jimmy demaret'
wikisql
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, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND 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 WHERE person_info.XM = '曹诗蕾' AND jybg...
css
CREATE TABLE table_11522 ( "Team" text, "Home city" text, "Stadium" text, "Capacity" real, "2011-12 season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home city when the crowd is under 18060, and in the 2011/2012 season they were pri...
SELECT "Home city" FROM table_11522 WHERE "Capacity" < '18060' AND "2011-12 season" = 'prima divisione/a play-off winners'
wikisql
CREATE TABLE table_name_81 ( poles INTEGER, year VARCHAR, starts VARCHAR, winnings VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of poles of the year before 1992 with more than 18 starts and winnings of $125,102?
SELECT MAX(poles) FROM table_name_81 WHERE starts > 18 AND winnings = "$125,102" AND year < 1992
sql_create_context
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT demographic.age, demographic.diagnosis FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2115" AND lab.label = "Glucose, Body Fluid"
mimicsql_data
CREATE TABLE train ( TIME VARCHAR, train_number VARCHAR, destination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give me the times and numbers of all trains that go to Chennai, ordered by time.
SELECT TIME, train_number FROM train WHERE destination = 'Chennai' ORDER BY TIME
sql_create_context
CREATE TABLE table_71798 ( "Manager" text, "Years" text, "Games" real, "Wins" real, "Losses" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average of wins with manager George Scherger smaller than 3 and losses smaller than 1?
SELECT AVG("Wins") FROM table_71798 WHERE "Games" < '3' AND "Manager" = 'george scherger' AND "Losses" < '1'
wikisql
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZ...
css
CREATE TABLE table_62840 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament had an A in 2012 and Q2 in 2010?
SELECT "Tournament" FROM table_62840 WHERE "2012" = 'a' AND "2010" = 'q2'
wikisql
CREATE TABLE Departments ( department_id INTEGER, dept_store_id INTEGER, department_name VARCHAR(80) ) CREATE TABLE Product_Suppliers ( product_id INTEGER, supplier_id INTEGER, date_supplied_from DATETIME, date_supplied_to DATETIME, total_amount_purchased VARCHAR(80), total_value_pu...
SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code
nvbench
CREATE TABLE table_18520 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the election in the Texas 3 district?
SELECT "Result" FROM table_18520 WHERE "District" = 'Texas 3'
wikisql
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "UPPER GI BLEED" AND demographic.age < "51"
mimicsql_data
CREATE TABLE qtb ( 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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE < 9 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE < 9 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE < 9 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PERSON_AG...
css
CREATE TABLE table_name_23 ( partner VARCHAR, edition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was partner for the 1988 world group i edition?
SELECT partner FROM table_name_23 WHERE edition = "1988 world group i"
sql_create_context
CREATE TABLE table_name_5 ( year_s__retired VARCHAR, quantity_made VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the year retired of the locomotive which had the quantity made of 25?
SELECT year_s__retired FROM table_name_5 WHERE quantity_made = "25"
sql_create_context
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id ...
SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'MEMS' AND cou...
advising
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_22770 ( "Year" real, "World" real, "Asia" text, "Africa" text, "Europe" text, "Latin America/Caribbean" text, "Northern America" text, "Oceania" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what will be the populatio...
SELECT "Africa" FROM table_22770 WHERE "Oceania" = '67 (0.6%)'
wikisql
CREATE TABLE table_60694 ( "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 date was the game when away team northampton town played?
SELECT "Date" FROM table_60694 WHERE "Away team" = 'northampton town'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT AVG(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-58018')) AND NOT vitalperiodic.sao2 IS NULL AND STRFT...
eicu
CREATE TABLE table_41132 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Format with a Label of electropolis and a Date that is 2002?
SELECT "Format" FROM table_41132 WHERE "Label" = 'electropolis' AND "Date" = '2002'
wikisql
CREATE TABLE table_28205 ( "Celebrity" text, "Known for" text, "Age" real, "Professional" text, "Series" real, "Place" text, "Dances" real, "Highest score" real, "Lowest score" real, "Aggregate" real, "Average" text ) -- Using valid SQLite, answer the following questions fo...
SELECT "Place" FROM table_28205 WHERE "Aggregate" = '35'
wikisql
CREATE TABLE status ( station_id VARCHAR ) CREATE TABLE station ( name VARCHAR, id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are names of stations that have average bike availability above 10 and are not located in San Jose city?
SELECT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING AVG(bikes_available) > 10 EXCEPT SELECT name FROM station WHERE city = "San Jose"
sql_create_context
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 lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-2001')) AND lab.labname = 'rdw' AND DATETIME(lab.labresulttime, 'start of year'...
eicu
CREATE TABLE table_name_72 ( europe VARCHAR, japan VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me europe for japan of january 28, 2010
SELECT europe FROM table_name_72 WHERE japan = "january 28, 2010"
sql_create_context
CREATE TABLE table_75168 ( "Volume:Issue" text, "Issue Date(s)" text, "Weeks on Top" real, "Song" text, "Artist" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Issue Date(s) has Weeks on Top larger than 3, and a Volume: Issue of 35:25-26, 36:1...
SELECT "Issue Date(s)" FROM table_75168 WHERE "Weeks on Top" > '3' AND "Volume:Issue" = '35:25-26, 36:1-2'
wikisql
CREATE TABLE table_203_794 ( id number, "year" number, "location" text, "attendance" number, "theme phrase" text, "top messages" text, "host" text, "opening general session guest(s)" text, "closing general session guest(s)" text, "sunday night reception" text, "wednesday nigh...
SELECT "theme phrase" FROM table_203_794 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_57311 ( "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. -- What is the average crowd size for corio oval?
SELECT AVG("Crowd") FROM table_57311 WHERE "Venue" = 'corio oval'
wikisql
CREATE TABLE table_name_68 ( min_press___mbar__ VARCHAR, deaths VARCHAR, storm_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Min press has none Death and seven Storm names?
SELECT min_press___mbar__ FROM table_name_68 WHERE deaths = "none" AND storm_name = "seven"
sql_create_context
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Pleas...
SELECT director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY director
nvbench
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2137-06-30 06:04:00"
mimicsql_data
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Mesothelial cells"
mimicsql_data
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Diverticulosis of colon with hemorrhage" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_4 ( city_of_license VARCHAR, channels_tv___rf VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which City of license has a Channels TV / RF of 67 ( psip ) 29 ( uhf )
SELECT city_of_license FROM table_name_4 WHERE channels_tv___rf = "67 ( psip ) 29 ( uhf )"
sql_create_context
CREATE TABLE table_name_3 ( interview_subject VARCHAR, centerfold_model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Interview Subject when the Centerfold Model was Melissa Deanne Holliday?
SELECT interview_subject FROM table_name_3 WHERE centerfold_model = "melissa deanne holliday"
sql_create_context
CREATE TABLE constructors ( constructorid number, constructorref text, name text, nationality text, url text ) CREATE TABLE circuits ( circuitid number, circuitref text, name text, location text, country text, lat number, lng number, alt number, url text ) CREAT...
SELECT COUNT(*), nationality FROM constructors GROUP BY nationality
spider
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TAB...
SELECT * FROM Posts WHERE AcceptedAnswerId IS NULL LIMIT 10
sede
CREATE TABLE table_16490 ( "Rank" real, "English title" text, "Chinese title" text, "Average" real, "Peak" real, "Premiere" real, "Finale" real, "HK viewers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What amount is the number of hk ...
SELECT "HK viewers" FROM table_16490 WHERE "Chinese title" = '十兄弟'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT DISTINCT C.PostId AS "post_link", C.CreationDate, C.Score, V.Id FROM Comments AS C, Posts AS P, Votes AS V, VoteTypes AS Vt WHERE C.UserId = '##userid##' AND V.VoteTypeId = 6 AND Text LIKE '%duplicate%' AND P.Id = C.PostId AND P.Id = V.PostId AND Vt.Id = V.VoteTypeId
sede
CREATE TABLE table_44100 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a Place of t1?
SELECT "Country" FROM table_44100 WHERE "Place" = 't1'
wikisql
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 SUM(t_kc22.AMOUNT) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '7879862' AND t_kc22.STA_DATE BETWEEN '2002-01-25' AND '2019-07-08' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT SUM(t_kc22.AMOUNT) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID ...
css
CREATE TABLE table_6334 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions fo...
SELECT "Club" FROM table_6334 WHERE "Points" = '56'
wikisql
CREATE TABLE table_name_69 ( rank VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2nd run has a less than 6 rank, and 3 as the total?
SELECT 2 AS nd_run FROM table_name_69 WHERE rank < 6 AND total = 3
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '31659348' AND t_kc21.MED_SER_ORG_NO = '6659356') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1
css
CREATE TABLE table_27733909_9 ( location_attendance VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location and attendance of game 70?
SELECT location_attendance FROM table_27733909_9 WHERE game = 70
sql_create_context
CREATE TABLE table_203_88 ( id number, "language" text, "number" number, "percentage (%)" number, "males" number, "females" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which language had the least female speakers ?
SELECT "language" FROM table_203_88 ORDER BY "females" LIMIT 1
squall
CREATE TABLE table_62143 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT COUNT("Wins") FROM table_62143 WHERE "Goal Difference" < '21' AND "Draws" = '4' AND "Losses" < '21'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-53628')) AND DATETIME(treatment.treatmenttime, 'start of year...
eicu
CREATE TABLE Payments ( Payment_Method_Code VARCHAR, Date_Payment_Made VARCHAR, Amount_Payment VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the method, date and amount of all the payments, in ascending order of date.
SELECT Payment_Method_Code, Date_Payment_Made, Amount_Payment FROM Payments ORDER BY Date_Payment_Made
sql_create_context
CREATE TABLE Companies ( id int, name text, Headquarters text, Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value_billion text ) CREATE TABLE Office_locations ( building_id int, company_id int, move_in_year int ) CREATE TABLE building...
SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry ORDER BY Industry DESC
nvbench
CREATE TABLE table_22123 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" real, "Viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which title, directed by D...
SELECT "Title" FROM table_22123 WHERE "Viewers (millions)" = '3.7' AND "Directed by" = 'David Kendall'
wikisql
CREATE TABLE table_37086 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent was present on April 14?
SELECT "Opponent" FROM table_37086 WHERE "Date" = 'april 14'
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 qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '4932501' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT) UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.OUT_DIAG_DIS_...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Abn react-surg proc NEC"
mimicsql_data
CREATE TABLE table_name_6 ( record VARCHAR, leading_scorer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record when the leading scorer is Antawn Jamison (14)?
SELECT record FROM table_name_6 WHERE leading_scorer = "antawn jamison (14)"
sql_create_context
CREATE TABLE table_name_87 ( points INTEGER, language VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the lowest points when the language is Portuguese?
SELECT MIN(points) FROM table_name_87 WHERE language = "portuguese"
sql_create_context
CREATE TABLE table_204_571 ( id number, "athlete" text, "event" text, "race 1\ntime" text, "race 2\ntime" text, "total\ntime" text, "total\nrank" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long did haraldsson take in race 1 of the ...
SELECT "race 1\ntime" FROM table_204_571 WHERE "athlete" = 'johann haraldsson' AND "event" = 'slalom'
squall
CREATE TABLE table_name_52 ( opponent VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent at the game with a result of l 27 3?
SELECT opponent FROM table_name_52 WHERE result = "l 27–3"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
SELECT * 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 = '23984748' AND hz_info.YLJGDM = '0159261' AND mzjzjlb.JZZDSM LIKE '%白内障%'
css
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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), ...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_51141 ( "2004/ 05" text, "2007/ 08" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2004/ 05 when the 2011/ 12 is non-ranking?
SELECT "2004/ 05" FROM table_51141 WHERE "2011/ 12" = 'non-ranking'
wikisql
CREATE TABLE table_69444 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which sum of week that had an attendance larger than 55,767 on September 28, 1986?
SELECT SUM("Week") FROM table_69444 WHERE "Attendance" > '55,767' AND "Date" = 'september 28, 1986'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
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.icd9_code = "431"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-155345')) AND diagnosis.diagnosisname = 'bladder ca'
eicu
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Initial insertion of dual-chamber device"
mimicsql_data
CREATE TABLE table_15086 ( "category" text, "1999" text, "2000" text, "2001" text, "2004" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which car won the 1.4litre to 1.8litre award in 2001?
SELECT "2001" FROM table_15086 WHERE "category" = '1.4litre to 1.8litre'
wikisql
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Chronic kidney disease, Stage III (moderate)" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_17001658_7 ( high_rebounds VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who got the game high rebounds in game 46?
SELECT high_rebounds FROM table_17001658_7 WHERE game = 46
sql_create_context
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT demographic.admission_location FROM demographic WHERE demographic.subject_id = "9575"
mimicsql_data
CREATE TABLE table_name_1 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What record has march 30 as the date?
SELECT record FROM table_name_1 WHERE date = "march 30"
sql_create_context
CREATE TABLE table_name_96 ( founded VARCHAR, suburb VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did the Nerang Suburb get founded?
SELECT COUNT(founded) FROM table_name_96 WHERE suburb = "nerang"
sql_create_context
CREATE TABLE table_74933 ( "Circuit" text, "Date" text, "Pole position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Winning manufacturer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fastest lap of th...
SELECT "Fastest Lap" FROM table_74933 WHERE "Winning team" = 'audi sport team abt' AND "Circuit" = 'oschersleben'
wikisql
CREATE TABLE table_60224 ( "Crude oil name \\Rightarrow Location \\Rightarrow" text, "Barrow Island Australia" real, "Mutineer-Exeter Australia" real, "CPC Blend Kazakhstan" real, "Draugen North Sea" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT MAX("CPC Blend Kazakhstan") FROM table_60224 WHERE "Barrow Island Australia" < '12'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id numbe...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 3
mimic_iii
CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number ) CREATE TABLE products ( code number, name text, price number, manufacturer number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Select...
SELECT AVG(price), manufacturer FROM products GROUP BY manufacturer
spider
CREATE TABLE table_48087 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round has an Opponent of ryan bixler?
SELECT "Round" FROM table_48087 WHERE "Opponent" = 'ryan bixler'
wikisql
CREATE TABLE table_38992 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has a total of the Bronze less than 4, gold more than 0, and no silver?
SELECT SUM("Bronze") FROM table_38992 WHERE "Total" < '4' AND "Gold" > '0' AND "Silver" = '0'
wikisql
CREATE TABLE table_27756474_6 ( game INTEGER, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most game for us airways center 16,470
SELECT MIN(game) FROM table_27756474_6 WHERE location_attendance = "US Airways Center 16,470"
sql_create_context