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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2186.0" AND prescriptions.formulary_drug_cd = "MOM30L"
mimicsql_data
CREATE TABLE table_1341549_33 ( first_elected VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many first elected with district being new york2
SELECT COUNT(first_elected) FROM table_1341549_33 WHERE district = "New York2"
sql_create_context
CREATE TABLE table_27128 ( "Wind farm" text, "Installed capacity (MW)" text, "Turbine Manufacturer" text, "County" text, "Date in Service" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the turbine manufacturer of the wind farm that started ...
SELECT "Turbine Manufacturer" FROM table_27128 WHERE "Date in Service" = '2005'
wikisql
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '40176918' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-08-23' AND '2002-12-05'
css
CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many friends does Dan have?
SELECT COUNT(T2.friend) FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Dan'
spider
CREATE TABLE table_name_53 ( react INTEGER, country VARCHAR, lane VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest react of the athlete from the United States who has a lane less than 4?
SELECT MIN(react) FROM table_name_53 WHERE country = "united states" AND lane < 4
sql_create_context
CREATE TABLE table_57029 ( "Country" text, "Release Date" real, "Music Label" text, "Media" text, "Catalogue Number" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release date by Virgin?
SELECT AVG("Release Date") FROM table_57029 WHERE "Music Label" = 'virgin'
wikisql
CREATE TABLE table_16137 ( "Sepal length" text, "Sepal width" text, "Petal length" text, "Petal width" text, "Species" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sepal length for sepal width of 2.8 and petal length of 5.1
SELECT "Sepal length" FROM table_16137 WHERE "Sepal width" = '2.8' AND "Petal length" = '5.1'
wikisql
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 COUNT(*) 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.person_info_XM = '水锐逸' AND mzjzjlb.JZKSRQ BETWEEN '2001-09-03' AND '2020-09-18' AND mzjzjlb.YLJGDM = '2777621'
css
CREATE TABLE table_203_18 ( id number, "year" number, "film" text, "role" text, "co-star" text, "director" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many movies has ahsan been in ?
SELECT COUNT("film") FROM table_203_18
squall
CREATE TABLE table_71005 ( "Language" text, "Number" text, "percentage (%)" text, "males" text, "females" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the percentage which has females of 2
SELECT "percentage (%)" FROM table_71005 WHERE "females" = '2'
wikisql
CREATE TABLE table_12157 ( "Draft" real, "Round" text, "Pick" real, "Player" text, "Nationality" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Pick, when Round is '6', when Nationality is 'Canada', when Draft is greater than 1983, and when ...
SELECT "Pick" FROM table_12157 WHERE "Round" = '6' AND "Nationality" = 'canada' AND "Draft" > '1983' AND "Player" = 'ed ward category:articles with hcards'
wikisql
CREATE TABLE table_34779 ( "County" text, "Monument name" text, "Year built" real, "City or Town" text, "Latitude" text, "Longitude" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the City or Town of the monument with a Longitude of 89 1...
SELECT "City or Town" FROM table_34779 WHERE "Longitude" = '89°11′w'
wikisql
CREATE TABLE table_name_52 ( years_for_jazz VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years did the Utah Jazz Player from Southern Methodist, Play?
SELECT years_for_jazz FROM table_name_52 WHERE school_club_team = "southern methodist"
sql_create_context
CREATE TABLE roles ( role_code text, role_name text, role_description text ) CREATE TABLE document_locations ( document_id number, location_code text, date_in_location_from time, date_in_locaton_to time ) CREATE TABLE ref_calendar ( calendar_date time, day_number number ) CREATE T...
SELECT T1.date_in_location_from, T1.date_in_locaton_to FROM document_locations AS T1 JOIN all_documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = "Robin CV"
spider
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
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 table_name_21 ( rank VARCHAR, points VARCHAR, nation VARCHAR, sp VARCHAR, fs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank for more than 120.44 points in East Germany and a SP+FS of 3?
SELECT COUNT(rank) FROM table_name_21 WHERE points > 120.44 AND nation = "east germany" AND sp + fs = 3
sql_create_context
CREATE TABLE table_name_69 ( player VARCHAR, round INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a Round smaller than 2?
SELECT player FROM table_name_69 WHERE round < 2
sql_create_context
CREATE TABLE table_24456 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the tota...
SELECT COUNT("Production code") FROM table_24456 WHERE "Written by" = 'Steve Cohen & Andrew Dettman'
wikisql
CREATE TABLE table_name_35 ( pba_team VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the PBA team with a Pick that is 4?
SELECT pba_team FROM table_name_35 WHERE pick = 4
sql_create_context
CREATE TABLE table_name_57 ( top_10 INTEGER, cuts_made VARCHAR, top_25 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average top-10 for cuts made of 10 and top-25 more than 6
SELECT AVG(top_10) FROM table_name_57 WHERE cuts_made = 10 AND top_25 > 6
sql_create_context
CREATE TABLE table_23284271_9 ( game INTEGER, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games had been played when the Mavericks had a 46-22 record?
SELECT MAX(game) FROM table_23284271_9 WHERE record = "46-22"
sql_create_context
CREATE TABLE table_70204 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of engine does a 1951 alfa romeo 159m chasis have?
SELECT "Engine" FROM table_70204 WHERE "Year" = '1951' AND "Chassis" = 'alfa romeo 159m'
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN 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 = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE table_64613 ( "Name" text, "Nationality" text, "1.85" text, "1.93" text, "Height" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1.93 that is 2.05 in height?
SELECT "1.93" FROM table_64613 WHERE "Height" = '2.05'
wikisql
CREATE TABLE table_21129 ( "English name" text, "Irish name" text, "Numeral" text, "Reverse" text, "Introduction" text, "Withdrawal" text, "\u00a31 Fraction" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the reverse when the 1 fract...
SELECT "Reverse" FROM table_21129 WHERE "\u00a31 Fraction" = '1/480'
wikisql
CREATE TABLE table_27223 ( "School" text, "Nickname" text, "Location" text, "Colors" text, "Type" text, "Membership Tenure" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school is in Jeromesville?
SELECT "Location" FROM table_27223 WHERE "School" = 'Jeromesville'
wikisql
CREATE TABLE table_2878 ( "#" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production Code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode written ...
SELECT "Director" FROM table_2878 WHERE "Writer(s)" = 'Jason Yoshimura'
wikisql
CREATE TABLE table_203_165 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many total gold medal have been given ?
SELECT SUM("gold") FROM table_203_165
squall
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE zyjzjlb.YLJGDM = '6930782' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 23
css
CREATE TABLE table_name_94 ( employee__real_name_ VARCHAR, role VARCHAR, pick__number VARCHAR, brand__from_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the real name of the male wrestler from Raw with a pick # smaller than 6?
SELECT employee__real_name_ FROM table_name_94 WHERE pick__number < 6 AND brand__from_ = "raw" AND role = "male wrestler"
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52327'...
eicu
CREATE TABLE table_59913 ( "Squad No." real, "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "FLT Apps" text, "FLT Goals" real, "Total Apps" text, "Total G...
SELECT MIN("FA Cup Goals") FROM table_59913 WHERE "Total Goals" > '0' AND "League Goals" = '4' AND "FA Cup Apps" = '1' AND "League Cup Goals" > '0'
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 t.Name, COUNT(PostId) AS Kount FROM PostHistory AS ph INNER JOIN PostHistoryTypes AS t ON ph.PostHistoryTypeId = t.Id GROUP BY t.Name
sede
CREATE TABLE table_2840500_1 ( position VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many positions does the draft pick whose nationality is Czech Republic play?
SELECT COUNT(position) FROM table_2840500_1 WHERE nationality = "Czech Republic"
sql_create_context
CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, ...
SELECT COUNT(*) FROM video_games
spider
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE p...
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o...
advising
CREATE TABLE table_8199 ( "Team" text, "Head coach" text, "Team captain" text, "Kitmaker" text, "Shirt sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the team captain of tus koblenz?
SELECT "Team captain" FROM table_8199 WHERE "Team" = 'tus koblenz'
wikisql
CREATE TABLE table_7952 ( "Type" text, "Name" text, "Title" text, "Royal house" text, "From" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Royal house is named Elah?
SELECT "Royal house" FROM table_7952 WHERE "Name" = 'elah'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612) AND STRFTIME('%y', prescriptions.startdate) <= '2104'
mimic_iii
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 demographic.dob, demographic.gender FROM demographic WHERE demographic.subject_id = "7273"
mimicsql_data
CREATE TABLE table_dev_48 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "hiv_infection" bool, "body_weight" float, "diabetic" string, "active_hepatitis" bool, "diastolic_blood_pressure_dbp" int, "liver_disease" bool, "high_density_lipoprotein_cholesterol_hdl_c" ...
SELECT * FROM table_dev_48 WHERE body_mass_index_bmi >= 18.5 AND body_mass_index_bmi <= 45 AND body_weight > 50
criteria2sql
CREATE TABLE table_25246990_5 ( original_us_air_date VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different original U.S. air dates appear where the U.S. viewers were 2.5 million?
SELECT COUNT(original_us_air_date) FROM table_25246990_5 WHERE us_viewers__millions_ = "2.5"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( 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 = 72107) AND microbiologyevents.spec_type_desc = 'blood culture - neonate' AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '2104-01' ORDER BY micr...
mimic_iii
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '91170006' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 6315.09)
css
CREATE TABLE table_name_43 ( rank INTEGER, studio_s_ VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the average rank for dharma productions before 2013
SELECT AVG(rank) FROM table_name_43 WHERE studio_s_ = "dharma productions" AND year < 2013
sql_create_context
CREATE TABLE table_34415 ( "Country" text, "Project Name" text, "Year startup" text, "Operator" text, "Peak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the operator for peak 90, in startup year 2010 for the project named Aosp expansion 1...
SELECT "Operator" FROM table_34415 WHERE "Peak" = '90' AND "Year startup" = '2010' AND "Project Name" = 'aosp expansion 1 (jackpine ph 1a)'
wikisql
CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed...
SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements GROUP BY Date_Claim_Settled
nvbench
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 qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_NM = '苗梦菡' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '速效救心丸') UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_NM = '苗梦菡' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC...
css
CREATE TABLE table_14187 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of electorates (2009) for Con...
SELECT "Number of electorates (2009)" FROM table_14187 WHERE "Constituency number" = '182'
wikisql
CREATE TABLE table_name_14 ( years_as_tallest VARCHAR, height_metres___ft VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Years as tallest that has Height metres / ft of 01.0 27 / 90?
SELECT years_as_tallest FROM table_name_14 WHERE height_metres___ft = "01.0 27 / 90"
sql_create_context
CREATE TABLE table_53476 ( "Grid" real, "Driver" text, "Constructor" text, "Qual" real, "Rank" real, "Laps" real, "Time/Retired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who constructed Joe James car when his rank was more than 10?
SELECT "Constructor" FROM table_53476 WHERE "Rank" > '10' AND "Driver" = 'joe james'
wikisql
CREATE TABLE table_name_37 ( result VARCHAR, venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the result when the venue is singapore on september 8, 1996?
SELECT result FROM table_name_37 WHERE venue = "singapore" AND date = "september 8, 1996"
sql_create_context
CREATE TABLE table_name_61 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game that was played on 3,4,5 Jul 1902?
SELECT result FROM table_name_61 WHERE date = "3,4,5 jul 1902"
sql_create_context
CREATE TABLE table_name_31 ( winner VARCHAR, winter_olympics VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Winner has a Winter Olympics of 1968?
SELECT winner FROM table_name_31 WHERE winter_olympics = "1968"
sql_create_context
CREATE TABLE table_1966992_1 ( administrative_capital VARCHAR, census_2006_population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the administrative capital that has a 2006 census population of 249425?
SELECT administrative_capital FROM table_1966992_1 WHERE census_2006_population = 249425
sql_create_context
CREATE TABLE table_name_79 ( res VARCHAR, time VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the resolution of the fight against kiuma kunioku with a time of 15:00?
SELECT res FROM table_name_79 WHERE time = "15:00" AND opponent = "kiuma kunioku"
sql_create_context
CREATE TABLE table_73370 ( "Election" text, "Mayor" text, "Seat no 1" text, "Seat no 2" text, "Seat no 3" text, "Seat no 4" text, "Seat no 5" text, "Seat no 6" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is seat no 1 when the mayo...
SELECT "Seat no 1" FROM table_73370 WHERE "Mayor" = 'John J. Seguier'
wikisql
CREATE TABLE table_8645 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Branding of the Frequency owned by Sound of Faith Broadcasting Group?
SELECT "Branding" FROM table_8645 WHERE "Owner" = 'sound of faith broadcasting group'
wikisql
CREATE TABLE table_name_29 ( election INTEGER, president VARCHAR, inhabitants VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest election result for President Leonardo Marras with an area smaller than 227,063 people?
SELECT MIN(election) FROM table_name_29 WHERE president = "leonardo marras" AND inhabitants < 227 OFFSET 063
sql_create_context
CREATE TABLE table_10470082_7 ( villains VARCHAR, storyteller VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the villains in the episodes where Megan is the storyteller and Lorette LeBlanc is the director?
SELECT villains FROM table_10470082_7 WHERE storyteller = "Megan" AND director = "Lorette LeBlanc"
sql_create_context
CREATE TABLE table_name_76 ( team__number2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 1st Leg, when Team #2 is 'Emelec'?
SELECT 1 AS st_leg FROM table_name_76 WHERE team__number2 = "emelec"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.drug = "0.45% Sodium Chloride"
mimicsql_data
CREATE TABLE table_17058151_5 ( game VARCHAR, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In how many game was the attendance at Staples Center 18,997?
SELECT COUNT(game) FROM table_17058151_5 WHERE location_attendance = "Staples Center 18,997"
sql_create_context
CREATE TABLE table_name_1 ( medal VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Medal had a Name of manuel felix diaz?
SELECT medal FROM table_name_1 WHERE name = "manuel felix diaz"
sql_create_context
CREATE TABLE table_name_51 ( player VARCHAR, overall INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the smallest overall under 22?
SELECT player FROM table_name_51 WHERE overall < 22
sql_create_context
CREATE TABLE table_43043 ( "Date" text, "Time" text, "Home" text, "Away" text, "Score" text, "Ground" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Away is High Park Demons?
SELECT "Date" FROM table_43043 WHERE "Away" = 'high park demons'
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 lab ( labid numbe...
SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'brain herniation syndrome - central' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2104')
eicu
CREATE TABLE table_name_83 ( record VARCHAR, opponent VARCHAR, time VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The match of at Michael's Eighth Avenue venue against Tim Coleman that went 3:00 has what record?
SELECT record FROM table_name_83 WHERE time = "3:00" AND venue = "michael's eighth avenue" AND opponent = "tim coleman"
sql_create_context
CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE customer_payments ( customer_id number, datetime_payment time, payment_method_code text, amount_payment number ) CREATE...
SELECT SUM(T1.amount_payment) FROM customer_payments AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Carole" AND T2.last_name = "Bernhard"
spider
CREATE TABLE table_16866 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During which years did Jim Farmer play for Jazz?
SELECT "Years for Jazz" FROM table_16866 WHERE "Player" = 'Jim Farmer'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "76" AND diagnoses.icd9_code = "99591"
mimicsql_data
CREATE TABLE table_2679061_7 ( college_junior_club_team VARCHAR, nhl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where are the Buffalo Sabres from?
SELECT college_junior_club_team FROM table_2679061_7 WHERE nhl_team = "Buffalo Sabres"
sql_create_context
CREATE TABLE shop ( shop_id number, shop_name text, location text, open_date text, open_year number ) CREATE TABLE device ( device_id number, device text, carrier text, package_version text, applications text, software_platform text ) CREATE TABLE stock ( shop_id number...
SELECT open_date, open_year FROM shop WHERE shop_name = "Apple"
spider
CREATE TABLE table_48630 ( "Game" real, "Date" text, "Team" text, "Score" text, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game number 22?
SELECT "Date" FROM table_48630 WHERE "Game" = '22'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "89" AND procedures.long_title = "Open biopsy of soft tissue"
mimicsql_data
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 DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'bedside glucose' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '002-59265' AND N...
eicu
CREATE TABLE table_name_31 ( location VARCHAR, score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which location has a Score of 3 2, and a Record of 3 2 3?
SELECT location FROM table_name_31 WHERE score = "3–2" AND record = "3–2–3"
sql_create_context
CREATE TABLE table_36703 ( "Conference" text, "Division" text, "Team" text, "City" text, "Home Stadium" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the Conference which Division is south, and the Home Stadium is georgia dome?
SELECT "Conference" FROM table_36703 WHERE "Division" = 'south' AND "Home Stadium" = 'georgia dome'
wikisql
CREATE TABLE table_name_17 ( doha_ VARCHAR, _qatar VARCHAR, snatch VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Doha, Qatar when the snatch is total?
SELECT doha_, _qatar FROM table_name_17 WHERE snatch = "total"
sql_create_context
CREATE TABLE table_name_18 ( place VARCHAR, player VARCHAR, to_par VARCHAR, score VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Bunky Henry of the United States scored higher than 67 and his To par was e, what was his place...
SELECT place FROM table_name_18 WHERE score > 67 AND country = "united states" AND to_par = "e" AND player = "bunky henry"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 836...
mimic_iii
CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CR...
SELECT origin, COUNT(*) FROM train GROUP BY origin ORDER BY origin
nvbench
CREATE TABLE table_11342 ( "Round" text, "Pick" text, "Player" text, "Position" text, "Nationality" text, "Team" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nationality is the player from the College of Cincinnati?
SELECT "Nationality" FROM table_11342 WHERE "College" = 'cincinnati'
wikisql
CREATE TABLE Undergoes ( Patient INTEGER, Procedures INTEGER, Stay INTEGER, DateUndergoes DATETIME, Physician INTEGER, AssistingNurse INTEGER ) CREATE TABLE Prescribes ( Physician INTEGER, Patient INTEGER, Medication INTEGER, Date DATETIME, Appointment INTEGER, Dose VARC...
SELECT Physician, Department FROM Affiliated_With WHERE PrimaryAffiliation = 1
nvbench
CREATE TABLE table_13836704_6 ( rank VARCHAR, freight___metric_tonnes__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of the airport with freight ( metric tonnes ) of 255121?
SELECT rank FROM table_13836704_6 WHERE freight___metric_tonnes__ = 255121
sql_create_context
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name ...
SELECT DISTINCT airline.airline_code FROM airline, airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'PITTSBURGH' AND flight.airline_code = airline.airline_code AND flight.from_airport = airport_service.airport_code
atis
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9...
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 67005 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.dischtime LIMIT 1
mimic_iii
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswe...
SELECT a.Id AS "post_link", a.LastEditDate, 'Your answer' FROM Posts AS a WHERE a.OwnerUserId = '##UserId:int##' AND a.PostTypeId = 2 AND a.LastEditDate != a.CreationDate UNION ALL SELECT q.Id AS "post_link", q.LastEditDate, 'Question you''ve answered' FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id WHERE a....
sede
CREATE TABLE table_name_14 ( losses VARCHAR, points VARCHAR, games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total number of losses with less than 19 points and more than 36 games?
SELECT COUNT(losses) FROM table_name_14 WHERE points < 19 AND games > 36
sql_create_context
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 gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5848199' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '58481...
css
CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) -- Using valid SQLite, answer the following questions for the ...
SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name ORDER BY Name
nvbench
CREATE TABLE table_8310 ( "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. -- What country was the game in when the player was Craig Stadler?
SELECT "Country" FROM table_8310 WHERE "Player" = 'craig stadler'
wikisql
CREATE TABLE table_14498 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years does the school have that's in Makikihi?
SELECT "Years" FROM table_14498 WHERE "Area" = 'makikihi'
wikisql
CREATE TABLE table_204_506 ( id number, "seasons" number, "team" text, "ch.wins" number, "promotions" number, "relegations" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many relegations did andrea costa imola undergo ?
SELECT "relegations" FROM table_204_506 WHERE "team" = 'andrea costa imola'
squall
CREATE TABLE gwyjzb ( 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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6947584' AND gwyjzb.IN_HOSP_DATE BETWEEN '2021-02-24' AND '2021-06-19' AND gwyjzb.REMOTE_SETTLE_FLG = '异地1' OR gwyjzb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6947584' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2021-02...
css
CREATE TABLE table_name_41 ( place VARCHAR, language VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Croatian spoken?
SELECT place FROM table_name_41 WHERE language = "croatian"
sql_create_context
CREATE TABLE table_67319 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Time" text, "Att." text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record at the game held on May 1st with a loss of Speier (1 3)...
SELECT "Record" FROM table_67319 WHERE "Date" = 'may 1' AND "Loss" = 'speier (1–3)'
wikisql
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM 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 = '97420642048' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.SELF_PAY_AMO) DES...
css
CREATE TABLE table_name_40 ( outgoing_manager VARCHAR, replaced_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the outgoing manager for craig brewster
SELECT outgoing_manager FROM table_name_40 WHERE replaced_by = "craig brewster"
sql_create_context