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 demographic.admittime FROM demographic WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT demographic.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "4342"
mimicsql_data
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 T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_17040 ( "Player" text, "Position" text, "School" text, "Hometown" text, "MLB Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school did the player Ethan Bennett attend?
SELECT "School" FROM table_17040 WHERE "Player" = 'Ethan Bennett'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, t...
SELECT DISTINCT name, number FROM course WHERE credits = 1 AND department = 'EECS'
advising
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb 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 AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '马...
css
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT HOSP_DOC_CD, HOSP_DOC_NM FROM t_kc22 WHERE MED_EXP_DET_ID = '11195658531'
css
CREATE TABLE table_23026 ( "No." real, "Country" text, "Local title" text, "Format" text, "Start Date" text, "End Date" text, "Episodes" text, "Premiere/Air Dates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the season with 1...
SELECT "Premiere/Air Dates" FROM table_23026 WHERE "Format" = '1 Team'
wikisql
CREATE TABLE table_name_22 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the date for new orleans saints
SELECT date FROM table_name_22 WHERE opponent = "new orleans saints"
sql_create_context
CREATE TABLE table_name_70 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2011 Australian Open and a 2010 QF?
SELECT 2011 FROM table_name_70 WHERE tournament = "australian open" AND 2010 = "qf"
sql_create_context
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, Price FROM Products WHERE Price >= 180 ORDER BY Price DESC, Name
nvbench
CREATE TABLE table_16066063_1 ( city_1 VARCHAR, city_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city is listed first when Okinawa is listed as the second city?
SELECT city_1 FROM table_16066063_1 WHERE city_2 = "Okinawa"
sql_create_context
CREATE TABLE table_20684390_1 ( mccain_number VARCHAR, obama_percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of McCain vote totals where Obama percentages was 17.34%?
SELECT COUNT(mccain_number) FROM table_20684390_1 WHERE obama_percentage = "17.34%"
sql_create_context
CREATE TABLE table_49769 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "High points" FROM table_49769 WHERE "Date" = 'june 20'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '72363456' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 7610.85) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '72363456' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID ...
css
CREATE TABLE gas_station ( station_id number, open_year number, location text, manager_name text, vice_manager_name text, representative_name text ) CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, sales_billion ...
SELECT COUNT(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005
spider
CREATE TABLE table_23177573_1 ( original_air_date VARCHAR, rank__week_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original air date of the episode that had a week ranking of 21?
SELECT original_air_date FROM table_23177573_1 WHERE rank__week_ = 21
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.BGDH FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '43179204' AND NOT jyjgzbb.BGDH IN (SELECT jyjgzb...
css
CREATE TABLE table_73472 ( "States" text, "No. of MLA/MPs" real, "Value of each Vote" real, "K.R. Narayanan (Votes)" real, "K.R. Narayanan (Values)" real, "T.N. Seshan (Votes)" real, "T.N. Seshan (Values)" real, "Invalid (Votes)" real, "Invalid (Values)" real ) -- Using valid SQLit...
SELECT MAX("K.R. Narayanan (Votes)") FROM table_73472 WHERE "Value of each Vote" = '208'
wikisql
CREATE TABLE table_28627 ( "Region" text, "Population" real, "% of countrys population" text, "Change in population since 1993" real, "Change in % of countrys population since 1993" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what region was t...
SELECT "Region" FROM table_28627 WHERE "Change in % of countrys population since 1993" = '0.3'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '慢性咽炎' AND jyjgzbb.JCZBDM = '491442'
css
CREATE TABLE table_30238 ( "Round" text, "Clubs remaining" real, "Clubs involved" real, "Winners from previous round" text, "New entries this round" text, "Leagues entering at this round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many c...
SELECT "Clubs involved" FROM table_30238 WHERE "Round" = 'Second round'
wikisql
CREATE TABLE table_14637853_3 ( title VARCHAR, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the title with original air date being september23,1995
SELECT title FROM table_14637853_3 WHERE original_air_date = "September23,1995"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT demographic.expire_flag FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_name_87 ( losses INTEGER, scored VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Losses has Scored of 9, and Points larger than 8?
SELECT AVG(losses) FROM table_name_87 WHERE scored = 9 AND points > 8
sql_create_context
CREATE TABLE table_203_191 ( id number, "year" number, "group" text, "award" text, "result" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when was the last time rade serbedzija won an award for best actor ?
SELECT "year" FROM table_203_191 WHERE "award" = 'best actor' ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( dormid...
SELECT dorm_name, COUNT(*) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.Age > 20 GROUP BY T3.dorm_name
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '032-1755'
eicu
CREATE TABLE table_name_66 ( height__m_ VARCHAR, city VARCHAR, height__ft_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the height in meters for a building in Frankfurt that is 850 feet tall?
SELECT height__m_ FROM table_name_66 WHERE city = "frankfurt" AND height__ft_ = 850
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Catheter based invasive electrophysiologic testing"
mimicsql_data
CREATE TABLE table_name_58 ( team__number1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 1st Leg, when Team #1 is 'San Lorenzo'?
SELECT 1 AS st_leg FROM table_name_58 WHERE team__number1 = "san lorenzo"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY...
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_2668378_13 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was running where the winner is daniel montgomery
SELECT candidates FROM table_2668378_13 WHERE incumbent = "Daniel Montgomery"
sql_create_context
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCAT...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID
nvbench
CREATE TABLE table_name_18 ( week INTEGER, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest week number for the game that was at milwaukee county stadium?
SELECT MIN(week) FROM table_name_18 WHERE game_site = "milwaukee county stadium"
sql_create_context
CREATE TABLE table_name_12 ( decision VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the decision in Minnesota?
SELECT decision FROM table_name_12 WHERE home = "minnesota"
sql_create_context
CREATE TABLE table_train_25 ( "id" int, "bleeding" int, "acute_cerebrovascular_accident_cva" bool, "heart_disease" bool, "trauma" bool, "st_segment_elevation_myocardial_infarction_stemi" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT * FROM table_train_25 WHERE bleeding = 1
criteria2sql
CREATE TABLE table_name_26 ( attendance VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Hamilton Academical is the Opponent, what is the total Attendance?
SELECT COUNT(attendance) FROM table_name_26 WHERE opponent = "hamilton academical"
sql_create_context
CREATE TABLE d_icd_diagnoses ( 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 labevents ( row_id number, subject_id number, ...
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, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 <= 3)
mimic_iii
CREATE TABLE table_1685 ( "Episode" text, "First broadcast" text, "Graemes guest" text, "Jeremys guest" text, "Votes (%)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the jeremy guest for the episode 1x01
SELECT "Jeremys guest" FROM table_1685 WHERE "Episode" = '1x01'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodici...
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-70851')) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CU...
eicu
CREATE TABLE table_203_564 ( id number, "hand" text, "1 credit" number, "2 credits" number, "3 credits" number, "4 credits" number, "5 credits" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- each four aces win is a multiple of what number ...
SELECT "1 credit" FROM table_203_564 WHERE "hand" = 'four aces'
squall
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( dormid...
SELECT city_code, AVG(Age) FROM Student WHERE Sex = 'M' GROUP BY city_code ORDER BY AVG(Age)
nvbench
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 a.Score, a.Id AS "post_link", q.AnswerCount AS Answers, q.OwnerUserId AS "user_link", a.CreationDate AS "answered_on", a.PostTypeId FROM Posts AS a INNER JOIN Posts AS q ON q.Id = a.ParentId WHERE q.AcceptedAnswerId IS NULL AND a.OwnerUserId = '##MyID##' ORDER BY a.CreationDate DESC
sede
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor ORDER BY COUNT(*)
nvbench
CREATE TABLE table_40980 ( "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 result of the game on October 17, 1965?
SELECT "Result" FROM table_40980 WHERE "Date" = 'october 17, 1965'
wikisql
CREATE TABLE table_11803648_17 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT POSITION DOES PATRICK WIERCIOCH PLAY?
SELECT position FROM table_11803648_17 WHERE player = "Patrick Wiercioch"
sql_create_context
CREATE TABLE table_name_1 ( value VARCHAR, first_issued VARCHAR, reverse VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much was a Reverse of guitar of agust n p o barrios before 1998?
SELECT value FROM table_name_1 WHERE first_issued < 1998 AND reverse = "guitar of agustín pío barrios"
sql_create_context
CREATE TABLE table_76584 ( "2006/ 07" text, "2008/ 09" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 2006/07, when 2008/09 is LQ, and when 2010/11 is Not Held?
SELECT "2006/ 07" FROM table_76584 WHERE "2008/ 09" = 'lq' AND "2010/ 11" = 'not held'
wikisql
CREATE TABLE table_20861261_4 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's Curtis Painter's position?
SELECT position FROM table_20861261_4 WHERE player = "Curtis Painter"
sql_create_context
CREATE TABLE table_29933 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name t...
SELECT COUNT("Date") FROM table_29933 WHERE "High points" = 'Stephen Curry , Dorell Wright (27)'
wikisql
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime t...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) ...
mimic_iii
CREATE TABLE table_name_8 ( position VARCHAR, pick VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the position when the pick is higher than 32 and the team is atlanta braves?
SELECT position FROM table_name_8 WHERE pick > 32 AND team = "atlanta braves"
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 t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '7149327' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_IN_DIAG_DIS_CD
css
CREATE TABLE table_name_16 ( muzzle_energy VARCHAR, source VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Muzzle energy, when Source is hornady?
SELECT muzzle_energy FROM table_name_16 WHERE source = "hornady"
sql_create_context
CREATE TABLE table_1376890_2 ( chroma_format VARCHAR, scalable_modes VARCHAR, intra_dc_precision VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the chroma format with scalable modes being snr- or spatial-scalable and intra dc precbeingion being 8,...
SELECT chroma_format FROM table_1376890_2 WHERE scalable_modes = "SNR- or spatial-scalable" AND intra_dc_precision = "8, 9, 10"
sql_create_context
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 gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '56692747' GROUP BY gwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '56692747' GROUP BY fgwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) ...
css
CREATE TABLE table_59460 ( "Club" text, "Coach" text, "City" text, "Stadium" text, "2007-2008 season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who coached for al farwaniyah?
SELECT "Coach" FROM table_59460 WHERE "City" = 'al farwaniyah'
wikisql
CREATE TABLE table_28946 ( "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 were the candidates leven powell (f) 63.8% roger west (dr...
SELECT COUNT("First elected") FROM table_28946 WHERE "Candidates" = 'Leven Powell (F) 63.8% Roger West (DR) 36.4%'
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 jyjgzbb.YQBH, jyjgzbb.YQMC 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 jybg...
css
CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABL...
SELECT T1.activity_name FROM activity AS T1 JOIN participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_203_67 ( id number, "place" number, "team" text, "played" number, "won" number, "draw" number, "lost" number, "goals\nscored" number, "goals\nconceded" number, "+/-" number, "points" number ) -- Using valid SQLite, answer the following questions for the t...
SELECT SUM("played") FROM table_203_67
squall
CREATE TABLE table_66254 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many silver medals did Estonia, which won more than 1 gold and less than 97 medals total...
SELECT "Silver" FROM table_66254 WHERE "Gold" > '1' AND "Total" < '97' AND "Nation" = 'estonia'
wikisql
CREATE TABLE table_41298 ( "Outcome" text, "Date" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score where the opponent was Mardy Fish?
SELECT "Score" FROM table_41298 WHERE "Opponent" = 'mardy fish'
wikisql
CREATE TABLE table_20804 ( "Institution" text, "Location" text, "Nickname" text, "Enrollment" real, "Established" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Location of the school with the nickname Mountaineers
SELECT "Location" FROM table_20804 WHERE "Nickname" = 'Mountaineers'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, ...
SELECT * FROM Posts WHERE Posts.PostTypeId = 5 AND 'Tag Name' LIKE '%sql%'
sede
CREATE TABLE table_80391 ( "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 was the loss of the Brewers game when the record was 46-48?
SELECT "Loss" FROM table_80391 WHERE "Record" = '46-48'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT (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.RYBH = '98519847' AND mzjzjlb.JZKSRQ BETWEEN '2005-12-14' AND '2010-02-05') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_...
css
CREATE TABLE table_name_83 ( country VARCHAR, date VARCHAR, birth_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country was the woman from who was born 1976-07-23 and became a grandmaster in 1991?
SELECT country FROM table_name_83 WHERE date = 1991 AND birth_date = "1976-07-23"
sql_create_context
CREATE TABLE table_39505 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game is the average one that has a February larger than 20, and a Record of 41 1...
SELECT AVG("Game") FROM table_39505 WHERE "February" > '20' AND "Record" = '41–17–4' AND "Points" < '86'
wikisql
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE T...
SELECT COUNT(DISTINCT flight.flight_id) FROM airport_service, city, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DATE_DAY_0.day_number = 29 AND DATE_DAY_0.month_number = 4 AND DATE_DAY_0.year = 1...
atis
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 DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = '2 ml : furosemide 10 mg/ml ij soln')
eicu
CREATE TABLE table_65415 ( "Region" text, "Date" text, "Format" text, "Label" text, "Edition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What format was released April 16, 2009?
SELECT "Format" FROM table_65415 WHERE "Date" = 'april 16, 2009'
wikisql
CREATE TABLE table_50541 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "High rebounds" FROM table_50541 WHERE "Date" = 'march 13'
wikisql
CREATE TABLE table_78603 ( "Date" text, "Venue" text, "Winner" text, "Runner-up" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner in the match that had John Higgins as runner-up?
SELECT "Winner" FROM table_78603 WHERE "Runner-up" = 'john higgins'
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 (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND p...
css
CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) ...
SELECT Away_team, COUNT(Away_team) FROM game GROUP BY Home_team, Away_team
nvbench
CREATE TABLE table_51716 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the Player playing for the College of Kentucky and a Height of 6-7 what was t...
SELECT "School" FROM table_51716 WHERE "College" = 'kentucky' AND "Height" = '6-7'
wikisql
CREATE TABLE table_68891 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the second leg that Valencia was on?
SELECT "2nd leg" FROM table_68891 WHERE "Team 2" = 'valencia'
wikisql
CREATE TABLE table_name_21 ( opponent VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent of the game in Week 3?
SELECT opponent FROM table_name_21 WHERE week = 3
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.short_title = "Vaccination NEC"
mimicsql_data
CREATE TABLE table_name_24 ( game INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Game with a Date that is june 14?
SELECT AVG(game) FROM table_name_24 WHERE date = "june 14"
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 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 table_30972 ( "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 (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT COUNT("No. in season") FROM table_30972 WHERE "No. in series" = '122'
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 zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers...
css
CREATE TABLE table_53186 ( "Round" real, "Pick #" real, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Position of Pick #77?
SELECT "Position" FROM table_53186 WHERE "Pick #" = '77'
wikisql
CREATE TABLE table_39703 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total medals for germany with under 56 bronzes?
SELECT SUM("Total") FROM table_39703 WHERE "Nation" = 'germany' AND "Bronze" < '56'
wikisql
CREATE TABLE table_1300525_1 ( density VARCHAR, english_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the density of yushan county?
SELECT COUNT(density) FROM table_1300525_1 WHERE english_name = "Yushan County"
sql_create_context
CREATE TABLE table_66601 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What frequency is First Nations Community?
SELECT "Frequency" FROM table_66601 WHERE "Format" = 'first nations community'
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7271121' AND t_kc21.IN_DIAG_DIS_CD = 'J45.129')
css
CREATE TABLE table_28885977_1 ( location VARCHAR, built_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what location was a stadium built for the St Kilda Football Club?
SELECT location FROM table_28885977_1 WHERE built_for = "St Kilda Football Club"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT demographic.age, demographic.insurance FROM demographic WHERE demographic.subject_id = "17595"
mimicsql_data
CREATE TABLE table_63709 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality with a lane larger than 1, and a rank larger than 5, for Hsu Chi-Chieh?
SELECT "Nationality" FROM table_63709 WHERE "Lane" > '1' AND "Rank" > '5' AND "Name" = 'hsu chi-chieh'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5583587' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_NM HAVING AVG(qtb.PERSON_AGE) < 5 UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5583587' GROUP ...
css
CREATE TABLE table_60569 ( "Measure" text, "Bombali" real, "Bonthe" real, "Kailahun" real, "Kambia" text, "Kenema" real, "Koinadugu" real, "Kono" real, "Moyamba" text, "Port Loko" text, "Pujehun" real, "Tonkolili" real ) -- Using valid SQLite, answer the following quest...
SELECT AVG("Pujehun") FROM table_60569 WHERE "Measure" = 'female enrollment'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Percutan liver aspirat"
mimicsql_data
CREATE TABLE table_name_13 ( founded INTEGER, suburb_town VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On average, when were vineyard schools founded?
SELECT AVG(founded) FROM table_name_13 WHERE suburb_town = "vineyard"
sql_create_context
CREATE TABLE table_name_95 ( lead VARCHAR, institute VARCHAR, social_democratic VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the lead for institute of election results and social democratic of 31.7% 8 seats
SELECT lead FROM table_name_95 WHERE institute = "election results" AND social_democratic = "31.7% 8 seats"
sql_create_context
CREATE TABLE table_57739 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points when under 17,197 attended agains...
SELECT AVG("Points") FROM table_57739 WHERE "Attendance" < '17,197' AND "Opponent" = 'wild'
wikisql
CREATE TABLE table_name_67 ( opponent VARCHAR, against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the opponent when norway is against?
SELECT opponent FROM table_name_67 WHERE against = "norway"
sql_create_context