instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_53004 ( "Outcome" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament was Dieter Kindlmann a partner?
SELECT "Tournament" FROM table_53004 WHERE "Partner" = 'dieter kindlmann'
wikisql
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO...
atis
CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst t...
SELECT growst FROM sampledata15 WHERE commod = "AP" GROUP BY growst ORDER BY COUNT(*) DESC LIMIT 1
pesticide
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diag...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 53176) AND icustays.outtime IS NULL
mimic_iii
CREATE TABLE table_52377 ( "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 was the away team score in a game with nort...
SELECT "Away team score" FROM table_52377 WHERE "Home team" = 'melbourne'
wikisql
CREATE TABLE table_55014 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total when the score of set 1 was 15 11?
SELECT "Total" FROM table_55014 WHERE "Set 1" = '15–11'
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 SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '周兰若' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2010-11-15' AND '2020-06-07' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_4390 ( "State" text, "Interview" real, "Swimsuit" real, "Evening gown" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the average for evening gown of 7.52 and swimsuit larger than 7.78
SELECT AVG("Average") FROM table_4390 WHERE "Evening gown" = '7.52' AND "Swimsuit" > '7.78'
wikisql
CREATE TABLE table_204_639 ( id number, "poll company" text, "source" text, "publication date" text, "psuv" number, "opposition" number, "undecided" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the next publication after the jun...
SELECT "source" FROM table_204_639 WHERE id = (SELECT id FROM table_204_639 WHERE "publication date" = 'june 2010' AND "source" = 'radio nacional de venezuela') + 1
squall
CREATE TABLE table_189598_7 ( name VARCHAR, land_area__km²_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 14.85 kilometers squared is the land area what is the name?
SELECT name FROM table_189598_7 WHERE land_area__km²_ = "14.85"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) >= '2101'
eicu
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, ...
SELECT jybgb.SQRGH, jybgb.SQRXM FROM jybgb WHERE jybgb.JZLSH = '70939777652' GROUP BY jybgb.SQRGH HAVING COUNT(*) > 12
css
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, s...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id 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_...
mimic_iii
CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, ...
SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id
spider
CREATE TABLE table_204_822 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which nation won the least number of bronze medals ?
SELECT "nation" FROM table_204_822 ORDER BY "bronze" LIMIT 1
squall
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '戚丽文' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-12-20' AND '2011-07-25' AND t_kc24.MED_AMOUT <= 10
css
CREATE TABLE table_18572 ( "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. -- what the was the final in which frank w. boykin was running
SELECT "Result" FROM table_18572 WHERE "Incumbent" = 'Frank W. Boykin'
wikisql
CREATE TABLE table_204_807 ( id number, "date" text, "winner" text, "runner-up" text, "result" text, "site" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who had the least amount of attendees ?
SELECT "site" FROM table_204_807 ORDER BY "attendance" LIMIT 1
squall
CREATE TABLE table_203_823 ( id number, "model name" text, "date" text, "type" text, "thrust (kg) / power (eshp)" text, "fitted to" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what model was dated before model s-18 / vdr-3 ?
SELECT "model name" FROM table_203_823 WHERE "date" < (SELECT "date" FROM table_203_823 WHERE "model name" = 's-18/vdr-3')
squall
CREATE TABLE table_31688 ( "Place" real, "Title" text, "Units sold in Japan" text, "Units sold in the UK" text, "Units sold in the US" text, "Total units sold" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Of the games that sold 321,000 units i...
SELECT AVG("Place") FROM table_31688 WHERE "Units sold in the UK" = '321,000'
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 course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%German Teaching Assistance for Children at the Deutsche Schule Ann Arbor (DSAA)%' AND NOT instructor.name...
advising
CREATE TABLE table_name_11 ( score VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for game 6?
SELECT score FROM table_name_11 WHERE game = 6
sql_create_context
CREATE TABLE table_name_88 ( heat VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many heats does Julia Wilkinson have?
SELECT COUNT(heat) FROM table_name_88 WHERE name = "julia wilkinson"
sql_create_context
CREATE TABLE table_name_32 ( opponent VARCHAR, week VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did they play against in a week after 6 and the result was l 30 24?
SELECT opponent FROM table_name_32 WHERE week > 6 AND result = "l 30–24"
sql_create_context
CREATE TABLE table_name_33 ( country VARCHAR, base VARCHAR, company VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the country of the play based in Athens at the Attis Theatre company?
SELECT country FROM table_name_33 WHERE base = "athens" AND company = "attis theatre"
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 zyjzjlb.CYZTDM FROM zyjzjlb WHERE zyjzjlb.JZLSH = '39258009864'
css
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT * FROM Posts WHERE CreationDate < '2011-01-02' AND CreationDate > '2011-01-01'
sede
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_name_92 ( position VARCHAR, year VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- After 1983, what was the Position in Seoul, South Korea?
SELECT position FROM table_name_92 WHERE year > 1983 AND venue = "seoul, south korea"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-27397')) AND medication.routeadmin = 'per j tube' AND DATE...
eicu
CREATE TABLE table_name_90 ( total INTEGER, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the total of the player who won in 1979?
SELECT SUM(total) FROM table_name_90 WHERE year_s__won = "1979"
sql_create_context
CREATE TABLE table_204_707 ( id number, "year" number, "english title" text, "chinese title" text, "director" text, "role" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference in years between his last role and his first role ?
SELECT MAX("year") - MIN("year") FROM table_204_707
squall
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 Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Manufacturer) DESC
nvbench
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(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '何美华' AND t_kc22.STA_DATE BETWEEN '2002-07-14' AND '2014-08-18' AND t_kc22.t_kc21_MED_SER_ORG_NO = '5350296' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_97 ( fastest_lap VARCHAR, winning_team VARCHAR, pole_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the winning team of mathiasen motorsports has a pole position of jonathan bomarito, who has the fastest lap?
SELECT fastest_lap FROM table_name_97 WHERE winning_team = "mathiasen motorsports" AND pole_position = "jonathan bomarito"
sql_create_context
CREATE TABLE table_name_81 ( round VARCHAR, city_location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round had a city/location of Toronto, Ontario?
SELECT round FROM table_name_81 WHERE city_location = "toronto, ontario"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT * 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 hz_info.YLJGDM = '8549699' AND zyjzjlb.CYKSMC LIKE '%关节病%'
css
CREATE TABLE table_10942 ( "Date" text, "Track" text, "Race" text, "Distance" text, "Purse ( US$ )" text, "Surface track" text, "Winning horse" text, "Winning jockey" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Date is Northern S...
SELECT "Date" FROM table_10942 WHERE "Race" = 'northern spur breeders'' cup stakes'
wikisql
CREATE TABLE table_name_54 ( other VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the other for 2012?
SELECT other FROM table_name_54 WHERE year = "2012"
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-142620')) AND STRFTIME('%y-%m', medication.drugstarttime) <= '2105-08'
eicu
CREATE TABLE table_name_40 ( established INTEGER, championships VARCHAR, league VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With less than 1 Championship, what es the Established date of the Niagara Rugby Union League?
SELECT SUM(established) FROM table_name_40 WHERE championships < 1 AND league = "niagara rugby union"
sql_create_context
CREATE TABLE table_name_34 ( player VARCHAR, transfer_fee VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a Transfer fee of 750,000 [x]?
SELECT player FROM table_name_34 WHERE transfer_fee = "£750,000 [x]"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-44805')) AND medication.drugname IN ('1000 ml flex cont: sodium chlori...
eicu
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 WHERE demographic.expire_flag = "1" AND diagnoses.long_title = "Tietze's disease"
mimicsql_data
CREATE TABLE table_34163 ( "Tournament" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "1998" FROM table_34163 WHERE "1993" = '2r' AND "1990" = '1r'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51177)) AND STRFTIME('%y-%m-%d', outputeve...
mimic_iii
CREATE TABLE table_28649 ( "Rank" real, "Couple" text, "Judges" real, "Public" real, "Total" real, "Vote percentage" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number for 3 public
SELECT COUNT("Total") FROM table_28649 WHERE "Public" = '3'
wikisql
CREATE TABLE table_21999 ( "No. in series" real, "No. in season" real, "Title" text, "Country" text, "Project" text, "Status at production" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status of the 'a...
SELECT "Status at production" FROM table_21999 WHERE "Title" = 'Azerbaijan''s Amazing Transformation'
wikisql
CREATE TABLE table_1339 ( "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. -- When the season number is listed as 4 what is the original aird...
SELECT "Original air date" FROM table_1339 WHERE "Season #" = '4'
wikisql
CREATE TABLE table_52111 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team was the home team when the home team score was 12.16 (88...
SELECT "Home team" FROM table_52111 WHERE "Home team score" = '12.16 (88)'
wikisql
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Co...
SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY SUM(Amount_Payment)
nvbench
CREATE TABLE table_name_16 ( Digital VARCHAR, owner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What digital channel does Three Angels Broadcasting Network own?
SELECT Digital AS channel FROM table_name_16 WHERE owner = "three angels broadcasting network"
sql_create_context
CREATE TABLE table_13759592_1 ( enrollment VARCHAR, high_school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many enrollment figures are provided for Roosevelt High School?
SELECT COUNT(enrollment) FROM table_13759592_1 WHERE high_school = "Roosevelt"
sql_create_context
CREATE TABLE table_12807904_5 ( points_against VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the total points agains the score of 63?
SELECT points_against FROM table_12807904_5 WHERE points = "63"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, ...
SELECT RANK() OVER (ORDER BY COUNT(Users.Id) DESC) AS "rank", COUNT(Users.Id) AS "famous_questions", Users.Id AS "user_link", 'http://scifi.stackexchange.com/help/badges/37/famous-question?userid=' + CAST(Users.Id AS TEXT) AS "questions" FROM Users INNER JOIN Badges ON Users.Id = Badges.UserId WHERE Badges.Name = 'Famo...
sede
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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 )...
SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1912) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.ite...
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRG...
SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '80645619078'
css
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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, ...
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 = 31880)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
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_DIRE_CD, MED_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '96078650618' AND SOC_SRT_DIRE_NM = '碳酸锂缓释片'
css
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport ( airport_code varchar, airp...
SELECT DISTINCT basic_type FROM aircraft WHERE aircraft_code IN (SELECT EQUIPMENT_SEQUENCEalias0.aircraft_code FROM equipment_sequence AS EQUIPMENT_SEQUENCEalias0 WHERE EQUIPMENT_SEQUENCEalias0.aircraft_code_sequence IN (SELECT FLIGHTalias0.aircraft_code_sequence FROM flight AS FLIGHTalias0 WHERE FLIGHTalias0.from_airp...
atis
CREATE TABLE table_76775 ( "Round" real, "Pick" real, "Player" text, "Position" text, "Nationality" text, "College/Junior Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the college/junior team of player tyler myers, who has a pick ...
SELECT "College/Junior Team" FROM table_76775 WHERE "Pick" < '44' AND "Player" = 'tyler myers'
wikisql
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 t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '58771000' AND t_kc21.MED_SER_ORG_NO = '6383480' AND t_kc21.OUT_DIAG_DOC_NM LIKE '孙%'
css
CREATE TABLE table_name_62 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the opponent Arsenal?
SELECT date FROM table_name_62 WHERE opponent = "arsenal"
sql_create_context
CREATE TABLE table_68128 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points did the ATS Wheels entrant with an ATS D2 chassis have?
SELECT "Points" FROM table_68128 WHERE "Entrant" = 'ats wheels' AND "Chassis" = 'ats d2'
wikisql
CREATE TABLE table_15909409_2 ( total_freshwater_withdrawal__km_3__yr_ VARCHAR, agricultural_use__m_3__p_yr__in__percentage_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many countries had a total freshwater withdrawal (km 3 /yr) where the agricultural...
SELECT COUNT(total_freshwater_withdrawal__km_3__yr_) FROM table_15909409_2 WHERE agricultural_use__m_3__p_yr__in__percentage_ = "428(62%)"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.ethnicity = "BLACK/CAPE VERDEAN"
mimicsql_data
CREATE TABLE table_63988 ( "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 was the 1st leg score in the matchup with a 2nd leg of 72-89?
SELECT "1st leg" FROM table_63988 WHERE "2nd leg" = '72-89'
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE >= 10)
css
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 WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "BLADDER CANCER/SDA"
mimicsql_data
CREATE TABLE CMI_Cross_References ( cmi_cross_ref_id INTEGER, master_customer_id INTEGER, source_system_code CHAR(15) ) CREATE TABLE Parking_Fines ( council_tax_id INTEGER, cmi_cross_ref_id INTEGER ) CREATE TABLE Business_Rates ( business_rates_id INTEGER, cmi_cross_ref_id INTEGER ) CREAT...
SELECT cmi_details, COUNT(cmi_details) FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax' GROUP BY cmi_details ORDER BY cmi_details DESC
nvbench
CREATE TABLE table_name_46 ( goals_for INTEGER, played VARCHAR, position VARCHAR, goal_difference VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest goals for the position after 10, a goal difference less than -24, and played more tha...
SELECT MAX(goals_for) FROM table_name_46 WHERE position > 10 AND goal_difference < -24 AND played > 30
sql_create_context
CREATE TABLE table_44201 ( "Publication" text, "Country" text, "Accolade" text, "Year" real, "Rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Year, when Rank is less than 19?
SELECT SUM("Year") FROM table_44201 WHERE "Rank" < '19'
wikisql
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '10619383' AND gwyjzb.MED_SER_ORG_NO = '2796899' AND NOT gwyjzb.OUT_DIAG_DIS_NM LIKE '%低钾血症%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '10619383' AND fgwyjzb.MED_SER_ORG_NO = '2796899' AND NOT fgwyjzb.OUT_DIAG_DIS_NM LIKE ...
css
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '9424563' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM gyb JOIN t_kc24 ON gyb...
css
CREATE TABLE table_name_76 ( record VARCHAR, home VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record with home of bucks on 24 november 2007
SELECT record FROM table_name_76 WHERE home = "bucks" AND date = "24 november 2007"
sql_create_context
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. -- what is the total number of shows sophie colguhoun appeared in ?
SELECT COUNT(*) FROM table_204_903
squall
CREATE TABLE table_name_43 ( package_option VARCHAR, television_service VARCHAR, hdtv VARCHAR, language VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Package/Option, when HDTV is no, when Language is Italian, and when Television service is c...
SELECT package_option FROM table_name_43 WHERE hdtv = "no" AND language = "italian" AND television_service = "cartello promozionale sky hd"
sql_create_context
CREATE TABLE table_2119448_3 ( won_promotion VARCHAR, lost_promotion_playoffs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the won promotion for kalmar ff
SELECT won_promotion FROM table_2119448_3 WHERE lost_promotion_playoffs = "Kalmar FF"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'lopinavir-ritonavir'
mimic_iii
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 jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '60882674098' AND jybgb.KSMC LIKE '%关节炎%'
css
CREATE TABLE table_1160304_2 ( weeks_on_peak VARCHAR, chart VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total number of weeks on peak for the Ireland Albums Top 75 chart?
SELECT COUNT(weeks_on_peak) FROM table_1160304_2 WHERE chart = "Ireland Albums Top 75"
sql_create_context
CREATE TABLE table_23761 ( "Original No." real, "LNER No. (Intermediate No.)" text, "BR No." real, "Name" text, "Rebuild Date" text, "Withdrawn" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name for br no. 60501
SELECT "Name" FROM table_23761 WHERE "BR No." = '60501'
wikisql
CREATE TABLE table_67818 ( "Stage" text, "Route" text, "Distance" text, "Date" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the distance for stage of 2
SELECT "Distance" FROM table_67818 WHERE "Stage" = '2'
wikisql
CREATE TABLE table_1637041_6 ( position VARCHAR, avg_start VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the position in the season when the average start is 9.2?
SELECT position FROM table_1637041_6 WHERE avg_start = "9.2"
sql_create_context
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, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZ...
css
CREATE TABLE table_2679061_6 ( nationality VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of the player kevin stevens?
SELECT nationality FROM table_2679061_6 WHERE player = "Kevin Stevens"
sql_create_context
CREATE TABLE table_64773 ( "Band" real, "Frequency (MHz)" text, "Wavelength" text, "Type" text, "Power (W)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Wavelength of Frequency (MHz) 14.050 14.150?
SELECT "Wavelength" FROM table_64773 WHERE "Frequency (MHz)" = '14.050–14.150'
wikisql
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Create a ba...
SELECT Class, COUNT(Class) FROM race GROUP BY Class ORDER BY Class
nvbench
CREATE TABLE table_name_58 ( right_ascension___j2000__ VARCHAR, object_type VARCHAR, ngc_number VARCHAR, constellation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the right ascension (j2000) with the ngc number less than 3384, the constell...
SELECT right_ascension___j2000__ FROM table_name_58 WHERE ngc_number < 3384 AND constellation = "hydra" AND object_type = "spiral galaxy"
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.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '99850400907' UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '99850400907'
css
CREATE TABLE table_15521 ( "Character" text, "Original West End Cast" text, "Original Broadway Cast" text, "First UK Tour Cast" text, "First US Tour Cast" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What character did Katie Rowley Jones play in t...
SELECT "Character" FROM table_15521 WHERE "Original West End Cast" = 'katie rowley jones'
wikisql
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 jyjgzbb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info...
css
CREATE TABLE table_31355 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number in series when U.S....
SELECT MIN("No. in series") FROM table_31355 WHERE "U.S. viewers (million)" = '0.23'
wikisql
CREATE TABLE table_3967 ( "Proceed to Quarter-final" text, "Match points" text, "Aggregate score" text, "Points margin" real, "Eliminated from competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many teams had a point margin of 48?
SELECT COUNT("Eliminated from competition") FROM table_3967 WHERE "Points margin" = '48'
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 t_kc21.MED_CLINIC_ID FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '苗飞章' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2015-03-03' AND '2015-09-01'
css
CREATE TABLE table_34192 ( "Name" text, "Term" text, "Games" real, "Record (W\u2013L\u2013T / OTL)" text, "Points" real, "Win percentage" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Win percentage has Points smaller than 472, and a Reco...
SELECT AVG("Win percentage") FROM table_34192 WHERE "Points" < '472' AND "Record (W\u2013L\u2013T / OTL)" = '140–220–40'
wikisql
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_Games, All_Games_Percent FROM basketball_match
nvbench
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, s...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hematocrit') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'star...
mimic_iii
CREATE TABLE table_7296 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Time when the Set 2 is 25 21, on 29 may?
SELECT "Time" FROM table_7296 WHERE "Set 2" = '25–21' AND "Date" = '29 may'
wikisql
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "0" AND prescriptions.drug = "Hydrocortisone Cream 0.5%"
mimicsql_data