instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_23079 ( "Rank" text, "Name" text, "Lifespan" text, "Country" text, "Wins" real, "Majors" real, "Winning span" text, "Span (years)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the winning span with the rank o...
SELECT "Winning span" FROM table_23079 WHERE "Rank" = '5'
wikisql
CREATE TABLE table_37909 ( "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 score of the game with a record of 37 26 9?
SELECT "Score" FROM table_37909 WHERE "Record" = '37–26–9'
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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2120-04-16 13:27:00"
mimicsql_data
CREATE TABLE table_17823 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the follo...
SELECT COUNT("Points for") FROM table_17823 WHERE "Lost" = '12'
wikisql
CREATE TABLE table_204_587 ( id number, "drop(s)" text, "multiplayer map(s)" text, "spec ops mission(s)" text, "face off map(s)" text, "xbox 360 release date" text, "playstation 3 release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT "drop(s)" FROM table_204_587 ORDER BY "spec ops mission(s)" DESC LIMIT 1
squall
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Cardiogenic shock"
mimicsql_data
CREATE TABLE table_2668243_25 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What candidate(s) ran for election when nathaniel h. claiborne was the incumbent?
SELECT candidates FROM table_2668243_25 WHERE incumbent = "Nathaniel H. Claiborne"
sql_create_context
CREATE TABLE table_name_56 ( calendar VARCHAR, wysiwyg_editor VARCHAR, unread_message_tracking VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Calendar has WYSIWYG Editor of yes and an Unread message tracking of yes?
SELECT calendar FROM table_name_56 WHERE wysiwyg_editor = "yes" AND unread_message_tracking = "yes"
sql_create_context
CREATE TABLE table_60232 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of First Elected, when Party is 'Democratic', and when District is 'T...
SELECT COUNT("First elected") FROM table_60232 WHERE "Party" = 'democratic' AND "District" = 'tennessee 5'
wikisql
CREATE TABLE table_60476 ( "Edition" text, "Round" text, "Date" text, "Surface" text, "Opponent" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the 1988 world group i edition with a result of 7 6 (7 5) , 6 3?
SELECT "Date" FROM table_60476 WHERE "Edition" = '1988 world group i' AND "Result" = '7–6 (7–5) , 6–3'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-40255' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit...
eicu
CREATE TABLE table_71308 ( "Member countries" text, "Population" text, "Area (km\u00b2)" text, "GDP (billion US$)" text, "GDP per capita (US$)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the country that has an Area (km ) of ...
SELECT "Member countries" FROM table_71308 WHERE "Area (km\u00b2)" = '49,036'
wikisql
CREATE TABLE table_name_61 ( away_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the Venue was victoria park, what was the Away team score?
SELECT away_team AS score FROM table_name_61 WHERE venue = "victoria park"
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 WHERE diagnoses.long_title = "Insulins and antidiabetic agents causing adverse effects in therapeutic use"
mimicsql_data
CREATE TABLE table_1858574_2 ( state_country VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 5 is the position what is the state or country?
SELECT state_country FROM table_1858574_2 WHERE position = 5
sql_create_context
CREATE TABLE table_11959 ( "Rank" real, "Name" text, "Headquarters" text, "Revenue \u20acMillion" real, "Profit \u20acMillion" real, "Employees (World)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the highest revenue for employees of 95,...
SELECT MAX("Revenue \u20acMillion") FROM table_11959 WHERE "Employees (World)" = '95,175' AND "Rank" < '8'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY ...
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_name_84 ( nation VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Nation has a Record of 15.16 m?
SELECT nation FROM table_name_84 WHERE record = "15.16 m"
sql_create_context
CREATE TABLE employees ( employee_id number, first_name text, last_name text, email text, phone_number text, hire_date time, job_id text, salary number, commission_pct number, manager_id number, department_id number ) CREATE TABLE jobs ( job_id text, job_title text, ...
SELECT first_name, last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163)
spider
CREATE TABLE table_204_24 ( id number, "year" number, "league" text, "record" text, "finish" text, "manager" text, "playoffs" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- whih year did they finish hiher , 1949 or 1961 ?
SELECT "year" FROM table_204_24 WHERE "year" IN (1949, 1961) ORDER BY "finish" LIMIT 1
squall
CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE all_documents ( document_id number, date_stored time, document_type_code text, document_name text, document_description text, other_details text ) CREAT...
SELECT location_code FROM ref_locations WHERE location_name = "Canada"
spider
CREATE TABLE table_21276 ( "Country" text, "Preliminary" text, "Interview" text, "Swimsuit" text, "Evening Gown" text, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the swimsuit scores of participants with score 9.366 in inte...
SELECT "Swimsuit" FROM table_21276 WHERE "Interview" = '9.366'
wikisql
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 COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.JZKSDM = '61501' AND wdmzjzjlb.RYDJSJ BETWEEN '2005-08-16' AND '2008-01-23' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.JZKSDM = '61501' AND bdmzjzjlb.RYDJSJ BETWEEN '2005-08-16' AND '2008-01-23'
css
CREATE TABLE table_40377 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release Date of Catalog RR 8655-2?
SELECT "Date" FROM table_40377 WHERE "Catalog" = 'rr 8655-2'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT Reputation, COUNT(1) AS UserCount FROM Users GROUP BY Reputation ORDER BY Reputation
sede
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, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE area.area LIKE '%web technology%' AND program_course.workload < (SELECT MIN(PROGRAM_COURS...
advising
CREATE TABLE table_name_26 ( position VARCHAR, played INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many positions have a played greater than 12?
SELECT COUNT(position) FROM table_name_26 WHERE played > 12
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TAB...
SELECT Id AS "post_link", LENGTH(Body) AS "Length" FROM Posts ORDER BY LENGTH(Body) DESC LIMIT 500
sede
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, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
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 INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
advising
CREATE TABLE Customer_Orders ( Order_ID INTEGER, Customer_ID INTEGER, Store_ID INTEGER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR(255) ) CREATE TABLE Performers ( Performer_ID INTEGER, Address_ID INTEGER, Cust...
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY payment_method_code DESC
nvbench
CREATE TABLE table_54704 ( "Catches" text, "Player" text, "Versus" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did af giles play?
SELECT "Date" FROM table_54704 WHERE "Player" = 'af giles'
wikisql
CREATE TABLE table_1893815_1 ( english_title VARCHAR, album_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the english title for album # 2nd
SELECT english_title FROM table_1893815_1 WHERE album_number = "2nd"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE T...
SELECT (SELECT 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 = 23929) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents...
mimic_iii
CREATE TABLE table_76791 ( "Pick" real, "Pos." text, "Nationality" text, "Team" text, "Previous team" text, "NBA years [a ]" text, "Career with the franchise [b ]" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the previous team of t...
SELECT "Previous team" FROM table_76791 WHERE "NBA years [a ]" = '4' AND "Pick" < '16'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT * FROM Comments WHERE UserId = @UserId AND Score = (SELECT MAX(Score) FROM Comments WHERE UserId = @UserId)
sede
CREATE TABLE table_name_94 ( total INTEGER, rank VARCHAR, tally VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of totals for ranks under 3 with tallies of 2-5?
SELECT SUM(total) FROM table_name_94 WHERE rank < 3 AND tally = "2-5"
sql_create_context
CREATE TABLE table_name_10 ( wins INTEGER, points VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Before 2007, how many wins were there when the point total was 48?
SELECT SUM(wins) FROM table_name_10 WHERE points = "48" AND year < 2007
sql_create_context
CREATE TABLE table_22378 ( "Mexico" text, "Ma\u00f1ana es para siempre" text, "El Canal de las Estrellas" text, "October 20, 2008" text, "June 14, 2009" text, "Monday to Friday" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the october ...
SELECT "October 20, 2008" FROM table_22378 WHERE "Mexico" = 'Romania'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number,...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27172 AND admissions.dischtime IS NULL)
mimic_iii
CREATE TABLE table_17081 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Zach Banner is a player at which school?
SELECT "School" FROM table_17081 WHERE "Player" = 'Zach Banner'
wikisql
CREATE TABLE table_4589 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Away team has a score fo 4.12 (36)?
SELECT "Away team" FROM table_4589 WHERE "Away team score" = '4.12 (36)'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 TABLE departments ( DEPARTME...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT demographic.discharge_location FROM demographic WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Other shock without mention of trauma"
mimicsql_data
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD...
SELECT t_kc21.IN_HOSP_DAYS FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '23675184652'
css
CREATE TABLE table_name_53 ( march VARCHAR, august VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the March playmate with an August playmate Gianna Amore?
SELECT march FROM table_name_53 WHERE august = "gianna amore"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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 AND jyb...
css
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 MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT" AND demographic.admityear >= "2146"
mimicsql_data
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '55103393' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 6694.41)
css
CREATE TABLE table_1356555_2 ( median_family_income VARCHAR, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the median family income for riverside
SELECT median_family_income FROM table_1356555_2 WHERE county = "Riverside"
sql_create_context
CREATE TABLE table_44655 ( "Nat." text, "Name" text, "Moving from" text, "Type" text, "Transfer window" text, "Ends" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type when they move from Gimn stic?
SELECT "Type" FROM table_44655 WHERE "Moving from" = 'gimnàstic'
wikisql
CREATE TABLE table_28280 ( "Rank" real, "Dismissals" real, "Catches" real, "Stumps" real, "Player" text, "Period" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the period if the player is Hashan Tillakaratne?
SELECT "Period" FROM table_28280 WHERE "Player" = 'Hashan Tillakaratne'
wikisql
CREATE TABLE table_52002 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Home team at corio oval?
SELECT "Home team" FROM table_52002 WHERE "Venue" = 'corio oval'
wikisql
CREATE TABLE table_name_6 ( grantee VARCHAR, date VARCHAR, concession VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the grantee for las pulgas in 1795
SELECT grantee FROM table_name_6 WHERE date = 1795 AND concession = "las pulgas"
sql_create_context
CREATE TABLE table_68639 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest points of using mclaren m14a as chassis?
SELECT MIN("Points") FROM table_68639 WHERE "Chassis" = 'mclaren m14a'
wikisql
CREATE TABLE table_name_38 ( tries_for VARCHAR, points_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tries for were there while having 479 points against?
SELECT tries_for FROM table_name_38 WHERE points_against = "479"
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 lab ( labid numbe...
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 = '010-38092')) AND DATETIME(medication.drugstarttime) >= DATETIM...
eicu
CREATE TABLE table_35433 ( "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 lowest pick # of John Ayres?
SELECT MIN("Pick #") FROM table_35433 WHERE "Name" = 'john ayres'
wikisql
CREATE TABLE table_10837 ( "Rank" real, "Constituency" text, "Winning party 2007" text, "Swing to gain" real, "PC's place 2007" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank was caerphilly with a Swing smaller than 6.92...
SELECT COUNT("Rank") FROM table_10837 WHERE "Swing to gain" < '6.92' AND "Constituency" = 'caerphilly'
wikisql
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 WHERE demographic.dod_year <= "2173.0" AND diagnoses.icd9_code = "V1083"
mimicsql_data
CREATE TABLE procedures ( 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 ) ...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.admission_type = "EMERGENCY"
mimicsql_data
CREATE TABLE table_name_4 ( original_name VARCHAR, designer VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original name of the place by designer Glen Peloso with a Location of n/a?
SELECT original_name FROM table_name_4 WHERE designer = "glen peloso" AND location = "n/a"
sql_create_context
CREATE TABLE table_name_87 ( draw VARCHAR, points VARCHAR, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many draws for avia band with over 22 points?
SELECT COUNT(draw) FROM table_name_87 WHERE points > 22 AND artist = "avia band"
sql_create_context
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.YQBH, jyjgzbb.YQMC 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.BG...
css
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, depart...
SELECT DISTINCT flight_id FROM flight WHERE to_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'WESTCHESTER COUNTY'))
atis
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT * 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 = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE table_name_95 ( appeared INTEGER, rr_w_rate INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total appeared that has an RR Rate less than 0.17?
SELECT SUM(appeared) FROM table_name_95 WHERE rr_w_rate < 0.17
sql_create_context
CREATE TABLE table_name_27 ( venue VARCHAR, competition VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- After 1979, where was the European Indoor Championships held?
SELECT venue FROM table_name_27 WHERE competition = "european indoor championships" AND year > 1979
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT demographic.marital_status, demographic.diagnosis FROM demographic WHERE demographic.name = "James Cepeda"
mimicsql_data
CREATE TABLE table_64117 ( "Date of release" text, "Title" text, "Billboard peak" text, "RIAA cert." text, "Label" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was twenty released?
SELECT "Date of release" FROM table_64117 WHERE "Title" = 'twenty'
wikisql
CREATE TABLE table_2010 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the power at the cebu station?
SELECT "Power (kW)" FROM table_2010 WHERE "Location" = 'Cebu'
wikisql
CREATE TABLE customers_cards ( card_id number, customer_id number, card_type_code text, card_number text, date_valid_from time, date_valid_to time, other_card_details text ) CREATE TABLE customers ( customer_id number, customer_first_name text, customer_last_name text, custo...
SELECT T2.customer_first_name, T2.customer_last_name, T1.customer_id FROM accounts AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) LIMIT 1
spider
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 demographic.dob, demographic.expire_flag FROM demographic WHERE demographic.name = "Dominga Garvin"
mimicsql_data
CREATE TABLE table_204_144 ( id number, "represent" number, "contestant" text, "age" number, "height" text, "hometown" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the other person who is 24 years old besides reyna royo ?
SELECT "contestant" FROM table_204_144 WHERE "contestant" <> 'reyna royo' AND "age" = 24
squall
CREATE TABLE table_27755603_2 ( high_rebounds VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did the high rebounds in the game in which Rodney Stuckey (16) did the high points?
SELECT high_rebounds FROM table_27755603_2 WHERE high_points = "Rodney Stuckey (16)"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId numb...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, LastAccessDate, UpVotes, DownVotes FROM Users WHERE (Location LIKE '%##city?slovenska##%' COLLATE Latin1_General_CI_AI) AND LENGTH(Location) > 1 ORDER BY Reputation DESC LIMIT 500
sede
CREATE TABLE bridge ( architect_id int, id int, name text, location text, length_meters real, length_feet real ) CREATE TABLE architect ( id text, name text, nationality text, gender text ) CREATE TABLE mill ( architect_id int, id int, location text, name text, ...
SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.id DESC
nvbench
CREATE TABLE table_name_72 ( extranet VARCHAR, intranet VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the intranet entry is Yes, what is the extranet entry for Microsoft Exchange server?
SELECT extranet FROM table_name_72 WHERE intranet = "yes" AND name = "microsoft exchange server"
sql_create_context
CREATE TABLE table_48538 ( "Gatchaman" text, "Eagle Riders" text, "Rank" text, "Bird Uniform" text, "Weapon" text, "Mecha" text, "Japanese voice actor" text, "Voice actor (Eagle Riders)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wha...
SELECT "Bird Uniform" FROM table_48538 WHERE "Voice actor (Eagle Riders)" = 'heidi noelle lenhart'
wikisql
CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(15), shipping_method_code VARCHAR(15), order_placed_datetime DATETIME, order_delivered_datetime DATETIME, order_shipping_charges VARCHAR(255) ) CREATE TABLE Mailshot_Campaigns ( mailshot_id I...
SELECT outcome_code, COUNT(*) FROM Mailshot_Customers GROUP BY outcome_code ORDER BY outcome_code
nvbench
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, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra...
advising
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15417')) AND microlab.culturesite = 'sputum, expectorated' AN...
eicu
CREATE TABLE table_name_95 ( english_title VARCHAR, original_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the English title listed that has an Original title of The Crying Game?
SELECT english_title FROM table_name_95 WHERE original_title = "the crying game"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT mzjzjlb.JZLSH 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 = '50606376' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2011-11-27')
css
CREATE TABLE table_name_27 ( events INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average events for miller barber
SELECT AVG(events) FROM table_name_27 WHERE player = "miller barber"
sql_create_context
CREATE TABLE table_1960 ( "Season" text, "League" text, "Division" text, "GP" real, "W" real, "L" real, "T" real, "OTL" real, "SOL" real, "Pts" real, "PCT" text, "GF" real, "GA" real, "PIM" real, "Coach(es)" text, "Result" text ) -- Using valid SQLite, a...
SELECT MIN("OTL") FROM table_1960 WHERE "PCT" = '0.514'
wikisql
CREATE TABLE table_117 ( "Title" text, "System" text, "Publisher" text, "Product No." text, "Compatible with 20/60GB NTSC PS3 (CECHA/CECHB)" text, "Compatible with 60GB PAL/80GB NTSC PS3 (CECHC/CECHE)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Publisher" FROM table_117 WHERE "Product No." = 'SLUS-20265'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent
nvbench
CREATE TABLE table_56461 ( "Sign" text, "Name" text, "Date" text, "Content" text, "City" text, "Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the city for athous lavrensis
SELECT "City" FROM table_56461 WHERE "Name" = 'athous lavrensis'
wikisql
CREATE TABLE table_23243 ( "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. -- If the vote percentage is 2.111%, what was the minimum rank?
SELECT MIN("Rank") FROM table_23243 WHERE "Vote percentage" = '2.111%'
wikisql
CREATE TABLE table_train_4 ( "id" int, "pregnancy_or_lactation" bool, "severe_sepsis" bool, "acute_venous_thromboembolism_vte" bool, "allergy_to_carbapenem" bool, "septic_shock" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT * FROM table_train_4 WHERE age < 13
criteria2sql
CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE de...
SELECT title, AVG(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title
nvbench
CREATE TABLE table_23289934_1 ( no_in_series INTEGER, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least number for production code for 3abc21
SELECT MIN(no_in_series) FROM table_23289934_1 WHERE production_code = "3ABC21"
sql_create_context
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Acc...
SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code
nvbench
CREATE TABLE table_17528 ( "Season" text, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the mens singles for 1944/1945
SELECT "Mens singles" FROM table_17528 WHERE "Season" = '1944/1945'
wikisql
CREATE TABLE table_71967 ( "Call sign" text, "Frequency" text, "City of license" text, "Facility ID" real, "ERP / Power W" real, "Height m ( ft )" text, "Class" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the heightfor city of licens...
SELECT "Height m ( ft )" FROM table_71967 WHERE "City of license" = 'malone, ny'
wikisql
CREATE TABLE table_204_522 ( id number, "boat #" text, "name" text, "builder" text, "laid down" text, "launched" text, "completed" text, "fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ha-201 and ha-202 were both launched on which ...
SELECT "launched" FROM table_204_522 WHERE "name" = 'ha-201'
squall
CREATE TABLE table_name_38 ( attendance INTEGER, home VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the low attendance was based in phoenix with a Record of 1 0 0?
SELECT MIN(attendance) FROM table_name_38 WHERE home = "phoenix" AND record = "1–0–0"
sql_create_context
CREATE TABLE table_name_61 ( losing_bonus VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Losing bonus, when the value for Points is 43?
SELECT losing_bonus FROM table_name_61 WHERE points = "43"
sql_create_context
CREATE TABLE table_name_29 ( player VARCHAR, total VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player has a total of more than 290 and +4 to par.
SELECT player FROM table_name_29 WHERE total > 290 AND to_par = "+4"
sql_create_context