instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_58553 ( "Player" text, "Pos." text, "From" text, "School/Country" text, "Rebs" real, "Asts" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the high assist total for players from 2010 and under 76 rebounds?
SELECT MAX("Asts") FROM table_58553 WHERE "From" = '2010' AND "Rebs" < '76'
wikisql
CREATE TABLE mountain ( Country VARCHAR, Height INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the countries of mountains with height bigger than 5000?
SELECT Country FROM mountain WHERE Height > 5000
sql_create_context
CREATE TABLE table_name_59 ( league_cup_goals INTEGER, scorer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest League Cup Goals, when Scorer is Denis Law?
SELECT MIN(league_cup_goals) FROM table_name_59 WHERE scorer = "denis law"
sql_create_context
CREATE TABLE fielding ( player_id text, year number, stint number, team_id text, league_id text, pos text, g number, gs number, inn_outs number, po number, a number, e number, dp number, pb number, wp number, sb number, cs number, zr number ) CREA...
SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T1.year = 1980 ORDER BY T1.attendance LIMIT 1
spider
CREATE TABLE table_25106 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the vacator when the reason for change was f...
SELECT "Vacator" FROM table_25106 WHERE "Reason for change" = 'Failure to elect'
wikisql
CREATE TABLE table_name_11 ( team VARCHAR, qual_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team had a qualifying 2 time of 1:01.093?
SELECT team FROM table_name_11 WHERE qual_2 = "1:01.093"
sql_create_context
CREATE TABLE ftxmzjzjlb ( 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, MZZYZD...
SELECT jybgb.BGDH FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '13405731' AND jybgb.BGRQ BETWEEN '2019-02-09' AND '2020-...
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T2.Revenue DESC
nvbench
CREATE TABLE table_name_46 ( region VARCHAR, label VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What region has the label of alfa records and the date of January 23, 1987?
SELECT region FROM table_name_46 WHERE label = "alfa records" AND date = "january 23, 1987"
sql_create_context
CREATE TABLE table_name_14 ( silver INTEGER, total VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of silver medals for teams with more than 14 total medals and more than 16 golds?
SELECT SUM(silver) FROM table_name_14 WHERE total > 14 AND gold > 16
sql_create_context
CREATE TABLE table_name_58 ( age_at_appointment INTEGER, portfolio_attachment VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average age at appointment of those attached to security?
SELECT AVG(age_at_appointment) FROM table_name_58 WHERE portfolio_attachment = "security"
sql_create_context
CREATE TABLE table_name_34 ( date VARCHAR, status VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Status is Second Test?
SELECT date FROM table_name_34 WHERE status = "second test"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'nephrology consultation' AND DATETIME(treatment.treatmenttime, 'start of ...
eicu
CREATE TABLE table_name_52 ( runner_up VARCHAR, last_16 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Runner-Up has a Last 16 of 300?
SELECT runner_up FROM table_name_52 WHERE last_16 = "£300"
sql_create_context
CREATE TABLE table_name_52 ( year_of_issue INTEGER, thickness VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year of Issue has a Thickness of 1.42mm?
SELECT MAX(year_of_issue) FROM table_name_52 WHERE thickness = "1.42mm"
sql_create_context
CREATE TABLE table_name_29 ( week_7_oct_12 VARCHAR, week_12_nov_16 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the week 7 opponent for the year that had a week 12 opponent of Oregon State (7-3)?
SELECT week_7_oct_12 FROM table_name_29 WHERE week_12_nov_16 = "oregon state (7-3)"
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) 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_gradu...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
advising
CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE...
SELECT phone, room, building FROM faculty WHERE fname = "Jerry" AND lname = "Prince"
spider
CREATE TABLE table_name_53 ( school_club_team VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the school for the player who was a DL?
SELECT school_club_team FROM table_name_53 WHERE position = "dl"
sql_create_context
CREATE TABLE table_68982 ( "Title" text, "Year" real, "Developer" text, "Publisher" text, "Players per Console" text, "Genre" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year was the game developed by Music Comp in?
SELECT "Year" FROM table_68982 WHERE "Developer" = 'music comp'
wikisql
CREATE TABLE table_name_34 ( league INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of League Cups a player with a 434 league has?
SELECT MIN(league) AS Cup FROM table_name_34 WHERE league = 434
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT * 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 = '50999365' AND hz_info.YLJGDM = '7538695' AND NOT mzjzjlb.JZZDSM LIKE '%过敏症%'
css
CREATE TABLE table_39837 ( "Rank" text, "s Wicket" text, "Player" text, "Matches" text, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average that has 2 for the rank?
SELECT "Average" FROM table_39837 WHERE "Rank" = '2'
wikisql
CREATE TABLE table_29086 ( "Round #" text, "Home Team" text, "Win/Loss" text, "Score" text, "Opposition" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score in round 7?
SELECT "Score" FROM table_29086 WHERE "Round #" = 'Round 7'
wikisql
CREATE TABLE table_test_8 ( "id" int, "anemia" bool, "intra_aortic_balloon_pump_iabp" bool, "systolic_blood_pressure_sbp" int, "intravenous_pressors" bool, "fever" bool, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "vasopressors" bool, "renal_disease" bool, "temperatur...
SELECT * FROM table_test_8 WHERE renal_disease = 1 AND creatinine_clearance_cl > 2.5
criteria2sql
CREATE TABLE table_204_801 ( id number, "year" number, "derby\nwinner" text, "galaxy" number, "draw" number, "chivas" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- is the number of draws in the history of the derby above or below 10 ?
SELECT (SELECT SUM("draw") FROM table_204_801) > 10
squall
CREATE TABLE table_21388 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Language(s)" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For what ceremony was 'Fire Dancer' not ...
SELECT "Year (Ceremony)" FROM table_21388 WHERE "Original title" = 'Fire Dancer'
wikisql
CREATE TABLE table_name_35 ( nation VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nation had 1399.3 points?
SELECT nation FROM table_name_35 WHERE points = 1399.3
sql_create_context
CREATE TABLE Patient ( SSN INTEGER, Name VARCHAR(30), Address VARCHAR(30), Phone VARCHAR(30), InsuranceID INTEGER, PCP INTEGER ) CREATE TABLE Procedures ( Code INTEGER, Name VARCHAR(30), Cost REAL ) CREATE TABLE Trained_In ( Physician INTEGER, Treatment INTEGER, Certifi...
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY Name
nvbench
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 MIN(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-123134')) AND NOT vitalperiodic.sao2 IS NULL AND DATE...
eicu
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_in...
css
CREATE TABLE zyb ( 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_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '33250252' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3095.33) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '33250252' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_...
css
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 COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52327' AND patient.hospitaldischargetime IS NULL))
eicu
CREATE TABLE table_1645 ( "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 is...
SELECT "Score" FROM table_1645 WHERE "Team" = 'San Antonio'
wikisql
CREATE TABLE table_name_50 ( d_46 VARCHAR, d_44 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the D46 when it has D 44 of majority
SELECT d_46 FROM table_name_50 WHERE d_44 = "← majority"
sql_create_context
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real...
SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY Country
nvbench
CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machin...
SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name ORDER BY COUNT(*)
nvbench
CREATE TABLE Apartments ( room_count INTEGER, apt_type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of rooms of apartments with type code 'Studio'?
SELECT AVG(room_count) FROM Apartments WHERE apt_type_code = "Studio"
sql_create_context
CREATE TABLE table_76881 ( "Name" text, "Built" text, "Listed" text, "Location" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the county of the bridge in Boulder?
SELECT "County" FROM table_76881 WHERE "Location" = 'boulder'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2150" AND prescriptions.drug = "Dabigatran Etexilate"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.days_stay > "23"
mimicsql_data
CREATE TABLE table_224616_1 ( location_of_venue VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the Bellerive Country Club venue located?
SELECT location_of_venue FROM table_224616_1 WHERE venue = "Bellerive country Club"
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 patient ( ...
SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'valve repair < 7 days' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY STRFTIME('%y', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE table_78444 ( "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 name shows as private authority and hibiscus and bays local...
SELECT "Name" FROM table_78444 WHERE "Authority" = 'private' AND "Local board" = 'hibiscus and bays'
wikisql
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 DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'valvular insufficiency - tricuspid valve')
eicu
CREATE TABLE table_56540 ( "Player" text, "Car." real, "Yards" text, "Avg." text, "TD's" real, "Long" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has the highest TDs, with yards of 9, and carries smaller than 13?
SELECT MAX("TD's") FROM table_56540 WHERE "Yards" = '9' AND "Car." < '13'
wikisql
CREATE TABLE table_name_72 ( total_production VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total production for model nd5
SELECT total_production FROM table_name_72 WHERE model = "nd5"
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 jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '吕经艺' AND NOT...
css
CREATE TABLE table_204_871 ( id number, "ano" text, "title" text, "role" text, "channel" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- she played veronica iturbe montalban in 1995 . what was her previous character ?
SELECT "role" FROM table_204_871 WHERE "ano" < 1995 ORDER BY "ano" DESC LIMIT 1
squall
CREATE TABLE table_46010 ( "Nat." text, "Name" text, "Since" text, "App(L/C/E)" text, "Goals(L/C/E)" text, "Ends" real, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has a nationality of GRE and an App(L/C/E) of 49 (40/8/...
SELECT "Name" FROM table_46010 WHERE "Nat." = 'gre' AND "App(L/C/E)" = '49 (40/8/1)'
wikisql
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 PostsWithDeleted ( Id number, PostTypeId number, ...
SELECT DISTINCT Posts.Id AS "post_link", Posts.CreationDate, Posts.ViewCount, Posts.AnswerCount, Posts.CommentCount, Posts.Tags FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON Tags.Id = PostTags.TagId INNER JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId LEFT JOIN Users ON Users.Id = P...
sede
CREATE TABLE table_218 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date on which a race was run at Halle-Saale-Schleife circuit?
SELECT "Date" FROM table_218 WHERE "Circuit" = 'Halle-Saale-Schleife'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.insurance = "Medicaid"
mimicsql_data
CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Descri...
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations ORDER BY COUNT(Date_in_Locaton_To)
nvbench
CREATE TABLE table_name_56 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did the Cubs play when they had a record of 4-4?
SELECT opponent FROM table_name_56 WHERE record = "4-4"
sql_create_context
CREATE TABLE table_70776 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For engines of Maserati Straight-6 and entrants of H H Gould, what is the latest year?
SELECT MAX("Year") FROM table_70776 WHERE "Engine" = 'maserati straight-6' AND "Entrant" = 'h h gould'
wikisql
CREATE TABLE table_name_34 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Record of 1-4?
SELECT date FROM table_name_34 WHERE record = "1-4"
sql_create_context
CREATE TABLE table_43941 ( "Fieldbus" text, "Bus power" text, "Cabling redundancy" text, "Synchronisation" text, "Sub millisecond cycle" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the bus power for the Controlnet Fieldbus?
SELECT "Bus power" FROM table_43941 WHERE "Fieldbus" = 'controlnet'
wikisql
CREATE TABLE table_12475 ( "State" text, "Type" text, "Name" text, "Title" text, "Royal house" text, "From" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which state has a royal house of Ying?
SELECT "State" FROM table_12475 WHERE "Royal house" = 'ying'
wikisql
CREATE TABLE table_203_577 ( id number, "tenure" text, "coach" text, "years" number, "record" text, "pct." number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which coach served previous to ardis smith ?
SELECT "coach" FROM table_203_577 WHERE "tenure" < (SELECT "tenure" FROM table_203_577 WHERE "coach" = 'ardis smith') ORDER BY "tenure" DESC LIMIT 1
squall
CREATE TABLE table_67783 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the game site with result of l 7-38
SELECT "Game site" FROM table_67783 WHERE "Result" = 'l 7-38'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "80" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_35330 ( "Year" real, "Film" text, "Role" text, "Producer/Director" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Producer/Director of Political Engagement?
SELECT "Producer/Director" FROM table_35330 WHERE "Film" = 'political engagement'
wikisql
CREATE TABLE table_name_3 ( uci_rating INTEGER, race_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Vuelta a Ecuador's lowest UCI Rating?
SELECT MIN(uci_rating) FROM table_name_3 WHERE race_name = "vuelta a ecuador"
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fl...
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND date_day.day_number = 8 AND date_day.month_number = 7 AND dat...
atis
CREATE TABLE table_name_31 ( week INTEGER, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the first week to have attendance of 65,866?
SELECT MIN(week) FROM table_name_31 WHERE attendance = 65 OFFSET 866
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age >= 60
mimic_iii
CREATE TABLE table_3253 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the director of episode 11 based on season?
SELECT "Directed by" FROM table_3253 WHERE "No. in season" = '11'
wikisql
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_diagnoses ( row_id number, icd9_code text, sh...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8888 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'clopidogrel bisulfate' ORDER BY prescriptions....
mimic_iii
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE...
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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE table_262560_2 ( location VARCHAR, nickname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many locations have a school that is nicknamed the Panthers?
SELECT COUNT(location) FROM table_262560_2 WHERE nickname = "Panthers"
sql_create_context
CREATE TABLE shop ( Shop_ID int, Address text, Num_of_staff text, Score real, Open_Year text ) CREATE TABLE happy_hour ( HH_ID int, Shop_ID int, Month text, Num_of_shaff_in_charge int ) CREATE TABLE member ( Member_ID int, Name text, Membership_card text, Age int, ...
SELECT Address, COUNT(*) FROM member GROUP BY Address ORDER BY Address
nvbench
CREATE TABLE bdmzjzjlb ( 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 wdmzjzjlb.JZJSSJ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '47178546840' UNION SELECT bdmzjzjlb.JZJSSJ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '47178546840'
css
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 AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_CD = '2348' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-10-12' AND '2010-05-02' AND t_kc21.IN_DIAG_DIS_NM = '冠状动脉粥样硬化性心脏病' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE table_19961 ( "No. in season" real, "No. disc" 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 wrote episode 11, of which was directed by Will Waring?...
SELECT "Written by" FROM table_19961 WHERE "Directed by" = 'Will Waring' AND "No. in season" = '11'
wikisql
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ tim...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ...
css
CREATE TABLE table_48679 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps did the driver with the yamaha manufacturer go on grid 3?
SELECT "Laps" FROM table_48679 WHERE "Manufacturer" = 'yamaha' AND "Grid" = '3'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT 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 = '51529676' AND t_kc22.STA_DATE BETWEEN '2001-12-07' AND '2006-04-08' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_38149 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Name has a Round smaller than 5, and a Pick # larger than 13?
SELECT "Name" FROM table_38149 WHERE "Round" < '5' AND "Pick #" > '13'
wikisql
CREATE TABLE table_1341423_36 ( results VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the results when the incumbent was ernest istook?
SELECT results FROM table_1341423_36 WHERE incumbent = "Ernest Istook"
sql_create_context
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id num...
SELECT NeighbouringTag.TagId, NeighbouringTag.TagName, COUNT(NeighbouringTag.TagId) FROM (SELECT Posts.Title, Tags.Id, Tags.TagName FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Posts.Id IN (SELECT Posts.Id FROM Posts INNER JOIN PostTags ON PostTags.PostI...
sede
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 mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.person_i...
css
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE fare ( fare_id int, from_...
SELECT DISTINCT fare_airline, fare_basis_code, fare_id, from_airport, one_direction_cost, restriction_code, round_trip_cost, round_trip_required, to_airport FROM fare WHERE fare_basis_code = 'QW' OR fare_basis_code = 'QX'
atis
CREATE TABLE table_name_61 ( home VARCHAR, visitor VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home team had a visitor of Ottawa Senators with a score of 1 5?
SELECT home FROM table_name_61 WHERE visitor = "ottawa senators" AND score = "1–5"
sql_create_context
CREATE TABLE table_name_98 ( jersey__number VARCHAR, weight__kg_ VARCHAR, height__cm_ VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Jersey # has a Height (cm) of 183, a Name of paul stastny, and a Weight (kg) smaller than 93?
SELECT COUNT(jersey__number) FROM table_name_98 WHERE height__cm_ = 183 AND name = "paul stastny" AND weight__kg_ < 93
sql_create_context
CREATE TABLE table_13268 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real ) -- Using valid SQLite, answer the following questi...
SELECT "FA Cup Apps" FROM table_13268 WHERE "League Apps" = '21'
wikisql
CREATE TABLE table_56603 ( "Faroese" text, "Norwegian (bokm\u00e5l)" text, "Norwegian (nynorsk)" text, "English" text, "Icelandic" text, "Danish" text, "Swedish" text, "German" text, "Dutch" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT "Icelandic" FROM table_56603 WHERE "Norwegian (nynorsk)" = 'kvitt/kvit'
wikisql
CREATE TABLE table_16388047_1 ( ground VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of grounds for essendon
SELECT COUNT(ground) FROM table_16388047_1 WHERE home_team = "Essendon"
sql_create_context
CREATE TABLE table_9371 ( "Year" text, "Starts" real, "Wins" real, "Top Fives" real, "Top Tens" real, "Poles" real, "Rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of wins when casey mears ranked 36th and had m...
SELECT COUNT("Wins") FROM table_9371 WHERE "Rank" = '36th' AND "Top Fives" > '0'
wikisql
CREATE TABLE table_78762 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player has 1 as the place?
SELECT "Player" FROM table_78762 WHERE "Finish" = '1'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME
nvbench
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE restriction ( restriction_code text, advance_purc...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PITTSBURGH' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'RENTAL CAR'
atis
CREATE TABLE table_name_81 ( format VARCHAR, catalogue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What format has a catalogue of asw 40362?
SELECT format FROM table_name_81 WHERE catalogue = "asw 40362"
sql_create_context
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY Name
nvbench
CREATE TABLE table_77728 ( "Name" text, "Tenure" text, "Ties" real, "Lost" real, "Win %" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the total number of ties for name of totals and lost more than 30
SELECT COUNT("Ties") FROM table_77728 WHERE "Name" = 'totals' AND "Lost" > '30'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.admityear < "2114"
mimicsql_data
CREATE TABLE table_name_95 ( away_captain VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Away captain that played on 11,12,13 Aug 1902?
SELECT away_captain FROM table_name_95 WHERE date = "11,12,13 aug 1902"
sql_create_context
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), ...
SELECT city_code, AVG(Age) FROM Student GROUP BY city_code ORDER BY AVG(Age) DESC
nvbench
CREATE TABLE table_name_88 ( points VARCHAR, cat_fea VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the CAT FEA is 3 how many points were scored?
SELECT points FROM table_name_88 WHERE cat_fea = "3"
sql_create_context