instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_44038 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What label has the netherlands as the region, and magik muzik 802-1 as the catalog?
SELECT "Label" FROM table_44038 WHERE "Region" = 'netherlands' AND "Catalog" = 'magik muzik 802-1'
wikisql
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 COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-19271')) AND STRFTIME('%y', microlab.culturetakentime) >= '2101'
eicu
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE wdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, K...
SELECT COUNT(*) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '83591891' AND wdmzjzjlb.JZKSRQ BETWEEN '2012-01-29' AND '2020-03-31' AND wdmzjzjlb.YLJGDM = '6330903' UNION SELECT COUNT(*) FROM hz_info JOIN bdmzjzjlb ON ...
css
CREATE TABLE table_name_30 ( time VARCHAR, nation VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time of kenya, which is ranked 2?
SELECT time FROM table_name_30 WHERE nation = "kenya" AND rank = "2"
sql_create_context
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 t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'encephalopathy' AND STRFTIME('%y', diagnosis...
eicu
CREATE TABLE people ( people_id number, name text, height number, weight number, birth_date text, birth_place text ) CREATE TABLE body_builder ( body_builder_id number, people_id number, snatch number, clean_jerk number, total number ) -- Using valid SQLite, answer the fol...
SELECT birth_date FROM people ORDER BY height
spider
CREATE TABLE table_33275 ( "Rank by average" real, "Place" real, "Couple" text, "Total points" real, "Number of dances" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of dances with a less than 2 place a...
SELECT MIN("Number of dances") FROM table_33275 WHERE "Place" < '2' AND "Average" < '27.5'
wikisql
CREATE TABLE table_name_31 ( pioneer INTEGER, year VARCHAR, sarina VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Pioneer population in 1966 with a Sarina population greater than 4,611?
SELECT MIN(pioneer) FROM table_name_31 WHERE year = 1966 AND sarina > 4 OFFSET 611
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY All_Games
nvbench
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE table_64235 ( "Title" text, "Label" text, "Year of Release" real, "Country of Release" text, "Peaches:" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which title has origianal sound entertainment as its label?
SELECT "Title" FROM table_64235 WHERE "Label" = 'origianal sound entertainment'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
SELECT Title, Id, PostTypeId FROM Posts WHERE CreationDate BETWEEN '2014-07-01' AND '2014-07-31'
sede
CREATE TABLE table_name_97 ( city VARCHAR, years VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city had years 1971-1974?
SELECT city FROM table_name_97 WHERE years = "1971-1974"
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Medicare" AND lab.label = "Hemoglobin"
mimicsql_data
CREATE TABLE table_44487 ( "Team" text, "Tries for" text, "Tries against" text, "Try diff" text, "Points for" text, "Points against" text, "Points diff" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Try Diff, when Points Diff is +71...
SELECT "Try diff" FROM table_44487 WHERE "Points diff" = '+71'
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "PITUITARY BLEED"
mimicsql_data
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 = "ASIAN" AND prescriptions.drug = "Dorzolamide 2%/Timolol 0.5% Ophth."
mimicsql_data
CREATE TABLE table_77124 ( "Date" text, "Opponent#" text, "Site" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Attendance when the Result is l0-13?
SELECT "Attendance" FROM table_77124 WHERE "Result" = 'l0-13'
wikisql
CREATE TABLE table_74852 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Points have an Opponent of @ los angeles kings and a Game larger than 4?
SELECT AVG("Points") FROM table_74852 WHERE "Opponent" = '@ los angeles kings' AND "Game" > '4'
wikisql
CREATE TABLE table_59203 ( "Year" real, "Lok Sabha" text, "Members of Parliament" text, "Party Won" text, "Winner's % votes" text, "Trailing Party" text, "Trailing Party % votes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Members...
SELECT "Members of Parliament" FROM table_59203 WHERE "Winner's % votes" = '50.54%'
wikisql
CREATE TABLE table_41771 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many totals have 1 gold and a rank smaller than 2?
SELECT COUNT("Total") FROM table_41771 WHERE "Gold" = '1' AND "Rank" < '2'
wikisql
CREATE TABLE table_204_987 ( id number, "city/municipality" text, "no. of\nbarangays" number, "area\n(km2)" number, "population\n(2010 census)" number, "pop. density\n(per km2)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the number of bara...
SELECT "city/municipality" FROM table_204_987 WHERE "no. of\nbarangays" = (SELECT SUM("no. of\nbarangays") FROM table_204_987 WHERE "city/municipality" IN ('morong', 'rodriguez'))
squall
CREATE TABLE table_name_32 ( crowd INTEGER, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest crowd for an Away team of st kilda?
SELECT MAX(crowd) FROM table_name_32 WHERE away_team = "st kilda"
sql_create_context
CREATE TABLE table_5075 ( "Match" real, "League" text, "Date & Time ( CET )" text, "Arena" text, "Team and Score" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result at A Arena, the SL league, and a match number ove...
SELECT "Result" FROM table_5075 WHERE "Arena" = 'a' AND "League" = 'sl' AND "Match" > '16'
wikisql
CREATE TABLE table_name_25 ( played VARCHAR, bp VARCHAR, pts_agst VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- B.P. of 0, and a Pts Agst smaller than 247 has how many total number of played?
SELECT COUNT(played) FROM table_name_25 WHERE bp = 0 AND pts_agst < 247
sql_create_context
CREATE TABLE table_name_29 ( speed VARCHAR, position VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the speed of the race that ended in 2nd place and had a time of 01:13:03.39?
SELECT speed FROM table_name_29 WHERE position = "2nd" AND time = "01:13:03.39"
sql_create_context
CREATE TABLE people ( people_id number, sex text, name text, date_of_birth text, height number, weight number ) CREATE TABLE candidate ( candidate_id number, people_id number, poll_source text, date text, support_rate number, consider_rate number, oppose_rate number,...
SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1
spider
CREATE TABLE table_53082 ( "Height (m.)" text, "No. of times visited" real, "No. of HC climbs" real, "First time as HC climb" real, "Most recent" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many HC climbs had 1 visit more recently than 1984, ...
SELECT "No. of HC climbs" FROM table_53082 WHERE "No. of times visited" = '1' AND "Most recent" > '1984' AND "First time as HC climb" < '1994' AND "Height (m.)" = '1900'
wikisql
CREATE TABLE table_40602 ( "Pick" real, "Player" text, "Team" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Team with a Player that is david cooper?
SELECT "Team" FROM table_40602 WHERE "Player" = 'david cooper'
wikisql
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "1" AND procedures.long_title = "Aortography"
mimicsql_data
CREATE TABLE table_61181 ( "Nat." text, "Name" text, "Moving from" text, "Type" text, "Transfer window" text, "Ends" real, "Transfer fee" text, "Source" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did the player with a transfer ...
SELECT "Moving from" FROM table_61181 WHERE "Type" = 'transfer' AND "Transfer window" = 'summer' AND "Ends" < '2013'
wikisql
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 COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-51980')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce...
eicu
CREATE TABLE table_33176 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the away team when the score is 6.9 (45)...
SELECT "Away team" FROM table_33176 WHERE "Away team score" = '6.9 (45)'
wikisql
CREATE TABLE table_25545 ( "Year" real, "Dates" text, "Champion" text, "Country" text, "Score" text, "Margin of victory" text, "Tournament location" text, "Purse ( $ )" real, "Winners share ($)" real ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT COUNT("Year") FROM table_25545 WHERE "Champion" = 'Pat Bradley'
wikisql
CREATE TABLE table_64749 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue had a competition of World Junior Championships before 2011?
SELECT "Venue" FROM table_64749 WHERE "Year" < '2011' AND "Competition" = 'world junior championships'
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 zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '苏正诚' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2021-04-1...
css
CREATE TABLE table_name_74 ( champion VARCHAR, second VARCHAR, third VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner the year Ramona Rahnis finished 2nd and Diana Sartor 3rd?
SELECT champion FROM table_name_74 WHERE second = "ramona rahnis" AND third = "diana sartor"
sql_create_context
CREATE TABLE table_204_215 ( id number, "airline" text, "destination(s)" text, "aircraft scheduled" text, "service date(s)" text, "comments" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which airline has more listed destinations , continental ...
SELECT "airline" FROM table_204_215 WHERE "airline" IN ('continental express', 'america west express') ORDER BY "destination(s)" DESC LIMIT 1
squall
CREATE TABLE table_20903 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position was taken out of Louisiana-Lafayette?
SELECT "Position" FROM table_20903 WHERE "College" = 'Louisiana-Lafayette'
wikisql
CREATE TABLE table_name_39 ( born_died VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Born-Died dates of Xhafer Bej Ypi?
SELECT born_died FROM table_name_39 WHERE name = "xhafer bej ypi"
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 demographic.dischtime FROM demographic WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
CREATE TABLE table_name_22 ( silver VARCHAR, total VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of silver medals for nations with 5 total medals and more than 3 gold medals?
SELECT COUNT(silver) FROM table_name_22 WHERE total = 5 AND gold > 3
sql_create_context
CREATE TABLE table_66584 ( "Latest stable release" text, "Developer" text, "3D support?" text, "Runs on POSIX style systems ?" text, "Runs on Windows?" text, "User Interface Language(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which User ...
SELECT "User Interface Language(s)" FROM table_66584 WHERE "Runs on POSIX style systems ?" = 'no' AND "Developer" = 'sescoi'
wikisql
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, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( ...
SELECT COUNT(*) > 0 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 = 'MATSCIE' AND course.number = 662 AND semester.semester <> 'Fall'
advising
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '9519720' GROUP BY MED_ORG_DEPT_CD HAVING AVG(IN_HOSP_DAYS) > 4) AS T
css
CREATE TABLE table_36629 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Opponent of @ giants, and a Record of 8 12 had what score?
SELECT "Score" FROM table_36629 WHERE "Opponent" = '@ giants' AND "Record" = '8–12'
wikisql
CREATE TABLE table_73379 ( "Round" real, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the driver for the winning team Laws...
SELECT "Winning Driver" FROM table_73379 WHERE "Winning Team" = 'Lawson Team Impul'
wikisql
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.CKZFWXX, jyjgzbb.CKZFWSX FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'E00.628' AND jyjgzbb.JCZBMC = '免疫球蛋白A(标准)' UNION SELECT jyjgzbb.CK...
css
CREATE TABLE table_11210576_4 ( final_episode VARCHAR, character VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the total number of final epbeingode count with character being rick stetler
SELECT COUNT(final_episode) AS Count FROM table_11210576_4 WHERE character = "Rick Stetler"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-10615' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1)
eicu
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.gender, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "5027"
mimicsql_data
CREATE TABLE table_26770 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many pole ...
SELECT MAX("Poles") FROM table_26770 WHERE "Season" = '2011'
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 T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code
nvbench
CREATE TABLE table_name_29 ( labour_party INTEGER, green_party VARCHAR, fianna_fáil VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many are in the Labour Party of a Fianna Fail of 3 with a total higher than 9 and more than 2 in the...
SELECT SUM(labour_party) FROM table_name_29 WHERE fianna_fáil = 3 AND total > 9 AND green_party > 2
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 * FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Road, ACC_Percent FROM basketball_match
nvbench
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 demographic.diagnosis, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "12220"
mimicsql_data
CREATE TABLE table_name_12 ( points_for VARCHAR, drawn VARCHAR, losing_bonus VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points drew 2 with a losing bonus of 5?
SELECT points_for FROM table_name_12 WHERE drawn = "2" AND losing_bonus = "5"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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 ...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '31294224' AND t_kc22.STA_DATE BETWEEN '2004-11-03' AND '2019-06-03' AND t_kc21.MED_SER_ORG_NO = '3614796' AND t_kc22.MED_INV...
css
CREATE TABLE table_name_80 ( date VARCHAR, h_a_n VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date was the Score 105-118 and the H/A/N A?
SELECT date FROM table_name_80 WHERE h_a_n = "a" AND score = "105-118"
sql_create_context
CREATE TABLE table_38115 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponent in the Final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Outcome of the game with a Score of 3 6, 4 6?
SELECT "Outcome" FROM table_38115 WHERE "Score" = '3–6, 4–6'
wikisql
CREATE TABLE table_name_28 ( rank VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank for season 1?
SELECT rank FROM table_name_28 WHERE season = 1
sql_create_context
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH ...
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '郎高义'
css
CREATE TABLE city ( city_id number, county_id number, name text, white number, black number, amerindian number, asian number, multiracial number, hispanic number ) CREATE TABLE county_public_safety ( county_id number, name text, population number, police_officers num...
SELECT crime_rate FROM county_public_safety ORDER BY police_officers
spider
CREATE TABLE table_34669 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value of bronze with less than 2 in total?
SELECT "Bronze" FROM table_34669 WHERE "Total" < '2'
wikisql
CREATE TABLE table_66151 ( "Season" real, "First Aired" text, "Last Aired" text, "Episodes" real, "Network" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Of the series that last aired August 20, 2010, what is the lowest number of seasons?
SELECT MIN("Season") FROM table_66151 WHERE "Last Aired" = 'august 20, 2010'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE pat...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'endovasc em...
mimic_iii
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.long_title = "Percutaneous transluminal coronary angioplasty status"
mimicsql_data
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 hz_info_zyjzjlb ( JZLSH number, ...
SELECT mzjzjlb.SG, mzjzjlb.TZ 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 = '00559880'
css
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(*) > 0 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 = 28443)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d...
mimic_iii
CREATE TABLE table_202_24 ( id number, "year" number, "single" text, "peak chart positions\nfin" number, "peak chart positions\nnor" number, "peak chart positions\nswe" number, "album" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which sol...
SELECT "single" FROM table_202_24 ORDER BY "peak chart positions\nfin" LIMIT 1
squall
CREATE TABLE captain ( captain_id number, name text, ship_id number, age text, class text, rank text ) CREATE TABLE ship ( ship_id number, name text, type text, built_year number, class text, flag text ) -- Using valid SQLite, answer the following questions for the tab...
SELECT COUNT(DISTINCT rank) FROM captain
spider
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 c...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'nonsp abn find-gu organs'))
mimic_iii
CREATE TABLE table_4091 ( "Track no." real, "Track" text, "Original Artist" text, "Soloist(s)" text, "Vocal Percussionist" text, "Arranger(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original artist when the vocal percussionis...
SELECT "Original Artist" FROM table_4091 WHERE "Vocal Percussionist" = 'Alexei Kalveks'
wikisql
CREATE TABLE table_name_46 ( winning_driver VARCHAR, pole_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the Winning driver with a Pole position of bryan herta?
SELECT winning_driver FROM table_name_46 WHERE pole_position = "bryan herta"
sql_create_context
CREATE TABLE table_6895 ( "Peel" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Wins has a Byes larger than 0?
SELECT MAX("Wins") FROM table_6895 WHERE "Byes" > '0'
wikisql
CREATE TABLE table_11862 ( "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 team has an away team score of 9.11 (65)?
SELECT "Home team" FROM table_11862 WHERE "Away team score" = '9.11 (65)'
wikisql
CREATE TABLE table_5717 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the latest week with a result of l 14-3?
SELECT MAX("Week") FROM table_5717 WHERE "Result" = 'l 14-3'
wikisql
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.days_stay > "26"
mimicsql_data
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid n...
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-28600')) AND microlab.culturesite = 'sputum, tracheal specimen' AND DATETIME(m...
eicu
CREATE TABLE table_name_46 ( enrollment INTEGER, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest enrollment that has Lafayette as the location?
SELECT MIN(enrollment) FROM table_name_46 WHERE location = "lafayette"
sql_create_context
CREATE TABLE table_name_60 ( to_par VARCHAR, player VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par of player tom weiskopf, who has a 71-74=145 score?
SELECT to_par FROM table_name_60 WHERE score = 71 - 74 = 145 AND player = "tom weiskopf"
sql_create_context
CREATE TABLE table_train_246 ( "id" int, "allergy_to_dapagliflozin" bool, "allergy_to_exenatide" bool, "estimated_glomerular_filtration_rate_egfr" int, "fasting_c_peptide" float, "urine_albumin_to_creatinine_ratio_uacr" int, "fasting_triglyceride" int, "NOUSE" float ) -- Using valid SQ...
SELECT * FROM table_train_246 WHERE estimated_glomerular_filtration_rate_egfr < 60
criteria2sql
CREATE TABLE table_dev_45 ( "id" int, "tc" int, "systolic_blood_pressure_sbp" int, "parenteral_antibiotic_therapy" bool, "fasting_plasma_glucose_fpg" float, "active_infection" bool, "untreated_hyperlipidemia" bool, "hemoglobin_a1c_hba1c" float, "temperature" float, "diastolic_blo...
SELECT * FROM table_dev_45 WHERE diabetes = 1 OR ((systolic_blood_pressure_sbp > 135 OR diastolic_blood_pressure_dbp > 85) OR a1c > 8 OR ldl > 100)
criteria2sql
CREATE TABLE table_204_789 ( id number, "plant name" text, "location" text, "country" text, "startup date" number, "capacity (mmtpa)" text, "corporation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- qatargas ii started up the same year as ...
SELECT "plant name" FROM table_204_789 WHERE "startup date" = (SELECT "startup date" FROM table_204_789 WHERE "plant name" = 'qatargas ii') AND "country" = 'indonesia'
squall
CREATE TABLE table_1558077_8 ( lunar_blastoff_date VARCHAR, mission_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of luna blastoff date for apollo 11
SELECT COUNT(lunar_blastoff_date) FROM table_1558077_8 WHERE mission_name = "Apollo 11"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2162" AND procedures.short_title = "Left heart cardiac cath"
mimicsql_data
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '14111458' AND t_kc22.STA_DATE BETWEEN '2005-03-22' AND '2009-01-07' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸多奈哌齐胶囊'
css
CREATE TABLE table_31340 ( "Rank 2012" real, "Country" text, "UNWTO Region" text, "International tourism expenditure 2011" text, "International tourism expenditure 2012" text, "% change" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many co...
SELECT MAX("Rank 2012") FROM table_31340 WHERE "International tourism expenditure 2011" = '$51.0 billion'
wikisql
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', 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 = '017-88691'...
eicu
CREATE TABLE table_38617 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of played of the tea...
SELECT MAX("Played") FROM table_38617 WHERE "Lost" < '11' AND "Drawn" < '12'
wikisql
CREATE TABLE table_53923 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the player number for the player from Cen...
SELECT "No.(s)" FROM table_53923 WHERE "School/Club Team/Country" = 'centenary'
wikisql
CREATE TABLE table_name_64 ( results¹ VARCHAR, type_of_game VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for the 1964 summer olympics on october 18?
SELECT results¹ FROM table_name_64 WHERE type_of_game = "1964 summer olympics" AND date = "october 18"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY ...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_name_52 ( bronze INTEGER, silver VARCHAR, gold VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average Bronze when silver is more than 3, gold is more than 1 and the total is 14
SELECT AVG(bronze) FROM table_name_52 WHERE gold > 1 AND total = 14 AND silver > 3
sql_create_context
CREATE TABLE table_18522 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the election in the Texas 4 district?
SELECT "Result" FROM table_18522 WHERE "District" = 'Texas 4'
wikisql
CREATE TABLE table_1342256_38 ( incumbent VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the incumbent in Pennsylvania 27?
SELECT incumbent FROM table_1342256_38 WHERE district = "Pennsylvania 27"
sql_create_context
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE View_Unit_Status ( apt_id INTEG...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date)
nvbench
CREATE TABLE table_name_25 ( competition VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What competition has may 5, 2001 as the date?
SELECT competition FROM table_name_25 WHERE date = "may 5, 2001"
sql_create_context
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 mzjzjlb ( HXPLC number, HZXM ...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzj...
css