instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_22 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was North Melbourne's score when they were the home team?
SELECT home_team AS score FROM table_name_22 WHERE home_team = "north melbourne"
sql_create_context
CREATE TABLE table_name_26 ( athlete VARCHAR, semifinal VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the light heavyweight 81 kg event that did not advance to semifinal, who was the athlete?
SELECT athlete FROM table_name_26 WHERE semifinal = "did not advance" AND event = "light heavyweight –81 kg"
sql_create_context
CREATE TABLE table_name_47 ( track VARCHAR, race_winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the track for scott lagasse jr.
SELECT track FROM table_name_47 WHERE race_winner = "scott lagasse jr."
sql_create_context
CREATE TABLE table_name_64 ( winning_score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the winning match on Oct 28, 1962?
SELECT winning_score FROM table_name_64 WHERE date = "oct 28, 1962"
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 zyjzjlb.ZYBMLX, zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '10564497940'
css
CREATE TABLE table_22753439_1 ( winner VARCHAR, runner_up_a VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many winners have a runner-up of A. Karthikeyan?
SELECT COUNT(winner) FROM table_22753439_1 WHERE runner_up_a = "A. Karthikeyan"
sql_create_context
CREATE TABLE table_name_34 ( driver_s_ VARCHAR, crew_chief VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the driver for crew chief Nick Carlson?
SELECT driver_s_ FROM table_name_34 WHERE crew_chief = "nick carlson"
sql_create_context
CREATE TABLE table_name_22 ( venue VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the venue in Seattle?
SELECT venue FROM table_name_22 WHERE city = "seattle"
sql_create_context
CREATE TABLE table_49675 ( "Year" real, "Stage" real, "Start of stage" text, "Distance (km)" text, "Category" text, "Stage winner" text, "Yellow jersey" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner in 2013?
SELECT "Stage winner" FROM table_49675 WHERE "Year" = '2013'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, ...
SELECT Id AS "user_link", Location, DisplayName, Age, WebsiteUrl, AboutMe, Reputation FROM Users WHERE Location LIKE '%##location##%'
sede
CREATE TABLE bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb...
css
CREATE TABLE table_53789 ( "Round" real, "Overall" real, "Player" text, "Position" text, "Nationality" text, "Club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team scores 119 in round 4?
SELECT "Club team" FROM table_53789 WHERE "Round" = '4' AND "Overall" = '119'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, ...
SELECT (SELECT 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 = 25754 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND ch...
mimic_iii
CREATE TABLE table_78088 ( "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. -- How big was the crowd of the team that scored 4....
SELECT SUM("Crowd") FROM table_78088 WHERE "Away team score" = '4.13 (37)'
wikisql
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, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE cost ( row_id number, subject_id n...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hyaline casts') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828) AND STRFTIME('%y-%m', labevents.charttime) = '2105-12'
mimic_iii
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTa...
SELECT TIME_TO_STR(CreationDate, '%j'), CAST(SUM(CASE WHEN AnswerCount > 0 THEN 1 ELSE 0 END) AS FLOAT) / COUNT(Posts.Id) AS Ratio FROM Posts WHERE (PostTypeId = 1 AND CreationDate < '##Date##') GROUP BY TIME_TO_STR(CreationDate, '%j') ORDER BY TIME_TO_STR(CreationDate, '%j')
sede
CREATE TABLE table_1342393_16 ( incumbent VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the incumbent for kentucky 9
SELECT incumbent FROM table_1342393_16 WHERE district = "Kentucky 9"
sql_create_context
CREATE TABLE table_8764 ( "Callsign" text, "Frequency" text, "Band" text, "On-air ID" text, "Purpose" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 4zr's callsign?
SELECT "Callsign" FROM table_8764 WHERE "On-air ID" = '4zr'
wikisql
CREATE TABLE settlements ( settlement_id number, claim_id number, effective_date time, settlement_amount number ) CREATE TABLE customers_policies ( customer_id number, policy_id number, date_opened time, date_closed time ) CREATE TABLE services ( service_id number, service_name...
SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = "Dayana Robel"
spider
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 jyjgzbb.JCXMMC, jyjgzbb.JCZBDM, jyjgzbb.JCZBMC, jyjgzbb.JCFF FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '79035647042'
css
CREATE TABLE table_name_59 ( d_42_√ VARCHAR, d_44_√ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the D 42 when D 44 is majority ?
SELECT d_42_√ FROM table_name_59 WHERE d_44_√ = "majority→"
sql_create_context
CREATE TABLE table_30803 ( "Year" text, "Position" real, "Games played" real, "Won" real, "Tied" real, "Lost" real, "Goals Scored" real, "Goals Against" real, "Points" real, "Postseason place" text ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT COUNT("Goals Scored") FROM table_30803 WHERE "Year" = 'Verano 2001'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')...
eicu
CREATE TABLE table_name_66 ( baby_gender VARCHAR, congresswoman VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the gender of Congresswoman Jaime Herrera Beutler's baby?
SELECT baby_gender FROM table_name_66 WHERE congresswoman = "jaime herrera beutler"
sql_create_context
CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year ...
SELECT Open_Date, COUNT(Open_Date) FROM church ORDER BY Open_Date
nvbench
CREATE TABLE table_43783 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT AVG("Lost") FROM table_43783 WHERE "Goals Against" > '57' AND "Position" < '17' AND "Drawn" = '8' AND "Team" = 'hyde united'
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 COUNT(t_kc21.IN_DIAG_DIS_CD) FROM t_kc21 WHERE t_kc21.PERSON_NM = '柳静涵' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-01-29' AND '2021-09-11'
css
CREATE TABLE table_name_43 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the home team that played at MCG?
SELECT home_team AS score FROM table_name_43 WHERE venue = "mcg"
sql_create_context
CREATE TABLE table_name_11 ( school VARCHAR, _number___county VARCHAR, enrollment VARCHAR, ihsaa_class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school in 72 Scott county has an enrollment more than 473 with an AAA IHSAA Class?
SELECT school FROM table_name_11 WHERE enrollment > 473 AND ihsaa_class = "aaa" AND _number___county = "72 scott"
sql_create_context
CREATE TABLE table_58690 ( "Stage" text, "Winner" text, "General classification" text, "Mountains classification" text, "Points classification" text, "Team Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team classification h...
SELECT "Team Classification" FROM table_58690 WHERE "Points classification" = 'alejandro valverde' AND "Winner" = 'alejandro valverde' AND "Stage" = '3'
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 tra...
SELECT COUNT(*) > 0 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 = 31854) AND icustays.outtime IS NULL) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WH...
mimic_iii
CREATE TABLE table_name_56 ( round_2 VARCHAR, round_4 VARCHAR, round_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Round 2 when Round 4 is Double and Round 3 is Single?
SELECT round_2 FROM table_name_56 WHERE round_4 = "double" AND round_3 = "single"
sql_create_context
CREATE TABLE table_name_24 ( rank INTEGER, points INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average rank for more than 12 points?
SELECT AVG(rank) FROM table_name_24 WHERE points > 12
sql_create_context
CREATE TABLE table_42639 ( "Date" text, "Tournament" text, "Location" text, "Home team" text, "Score" text, "Away team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the location of the game with a score of 2:3?
SELECT "Location" FROM table_42639 WHERE "Score" = '2:3'
wikisql
CREATE TABLE table_1341522_38 ( party VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the party with opponent being mike oxley (r) unopposed
SELECT party FROM table_1341522_38 WHERE opponent = "Mike Oxley (R) unopposed"
sql_create_context
CREATE TABLE table_41352 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the visitor with a 14-10 record?
SELECT "Visitor" FROM table_41352 WHERE "Record" = '14-10'
wikisql
CREATE TABLE table_115 ( "Title" text, "System" text, "Publisher" text, "Product No." text, "Compatible with 20/60GB NTSC PS3 (CECHA/CECHB)" text, "Compatible with 60GB PAL/80GB NTSC PS3 (CECHC/CECHE)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT COUNT("Product No.") FROM table_115 WHERE "Title" = 'Jak 3'
wikisql
CREATE TABLE table_42177 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament had a winning score of 5 (69-69-73=211)?
SELECT "Tournament" FROM table_42177 WHERE "Winning score" = '−5 (69-69-73=211)'
wikisql
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) -- Using valid SQLite, answer the following questions fo...
SELECT Type, COUNT(Type) FROM ship GROUP BY Type ORDER BY COUNT(Type)
nvbench
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '范雅韶' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费'
css
CREATE TABLE table_69903 ( "Year" real, "Team" text, "Class" text, "Laps" real, "Pos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the position of the teams before 1973?
SELECT "Pos." FROM table_69903 WHERE "Year" < '1973'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number...
SELECT name FROM sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb', 'Data.StackExchange')
sede
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.language = "ENGL" AND lab.label = "Alkaline Phosphatase"
mimicsql_data
CREATE TABLE table_43529 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date with 68,463 in attendance?
SELECT "Date" FROM table_43529 WHERE "Attendance" = '68,463'
wikisql
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average age for...
SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY AVG(age) DESC
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'acetaminophen overdose - dosage unknown' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY STRFTIME('%y-%m-%d', diagnosis....
eicu
CREATE TABLE table_name_12 ( stories VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total stories that rank number 10?
SELECT COUNT(stories) FROM table_name_12 WHERE rank = 10
sql_create_context
CREATE TABLE Sportsinfo ( StuID VARCHAR ) CREATE TABLE Plays_games ( StuID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show ids of students who play video game and play sports.
SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games
sql_create_context
CREATE TABLE table_71419 ( "Position" real, "Club" text, "Played" real, "Points" text, "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 MIN("Goals against") FROM table_71419 WHERE "Played" > '38'
wikisql
CREATE TABLE table_31440 ( "model" text, "Sonnet" text, "Apple" text, "NUpowr 117" text, "NUpowr 167" text, "NUpowr 183" text, "NUpowr G3" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 0,4, or 8 mb is the nupowr 117 what is the nupowr ...
SELECT "NUpowr 183" FROM table_31440 WHERE "NUpowr 117" = '0,4, or 8 MB'
wikisql
CREATE TABLE table_name_20 ( position VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the draft pick number play that was overall pick number 133?
SELECT position FROM table_name_20 WHERE overall = 133
sql_create_context
CREATE TABLE table_75470 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the attendance of the game where there was a Loss of Yates (3-2)?
SELECT "Attendance" FROM table_75470 WHERE "Loss" = 'yates (3-2)'
wikisql
CREATE TABLE table_24932 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "U.S. viewers (million)" FROM table_24932 WHERE "Production code" = '3X6704'
wikisql
CREATE TABLE table_13608101_1 ( others_percentage VARCHAR, parish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the others% with parbeingh being tangipahoa
SELECT others_percentage FROM table_13608101_1 WHERE parish = "Tangipahoa"
sql_create_context
CREATE TABLE table_41445 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest silver that has a bronze greater than 1, a gold less than 2, and a total ...
SELECT MIN("Silver") FROM table_41445 WHERE "Bronze" > '1' AND "Gold" < '2' AND "Total" < '2'
wikisql
CREATE TABLE table_7883 ( "Name" text, "Location" text, "Years as tallest" text, "Height metres / ft" text, "Floors" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the building at Aston?
SELECT "Name" FROM table_7883 WHERE "Location" = 'aston'
wikisql
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, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT COUNT(*) FROM mzjzjlb WHERE JZKSBM = '16206' AND JZKSRQ BETWEEN '2000-12-12' AND '2001-10-14'
css
CREATE TABLE airport ( airport_id number, airport_name text, total_passengers number, %_change_2007 text, international_passengers number, domestic_passengers number, transit_passengers number, aircraft_movements number, freight_metric_tonnes number ) CREATE TABLE airport_aircraft (...
SELECT T1.aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.aircraft_id = T2.winning_aircraft GROUP BY T2.winning_aircraft
spider
CREATE TABLE table_name_75 ( area VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what area is Morven School?
SELECT area FROM table_name_75 WHERE name = "morven school"
sql_create_context
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.BGRQ FROM jybgb WHERE jybgb.BGDH = '51074072254'
css
CREATE TABLE table_20883 ( "Parameter" text, "1st stage" text, "2nd stage" text, "3rd stage" text, "4th stage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the paarameter for 1.0 m 3rd stage
SELECT "Parameter" FROM table_20883 WHERE "3rd stage" = '1.0 m'
wikisql
CREATE TABLE Addresses ( address_id INTEGER, address_content VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50), other_address_details VARCHAR(255) ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, ...
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer)
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.JCZBJGDL, jyjgzbb.JCZBJGDW 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...
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-32465') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) = '2102-05' ORDER BY patient.unitadmittime DESC LIMIT ...
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.discharge_location = "HOME HEALTH CARE"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.short_title = "Percu gastrojejunostomy"
mimicsql_data
CREATE TABLE table_name_50 ( game VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the game number that took place on April 27?
SELECT game FROM table_name_50 WHERE date = "april 27"
sql_create_context
CREATE TABLE table_10224 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the record 56-46 was met?
SELECT "Score" FROM table_10224 WHERE "Record" = '56-46'
wikisql
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "1" AND prescriptions.drug = "Timolol Maleate 0.5%"
mimicsql_data
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 person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE zzmzjzjlb.JZZDBM = 'K44.X89' GROUP BY person_info.JGDM UNION SELECT...
css
CREATE TABLE table_17340355_7 ( date VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day(s) did the team play indiana?
SELECT date FROM table_17340355_7 WHERE team = "Indiana"
sql_create_context
CREATE TABLE table_name_16 ( distance VARCHAR, weight VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the distance when the weight is 9.2?
SELECT distance FROM table_name_16 WHERE weight = 9.2
sql_create_context
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), E...
SELECT STU_FNAME, COUNT(STU_FNAME) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME ORDER BY COUNT(STU_FNAME)
nvbench
CREATE TABLE table_name_47 ( county VARCHAR, longitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What County has a Longitude of 85 45 43 w?
SELECT county FROM table_name_47 WHERE longitude = "85°45′43″w"
sql_create_context
CREATE TABLE table_52288 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which NGC number has a Constellation of ursa major?
SELECT MAX("NGC number") FROM table_52288 WHERE "Constellation" = 'ursa major'
wikisql
CREATE TABLE table_32367 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team had a qual 1 of 59.895?
SELECT "Team" FROM table_32367 WHERE "Qual 1" = '59.895'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admis...
SELECT SUM(outputevents.value) 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 = 4469)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'righ...
mimic_iii
CREATE TABLE table_68908 ( "Model" text, "Codename" text, "Released" text, "Fab ( nm )" real, "SATA" text, "USB 2.0+1.1" text, "USB 3.0" text, "Parallel ATA 1" text, "RAID" real, "Gb Ethernet MAC" text, "Package" text, "TDP ( W )" real ) -- Using valid SQLite, answer th...
SELECT AVG("Fab ( nm )") FROM table_68908 WHERE "Released" = 'q4 2008' AND "RAID" > '0,1,5,10'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTy...
SELECT Id AS "post_link" FROM Posts WHERE ParentId = 2140 AND LastActivityDate < DATEADD(YEAR, -2, GETDATE()) AND Score < 2
sede
CREATE TABLE table_8516 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team that has a shooting guard that played for the Grizzlies in 2...
SELECT "School/Club Team" FROM table_8516 WHERE "Position" = 'shooting guard' AND "Years for Grizzlies" = '2000-2001'
wikisql
CREATE TABLE table_33312 ( "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 was the smallest crowd for a Melbourne away...
SELECT MIN("Crowd") FROM table_33312 WHERE "Away team" = 'melbourne'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, pro...
SELECT DISTINCT fare_basis_code FROM fare_basis WHERE fare_basis_code = 'QO'
atis
CREATE TABLE table_name_39 ( reserved_for___sc___st__none_ VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Reserved For of Lahar?
SELECT reserved_for___sc___st__none_ FROM table_name_39 WHERE name = "lahar"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patient...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-10390')) AND intakeoutput.celllabel = 'volum...
eicu
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 SUM(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.PERSON_ID = '43928583' AND t_kc21.CLINIC_TYPE = '门诊'
css
CREATE TABLE document_types ( document_type_code text, document_description text ) CREATE TABLE organisations ( organisation_id number, organisation_type text, organisation_details text ) CREATE TABLE organisation_types ( organisation_type text, organisation_type_description text ) CREATE...
SELECT T1.organisation_type, T1.organisation_id FROM organisations AS T1 JOIN research_staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1
spider
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 jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN 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.JZLSH_MZJZJLB AND jybgb.YLJGDM = ...
css
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.BBCJBW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb 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_MZJZJLB WHERE person_info.XM = ...
css
CREATE TABLE table_name_49 ( date VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date is Olimpia the Home team?
SELECT date FROM table_name_49 WHERE home = "olimpia"
sql_create_context
CREATE TABLE table_61424 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Alyona Klimenko's Pos.?
SELECT "Pos." FROM table_61424 WHERE "Name" = 'alyona klimenko'
wikisql
CREATE TABLE table_50123 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance for the match where cambridge united was the home team?
SELECT "Attendance" FROM table_50123 WHERE "Home team" = 'cambridge united'
wikisql
CREATE TABLE table_26093 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Final Score" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent has 36102 is the attendance?
SELECT "Opponent" FROM table_26093 WHERE "Attendance" = '36102'
wikisql
CREATE TABLE table_23342 ( "#" real, "Episode" text, "Rating" text, "Share" real, "Rating/Share (18-49)" text, "Viewers (millions)" text, "Rank (Night)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the night rank is 9, what is the total...
SELECT COUNT("Share") FROM table_23342 WHERE "Rank (Night)" = '9'
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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime tim...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium, whole blood'))
mimic_iii
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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 pat...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnos...
mimic_iii
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT SOC_SRT_DIRE_NM, EACH_DOSAGE, USE_FRE FROM t_kc22 WHERE MED_CLINIC_ID = '84336968126'
css
CREATE TABLE table_204_834 ( id number, "rank" number, "name" text, "nationality" text, "time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the time for each name
SELECT "time" FROM table_204_834 WHERE NOT "name" IS NULL
squall
CREATE TABLE table_48477 ( "Runs" text, "Match" text, "Stadium" text, "City/Country" text, "Year" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 2009 with 100* runs, what is the match?
SELECT "Match" FROM table_48477 WHERE "Year" = '2009' AND "Runs" = '100*'
wikisql
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN 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.JZLSH_MZJZJLB ...
css
CREATE TABLE train ( Train_ID int, Train_Num text, Name text, From text, Arrival text, Railway_ID int ) CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text ) CREATE TABLE manager ( Manager_ID int, Name text, Country text, Working_year_starts...
SELECT Arrival, COUNT(Arrival) FROM train GROUP BY Arrival ORDER BY COUNT(Arrival) DESC
nvbench