instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ) CREATE TABLE volume ( volume_id number, volume_issue text, issue_date text, weeks_on_top number, song text, artist_id number ) CREATE TABLE a...
SELECT song FROM volume ORDER BY weeks_on_top DESC LIMIT 1
spider
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time,...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 86209 AND STRFTIME('%y', admissions.admittime) = '2105' ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_54782 ( "Rank" real, "Club" text, "Gold" real, "Big Silver" real, "Small Silver" real, "Bronze" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points did landskrona bois get when they were ranked be...
SELECT COUNT("Points") FROM table_54782 WHERE "Club" = 'landskrona bois' AND "Rank" < '18'
wikisql
CREATE TABLE flight ( id VARCHAR, airport_id VARCHAR, pilot VARCHAR ) CREATE TABLE airport ( id VARCHAR, airport_id VARCHAR, pilot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many airports haven't the pilot 'Thompson' driven an aircra...
SELECT COUNT(*) FROM airport WHERE NOT id IN (SELECT airport_id FROM flight WHERE pilot = 'Thompson')
sql_create_context
CREATE TABLE table_34802 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the runner-up on 5 aug 1990?
SELECT "Runner-up" FROM table_34802 WHERE "Date" = '5 aug 1990'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "5589" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ...
css
CREATE TABLE table_66046 ( "Hull Number" text, "Name" text, "Builder" text, "Laid down" text, "Launched" text, "Completed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the builder for the USS cambridge?
SELECT "Builder" FROM table_66046 WHERE "Name" = 'uss cambridge'
wikisql
CREATE TABLE drivers ( forename VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the forenames of all distinct drivers in alphabetical order?
SELECT DISTINCT forename FROM drivers ORDER BY forename
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE i...
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15417')) AND DATETIME(microlab.culturetakentime) >= DATETIME(CURRE...
eicu
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '81139819' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 5429.71)
css
CREATE TABLE procedures ( 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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Benign neoplasm of pituitary gland and craniopharyngeal duct" AND lab.flag = "delta"
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 SUM(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.PERSON_NM = '戚文栋' AND t_kc21.CLINIC_TYPE = '门诊'
css
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.days_stay FROM demographic WHERE demographic.subject_id = "8440"
mimicsql_data
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '41538489' AND MED_SER_ORG_NO = '7012713' AND IN_DIAG_DIS_NM LIKE '%未%'
css
CREATE TABLE table_21592 ( "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 d...
SELECT "Date" FROM table_21592 WHERE "Team" = 'Indiana'
wikisql
CREATE TABLE table_name_56 ( erp_w VARCHAR, city_of_license VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the ERP W for glens falls, new york
SELECT erp_w FROM table_name_56 WHERE city_of_license = "glens falls, new york"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, u...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636')) AND medication.routeadmin = 'ngt' AND DATETIME(medicati...
eicu
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT demographic.dod FROM demographic WHERE demographic.name = "Brian Taylor"
mimicsql_data
CREATE TABLE table_53425 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How large of a crowd can the Brunswick Street Ov...
SELECT COUNT("Crowd") FROM table_53425 WHERE "Venue" = 'brunswick street oval'
wikisql
CREATE TABLE table_28693349_2 ( games INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games did Robert Peare play?
SELECT MAX(games) FROM table_28693349_2 WHERE player = "Robert Peare"
sql_create_context
CREATE TABLE table_78445 ( "Name" text, "Gender" text, "Local board" text, "Suburb" text, "Authority" text, "Decile" text, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name when the local board is albert eden, and a Deci...
SELECT "Name" FROM table_78445 WHERE "Local board" = 'albert–eden' AND "Decile" = '9'
wikisql
CREATE TABLE table_name_35 ( record VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Record has an Event of cage rage 23?
SELECT record FROM table_name_35 WHERE event = "cage rage 23"
sql_create_context
CREATE TABLE table_50370 ( "Start Date/Time" text, "Duration" text, "End Time" text, "Spacecraft" text, "Crew" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What crew's EVA started on 20 February 20:09?
SELECT "Crew" FROM table_50370 WHERE "Start Date/Time" = '20 february 20:09'
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.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'C26.768' AND jyjgzbb.JCZBDM = '680382'
css
CREATE TABLE table_19446 ( "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. -- What are all the AAA classes in the school years of 2004-05?
SELECT "Class AAA" FROM table_19446 WHERE "School Year" = '2004-05'
wikisql
CREATE TABLE table_name_46 ( date VARCHAR, winner VARCHAR, race_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did Ted Horn win Lakewood Race 2?
SELECT date FROM table_name_46 WHERE winner = "ted horn" AND race_name = "lakewood race 2"
sql_create_context
CREATE TABLE company ( headquarters VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all headquarters and the number of companies in each headquarter.
SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-70268')) AND DATETIME(treatment.treatmenttime, 'start of year...
eicu
CREATE TABLE table_46742 ( "Country" text, "Amateur Era" real, "Open Era" real, "All-time" real, "First title" real, "Last title" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of All-Time, when Amateur Era is less than 0?
SELECT SUM("All-time") FROM table_46742 WHERE "Amateur Era" < '0'
wikisql
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'BCS' AND number = 439
advising
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 demographic.expire_flag, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Bruce Harris"
mimicsql_data
CREATE TABLE table_32253 ( "Season" real, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "Podiums" text, "Points" text, "Final Placing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the points with 7 r...
SELECT "Points" FROM table_32253 WHERE "Races" = '7'
wikisql
CREATE TABLE table_30818 ( "Pick" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did Edmonton Oilers get for their draft pick?
SELECT "Player" FROM table_30818 WHERE "NHL team" = 'Edmonton Oilers'
wikisql
CREATE TABLE table_name_96 ( outcome VARCHAR, score_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Outcome has a Score in the final of 4 6, 5 7?
SELECT outcome FROM table_name_96 WHERE score_in_the_final = "4–6, 5–7"
sql_create_context
CREATE TABLE table_30511 ( "Pick" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of the chosen club where the hc dukla tren ...
SELECT COUNT("Pick") FROM table_30511 WHERE "College/junior/club team" = 'HC Dukla Trenčín (Slovakia)'
wikisql
CREATE TABLE table_17814458_1 ( capacity_in_persons_hour INTEGER, construction_year_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least capacity for persons hour for 1983
SELECT MIN(capacity_in_persons_hour) FROM table_17814458_1 WHERE construction_year_s_ = "1983"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-139111')) AND NOT vitalperiodic.systemicsystoli...
eicu
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
SELECT zyjzjlb.MZBMLX, zyjzjlb.MZZDBM, zyjzjlb.MZZDMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '09590061301'
css
CREATE TABLE table_204_903 ( id number, "title" text, "character" text, "broadcaster" text, "episodes" number, "date" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- were there more than four episodes that featured cynthia ?
SELECT (SELECT "episodes" FROM table_204_903 WHERE "character" = 'cynthia') > 4
squall
CREATE TABLE table_train_152 ( "id" int, "systolic_blood_pressure_sbp" int, "creatinine_clearance_cl" float, "diastolic_blood_pressure_dbp" int, "total_cholesterol" int, "urine_protein" int, "proteinuria" int, "NOUSE" float ) -- Using valid SQLite, answer the following questions for th...
SELECT * FROM table_train_152 WHERE creatinine_clearance_cl > 1.6
criteria2sql
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, Po...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%auckland%' OR UPPER(Location) LIKE '%AUCKLAND' ORDER BY Reputation DESC LIMIT 50
sede
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDa...
SELECT questions.Id AS "post_link", COUNT(*) AS "AnswerCount" FROM Posts AS questions JOIN Posts AS answers ON answers.ParentId = questions.Id WHERE questions.OwnerUserId = '##UserId##' AND questions.PostTypeId = 1 AND questions.AcceptedAnswerId IS NULL GROUP BY questions.Id
sede
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 COUNT(gwyjzb.PERSON_ID) FROM gwyjzb WHERE gwyjzb.IN_DIAG_DIS_NM = '酒精依赖综合征' UNION SELECT COUNT(fgwyjzb.PERSON_ID) FROM fgwyjzb WHERE fgwyjzb.IN_DIAG_DIS_NM = '酒精依赖综合征'
css
CREATE TABLE program ( program_id number, name text, origin text, launch number, owner text ) CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, share_in_percent number ) CREATE TABLE channel ( channel_id number, name text, owner text, s...
SELECT COUNT(DISTINCT owner) FROM channel
spider
CREATE TABLE table_name_10 ( winner VARCHAR, young_rider_classification VARCHAR, mountains_classification VARCHAR, general_classification VARCHAR, points_classification VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner when the Ge...
SELECT winner FROM table_name_10 WHERE general_classification = "miguel indurain" AND points_classification = "mario cipollini" AND mountains_classification = "claudio chiappucci" AND young_rider_classification = "pavel tonkov"
sql_create_context
CREATE TABLE table_20236726_2 ( builder VARCHAR, wd_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the builder for wd number being 22
SELECT builder FROM table_20236726_2 WHERE wd_no = 22
sql_create_context
CREATE TABLE table_name_60 ( route INTEGER, rank VARCHAR, elevation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Route is the mountain with a Rank less than 33 and an Elevation of 11,312 feet 3448 m?
SELECT MAX(route) FROM table_name_60 WHERE rank < 33 AND elevation = "11,312 feet 3448 m"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT SUM(PER_ACC_PAY) FROM t_kc24 WHERE PERSON_ID = '72132920' AND CLINIC_SLT_DATE BETWEEN '2012-06-13' AND '2015-07-04'
css
CREATE TABLE table_76493 ( "Game" real, "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the venue of game 3?
SELECT "Venue" FROM table_76493 WHERE "Game" = '3'
wikisql
CREATE TABLE table_name_12 ( player VARCHAR, to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Player's had a To par of +1 and a Score of 73-71-73=217?
SELECT player FROM table_name_12 WHERE to_par = "+1" AND score = 73 - 71 - 73 = 217
sql_create_context
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 zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '潘锐泽' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2007-03-13')
css
CREATE TABLE view_unit_status ( apt_id number, apt_booking_id number, status_date time, available_yn others ) CREATE TABLE apartments ( apt_id number, building_id number, apt_type_code text, apt_number text, bathroom_count number, bedroom_count number, room_count text ) CRE...
SELECT MIN(bathroom_count), MAX(bathroom_count) FROM apartments
spider
CREATE TABLE table_4962 ( "Date" real, "Opponent" text, "Result" text, "Odds" text, "Location" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for a game with the odds of p + 2 after 1847?
SELECT "Score" FROM table_4962 WHERE "Odds" = 'p + 2' AND "Date" > '1847'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '苗芳蔼' AND t_kc21.MED_SER_ORG_NO = '3888607' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%药%'
css
CREATE TABLE store_district ( store_id number, district_id number ) CREATE TABLE product ( product_id number, product text, dimensions text, dpi number, pages_per_minute_color number, max_page_size text, interface text ) CREATE TABLE district ( district_id number, district_...
SELECT max_page_size FROM product GROUP BY max_page_size HAVING COUNT(*) > 3
spider
CREATE TABLE table_72729 ( "Series #" real, "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. -- Who directed the episode that was written by Jackson Gillis an...
SELECT "Directed by:" FROM table_72729 WHERE "Written by:" = 'Jackson Gillis' AND "Original air date" = 'May 21, 1955'
wikisql
CREATE TABLE table_71138 ( "Auckland" text, "Canterbury" text, "Central Districts" text, "Otago" text, "Wellington" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Auckland thats got Otago of 184 R.C. Blunt & W. Hawksworth V (C) 1931/32?
SELECT "Auckland" FROM table_71138 WHERE "Otago" = '184 r.c. blunt & w. hawksworth v (c) 1931/32'
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 MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-17922')) AND lab.labname = 'mchc' AND DATETIME(lab.labresulttime) >= DATETIME(...
eicu
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 t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '8564108' AND t_kc22.SOC_SRT_DIRE_NM = '阿戈美拉汀片'
css
CREATE TABLE table_44814 ( "Round" real, "Pick" real, "Player" text, "Position" text, "Nationality" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Round was Grant Long Drafted?
SELECT MIN("Round") FROM table_44814 WHERE "Player" = 'grant long'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27146) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-12'
mimic_iii
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city var...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester...
advising
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT * FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '92057161700' AND t_kc22.MED_ORG_DEPT_NM LIKE '%不孕%'
css
CREATE TABLE table_name_58 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Tournament was the 2010 Olympic Games?
SELECT tournament FROM table_name_58 WHERE 2010 = "olympic games"
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) 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...
SELECT DISTINCT department, name, number FROM course WHERE credits = 17 AND department = 'ANTHRCUL' AND number < 500 + 100 AND number >= 500
advising
CREATE TABLE table_30490 ( "Team" text, "Female \u00e9p\u00e9e" text, "Male \u00e9p\u00e9e" text, "Female foil" text, "Male foil" text, "Female saber" text, "Male saber" text, "Average fencers rank" text, "Initial Team rank" real ) -- Using valid SQLite, answer the following questi...
SELECT "Female saber" FROM table_30490 WHERE "Average fencers rank" = '3.5'
wikisql
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex
nvbench
CREATE TABLE table_16317 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the college for the player with the cfl team of Edmonton Eskimos (via calgary)?
SELECT "College" FROM table_16317 WHERE "CFL Team" = 'Edmonton Eskimos (via Calgary)'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 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 = 'periph nerve destruct...
mimic_iii
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationD...
SELECT COUNT(A.Id) FROM Posts AS A WHERE A.PostTypeId = 2
sede
CREATE TABLE table_name_83 ( bleeding_time VARCHAR, platelet_count VARCHAR, condition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the bleeding time with platelet count of unaffected and condition of factor xii deficiency
SELECT bleeding_time FROM table_name_83 WHERE platelet_count = "unaffected" AND condition = "factor xii deficiency"
sql_create_context
CREATE TABLE table_name_2 ( played INTEGER, drawn VARCHAR, lost VARCHAR, percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest number of games played when there was 2 losses, percentage was 0.00% and more than 0 draws?
SELECT MAX(played) FROM table_name_2 WHERE lost = 2 AND percentage = "0.00%" AND drawn > 0
sql_create_context
CREATE TABLE competition ( Competition_type VARCHAR, Country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the types and countries of competitions?
SELECT Competition_type, Country FROM competition
sql_create_context
CREATE TABLE procedures ( 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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ATRIAL SEPTAL DEFECT\MITRAL VALVE REPLACEMENT;REPAIR ATRIAL-SEPTAL DEFECT/SDA" AND procedures.short_title = "Cath base invasv ep test"
mimicsql_data
CREATE TABLE table_name_36 ( fastest_lap VARCHAR, grand_prix VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the fastest lap at the Australian Grand Prix?
SELECT fastest_lap FROM table_name_36 WHERE grand_prix = "australian grand prix"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( ro...
SELECT chartevents.charttime 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 = 4401)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat...
mimic_iii
CREATE TABLE table_name_80 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the home team was geelong, who played as the away team?
SELECT away_team FROM table_name_80 WHERE home_team = "geelong"
sql_create_context
CREATE TABLE table_64918 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank for the rowers with the time of 6:24.35?
SELECT "Rank" FROM table_64918 WHERE "Time" = '6:24.35'
wikisql
CREATE TABLE table_29141354_7 ( scores VARCHAR, andrew_and_jacks_guest VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for the episode with Matt Smith as Andrew and Jack's guest?
SELECT scores FROM table_29141354_7 WHERE andrew_and_jacks_guest = "Matt Smith"
sql_create_context
CREATE TABLE table_229059_2 ( score VARCHAR, champion VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score in the tournament won by Jan Stephenson?
SELECT score FROM table_229059_2 WHERE champion = "Jan Stephenson"
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 prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Ascorbic Acid"
mimicsql_data
CREATE TABLE table_203_215 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times did japan place in the top 2 ?
SELECT COUNT(*) FROM table_203_215 WHERE "position" <= 2
squall
CREATE TABLE table_27361255_1 ( location VARCHAR, institution VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Robert Morris University-Illinois held?
SELECT location FROM table_27361255_1 WHERE institution = "Robert Morris University-Illinois"
sql_create_context
CREATE TABLE table_1341577_50 ( result VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the final result for Les Aspin?
SELECT result FROM table_1341577_50 WHERE incumbent = "Les Aspin"
sql_create_context
CREATE TABLE storm ( damage_millions_USD INTEGER, max_speed INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the average and maximum damage for all storms with max speed higher than 1000.
SELECT AVG(damage_millions_USD), MAX(damage_millions_USD) FROM storm WHERE max_speed > 1000
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC), Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%nepal%' OR UPPER(Location) LIKE '%NP' ORDER BY Reputation DESC LIMIT 50
sede
CREATE TABLE accounts ( account_id number, customer_id number, account_name text, other_account_details text ) CREATE TABLE financial_transactions ( transaction_id number, previous_transaction_id number, account_id number, card_id number, transaction_type text, transaction_date ...
SELECT card_type_code, COUNT(DISTINCT customer_id) FROM customers_cards GROUP BY card_type_code
spider
CREATE TABLE table_71854 ( "Matches" real, "Innings" real, "Not Out" real, "High Score" text, "Runs" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the high run total associated with a high score of 385 and under 407 inni...
SELECT MAX("Runs") FROM table_71854 WHERE "High Score" = '385' AND "Innings" < '407'
wikisql
CREATE TABLE table_name_77 ( place VARCHAR, country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is john daly of united states from?
SELECT place FROM table_name_77 WHERE country = "united states" AND player = "john daly"
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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "PO"
mimicsql_data
CREATE TABLE table_56198 ( "Rank" real, "Player" text, "Country" text, "Earnings( $ )" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest rank for gene littler with under 3 wins and under $962,133?
SELECT MAX("Rank") FROM table_56198 WHERE "Earnings( $ )" < '962,133' AND "Player" = 'gene littler' AND "Wins" < '3'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-6010' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit...
eicu
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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, ...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJG...
css
CREATE TABLE table_43633 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Event, when Round is '1', when Location is ...
SELECT "Event" FROM table_43633 WHERE "Round" = '1' AND "Location" = 'new town, north dakota , united states' AND "Time" = '4:12'
wikisql
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, ...
SELECT COUNT(DISTINCT acc_type) FROM customer
spider
CREATE TABLE table_12082 ( "Draw" real, "Artist" text, "Song" text, "Points" real, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did the artist All Mixed Up place?
SELECT MIN("Place") FROM table_12082 WHERE "Artist" = 'all mixed up'
wikisql
CREATE TABLE table_name_48 ( attendance VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance for the home team of Walsall?
SELECT attendance FROM table_name_48 WHERE home_team = "walsall"
sql_create_context
CREATE TABLE table_64351 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Playing against the Seattle Seahawks in a week after week 1 before 69,149 people what was the result of ...
SELECT "Result" FROM table_64351 WHERE "Week" > '1' AND "Attendance" = '69,149' AND "Opponent" = 'seattle seahawks'
wikisql
CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Ra...
SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank
nvbench