instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 demographic.discharge_location FROM demographic WHERE demographic.name = "Paul Edwards"
mimicsql_data
CREATE TABLE table_18471 ( "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 is the latest year listed with the Alabama 4 voting district?
SELECT MAX("First elected") FROM table_18471 WHERE "District" = 'Alabama 4'
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 Team_Name, ACC_Percent FROM basketball_match
nvbench
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND...
css
CREATE TABLE table_12453 ( "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. -- What is the Record in a week later than 7 against the San Diego...
SELECT "Record" FROM table_12453 WHERE "Week" > '7' AND "Opponent" = 'san diego chargers'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "74463"
mimicsql_data
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total...
SELECT COUNT(DISTINCT COURSE_1.department, COURSE_0.number) FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'PHIL' AND COURSE_1.number = 427 AND ...
advising
CREATE TABLE table_name_17 ( player VARCHAR, place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player placed in t5 and had a score of 72-71-73-78=294?
SELECT player FROM table_name_17 WHERE place = "t5" AND score = 72 - 71 - 73 - 78 = 294
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Poisoning-opiates NEC" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_33329 ( "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. -- Where did Essendon play as the home team?
SELECT "Venue" FROM table_33329 WHERE "Home team" = 'essendon'
wikisql
CREATE TABLE table_38646 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record on April 6?
SELECT "Record" FROM table_38646 WHERE "Date" = 'april 6'
wikisql
CREATE TABLE fgwyjzb ( 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_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '44017290' AND gwyjzb.IN_HOSP_DATE BETWEEN '2005-10-18' AND '2012-02-28' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '44017290' AND fgwyjzb.IN_HOSP_DATE BETWEEN ...
css
CREATE TABLE table_46966 ( "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. -- Who ha...
SELECT "High points" FROM table_46966 WHERE "Score" = 'w 108–105 (ot)'
wikisql
CREATE TABLE table_name_22 ( grid VARCHAR, team VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the grid of driver tomas scheckter from vision racing team?
SELECT grid FROM table_name_22 WHERE team = "vision racing" AND driver = "tomas scheckter"
sql_create_context
CREATE TABLE table_45943 ( "Ethnicity" text, "Islam" text, "Christianity" text, "Judaism" text, "Buddhism" text, "Other" text, "Atheism" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the other value associated with a Christianity va...
SELECT "Other" FROM table_45943 WHERE "Christianity" = '10.24%'
wikisql
CREATE TABLE table_12848 ( "Governorate" text, "Cereals" real, "Fruit Trees" real, "Olives" real, "Industrial crops" real, "Vegetables" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of olives of the governorate with les...
SELECT COUNT("Olives") FROM table_12848 WHERE "Vegetables" < '259,743' AND "Industrial crops" > '14,625' AND "Fruit Trees" = '20,768'
wikisql
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM 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 = '79096915'
css
CREATE TABLE table_67118 ( "State ranked in partisan order" text, "Percentage Republicans" text, "Percentage Democrats" text, "Republican/ Democratic" text, "Republican seat plurality" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What state is 25%...
SELECT "State ranked in partisan order" FROM table_67118 WHERE "Percentage Democrats" = '25%' AND "Republican/ Democratic" = '6/2'
wikisql
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops 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, date_day, days, flight WHERE (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.day_nam...
atis
CREATE TABLE table_name_85 ( goals_for INTEGER, wins VARCHAR, goals_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of 'goals for' out of the clubs where there were 18 wins and fewer than 38 'goals against'?
SELECT MIN(goals_for) FROM table_name_85 WHERE wins = 18 AND goals_against < 38
sql_create_context
CREATE TABLE table_68411 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round did the bout against Jonatas Novaes end in?
SELECT "Round" FROM table_68411 WHERE "Opponent" = 'jonatas novaes'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, g...
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'HJCS' AND course.number = 425 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1
advising
CREATE TABLE table_204_974 ( id number, "season" number, "level" text, "division" text, "section" text, "administration" text, "position" text, "movements" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- of the third division , how many w...
SELECT COUNT(*) FROM table_204_974 WHERE "division" = 'third division' AND "section" = 'section 3'
squall
CREATE TABLE table_14423274_3 ( date VARCHAR, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did they play in Cleveland Municipal Stadium?
SELECT date FROM table_14423274_3 WHERE game_site = "Cleveland Municipal Stadium"
sql_create_context
CREATE TABLE table_name_35 ( location VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Terre Haute North located?
SELECT location FROM table_name_35 WHERE school = "terre haute north"
sql_create_context
CREATE TABLE table_name_11 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tournament has A in 1987?
SELECT tournament FROM table_name_11 WHERE 1987 = "a"
sql_create_context
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( ...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E...
advising
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = ...
css
CREATE TABLE table_name_81 ( points_against VARCHAR, played VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the points against for the team that played 22 and lost 6?
SELECT points_against FROM table_name_81 WHERE played = "22" AND lost = "6"
sql_create_context
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_Neutral, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC
nvbench
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM ...
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '8951695' AND mzjzjlb.JZKSRQ BETWEEN '2000-12-30' AND '2020-10-26' AND mzjzjlb.ZSEBZ > 0
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'cortisol')) GROUP BY cost.patienthealthsystemstayid) AS t1
eicu
CREATE TABLE table_5248 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest positioned with more than 9...
SELECT MIN("Position") FROM table_5248 WHERE "Played" > '9'
wikisql
CREATE TABLE table_name_91 ( label VARCHAR, catalog VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which label has a catalog of y8hr 1006 in 1972?
SELECT label FROM table_name_91 WHERE catalog = "y8hr 1006" AND date = "1972"
sql_create_context
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cholecystectomy')) AND STRFTIME('%y', cost.chargetime) = ...
mimic_iii
CREATE TABLE table_67161 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of Tim Herron, who placed t1?
SELECT "Score" FROM table_67161 WHERE "Place" = 't1' AND "Player" = 'tim herron'
wikisql
CREATE TABLE table_48052 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a Grid less than 15, and a Time of +52.833, what is the highest number of Laps?
SELECT MAX("Laps") FROM table_48052 WHERE "Grid" < '15' AND "Time" = '+52.833'
wikisql
CREATE TABLE table_19753079_35 ( party VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the party for new york 4
SELECT party FROM table_19753079_35 WHERE district = "New York 4"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_des...
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOST...
atis
CREATE TABLE table_24108789_6 ( events INTEGER, _number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least events for number 7
SELECT MIN(events) FROM table_24108789_6 WHERE _number = 7
sql_create_context
CREATE TABLE Physician ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), SSN INTEGER ) CREATE TABLE Block ( BlockFloor INTEGER, BlockCode INTEGER ) CREATE TABLE Stay ( StayID INTEGER, Patient INTEGER, Room INTEGER, StayStart DATETIME, StayEnd DATETIME ) CREATE ...
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY COUNT(Name) DESC
nvbench
CREATE TABLE table_46432 ( "Club" text, "Location" text, "Current manager" text, "Team captain" text, "Stadium" text, "Capacity" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the team captain of Regenboogstadion?
SELECT "Team captain" FROM table_46432 WHERE "Stadium" = 'regenboogstadion'
wikisql
CREATE TABLE table_name_6 ( total INTEGER, gold VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least total when there are more than 2 golds and fewer than 0 silver?
SELECT MIN(total) FROM table_name_6 WHERE gold > 2 AND silver < 0
sql_create_context
CREATE TABLE table_47903 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the college when the overall is more than 76 for brian mitchell?
SELECT "College" FROM table_47903 WHERE "Overall" > '76' AND "Name" = 'brian mitchell'
wikisql
CREATE TABLE table_38130 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date were the Results 4:0?
SELECT "Date" FROM table_38130 WHERE "Results\u00b9" = '4:0'
wikisql
CREATE TABLE Student_Addresses ( student_id INTEGER, address_id INTEGER, date_address_from DATETIME, date_address_to DATETIME, monthly_rental DECIMAL(19,4), other_details VARCHAR(255) ) CREATE TABLE Assessment_Notes ( notes_id INTEGER, student_id INTEGER, teacher_id INTEGER, dat...
SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_27537518_6 ( decision VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who made the decision in the game played on December 26?
SELECT decision FROM table_27537518_6 WHERE date = "December 26"
sql_create_context
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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 te...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j...
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE table_name_93 ( release_date VARCHAR, title VARCHAR, production_number VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release date of the episode named Mouse-Placed Kitten with an episode number less than 14...
SELECT release_date FROM table_name_93 WHERE production_number < 1495 AND director = "robert mckimson" AND title = "mouse-placed kitten"
sql_create_context
CREATE TABLE table_1652 ( "Season" text, "Series" text, "Team Name" text, "Races" real, "Poles" real, "Wins" real, "Points" real, "Final Placing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team started 2010?
SELECT "Team Name" FROM table_1652 WHERE "Season" = '2010'
wikisql
CREATE TABLE table_27704187_2 ( high_assists VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the most assists and how many did they have on October 5?
SELECT high_assists FROM table_27704187_2 WHERE date = "October 5"
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 txmzjzjlb.JZLSH FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '96787952' AND hz_info.YLJGDM = '6798205' AND txmzjzjlb.JZKSMC LIKE '%手外科%' UNION SELECT ftxmzjzjlb.JZLSH FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJ...
css
CREATE TABLE table_255829_1 ( population__2010_ VARCHAR, no_of_barangays VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2010 population of the municipality with 31 barangays?
SELECT population__2010_ FROM table_255829_1 WHERE no_of_barangays = 31
sql_create_context
CREATE TABLE table_name_87 ( competition VARCHAR, result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the competition when the result is won and the date is september 13, 1996?
SELECT competition FROM table_name_87 WHERE result = "won" AND date = "september 13, 1996"
sql_create_context
CREATE TABLE table_56736 ( "Player" text, "Overs" text, "Runs" text, "Wkts" text, "Mdns" text, "Econ" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the player with econ of 4.23
SELECT "Player" FROM table_56736 WHERE "Econ" = '4.23'
wikisql
CREATE TABLE table_32534 ( "Week" text, "Kickoff" text, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game site" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the kickoff time of the SB XXXVI?
SELECT "Kickoff" FROM table_32534 WHERE "Week" = 'sb xxxvi'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskSt...
WITH Edits AS (SELECT RANK() OVER (ORDER BY COUNT(*) DESC) AS Rank, UserId AS "user_link", COUNT(*) AS NumRevisions FROM PostHistory WHERE PostHistoryTypeId BETWEEN 4 AND 9 GROUP BY UserId) SELECT Rank, 'user_link', NumRevisions FROM Edits WHERE Rank < 100 OR 'user_link' = '##UserID##' ORDER BY Rank
sede
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.insurance = "Private"
mimicsql_data
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-1337')) AND microlab.culturesite = 'urine, catheter specimen' ORDER BY mic...
eicu
CREATE TABLE table_2296507_1 ( stellar_age__myr_ VARCHAR, stellar_classification VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the stellar age for f3v
SELECT stellar_age__myr_ FROM table_2296507_1 WHERE stellar_classification = "F3V"
sql_create_context
CREATE TABLE acceptance ( Result VARCHAR, Submission_ID VARCHAR ) CREATE TABLE submission ( Author VARCHAR, Submission_ID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the authors of submissions and the acceptance results of their submissions....
SELECT T2.Author, T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID
sql_create_context
CREATE TABLE table_name_41 ( margin_of_victory VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Margin of victory on aug 11, 2002?
SELECT margin_of_victory FROM table_name_41 WHERE date = "aug 11, 2002"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Poisoning by penicillins"
mimicsql_data
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 labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73075) AND STRFTIME('%y-%m', labevents.charttime) = '2104-12' ORDER BY labevents.charttime LIMIT 1
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = jy...
css
CREATE TABLE table_32570 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of week(s) with an attendance of 30,751?
SELECT SUM("Week") FROM table_32570 WHERE "Attendance" = '30,751'
wikisql
CREATE TABLE table_name_56 ( money___ INTEGER, to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which money is the highest one that has a To par of 1, and a Score of 73-70-73-71=287?
SELECT MAX(money___) AS $__ FROM table_name_56 WHERE to_par = "–1" AND score = 73 - 70 - 73 - 71 = 287
sql_create_context
CREATE TABLE table_name_72 ( result VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which result featured the Indianapolis Colts as opponents?
SELECT result FROM table_name_72 WHERE opponent = "indianapolis colts"
sql_create_context
CREATE TABLE table_name_32 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the Tournament during which Ji Nov k made it to the 1st round(1R) in 1995, how did he do in 2001?
SELECT 2001 FROM table_name_32 WHERE 1995 = "1r"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABL...
SELECT COUNT(*) > 0 FROM course, program, program_course WHERE course.department = 'ARABIC' AND course.number = 201 AND program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_21264 ( "Athlete" text, "Event" text, "Swim (1.5km)" text, "Trans 1" text, "Bike (40km)" text, "Trans 2" text, "Run (10km)" text, "Total Time" text, "Rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was th...
SELECT "Swim (1.5km)" FROM table_21264 WHERE "Athlete" = 'Daniela Ryf'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime ti...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30509) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-1 year')
mimic_iii
CREATE TABLE table_name_79 ( winner VARCHAR, tier VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the Tier is listed as tier iii, who is the Winner?
SELECT winner FROM table_name_79 WHERE tier = "tier iii"
sql_create_context
CREATE TABLE table_22941863_19 ( mountains_classification VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mountain classification name if the winner is Bernhard Eisel?
SELECT mountains_classification FROM table_22941863_19 WHERE winner = "Bernhard Eisel"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Remov biliary/liver tube"
mimicsql_data
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id num...
SELECT COUNT(*) AS threads FROM Comments WHERE Text LIKE 'Comments are not for extended discussion%' AND CreationDate > CURRENT_TIMESTAMP() - '##days?90##'
sede
CREATE TABLE player_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first text ) CREATE TABLE player ( player_id text, birth_year text, birth_month text, birth_day text, birth_country text, birth_st...
SELECT T2.points_won FROM player_award AS T1 JOIN player_award_vote AS T2 ON T1.player_id = T2.player_id WHERE T1.league_id = "NL" AND T1.award_id = "Most Valuable Player" AND T1.year = "1990" AND T2.league_id = "NL" AND T2.year = "1990"
thehistoryofbaseball
CREATE TABLE table_9154 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Place of the Player with a To par of +4 and Score of 70-76-71=217?
SELECT "Place" FROM table_9154 WHERE "To par" = '+4' AND "Score" = '70-76-71=217'
wikisql
CREATE TABLE table_name_75 ( position VARCHAR, nationality VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did Jimmy Oliver of the United States play?
SELECT position FROM table_name_75 WHERE nationality = "united states" AND player = "jimmy oliver"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, ...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95986) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'metamyelocytes') AND STRFTIME('%y-%m', labevents.charttime) = '2105-05' ORDER B...
mimic_iii
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_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '水建茗' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2013-03-05' AND '2016-01-07' AND t_kc24.MED_AMOUT <= 10
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-40970')) AND vitalperiodic.respiration BETWEEN respiration_lower...
eicu
CREATE TABLE table_name_93 ( winning_score VARCHAR, margin_of_victory VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the winning score with a margin of victory of 4 strokes for the NEC Invitational tournament?
SELECT winning_score FROM table_name_93 WHERE margin_of_victory = "4 strokes" AND tournament = "nec invitational"
sql_create_context
CREATE TABLE table_10308 ( "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 date was the game played at Princes Park?
SELECT "Date" FROM table_10308 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE table_23963781_3 ( position VARCHAR, nationality VARCHAR, minutes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of the player who is from the United States and has 30 minutes?
SELECT position FROM table_23963781_3 WHERE nationality = "United States" AND minutes = 30
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Po...
SELECT q.Score AS Score, q.Id AS "post_link", CASE h.Comment WHEN '1' THEN 'Exact Duplicate' WHEN '2' THEN 'Off-topic' WHEN '3' THEN 'Subjective and argumentative' WHEN '4' THEN 'Not a real question' WHEN '7' THEN 'Too localized' WHEN '10' THEN 'General reference' WHEN '20' THEN 'Noise or pointless (Meta sites only)' W...
sede
CREATE TABLE table_204_823 ( id number, "dates" text, "location" text, "attendance" text, "official guests" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the first year the event was held at the pick congress hotel in chi...
SELECT MIN("dates") FROM table_204_823 WHERE "location" = 'chicago'
squall
CREATE TABLE table_name_72 ( theme VARCHAR, issue_price VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the theme when the issue price was $508.95?
SELECT theme FROM table_name_72 WHERE issue_price = "$508.95"
sql_create_context
CREATE TABLE table_16893837_4 ( date VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for margalita chakhnashvili salome devidze
SELECT date FROM table_16893837_4 WHERE opponents = "Margalita Chakhnashvili Salome Devidze"
sql_create_context
CREATE TABLE table_71410 ( "Week" real, "Date" text, "Opponent" text, "Score" text, "Result" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record of the opponent that has a bye?
SELECT "Record" FROM table_71410 WHERE "Opponent" = 'bye'
wikisql
CREATE TABLE table_name_37 ( laps VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps are associated with a time of + 1:39.591?
SELECT laps FROM table_name_37 WHERE time_retired = "+ 1:39.591"
sql_create_context
CREATE TABLE table_36610 ( "Weight Division" text, "Winner" text, "Loser" text, "Method" text, "Round" real, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the loser of the heavyweight division fight that lasted a time of 2:24?
SELECT "Loser" FROM table_36610 WHERE "Weight Division" = 'heavyweight' AND "Time" = '2:24'
wikisql
CREATE TABLE table_48606 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score did Ed Furgol get to come in at T6?
SELECT "Score" FROM table_48606 WHERE "Place" = 't6' AND "Player" = 'ed furgol'
wikisql
CREATE TABLE table_name_61 ( season VARCHAR, team VARCHAR, wins VARCHAR, losses VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which season had 0 wins and 5 losses for the Surrey team?
SELECT season FROM table_name_61 WHERE wins = "0" AND losses = "5" AND team = "surrey"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
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 = "Diverticulosis of colon with hemorrhage" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_58261 ( "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 home team score at VFL Park?
SELECT "Home team score" FROM table_58261 WHERE "Venue" = 'vfl park'
wikisql
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 patient ( uniquep...
SELECT 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 = '030-8973')) AND NOT vitalperiodic.sao2 IS NULL AND STRFTIME('%...
eicu
CREATE TABLE table_2012187_1 ( wins VARCHAR, top_10 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- state the wins of the team with 2 top 10
SELECT COUNT(wins) FROM table_2012187_1 WHERE top_10 = 2
sql_create_context