instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Arthrocentesis"
mimicsql_data
CREATE TABLE table_8712 ( "Event" text, "Record" text, "Nationality" text, "Date" text, "Meet" text, "Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the meet when the event is flying 200 m time trial?
SELECT "Meet" FROM table_8712 WHERE "Event" = 'flying 200 m time trial'
wikisql
CREATE TABLE table_28827 ( "Name" text, "Jewel" text, "Species" text, "Gender" text, "Jewel Power" text, "Attribute" text, "Birthday" text, "Media Debut" text, "Voice actor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the ...
SELECT "Jewel Power" FROM table_28827 WHERE "Media Debut" = 'EP 17'
wikisql
CREATE TABLE table_name_47 ( total INTEGER, name VARCHAR, scottish_cup VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Total has a Name of eoin jess category:articles with hcards, and a Scottish Cup larger than 23?
SELECT MIN(total) FROM table_name_47 WHERE name = "eoin jess category:articles with hcards" AND scottish_cup > 23
sql_create_context
CREATE TABLE table_204_23 ( id number, "#" number, "wrestlers" text, "reign" number, "date" text, "days held" number, "location" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many days did hardcore tv...
SELECT "days held" FROM table_204_23 WHERE "event" = 'hardcore tv #6'
squall
CREATE TABLE table_35325 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Score at the Auckland, New Zealand Tournament?
SELECT "Score" FROM table_35325 WHERE "Tournament" = 'auckland, new zealand'
wikisql
CREATE TABLE visits ( visit_id number, tourist_attraction_id number, tourist_id number, visit_date time, visit_details text ) CREATE TABLE royal_family ( royal_family_id number, royal_family_details text ) CREATE TABLE staff ( staff_id number, tourist_attraction_id number, name...
SELECT T1.market_details FROM street_markets AS T1 JOIN tourist_attractions AS T2 ON T1.market_id = T2.tourist_attraction_id WHERE T2.how_to_get_there = "walk" OR T2.how_to_get_there = "bus"
spider
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 WHERE demographic.ethnicity = "ASIAN" AND demographic.diagnosis = "MESENTERIC ISCHEMIA"
mimicsql_data
CREATE TABLE table_80262 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of the World Race Walking Cup tournament played before the year 2010?
SELECT "Result" FROM table_80262 WHERE "Year" > '2010' AND "Tournament" = 'world race walking cup'
wikisql
CREATE TABLE table_23369 ( "N\u00ba" real, "Ep" real, "Huckleberry Hound" text, "Pixie and Dixie" text, "Yogi Bear" text, "Air date" text, "Credited animators" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Pixie and Dixie skit i...
SELECT "Pixie and Dixie" FROM table_23369 WHERE "Ep" = '7'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '戚玉树' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_203_636 ( id number, "#" number, "date" text, "winner" text, "score" text, "location" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when was the first game played in houston , tx ?
SELECT "date" FROM table_203_636 WHERE "location" = 'houston, tx' ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_21948 ( "Parish (Prestegjeld)" text, "Sub-Parish (Sokn)" text, "Church Name" text, "Year Built" text, "Location of the Church" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the name of the church in Stavang?
SELECT "Church Name" FROM table_21948 WHERE "Location of the Church" = 'Stavang'
wikisql
CREATE TABLE table_dev_54 ( "id" int, "ogtt" int, "anemia" bool, "gender" string, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "hematocrit_hct" float, "body_mass_index_bmi" float, "igt" bool, "fasting_glucose" int, "age" float, "NOUSE" float ) -- Using valid S...
SELECT * FROM table_dev_54 WHERE igt = 1 OR (fasting_glucose > 100 OR fasting_glucose < 126) OR (ogtt > 140 AND ogtt < 200)
criteria2sql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
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 = '005-46456')) AND DATETIME(medication.drugstarttime, 'start of ...
eicu
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0295569' AND t_kc21.IN_HOSP_DATE BETWEEN '2001-01-07' AND '2013-04-27' AND t_kc21.INSU_TYPE = '儿童'
css
CREATE TABLE table_203_34 ( id number, "season" text, "appearance" number, "interchange" number, "tries" number, "goals" number, "f/g" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many total points were score ove...
SELECT SUM("points") FROM table_203_34
squall
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.SOC_SRT_DIRE_NM, t_kc22.AMOUNT, t_kc21.MED_CLINIC_ID FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '64708958100' OR t_kc21_t_kc22.MED_CLINIC_ID = '71656781055' AND t_kc2...
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.marital_status = "DIVORCED"
mimicsql_data
CREATE TABLE table_name_2 ( shot_pct INTEGER, blank_ends INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Shot Pct., when Blank Ends is greater than 6?
SELECT MIN(shot_pct) FROM table_name_2 WHERE blank_ends > 6
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jybgb.SQRGH, jybgb.SQRXM FROM jybgb WHERE jybgb.JZLSH = '98673315377' GROUP BY jybgb.SQRGH HAVING COUNT(*) > 19
css
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '3780652' AND IN_HOSP_DATE BETWEEN '2004-01-02' AND '2015-04-17' AND IN_DIAG_DIS_CD <> OUT_DIAG_DIS_CD
css
CREATE TABLE table_69510 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for record 33-47
SELECT "Score" FROM table_69510 WHERE "Record" = '33-47'
wikisql
CREATE TABLE table_30212 ( "Draw" real, "Artist" text, "Song (English translation)" text, "Lyrics (l) / Music (m)" text, "Juries" real, "Viewers" real, "Total" real, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many items a...
SELECT COUNT("Viewers") FROM table_30212 WHERE "Draw" = '2'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate ...
SELECT COUNT(*) / '##NumDays:int?7##' AS numberOfDailyFirstPostsLastWeek FROM (SELECT u.Id FROM Users AS u INNER JOIN (SELECT * FROM Posts WHERE CreationDate >= DATEADD(day, DATEDIFF(day, '##NumDays:int?7##' + 1, GETDATE()), 0) AND CreationDate < DATEADD(day, DATEDIFF(day, 1, GETDATE()), 0)) AS p ON p.OwnerUserId = u.I...
sede
CREATE TABLE table_name_56 ( date INTEGER, number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest date that has a serial number of Infec 107CDSX?
SELECT MAX(date) FROM table_name_56 WHERE number = "infec 107cdsx"
sql_create_context
CREATE TABLE table_61103 ( "Year" real, "Award" text, "Category" text, "Nominated Work" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year with a Drama Desk award when the Mineola Twins was a nominated work?
SELECT MIN("Year") FROM table_61103 WHERE "Award" = 'drama desk award' AND "Nominated Work" = 'the mineola twins'
wikisql
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, J...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i...
css
CREATE TABLE table_54353 ( "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. -- In what venue is Essendon the home team?
SELECT "Venue" FROM table_54353 WHERE "Home team" = 'essendon'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ...
SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54281)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'condom cath' A...
mimic_iii
CREATE TABLE table_name_48 ( party VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Kerry J. Donley's Party?
SELECT party FROM table_name_48 WHERE name = "kerry j. donley"
sql_create_context
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 u.DisplayName, b.Name, COUNT(*) AS awarded FROM Users AS u INNER JOIN Badges AS b ON u.Id = b.UserId WHERE b.Name = '##BadgeName:String##' GROUP BY u.DisplayName, b.Name ORDER BY Awarded DESC LIMIT 1000
sede
CREATE TABLE table_name_83 ( number_of_dances INTEGER, place VARCHAR, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of dances with a less than 2 place and an average smaller than 27.5?
SELECT MIN(number_of_dances) FROM table_name_83 WHERE place < 2 AND average < 27.5
sql_create_context
CREATE TABLE table_75885 ( "Type" text, "Name" text, "Title" text, "Royal house" text, "From" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Demetrios III begin to hold power?
SELECT "From" FROM table_75885 WHERE "Name" = 'demetrios iii'
wikisql
CREATE TABLE table_2784232_1 ( hebrew_form VARCHAR, arabic_form VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many hebrew forms are there for the arabic form yuktibu ?
SELECT COUNT(hebrew_form) FROM table_2784232_1 WHERE arabic_form = "yuktibu يكتب"
sql_create_context
CREATE TABLE table_71902 ( "No.1" text, "No.2" text, "No.3" text, "No.5" text, "No.6" text, "FINAL" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is no. 5 when Lena Claudisabel is no. 1 and Lena Sylvie is no. 2?
SELECT "No.5" FROM table_71902 WHERE "No.1" = 'lena claudisabel' AND "No.2" = 'lena sylvie'
wikisql
CREATE TABLE table_10812293_3 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game on November 12?
SELECT score FROM table_10812293_3 WHERE date = "November 12"
sql_create_context
CREATE TABLE table_45071 ( "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 was the Tie Number of the Bradford City away team?
SELECT "Tie no" FROM table_45071 WHERE "Away team" = 'bradford city'
wikisql
CREATE TABLE table_2651755_2 ( cons VARCHAR, together_we_can_do_more VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- where together we can do more is gloria mujica ( ph ) what are all the cons.
SELECT cons FROM table_2651755_2 WHERE together_we_can_do_more = "Gloria Mujica ( PH )"
sql_create_context
CREATE TABLE table_name_91 ( date VARCHAR, race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the swiss grand prix?
SELECT date FROM table_name_91 WHERE race = "swiss grand prix"
sql_create_context
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND prescriptions.drug = "Phenylephrine"
mimicsql_data
CREATE TABLE table_72875 ( "Fin. Pos" real, "Car No." real, "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Laps Led" real, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the grid for the ...
SELECT "Grid" FROM table_72875 WHERE "Points" = '14'
wikisql
CREATE TABLE table_69638 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In Los Banos, California, when the ERP W is than 10, what is the ave...
SELECT AVG("Frequency MHz") FROM table_69638 WHERE "City of license" = 'los banos, california' AND "ERP W" < '10'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phosphate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70516) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-3 year')
mimic_iii
CREATE TABLE table_12983929_1 ( construction_start VARCHAR, net_power VARCHAR, unit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the construction of the unit Chinon B1 with net power of 905 MW start?
SELECT construction_start FROM table_12983929_1 WHERE net_power = "905 MW" AND unit = "Chinon B1"
sql_create_context
CREATE TABLE table_78002 ( "Bowl" text, "Score" text, "Season" real, "Opponent" text, "Stadium" text, "Location" text, "Attendance" text, "Head coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What stadium had an opponent of Cal Sta...
SELECT "Stadium" FROM table_78002 WHERE "Opponent" = 'cal state fullerton titans'
wikisql
CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Dat...
SELECT Document_Name, COUNT(Document_Name) FROM Documents GROUP BY Document_Name ORDER BY Document_Name DESC
nvbench
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) 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, ...
SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/57'
atis
CREATE TABLE table_name_29 ( score VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score when the home team is queens park rangers?
SELECT score FROM table_name_29 WHERE home_team = "queens park rangers"
sql_create_context
CREATE TABLE table_name_15 ( opponents_in_the_final VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the opponents in the final at Noida?
SELECT opponents_in_the_final FROM table_name_15 WHERE tournament = "noida"
sql_create_context
CREATE TABLE table_train_22 ( "id" int, "pre_treatment_with_hydroxyethyl_starch" int, "requiring_dialysis" bool, "intracerebral_hemorrhage" bool, "serum_creatinine" float, "kidney_disease" bool, "allergy_to_hydroxyethyl_starch" bool, "age" float, "NOUSE" float ) -- Using valid SQLi...
SELECT * FROM table_train_22 WHERE age < 18
criteria2sql
CREATE TABLE table_name_3 ( team_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 1st leg has a Team 1 of drita?
SELECT 1 AS st_leg FROM table_name_3 WHERE team_1 = "drita"
sql_create_context
CREATE TABLE table_17839_1 ( avg_trips_per_mile__ VARCHAR, map_colour VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When turquoise is the map colour how many avg. trips per mile ( 1000) are there?
SELECT COUNT(avg_trips_per_mile__) AS ×1000_ FROM table_17839_1 WHERE map_colour = "Turquoise"
sql_create_context
CREATE TABLE table_48948 ( "Heat" real, "Lane" real, "Name" text, "Country" text, "Mark" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a Mark of 46.47, What is the lowest Heat?
SELECT MIN("Heat") FROM table_48948 WHERE "Mark" = '46.47'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE out...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 65401 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
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 DATE(p.CreationDate) AS date, COUNT(DISTINCT p.OwnerUserId) AS users, SUM(1) AS total, SUM(CASE WHEN COALESCE(p.AcceptedAnswerId, 0) = 0 THEN 1 ELSE 0 END) AS unanswered, SUM(CASE WHEN COALESCE(p.AcceptedAnswerId, 0) = 0 THEN 0 ELSE 1 END) AS answered FROM Posts AS p GROUP BY DATE(p.CreationDate) ORDER BY DATE(p...
sede
CREATE TABLE table_43610 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the pyramid location?
SELECT "Date" FROM table_43610 WHERE "Location" = 'the pyramid'
wikisql
CREATE TABLE player ( player_id number, name text, position text, club_id number, apps number, tries number, goals text, points number ) CREATE TABLE competition_result ( competition_id number, club_id_1 number, club_id_2 number, score text ) CREATE TABLE club_rank ( ...
SELECT COUNT(DISTINCT position) FROM player
spider
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, C...
SELECT CreationDate, Id AS "post_link" FROM Posts WHERE (PostTypeId = 2) AND (OwnerUserId = '##UserId##') ORDER BY CreationDate DESC
sede
CREATE TABLE table_43196 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Distance (Miles)" text, "Time" text, "Purse" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Trainer had Jockey William Jenkins in a...
SELECT "Trainer" FROM table_43196 WHERE "Time" = '1:44.80' AND "Jockey" = 'william jenkins'
wikisql
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_20...
SELECT T4.Name, COUNT(T4.Name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID JOIN event AS t3 ON t2.Event_ID = t3.ID JOIN stadium AS t4 ON t4.ID = t3.Stadium_ID WHERE t1.Nationality = 'Australia' GROUP BY T4.Name ORDER BY T4.Name DESC
nvbench
CREATE TABLE table_15204 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record at the game that had a loss of Brandon (4 8)?
SELECT "Record" FROM table_15204 WHERE "Loss" = 'brandon (4–8)'
wikisql
CREATE TABLE table_4578 ( "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. -- Which home team score occurred at Victoria Park?
SELECT "Home team score" FROM table_4578 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, product_category_code VARCHAR(20), date_product_first_available DATETIME, date_product_discontinued DATETIME, product_name VARCHAR(80), product_description VARCHAR(255), product_price DECIMAL(19,4) ) CREATE TABLE Cus...
SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name
nvbench
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 hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD...
css
CREATE TABLE table_name_5 ( place VARCHAR, rope VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Milena Reljin's place with a smaller than 9.8 rope?
SELECT place FROM table_name_5 WHERE rope < 9.8 AND name = "milena reljin"
sql_create_context
CREATE TABLE table_name_3 ( year VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year was the score 204 (-6)?
SELECT year FROM table_name_3 WHERE score = "204 (-6)"
sql_create_context
CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE t...
SELECT Name, Total_Passengers FROM station WHERE Location <> 'London' ORDER BY Total_Passengers
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-9534')) AND STRFTIME('%y-%m', allergy.allergytime) <= '2102-08'
eicu
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 t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'administration of electrolytes - magnesi...
eicu
CREATE TABLE Invoice_Items ( Invoice_Item_ID INTEGER, Invoice_ID INTEGER, Order_ID INTEGER, Order_Item_ID INTEGER, Product_ID INTEGER, Order_Quantity INTEGER, Other_Item_Details VARCHAR(255) ) CREATE TABLE Invoices ( Invoice_ID INTEGER, Order_ID INTEGER, payment_method_code CHAR...
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code
nvbench
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb 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 = jybgb_jyjgzbb.YLJGDM ...
css
CREATE TABLE table_54423 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The driver Jacky Ickx had what time/retired?
SELECT "Time/Retired" FROM table_54423 WHERE "Driver" = 'jacky ickx'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, ...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83062 AND admissions.dischtime IS NULL) ORDER BY microbiologyevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_71 ( area_km_2 VARCHAR, population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Area of the Parish with a Population of 71?
SELECT area_km_2 FROM table_name_71 WHERE population = 71
sql_create_context
CREATE TABLE table_name_69 ( overall INTEGER, name VARCHAR, pick VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Overall, when Pick is greater than 5, when Round is less than 11, and when Name is 'Tom Barrington'?
SELECT SUM(overall) FROM table_name_69 WHERE pick > 5 AND round < 11 AND name = "tom barrington"
sql_create_context
CREATE TABLE table_name_72 ( rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2010 with a rank higher than 15 and a 2011 maserati?
SELECT 2010 FROM table_name_72 WHERE rank > 15 AND 2011 = "maserati"
sql_create_context
CREATE TABLE table_38477 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text, "Class AAAAA" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the class AAAAA of the school year 1993-94 with a class AAA...
SELECT "Class AAAAA" FROM table_38477 WHERE "Class AAA" = 'mont belvieu barbers hill' AND "School Year" = '1993-94'
wikisql
CREATE TABLE table_9833 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the event name when the method is submission (brabo choke)?
SELECT "Event" FROM table_9833 WHERE "Method" = 'submission (brabo choke)'
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 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 = '22945235' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2001-12-09')
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2154" AND prescriptions.drug = "SW"
mimicsql_data
CREATE TABLE table_57432 ( "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 team played Geelong at their away game?
SELECT "Home team" FROM table_57432 WHERE "Away team" = 'geelong'
wikisql
CREATE TABLE table_name_97 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for 2010 when 2007 is a and 2004 is 2r?
SELECT 2010 FROM table_name_97 WHERE 2007 = "a" AND 2004 = "2r"
sql_create_context
CREATE TABLE table_73005 ( "No. overall" real, "No. in series" real, "Title" text, "Director" text, "Writer" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 1 is the number in series who ...
SELECT "Director" FROM table_73005 WHERE "No. in series" = '1'
wikisql
CREATE TABLE table_42977 ( "U.S. mission" text, "Mass (kg)" real, "Booster" text, "Launched" text, "Mission goal" text, "Landing zone" text, "Lat / Lon" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest mass for Tycho Crater...
SELECT MAX("Mass (kg)") FROM table_42977 WHERE "Landing zone" = 'tycho crater'
wikisql
CREATE TABLE table_17462 ( "Pick #" real, "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 nationality is pick # 89
SELECT "Nationality" FROM table_17462 WHERE "Pick #" = '89'
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 jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjl...
css
CREATE TABLE table_46223 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who does p draig harrington play for?
SELECT "Country" FROM table_46223 WHERE "Player" = 'pádraig harrington'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_32705 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is his record at ufc 115?
SELECT "Record" FROM table_32705 WHERE "Event" = 'ufc 115'
wikisql
CREATE TABLE table_name_20 ( country VARCHAR, format VARCHAR, catalog VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has an LP format, catalog s 31503?
SELECT country FROM table_name_20 WHERE format = "lp" AND catalog = "s 31503"
sql_create_context
CREATE TABLE table_77902 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the top lap that had a tyre time?
SELECT MAX("Laps") FROM table_77902 WHERE "Time/Retired" = 'tyre'
wikisql
CREATE TABLE table_name_23 ( chief_judge VARCHAR, active_service VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Chief Judge has Active service of 1873 1875?
SELECT chief_judge FROM table_name_23 WHERE active_service = "1873–1875"
sql_create_context
CREATE TABLE table_15045 ( "Country" text, "Film title used in nomination" text, "Language" text, "Original title" text, "Director" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the film title used in nomination for the film from South Kore...
SELECT "Film title used in nomination" FROM table_15045 WHERE "Country" = 'south korea'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '施方方' AND MED_SER_ORG_NO = '4248222' AND OUT_DIAG_DOC_NM LIKE '陈%'
css
CREATE TABLE table_204_23 ( id number, "#" number, "wrestlers" text, "reign" number, "date" text, "days held" number, "location" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times , from june 23...
SELECT COUNT(*) FROM table_204_23 WHERE "wrestlers" = 'the suicide blondes'
squall
CREATE TABLE table_203_123 ( id number, "year" number, "title" text, "b-side" text, "mediums" text, "label (catalog)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the first single released for the epic label ?
SELECT "title" FROM table_203_123 WHERE "label (catalog)" = 'epic' ORDER BY id LIMIT 1
squall
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '孔雅静' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2011-01-25' UNI...
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperlipidemia' AND STRFTIME('%y', diagnosis...
eicu
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2238)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label ...
mimic_iii