instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_70211 ( "Grand Prix" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the pole position for belgian grand prix
SELECT "Pole position" FROM table_70211 WHERE "Grand Prix" = 'belgian grand prix'
wikisql
CREATE TABLE table_30656 ( "#" real, "Stadium" text, "Capacity" real, "Opened" text, "City / Town" text, "Home team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What stadium does FK Jedinstvo play in?
SELECT "Stadium" FROM table_30656 WHERE "Home team" = 'FK Jedinstvo'
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 zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '42116254' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2019-05-06')
css
CREATE TABLE table_2508633_4 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What number draft pick was linebacker Steve Maidlow in the 1983 NFL Draft?
SELECT position FROM table_2508633_4 WHERE player = "Steve Maidlow"
sql_create_context
CREATE TABLE team ( year INTEGER, league_id TEXT, team_id TEXT, franchise_id TEXT, div_id TEXT, rank INTEGER, g INTEGER, ghome NUMERIC, w INTEGER, l INTEGER, div_win TEXT, wc_win TEXT, lg_win TEXT, ws_win TEXT, r INTEGER, ab INTEGER, h INTEGER, dou...
SELECT year, AVG(attendance) FROM home_game ORDER BY year DESC
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2198" AND diagnoses.icd9_code = "7830"
mimicsql_data
CREATE TABLE table_25260 ( "Number" real, "Name" text, "Position" text, "Height" text, "Experience" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the number of the player that was 6-6?
SELECT "Number" FROM table_25260 WHERE "Height" = '6-6'
wikisql
CREATE TABLE table_203_438 ( id number, "year" number, "title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what were the number of titles produced in 2004 ?
SELECT COUNT("title") FROM table_203_438 WHERE "year" = 2004
squall
CREATE TABLE table_37665 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Attendance larger than 17,001, and a Date of june 15 had what decision?
SELECT "Decision" FROM table_37665 WHERE "Attendance" > '17,001' AND "Date" = 'june 15'
wikisql
CREATE TABLE table_name_67 ( away_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the away team at the game played at Lake Oval?
SELECT away_team FROM table_name_67 WHERE venue = "lake oval"
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.expire_flag = "0" AND prescriptions.drug = "Erythromycin"
mimicsql_data
CREATE TABLE table_name_52 ( name VARCHAR, town_city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the museum name located in Rudyard?
SELECT name FROM table_name_52 WHERE town_city = "rudyard"
sql_create_context
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 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 = '33997628' AND hz_info.YLJGDM = '2339646' AND NOT mzjzjlb.JZKSMC LIKE '%化疗%'
css
CREATE TABLE tourist_attraction_features ( tourist_attraction_id number, feature_id number ) CREATE TABLE street_markets ( market_id number, market_details text ) CREATE TABLE visitors ( tourist_id number, tourist_details text ) CREATE TABLE shops ( shop_id number, shop_details text )...
SELECT T1.name, T1.tourist_attraction_id FROM tourist_attractions AS T1 JOIN visits AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id GROUP BY T2.tourist_attraction_id HAVING COUNT(*) <= 1
spider
CREATE TABLE table_22693 ( "Rank" real, "Peak" text, "Country" text, "Island" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When mount gauttier is the peak what is the island?
SELECT "Island" FROM table_22693 WHERE "Peak" = 'Mount Gauttier'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2137-08-30 14:39:00"
mimicsql_data
CREATE TABLE table_name_89 ( race VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner of the race in monza?
SELECT race AS Winner FROM table_name_89 WHERE location = "monza"
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.short_title = "Idio periph neurpthy NOS"
mimicsql_data
CREATE TABLE table_25668962_1 ( directed_by VARCHAR, no_in_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed episode number 18 in the series?
SELECT directed_by FROM table_25668962_1 WHERE no_in_series = 18
sql_create_context
CREATE TABLE table_30949 ( "Rd." real, "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the constructor in the Belgian Gr...
SELECT "Constructor" FROM table_30949 WHERE "Grand Prix" = 'Belgian Grand Prix'
wikisql
CREATE TABLE table_22849575_6 ( conference VARCHAR, tournament_winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of conference tournament for james madison
SELECT COUNT(conference) AS Tournament FROM table_22849575_6 WHERE tournament_winner = "James Madison"
sql_create_context
CREATE TABLE table_10990 ( "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 venue had an away team that scored 18.11 (...
SELECT "Venue" FROM table_10990 WHERE "Away team score" = '18.11 (119)'
wikisql
CREATE TABLE table_45520 ( "Poll Source" text, "Dates administered" text, "Democrat: Tom Harkin" text, "Republican: Christopher Reed" text, "Lead Margin" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage did Republish Christopher Reed r...
SELECT "Republican: Christopher Reed" FROM table_45520 WHERE "Lead Margin" < '16'
wikisql
CREATE TABLE table_28741_1 ( _usd__2012_ VARCHAR, gdp__nominal__per_capita VARCHAR, capital VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the numbers for GDP (nominal) per capita and USD (2012) of the area with Phnom Penh as capital?
SELECT COUNT(gdp__nominal__per_capita), _usd__2012_ FROM table_28741_1 WHERE capital = "Phnom Penh"
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'V27.340' AND jyjgzbb.JCZBDM = '043045' UNION SELECT jyjgzbb.CKZF...
css
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, ...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'WN' AND semester.year = 2017)) AND course.course_id = course_offering.course_id AND course.department = 'department0...
advising
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No...
SELECT Year, AVG(Price) FROM wine GROUP BY Year ORDER BY Year
nvbench
CREATE TABLE table_64241 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- wh...
SELECT MAX("GEO ID") FROM table_64241 WHERE "Longitude" = '-98.435797' AND "Land ( sqmi )" < '36.039'
wikisql
CREATE TABLE table_train_72 ( "id" int, "extracorporeal_membrane_oxygenation_ecmo_cannulation" bool, "heart_disease" bool, "meningitis_or_encephalitis" bool, "sepsis" bool, "cancer" bool, "prisoners" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the ta...
SELECT * FROM table_train_72 WHERE heart_disease = 1
criteria2sql
CREATE TABLE table_37193 ( "Name" text, "Type" text, "Entered service" text, "Water depth" text, "Location" text, "Customer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the water depth in the Gulf of Mexico named Discoverer Clear Lea...
SELECT "Water depth" FROM table_37193 WHERE "Location" = 'gulf of mexico' AND "Name" = 'discoverer clear leader'
wikisql
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0...
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51254"
mimicsql_data
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(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '60198732' AND t_kc22.STA_DATE BETWEEN '2008-12-03' AND '2010-01-06' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_I...
css
CREATE TABLE table_202_104 ( id number, "governorate" text, "percentage" text, "seats won" number, "total seats" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many groups have more than 32 total seats ?
SELECT COUNT("governorate") FROM table_202_104 WHERE "total seats" > 32
squall
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm...
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'periph t cell lym abdom' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'periph t cell lym abdom'
mimic_iii
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, Cr...
SELECT u.Id, u.DisplayName, u.Reputation, COUNT(*) AS AndroidAnswers FROM Users AS u, Posts AS p, Posts AS pp WHERE u.Id IN (SELECT Id FROM Users WHERE Location LIKE ('%Russia')) AND p.OwnerUserId = u.Id AND pp.Id = p.ParentId AND pp.Tags LIKE ('%android%') GROUP BY u.Id, u.DisplayName, u.Reputation ORDER BY AndroidAns...
sede
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
WITH posts_WITH_java_tags AS (SELECT PostId FROM PostTags AS pt LEFT JOIN Tags AS t ON pt.TagId = t.Id WHERE LOWER(t.TagName) = 'java') SELECT u.Id AS "user_link", u.Reputation, COUNT(*) AS number_of_answers FROM Posts AS p INNER JOIN posts_WITH_java_tags AS pt ON pt.PostId = p.Id INNER JOIN Posts AS a ON a.ParentId = ...
sede
CREATE TABLE table_name_49 ( diameter VARCHAR, year VARCHAR, reverse VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the diameter of the 2006 equestrian Reverse?
SELECT diameter FROM table_name_49 WHERE year = 2006 AND reverse = "equestrian"
sql_create_context
CREATE TABLE table_name_9 ( score VARCHAR, venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the score of the game at pro player stadium on june 14?
SELECT score FROM table_name_9 WHERE venue = "pro player stadium" AND date = "june 14"
sql_create_context
CREATE TABLE table_1939214_1 ( regular_season VARCHAR, playoffs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what season did the team get in the conference finals of the playoffs?
SELECT regular_season FROM table_1939214_1 WHERE playoffs = "Conference Finals"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-16572'...
eicu
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_c...
SELECT MIN(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 = 7112)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arter...
mimic_iii
CREATE TABLE table_39424 ( "Crime" text, "Reported Offenses" real, "Killeen Rate" real, "Texas Rate" real, "U.S. Rate" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Texas Rate smaller than 32.9, and a U.S. Rate larger than 5.6 is what highest kille...
SELECT MAX("Killeen Rate") FROM table_39424 WHERE "Texas Rate" < '32.9' AND "U.S. Rate" > '5.6'
wikisql
CREATE TABLE table_name_52 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for the home team that played at Brunswick Street Oval?
SELECT home_team AS score FROM table_name_52 WHERE venue = "brunswick street oval"
sql_create_context
CREATE TABLE table_57306 ( "Rank" real, "English title" text, "Chinese title" text, "Average" real, "Peak" real, "Premiere" real, "Finale" real, "HK viewers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Premiere peak...
SELECT MIN("Premiere") FROM table_57306 WHERE "Peak" > '35' AND "Rank" = '10' AND "Finale" > '33'
wikisql
CREATE TABLE table_7125 ( "Track" real, "Recorded" text, "Catalogue" text, "Release date" text, "Chart peak" text, "Song title" text, "Writer(s)" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Chart peak has a Time of ...
SELECT "Chart peak" FROM table_7125 WHERE "Time" = '3:11'
wikisql
CREATE TABLE table_name_8 ( trainer VARCHAR, owner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the trainer with Robert Courtney was owner?
SELECT trainer FROM table_name_8 WHERE owner = "robert courtney"
sql_create_context
CREATE TABLE table_204_759 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many competitions did he finish in at least 10th place ?
SELECT COUNT("competition") FROM table_204_759 WHERE "position" <= 10
squall
CREATE TABLE table_8604 ( "Rank" text, "Runs" text, "Player" text, "Opponent" text, "Venue" text, "Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Runs which has Venue of adelaide oval , adelaide?
SELECT "Runs" FROM table_8604 WHERE "Venue" = 'adelaide oval , adelaide'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2170" AND diagnoses.long_title = "Diabetes with ketoacidosis, type I [juvenile type], not stated as uncontrolled"
mimicsql_data
CREATE TABLE table_31515 ( "Townland" text, "Area( acres )" real, "Barony" text, "Civil parish" text, "Poor law union" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many entries are in barony when the townland is derrigra?
SELECT COUNT("Barony") FROM table_31515 WHERE "Townland" = 'Derrigra'
wikisql
CREATE TABLE table_24316 ( "Competition" text, "Round" text, "Opponent" text, "Result" text, "Score" text, "Home/Away" text, "Venue" text, "Attendance" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many opponents di...
SELECT COUNT("Opponent") FROM table_24316 WHERE "Date" = '17/05/2009'
wikisql
CREATE TABLE table_train_278 ( "id" int, "gender" string, "supine" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "estimated_glomerular_filtration_rate_egfr" int, "diastolic_blood_pressure_dbp" int, "serum_creatinine" float, "bilirubin" float, "NOUSE" floa...
SELECT * FROM table_train_278 WHERE (serum_creatinine >= 1.5 AND gender = 'male') OR (serum_creatinine >= 1.4 AND gender = 'female')
criteria2sql
CREATE TABLE table_name_77 ( score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score that led to an 11-16 record?
SELECT score FROM table_name_77 WHERE record = "11-16"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year < "2076"
mimicsql_data
CREATE TABLE table_204_137 ( id number, "race" number, "race name" text, "pole position" text, "fastest lap" text, "winning driver" text, "winning team" text, "yokohama winner" text, "jay-ten winner" text, "report" text ) -- Using valid SQLite, answer the following questions fo...
SELECT "race name" FROM table_204_137 WHERE id = (SELECT id FROM table_204_137 WHERE "race name" = 'race of hungary') - 1
squall
CREATE TABLE table_name_79 ( date__to_ VARCHAR, date__from_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date has date started from 30 Sep 1913?
SELECT date__to_ FROM table_name_79 WHERE date__from_ = "30 sep 1913"
sql_create_context
CREATE TABLE table_63681 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Lane of the swimmer with a Time of 8:34.25?
SELECT "Lane" FROM table_63681 WHERE "Time" = '8:34.25'
wikisql
CREATE TABLE table_1216675_1 ( pinyin VARCHAR, translation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the pinyin for explaining music?
SELECT pinyin FROM table_1216675_1 WHERE translation = "Explaining Music"
sql_create_context
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, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'baclo...
eicu
CREATE TABLE table_62652 ( "Model Number" text, "Clock Speed" text, "L1 Cache" text, "L2 Cache" text, "FSB Speed" text, "Clock Multiplier" text, "Idle Power" text, "Socket" text, "Cores" real, "Release Date" text ) -- Using valid SQLite, answer the following questions for the t...
SELECT COUNT("Cores") FROM table_62652 WHERE "Clock Speed" = '1.3ghz'
wikisql
CREATE TABLE table_69044 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In Round 13, what was the Pick # of the Guard Position with an Overall greater than 23...
SELECT "Pick #" FROM table_69044 WHERE "Overall" > '23' AND "Position" = 'guard' AND "Round" = '13'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb 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 WHERE person_info.XM = '沈...
css
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int,...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN program_course WHERE ((course.number < 400 + 100 AND course.number >= 400) OR (course.number < 500 + 100 AND course.number >= 500)) AND course.department = 'CCS' AND program_course.workload = (SELECT MIN(PROGRA...
advising
CREATE TABLE table_name_20 ( points INTEGER, date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest points on October 12, when the attendance where is over 10,701?
SELECT MAX(points) FROM table_name_20 WHERE date = "october 12" AND attendance > 10 OFFSET 701
sql_create_context
CREATE TABLE table_name_65 ( hanyu_pinyin VARCHAR, density___km²_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Pinyin for the item that has a density of 77?
SELECT hanyu_pinyin FROM table_name_65 WHERE density___km²_ = "77"
sql_create_context
CREATE TABLE table_203_838 ( id number, "year" number, "world car of the year" text, "world performance car" text, "world green car" text, "world car design of the year" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of ...
SELECT "world green car" FROM table_203_838 WHERE "year" = 2007
squall
CREATE TABLE Product_Suppliers ( product_id INTEGER, supplier_id INTEGER, date_supplied_from DATETIME, date_supplied_to DATETIME, total_amount_purchased VARCHAR(80), total_value_purchased DECIMAL(19,4) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date...
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_id DESC
nvbench
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, Revision...
SELECT YEAR(CreationDate), COUNT(*) FROM Posts WHERE PostTypeId = 1 AND NOT AcceptedAnswerId IS NULL AND AnswerCount > 0 GROUP BY YEAR(CreationDate)
sede
CREATE TABLE table_22879323_8 ( game INTEGER, high_rebounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the highest game number for a game in which Kris Humphries (8) did the high rebounds?
SELECT MAX(game) FROM table_22879323_8 WHERE high_rebounds = "Kris Humphries (8)"
sql_create_context
CREATE TABLE table_22879323_9 ( high_points VARCHAR, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of high points for ford center
SELECT COUNT(high_points) FROM table_22879323_9 WHERE location_attendance = "Ford Center"
sql_create_context
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 demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.name = "James Sloan"
mimicsql_data
CREATE TABLE table_18414 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times was frank m. clark the incumbent?
SELECT COUNT("Result") FROM table_18414 WHERE "Incumbent" = 'Frank M. Clark'
wikisql
CREATE TABLE table_51372 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record on March 27?
SELECT "Record" FROM table_51372 WHERE "Date" = 'march 27'
wikisql
CREATE TABLE table_43456 ( "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. -- If Class AAAA is Schertz Clemens and SChool Year is 1987-88, what i...
SELECT "Class AA" FROM table_43456 WHERE "Class AAAA" = 'schertz clemens' AND "School Year" = '1987-88'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%netherlands' ORDER BY Reputation DESC LIMIT 2500
sede
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_...
SELECT date, SUM(cloud_cover) FROM weather
nvbench
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'EECS' AND semester.semester = 'Spring' AND (SELECT COUNT(DISTINCT SEMESTE...
advising
CREATE TABLE table_16141 ( "No." real, "#" real, "Title" text, "Director" text, "Writer" text, "US air date" text, "Storyteller" text, "Villains" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the director of the episode whom Scot...
SELECT "Director" FROM table_16141 WHERE "Writer" = 'Scott Peters'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TAB...
SELECT p.Id, p.Tags, t.TagName, CASE WHEN p.Title LIKE '%' + t.TagName + '%' THEN 'In Title' WHEN p.Body LIKE '%' + t.TagName + '%' THEN 'In Question' ELSE NULL END AS "tag_location", p.CreationDate FROM Posts AS p INNER JOIN PostTypes AS ptypes ON p.PostTypeId = ptypes.Id AND ptypes.Name = 'Question' INNER JOIN PostTa...
sede
CREATE TABLE table_31431 ( "Rank" real, "Country/Territory" text, "Manhunt International" real, "1st runner-up" real, "2nd runner-up" real, "3rd runner-up" real, "4th runner-up" real, "Semifinalists" real, "Total" real ) -- Using valid SQLite, answer the following questions for the...
SELECT MIN("Total") FROM table_31431
wikisql
CREATE TABLE table_20206 ( "Ecosystem" text, "Date of issue" text, "Place of issue" text, "No. stamps in sheet" real, "Face Value" text, "Printer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the printer of Estes Park, Colorado?
SELECT "Printer" FROM table_20206 WHERE "Place of issue" = 'Estes Park, Colorado'
wikisql
CREATE TABLE table_name_53 ( date_of_appointment VARCHAR, outgoing_manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of appointment for javier aguirre's replacement?
SELECT date_of_appointment FROM table_name_53 WHERE outgoing_manager = "javier aguirre"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime ti...
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 5
mimic_iii
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 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...
css
CREATE TABLE table_name_64 ( opponent VARCHAR, year VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponent, when Year is greater than 2009, and when Score is 7 5, 6 7 (6 8) , 6 1?
SELECT opponent FROM table_name_64 WHERE year > 2009 AND score = "7–5, 6–7 (6–8) , 6–1"
sql_create_context
CREATE TABLE table_name_21 ( report VARCHAR, winning_driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What report did Jack Brabham win?
SELECT report FROM table_name_21 WHERE winning_driver = "jack brabham"
sql_create_context
CREATE TABLE table_57548 ( "Player" text, "Position" text, "School" text, "Hometown" text, "MLB Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player has a Position of infielder, and a Hometown of atlanta, ga?
SELECT "Player" FROM table_57548 WHERE "Position" = 'infielder' AND "Hometown" = 'atlanta, ga'
wikisql
CREATE TABLE table_name_66 ( spectators INTEGER, time___cest__ VARCHAR, team__number2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sum of spectators for time more than 20.05 and team #2 of estonia
SELECT SUM(spectators) FROM table_name_66 WHERE time___cest__ > 20.05 AND team__number2 = "estonia"
sql_create_context
CREATE TABLE table_57664 ( "Athlete" text, "Country" text, "Wins" real, "Years" text, "Distance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the country for athlete of ziedonis za kalns
SELECT "Country" FROM table_57664 WHERE "Athlete" = 'ziedonis zaļkalns'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Name, AVG(Price) FROM Products GROUP BY Name ORDER BY Name
nvbench
CREATE TABLE table_78821 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Kickoff Time" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What week was the opponent the San Diego Chargers?
SELECT AVG("Week") FROM table_78821 WHERE "Opponent" = 'san diego chargers'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2058" AND diagnoses.short_title = "Stevens-Johnson-TEN syn"
mimicsql_data
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_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
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 = 1417)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn d8' A...
mimic_iii
CREATE TABLE table_3252 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the episode # 11 in the season?
SELECT "Title" FROM table_3252 WHERE "No. in season" = '11'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "99592"
mimicsql_data
CREATE TABLE table_29719 ( "Year" real, "Exhibitors (domestic)" real, "Exhibitors (foreign)" real, "Exhibitors (total)" real, "Visitors (total)" real, "Visitors (foreign in %)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many people come ...
SELECT COUNT("Visitors (total)") FROM table_29719 WHERE "Exhibitors (total)" = '1654'
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 jybgb.JYSQJGMC, jybgb.JYJGMC FROM jybgb WHERE jybgb.BGDH = '98041595425'
css