context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ...
what are the five commonly ordered lab tests for patients who were diagnosed with tremor nec previously in the same hospital encounter, until 1 year ago?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W...
mimic_iii
CREATE TABLE table_68135 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text )
Who was the captain of the away team at Adelaide Oval?
SELECT "Away captain" FROM table_68135 WHERE "Venue" = 'adelaide oval'
wikisql
CREATE TABLE table_dev_43 ( "id" int, "gender" string, "serum_potassium" float, "systolic_blood_pressure_sbp" int, "serum_bicarbonate" int, "hemoglobin_a1c_hba1c" float, "point_of_care_blood_glucose_poc" int, "diabetic" string, "temperature" float, "creatinine_clearance_cl" float...
subjects must have been diagnosed with type ii diabetes, with hba1c level >= 7 % and <= 11 % and a fasting glucose level <= 280 mg / dl.
SELECT * FROM table_dev_43 WHERE diabetic = 'ii' AND (hemoglobin_a1c_hba1c >= 7 AND hemoglobin_a1c_hba1c <= 11) AND fasting_glucose <= 280
criteria2sql
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 ) ...
what is the average age of married patients who are of 43 years of age or more?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.age >= "43"
mimicsql_data
CREATE TABLE table_73781 ( "Song" text, "Singer" text, "Co-Singers" text, "Music Director" text, "Lyricist" text, "Co-Stars" text, "Movie/Album" text, "Year" real, "Additional Info" text )
What year did Naushad Direct the Music?
SELECT MAX("Year") FROM table_73781 WHERE "Music Director" = 'Naushad'
wikisql
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_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( ...
what were the four medicines most frequently prescribed until 2101?
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE STRFTIME('%y', prescriptions.startdate) <= '2101' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 4
mimic_iii
CREATE TABLE table_78625 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real )
What was Tom Watson's lowest To par when the total was larger than 144?
SELECT MIN("To par") FROM table_78625 WHERE "Player" = 'tom watson' AND "Total" > '144'
wikisql
CREATE TABLE table_name_15 ( bronze VARCHAR, silver INTEGER )
What is the total of bronze that has more silvers than 2?
SELECT COUNT(bronze) FROM table_name_15 WHERE silver > 2
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, su...
what is the daily average amount of the gastric nasogastric of patient 93078 since 12/2105?
SELECT AVG(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 93078)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gas...
mimic_iii
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 lab ( subject_id text, hadm_id text, ...
how many patients are discharged due to short term hospital and are under the age 64?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.age < "64"
mimicsql_data
CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE route ( train_id int, station_id int ) CREATE TA...
Find the number of trains starting from each origin. Plot them as bar chart.
SELECT origin, COUNT(*) FROM train GROUP BY origin
nvbench
CREATE TABLE table_24786958_2 ( final_score VARCHAR, game_site VARCHAR )
How many final scores were there on the game at Amsterdam arena?
SELECT COUNT(final_score) FROM table_24786958_2 WHERE game_site = "Amsterdam ArenA"
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...
what is the number of patients less than 70 years who were admitted to hospital before 2180?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "70" AND demographic.admityear < "2180"
mimicsql_data
CREATE TABLE table_203_661 ( id number, "year" number, "single" text, "peak chart positions\nus mod" number, "peak chart positions\nuk" number, "album" text )
which song came out first ? dopeman or surrender .
SELECT "single" FROM table_203_661 WHERE "single" IN ('"dopeman"', '"surrender"') ORDER BY "year" LIMIT 1
squall
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,...
find me a flight from ATLANTA to BALTIMORE
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIM...
atis
CREATE TABLE table_3645 ( "Country or territory with flag" text, "Area (km\u00b2) (per sqmi)" text, "Population (July 2009 est.)" real, "Population density per km\u00b2" text, "Capital" text )
What was the population of a country with a population density of 14.3/km (/sqmi)?
SELECT "Population (July 2009 est.)" FROM table_3645 WHERE "Population density per km\u00b2" = '14.3/km² (/sqmi)'
wikisql
CREATE TABLE table_name_65 ( player VARCHAR, placing VARCHAR )
Who is the player in 20th place?
SELECT player FROM table_name_65 WHERE placing = "20th place"
sql_create_context
CREATE TABLE table_name_96 ( production_number VARCHAR, series VARCHAR, release_date VARCHAR )
What is the Production Number of the Filmography in MM Series with a Release date of 1964-06-27?
SELECT production_number FROM table_name_96 WHERE series = "mm" AND release_date = "1964-06-27"
sql_create_context
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...
出院日期是哪一天?就是57313257288的那个医疗就诊
SELECT qtb.OUT_HOSP_DATE FROM qtb WHERE qtb.MED_CLINIC_ID = '57313257288' UNION SELECT gyb.OUT_HOSP_DATE FROM gyb WHERE gyb.MED_CLINIC_ID = '57313257288' UNION SELECT zyb.OUT_HOSP_DATE FROM zyb WHERE zyb.MED_CLINIC_ID = '57313257288' UNION SELECT mzb.OUT_HOSP_DATE FROM mzb WHERE mzb.MED_CLINIC_ID = '57313257288'
css
CREATE TABLE table_22441 ( "Round" text, "Clubs remaining" real, "Clubs involved" real, "Winners from previous round" text, "New entries this round" text, "Leagues entering at this round" text )
If the winners from the previous round is 8, what is the round?
SELECT "Round" FROM table_22441 WHERE "Winners from previous round" = '8'
wikisql
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 Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Participates_in ( stuid INTEGER...
How many students are advised by each rank of faculty? List the rank and the number of students in a bar chart.
SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank
nvbench
CREATE TABLE table_18304259_1 ( ebit__£m_ VARCHAR, earnings_per_share__p_ VARCHAR )
Name the ebit for eps being 10.6
SELECT ebit__£m_ FROM table_18304259_1 WHERE earnings_per_share__p_ = "10.6"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
what was the total number of patients on ward 99 until 4 years ago?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 99 AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-4 year')
eicu
CREATE TABLE table_201_2 ( id number, "name" text, "height\nm (ft)" text, "completed" number, "country" text, "location" text, "coordinates" text, "remarks" text )
which ferris wheel was completed in 2008 and has the height of 165 ?
SELECT "name" FROM table_201_2 WHERE "completed" = 2008 AND "height\nm (ft)" = 165
squall
CREATE TABLE table_name_76 ( rank INTEGER, name VARCHAR )
What's the smallest rank of noriko inada?
SELECT MIN(rank) FROM table_name_76 WHERE name = "noriko inada"
sql_create_context
CREATE TABLE table_65190 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
Which Rank has a Time of 5:56.73?
SELECT "Rank" FROM table_65190 WHERE "Time" = '5:56.73'
wikisql
CREATE TABLE table_203_102 ( id number, "event" text, "performance" text, "athlete" text, "nation" text, "place" text, "date" text )
in how many places were the records made ?
SELECT COUNT(DISTINCT "place") FROM table_203_102
squall
CREATE TABLE table_29682 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (millions)" text, "Original U.S. air date" text, "Prod. code" text )
which is the production code when the number of the episode in series is 87?
SELECT "Prod. code" FROM table_29682 WHERE "No. in series" = '87'
wikisql
CREATE TABLE table_43621 ( "Developer(s)" text, "Release date" text, "Required OS" text, "Genre" text, "Type" text )
What operating system was needed for 2D games?
SELECT "Required OS" FROM table_43621 WHERE "Type" = '2d'
wikisql
CREATE TABLE table_20854943_2 ( position INTEGER, loa__metres_ VARCHAR )
What position is the boat with 20.12 LOA (metres)?
SELECT MAX(position) FROM table_20854943_2 WHERE loa__metres_ = "20.12"
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...
how many patients whose procedure long title is thoracentesis and lab test category is hematology?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Thoracentesis" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_32898 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "TV Time" text, "Attendance" text )
What was the result when they had their bye week?
SELECT "Result" FROM table_32898 WHERE "Date" = 'bye'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, ...
count the number of times that patient 26398 received a laboratory test for vancomycin in a month before.
SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'vancomycin') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26398) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME()...
mimic_iii
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 ...
Of the classes in the morning , are there any EEB 497 ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EEB' AND course.number = 497 AND semester.semester = 'WN' AND semester.semester_id = course_offe...
advising
CREATE TABLE table_68220 ( "Name" text, "Entered office" text, "Left office" text, "Party" text, "First Minister" text )
What is the name of the minister that left office on 14 November 2006?
SELECT "Name" FROM table_68220 WHERE "Left office" = '14 november 2006'
wikisql
CREATE TABLE table_203_818 ( id number, "kategori" text, "1995" text, "2004" text, "2005" text, "2006" text, "2007" text )
how many awards were handed out in 2004 ?
SELECT COUNT("2004") FROM table_203_818
squall
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, ...
find out the maximum age of patients suffering from acute subdural hematoma who were hospitalized for 8 days.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "ACUTE SUBDURAL HEMATOMA" AND demographic.days_stay = "8"
mimicsql_data
CREATE TABLE table_name_45 ( party VARCHAR )
What is the name of the party called name?
SELECT party FROM table_name_45 WHERE "name" = "name"
sql_create_context
CREATE TABLE table_1842 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Who's the writer of the episode seen by 3.25 million people in the US?
SELECT "Written by" FROM table_1842 WHERE "U.S. viewers (million)" = '3.25'
wikisql
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE ...
Papers published in 2016 by li dong
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'li dong' AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_26478 ( "World record" text, "Jarmila Kratochv\u00edlov\u00e1 ( TCH )" text, "1:53.28" text, "Munich , West Germany" text, "26 July 1983" text )
If 1:53.28 is 1:54.01, what is the world record?
SELECT "World record" FROM table_26478 WHERE "1:53.28" = '1:54.01'
wikisql
CREATE TABLE table_name_90 ( total_region INTEGER, mt_morgan INTEGER )
What is the sum of people in the total region when more than 5,060 were in Mt. Morgan?
SELECT SUM(total_region) FROM table_name_90 WHERE mt_morgan > 5 OFFSET 060
sql_create_context
CREATE TABLE table_43960 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text )
Who was the opponent of the match in South Dakota, United States which has 2 rounds?
SELECT "Opponent" FROM table_43960 WHERE "Round" = '2' AND "Location" = 'south dakota, united states'
wikisql
CREATE TABLE table_name_74 ( total VARCHAR, gold VARCHAR, bronze VARCHAR, nation VARCHAR )
What is the total number of medals for West Germany with more than 1 bronze medal and more than 2 gold medals?
SELECT COUNT(total) FROM table_name_74 WHERE bronze > 1 AND nation = "west germany" AND gold > 2
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
how many patients received dressing change during the last year?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'dressing change' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
eicu
CREATE TABLE table_21785 ( "Poll Source" text, "Dates administered" text, "Democrat: John Lynch" text, "Republican: Joe Kenney" text, "Lead Margin" real )
Name the number of lead margin for republican joe kenney being 31%
SELECT COUNT("Lead Margin") FROM table_21785 WHERE "Republican: Joe Kenney" = '31%'
wikisql
CREATE TABLE all_documents ( document_id number, date_stored time, document_type_code text, document_name text, document_description text, other_details text ) CREATE TABLE ref_calendar ( calendar_date time, day_number number ) CREATE TABLE roles ( role_code text, role_name tex...
List all role codes, role names, and role descriptions.
SELECT role_code, role_name, role_description FROM roles
spider
CREATE TABLE table_65572 ( "Week 1" text, "Week 3" text, "Week 4" text, "Week 6" text, "Week 7" text, "Week 8" text, "Week 9" text, "Week 10" text, "Final Week 12" text )
Who did the housemate that nominated Kashmera Rakhi in week 3 and Amit Bobby in week 1 nominate in week 6?
SELECT "Week 6" FROM table_65572 WHERE "Week 3" = 'kashmera rakhi' AND "Week 1" = 'amit bobby'
wikisql
CREATE TABLE table_48786 ( "System" text, "Year Introduced" real, "S-100 slots" real, "Internal Floppy Disk" text, "Internal Hard Disk" text )
What is the value for internal floppy disk with s-100 slots greater than 8 introduced earlier than 1978?
SELECT "Internal Floppy Disk" FROM table_48786 WHERE "S-100 slots" > '8' AND "Year Introduced" < '1978'
wikisql
CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE party ( ...
Return the names of all counties sorted by population in ascending order.
SELECT county_name FROM county ORDER BY population
spider
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...
Winforms View Counts by Date.
SELECT TIME_TO_STR(CreationDate, '%d') AS "day", TIME_TO_STR(CreationDate, '%M') AS "month", TIME_TO_STR(CreationDate, '%Y') AS "year", SUM(ViewCount) AS "views" FROM Posts WHERE (STR_POSITION(Tags, '<winforms>') > 0) GROUP BY TIME_TO_STR(CreationDate, '%d'), TIME_TO_STR(CreationDate, '%M'), TIME_TO_STR(CreationDate, '...
sede
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
what the first height of patient 011-36282 until 12 months ago.
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-36282') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-12 month') ORDER BY patient.unita...
eicu
CREATE TABLE table_20108 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Name the total number of years where runner-up and championship is us open
SELECT COUNT("Year") FROM table_20108 WHERE "Outcome" = 'Runner-up' AND "Championship" = 'US Open'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number...
give me the top five most common diagnostics in 2100?
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) = '2100' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_name_86 ( university_students_and_adults__18yrs VARCHAR, _ VARCHAR, specification VARCHAR, gender VARCHAR )
Which University students and adults have minimum diameter of Sakigawa for female gender?
SELECT university_students_and_adults__18yrs + _ FROM table_name_86 WHERE specification = "minimum diameter of sakigawa" AND gender = "female"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
How many patients with squamous cell carcinoma oral tongue/sda as primary disease died in or before the year 2131?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" AND demographic.dod_year <= "2131.0"
mimicsql_data
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, ...
Users with similar name to Super*.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id, Location, Id AS "user_link", CreationDate AS "creation_date", DisplayName AS "name", Reputation FROM Users WHERE DisplayName LIKE 'Super%'
sede
CREATE TABLE table_61312 ( "Player" text, "Club" text, "Qualifying Goals" real, "Finals Goals" real, "Total Goals" real )
What is the total number of Total Goals scored by Stan Mortensen where the Qualifying Goals is greater than 3?
SELECT COUNT("Total Goals") FROM table_61312 WHERE "Player" = 'stan mortensen' AND "Qualifying Goals" > '3'
wikisql
CREATE TABLE table_36957 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text )
What is the venue with a competition in 1964?
SELECT "Venue" FROM table_36957 WHERE "Year" = '1964'
wikisql
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 prescriptions ( subject_id text, hadm_id...
give me the number of patients with procedure icd9 code 9915 who were born before 2175.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2175" AND procedures.icd9_code = "9915"
mimicsql_data
CREATE TABLE table_33825 ( "Series Ep." text, "Episode" real, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
Which items in segment A have a segment D of marble sculptures?
SELECT "Segment A" FROM table_33825 WHERE "Segment D" = 'marble sculptures'
wikisql
CREATE TABLE table_26888 ( "Candidate" text, "Background" text, "Original team" text, "Age" real, "Hometown" text, "Result" text )
How many ages for player Amy Cato?
SELECT COUNT("Age") FROM table_26888 WHERE "Candidate" = 'Amy Cato'
wikisql
CREATE TABLE table_40624 ( "Japanese name" text, "Kana" text, "Hanja / Kanji" text, "Korean name" text, "Hangul" text )
What is the Hanja/Kanji of the Province with a Kana of ?
SELECT "Hanja / Kanji" FROM table_40624 WHERE "Kana" = 'ちゅうせいほくどう'
wikisql
CREATE TABLE table_13010 ( "Country" text, "Builder" text, "Location" text, "Ship" text, "Class / type" text )
What is the class/type at Trieste?
SELECT "Class / type" FROM table_13010 WHERE "Location" = 'trieste'
wikisql
CREATE TABLE table_20872722_1 ( position VARCHAR, round VARCHAR )
How many positions have round 3?
SELECT COUNT(position) FROM table_20872722_1 WHERE round = 3
sql_create_context
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 ) ...
how many of the patients from catholic belief were aged below 47?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "CATHOLIC" AND demographic.age < "47"
mimicsql_data
CREATE TABLE table_name_73 ( record VARCHAR, date VARCHAR )
What is the Record with a Date that is may 20, 1961?
SELECT record FROM table_name_73 WHERE date = "may 20, 1961"
sql_create_context
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...
What classes are being taught by Dr. Jasmine Boster next semester ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Jasmine Boster%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of...
advising
CREATE TABLE table_14460 ( "Year active" text, "Title" text, "Role" text, "Medium" text, "Notes" text )
What year was the role of Rachel active in TV?
SELECT "Year active" FROM table_14460 WHERE "Role" = 'rachel'
wikisql
CREATE TABLE table_name_27 ( time VARCHAR, country VARCHAR )
What was the time for the rowers representing great britain?
SELECT time FROM table_name_27 WHERE country = "great britain"
sql_create_context
CREATE TABLE table_name_72 ( react INTEGER, time VARCHAR, athlete VARCHAR )
What is Christian Malcolm s highest react when his time was below 20.58?
SELECT MAX(react) FROM table_name_72 WHERE time < 20.58 AND athlete = "christian malcolm"
sql_create_context
CREATE TABLE table_5662 ( "Surname" text, "First" text, "D.O.B." text, "Bats" text, "Throws" text, "Position" text )
Which First has a Surname of searle?
SELECT "First" FROM table_5662 WHERE "Surname" = 'searle'
wikisql
CREATE TABLE table_28286776_52 ( player VARCHAR, goal_s_ VARCHAR )
How many players had 8 goals?
SELECT COUNT(player) FROM table_28286776_52 WHERE goal_s_ = 8
sql_create_context
CREATE TABLE table_50859 ( "Internet Plan" text, "Downstream" text, "Upstream" text, "Bandwidth Included" text, "Price" text )
What is Bandwidth Included, when Internet Plan is '8mb'?
SELECT "Bandwidth Included" FROM table_50859 WHERE "Internet Plan" = '8mb'
wikisql
CREATE TABLE table_17072 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text )
HOW MANY PLAYERS PLAY FOR OREGON?
SELECT COUNT("Player") FROM table_17072 WHERE "College" = 'Oregon'
wikisql
CREATE TABLE table_56362 ( "Class" text, "Ships in class" text, "Pennant Number" real, "Unit" text, "Builder" text, "Commissioned" text )
Which unit has a Pennant Number of 82?
SELECT "Unit" FROM table_56362 WHERE "Pennant Number" = '82'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_fro...
i'd like to fly UA from WASHINGTON to DENVER
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHIN...
atis
CREATE TABLE table_33757 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the average crowd size when the home side scores 8.9 (57)?
SELECT AVG("Crowd") FROM table_33757 WHERE "Home team score" = '8.9 (57)'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
在2018-09-20到2020-02-03的这几年里,查一下医疗机构1511362有哪些病人的住院时长是超过8天的
SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '1511362' AND RYDJSJ BETWEEN '2018-09-20' AND '2020-02-03' AND DATEDIFF(CYSJ, RYSJ) > 8
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...
the number of patients since 3 years ago in ward 1048.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 1048 AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-3 year')
eicu
CREATE TABLE table_36660 ( "Season" real, "Driver" text, "Team" text, "Tyre" text, "Points" real )
What team has fewer than 203 points?
SELECT "Team" FROM table_36660 WHERE "Points" < '203'
wikisql
CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TAB...
How many papers used ImageNet datasets in cvpr ?
SELECT DISTINCT COUNT(paper.paperid) FROM dataset, paper, paperdataset, venue WHERE dataset.datasetname = 'ImageNet' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid AND venue.venueid = paper.venueid AND venue.venuename = 'cvpr'
scholar
CREATE TABLE table_80351 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
What year did the finish of 15 happen in?
SELECT "Year" FROM table_80351 WHERE "Finish" = '15'
wikisql
CREATE TABLE table_13883 ( "Athlete" text, "Event" text, "Round of 32" text, "Round of 16" text, "Quarterfinals" text, "Semifinals" text, "Finals" text, "Rank" text )
Who was the athlete in the 56kg event having a did not advance in the finals?
SELECT "Athlete" FROM table_13883 WHERE "Finals" = 'did not advance' AND "Event" = '56kg'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CR...
what is the total amount of urine out foley output that patient 83062 had had during yesterday?
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83062)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'uri...
mimic_iii
CREATE TABLE table_name_1 ( qual VARCHAR, year VARCHAR )
Name the qual for 1957
SELECT qual FROM table_name_1 WHERE year = "1957"
sql_create_context
CREATE TABLE table_name_95 ( date VARCHAR, road_team VARCHAR, game VARCHAR )
On what date was Portland on the road for Game 2?
SELECT date FROM table_name_95 WHERE road_team = "portland" AND game = "game 2"
sql_create_context
CREATE TABLE table_203_568 ( id number, "town/village" text, "population" number, "postal code" text, "municipality" text, "island" text, "location" text )
which town or village is listed after akar ?
SELECT "town/village" FROM table_203_568 WHERE id = (SELECT id FROM table_203_568 WHERE "town/village" = 'akrar') + 1
squall
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...
what flights are available from DENVER to BALTIMORE FIRST class on UA arriving 5 7 before 1200
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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare AS FARE_0, fare AS FARE_1, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, fare_b...
atis
CREATE TABLE table_1507423_4 ( avg_finish VARCHAR, winnings VARCHAR )
How many times were the winnings $3,816,362?
SELECT COUNT(avg_finish) FROM table_1507423_4 WHERE winnings = "$3,816,362"
sql_create_context
CREATE TABLE event ( event_id number, date text, venue text, name text, event_attendance number ) CREATE TABLE news_report ( journalist_id number, event_id number, work_type text ) CREATE TABLE journalist ( journalist_id number, name text, nationality text, age text, ...
List the names of journalists who have not reported any event.
SELECT name FROM journalist WHERE NOT journalist_id IN (SELECT journalist_id FROM news_report)
spider
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC...
在02年7月13日到2009年11月4日内名叫戚雅娴的病人所有检验结果指标记录中的仪器编号以及名称分别都是啥?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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...
css
CREATE TABLE table_55428 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
What is the record for April 8?
SELECT "Record" FROM table_55428 WHERE "Date" = 'april 8'
wikisql
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 prescription...
what is maximum age of patients whose marital status is married and primary disease is overdose?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.diagnosis = "OVERDOSE"
mimicsql_data
CREATE TABLE table_79905 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" text )
What is the entrant of a chassis maserati 250f, also has 6 points and older than year 1957?
SELECT "Entrant" FROM table_79905 WHERE "Chassis" = 'maserati 250f' AND "Points" = '6' AND "Year" < '1957'
wikisql
CREATE TABLE Locations ( Location_ID INTEGER, Location_Name VARCHAR(255), Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Visitors ( Tourist_ID INTEGER, Tourist_Details VARCHAR(255) ) CREATE TABLE Features ( Feature_ID INTEGER, Feature_Details VARCHAR(255) ) CREATE TAB...
Show the names and ids of tourist attractions that are visited at least two times with a bar chart, and order by the x axis from high to low.
SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Name DESC
nvbench
CREATE TABLE person ( name text, age number, city text, gender text, job text ) CREATE TABLE personfriend ( name text, friend text, year number )
Who is the friend of Zach with longest year relationship?
SELECT friend FROM personfriend WHERE name = 'Zach' AND year = (SELECT MAX(year) FROM personfriend WHERE name = 'Zach')
spider
CREATE TABLE table_37890 ( "Date" text, "Round" text, "Opponents" text, "H / A" text, "Result F \u2013 A" text )
Was the semi-final round held at home or away?
SELECT "H / A" FROM table_37890 WHERE "Round" = 'semi-final'
wikisql
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) 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, ...
列出患者韦坚秉的检验报告单日期在零一年二月二十三日之前的所对应的门诊就诊的流水号
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND ...
css
CREATE TABLE table_name_58 ( set_3 VARCHAR, set_2 VARCHAR )
What is the Set 3 with a Set 2 with 15 6?
SELECT set_3 FROM table_name_58 WHERE set_2 = "15–6"
sql_create_context