context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_18 ( social_software VARCHAR, charting VARCHAR, discussion VARCHAR, time_tracking VARCHAR )
WHAT IS THE SOCIAL SOFTWARE WITH NO DISCUSSION, NO TIME TRACKING, AND NO CHARTING?
SELECT social_software FROM table_name_18 WHERE discussion = "no" AND time_tracking = "no" AND charting = "no"
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 whose year of birth is less than 2121 and lab test fluid is cerebrospinal fluid (csf)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2121" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
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...
Questions by Time of Day and Day of Week. Designed to consider whether 'night' questions have more visibility than 'day' questions
SELECT ((TIME_TO_STR(Posts.CreationDate, '%W')) + (TIME_TO_STR(Posts.CreationDate, '%h')) / 24.0) AS HourOfWeek, COUNT(Posts.Id) AS Questions FROM Posts WHERE PostTypeId = 1 GROUP BY TIME_TO_STR(Posts.CreationDate, '%W'), TIME_TO_STR(Posts.CreationDate, '%h') ORDER BY HourOfWeek
sede
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE inputevents_cv ( row_id nu...
how much is the total medical bill of patient 73423 until 4 years ago during their stay?
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73423) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-4 year')
mimic_iii
CREATE TABLE table_724 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
who is the incumbent where the district is florida 9?
SELECT "Incumbent" FROM table_724 WHERE "District" = 'Florida 9'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, O...
mean answer score as function of response time.
WITH a AS (SELECT pa.Score, pq.CreationDate AS question_date, pa.CreationDate AS answer_date, DATEDIFF(day, pq.CreationDate, CreationDate) AS daydiff FROM Posts AS pa JOIN Posts AS pq ON pa.ParentId = pq.Id) SELECT daydiff, AVG(1.00 * Score) AS quality FROM a WHERE daydiff >= 0 AND daydiff <= 300 GROUP BY daydiff ORDER...
sede
CREATE TABLE table_46647 ( "Pick" real, "Player" text, "Nationality" text, "New WNBA Team" text, "Former WNBA Team" text, "College/Country/Team" text )
What Player is from Connecticut?
SELECT "Player" FROM table_46647 WHERE "College/Country/Team" = 'connecticut'
wikisql
CREATE TABLE table_21566 ( "1391 Carelia" text, "1398 Donnera" text, "1405 Sibelius" text, "1406 Komppa" text, "1407 Lindel\u00f6f" text )
what is the 1406 komppa of asteroid which 1391 carelia is 1460 haltia
SELECT "1406 Komppa" FROM table_21566 WHERE "1391 Carelia" = '1460 Haltia'
wikisql
CREATE TABLE table_204_909 ( id number, "pollutant" text, "units" text, "emission standard" number, "coal-fired" text, "petroleum coke-fired" text )
at most part , how many emission standards are equal to or less than 1.1 ?
SELECT COUNT("emission standard") FROM table_204_909 WHERE "emission standard" = '≤ 1.1'
squall
CREATE TABLE table_73343 ( "Team" text, "Stadium" text, "Match played" text, "Highest" real, "Lowest" real, "Average" real )
Which team has a match played of 10 4?
SELECT "Team" FROM table_73343 WHERE "Match played" = '10 4'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
Users receiving multiple bounties from the same person.
SELECT CAST(N'2016-03-08T08:00:00' AS DATETIME)
sede
CREATE TABLE table_46367 ( "Year" real, "Show" text, "Season" real, "Episode" text, "Episode number" real, "Original airdate" text )
What is the average Episode Number, when Original Airdate is March 21, 2010, and when Season is less than 3?
SELECT AVG("Episode number") FROM table_46367 WHERE "Original airdate" = 'march 21, 2010' AND "Season" < '3'
wikisql
CREATE TABLE table_name_2 ( venue VARCHAR, round VARCHAR, result VARCHAR )
Which Venue has a Round of gs, and a Result of 0 3?
SELECT venue FROM table_name_2 WHERE round = "gs" AND result = "0–3"
sql_create_context
CREATE TABLE table_name_42 ( producer_s_ VARCHAR, recipient VARCHAR )
Which producer worked for Animus Films LTD?
SELECT producer_s_ FROM table_name_42 WHERE recipient = "animus films ltd"
sql_create_context
CREATE TABLE film ( Film_ID int, Title text, Studio text, Director text, Gross_in_dollar int ) CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE market ( Mar...
List the studios of each film and the number of films produced by that studio Show bar chart, could you list by the X from low to high?
SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY Studio
nvbench
CREATE TABLE table_29792 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code(s)" real, "U.S. viewers (millions)" text )
how many millions of north american viewers had the episode whose director was Michael Lembeck?
SELECT "U.S. viewers (millions)" FROM table_29792 WHERE "Directed by" = 'Michael Lembeck'
wikisql
CREATE TABLE table_name_82 ( try_bonus VARCHAR, tries_against VARCHAR )
With 37 tries against, what is the try bonus?
SELECT try_bonus FROM table_name_82 WHERE tries_against = "37"
sql_create_context
CREATE TABLE table_203_345 ( id number, "name" text, "party" text, "took office" number, "left office" number )
who was the last representative to take office ?
SELECT "name" FROM table_203_345 ORDER BY "took office" DESC LIMIT 1
squall
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE STUDENT ...
Return a bar chart on what is the number of professors for different school?, and sort from high to low by the the total number .
SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_16 ( matches VARCHAR, clubs VARCHAR )
What is the total number of Matches, when Clubs is 588 406?
SELECT COUNT(matches) FROM table_name_16 WHERE clubs = "588 → 406"
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
Find meter_400 and ID , and visualize them by a bar chart, and list by the Y from high to low please.
SELECT meter_400, ID FROM swimmer ORDER BY ID DESC
nvbench
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about employee_id over the last_name , show by the Y-axis in ascending.
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
nvbench
CREATE TABLE table_name_83 ( week INTEGER, attendance VARCHAR, result VARCHAR )
What is the Week of the game with an Attendance of 64,900 and a Result of L 34-13?
SELECT MAX(week) FROM table_name_83 WHERE attendance = "64,900" AND result = "l 34-13"
sql_create_context
CREATE TABLE table_70730 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Hole" text )
What is the To par has the presence of Vijay Singh?
SELECT "To par" FROM table_70730 WHERE "Player" = 'vijay singh'
wikisql
CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text )
What are the names of everybody who has exactly one friend?
SELECT name FROM personfriend GROUP BY name HAVING COUNT(*) = 1
spider
CREATE TABLE table_name_37 ( in_service INTEGER, aircraft VARCHAR )
How many Antonov An-2 Colt aircraft are in service?
SELECT AVG(in_service) FROM table_name_37 WHERE aircraft = "antonov an-2 colt"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar...
i want to fly from MIAMI to CHICAGO on AA and arrive at around 5 o'clock in the afternoon show me all flights
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 (((flight.arrival_time <= 1730 AND flight.arrival_time >= 1630) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHICAGO' AND flight.to...
atis
CREATE TABLE table_57816 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
Who is the opponent in the Tournament of Lahore final?
SELECT "Opponent in the final" FROM table_57816 WHERE "Tournament" = 'lahore'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,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 varc...
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the average of manager_id bin hire_date by time.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE key...
papers about crowdsourcing in acl 2015
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'crowdsourcing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2015 AND venue.venueid = paper.venueid AND venue.venuename = 'acl'
scholar
CREATE TABLE table_34195 ( "Club" text, "Nickname" text, "Years in Competition" text, "No. of Premierships" real, "Premiership Years" text )
What was the Years in competition that had a Premiership of 1982, 1984, 1999, 2002-03, 2008-09-10?
SELECT "Years in Competition" FROM table_34195 WHERE "Premiership Years" = '1982, 1984, 1999, 2002-03, 2008-09-10'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id ...
what is the change in the hemoglobin of patient 88191's value second measured on the first hospital visit compared to the value first measured on the first hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88191 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ...
mimic_iii
CREATE TABLE table_204_649 ( id number, "rank" number, "name" text, "image" number, "height\nft (m)" text, "floors" number, "year" number, "notes" text )
when the key tower was built in 1991 , what was the previous tallest building constructed ?
SELECT "name" FROM table_204_649 WHERE "year" < 1991 ORDER BY "height\nft (m)" DESC LIMIT 1
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalp...
when did patient 015-59871 receive procedures for the first time during their last hospital visit?
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59871' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
eicu
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, ...
what was the total amount of output amt-jackson pratt drain patient 021-250695 produced on 11/18/last year?
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-250695')) AND intakeoutput.celllabel = 'outp...
eicu
CREATE TABLE table_name_92 ( score VARCHAR, date VARCHAR )
What scored is recorded on April 24?
SELECT score FROM table_name_92 WHERE date = "april 24"
sql_create_context
CREATE TABLE table_name_14 ( matches VARCHAR, lose VARCHAR, draw VARCHAR, lost_point VARCHAR )
I want the total number of matches for draw less than 7 and lost point of 16 with lose more than 4
SELECT COUNT(matches) FROM table_name_14 WHERE draw < 7 AND lost_point = 16 AND lose > 4
sql_create_context
CREATE TABLE table_17780 ( "Day (see Irregularities )" text, "Monday First Day" text, "Tuesday Second Day" text, "Wednesday Third Day" text, "Thursday Fourth Day" text, "Friday Fifth Day" text, "Saturday Sixth Day" text, "Sunday Seventh Day" text )
What's the Slovene word for Thursday?
SELECT "Thursday Fourth Day" FROM table_17780 WHERE "Day (see Irregularities )" = 'Slovene'
wikisql
CREATE TABLE table_name_38 ( overall INTEGER, name VARCHAR, pick__number VARCHAR )
What is the average overall of John Ayres, who had a pick # greater than 4?
SELECT AVG(overall) FROM table_name_38 WHERE name = "john ayres" AND pick__number > 4
sql_create_context
CREATE TABLE table_1137707_2 ( date VARCHAR, location VARCHAR )
What is the date of the circuit gilles villeneuve?
SELECT date FROM table_1137707_2 WHERE location = "Circuit Gilles Villeneuve"
sql_create_context
CREATE TABLE table_11545282_11 ( position VARCHAR, years_for_jazz VARCHAR )
What is the position for the years 1998-99
SELECT position FROM table_11545282_11 WHERE years_for_jazz = "1998-99"
sql_create_context
CREATE TABLE table_name_54 ( theme VARCHAR, year VARCHAR, artist VARCHAR, issue_price VARCHAR )
What is the Theme of Christie Paquet after 2004 with an Issue Price of $34.95?
SELECT theme FROM table_name_54 WHERE artist = "christie paquet" AND issue_price = "$34.95" AND year > 2004
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
find the admission time of jerry deberry.
SELECT demographic.admittime FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_12641 ( "South West DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the sum of Against, when Wins is greater than 8, and when Losses is greater than 6?
SELECT SUM("Against") FROM table_12641 WHERE "Wins" > '8' AND "Losses" > '6'
wikisql
CREATE TABLE table_59730 ( "Name (year commissioned)" text, "Owner/operator" text, "Length" text, "Maximum diameter" text, "From/to" text, "Licence number" text )
Who is the owner operator who has license number PL 59?
SELECT "Owner/operator" FROM table_59730 WHERE "Licence number" = 'pl 59'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of email and department_id , display from high to low by the DEPARTMENT_ID.
SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC
nvbench
CREATE TABLE table_18483171_1 ( institution VARCHAR, team_nickname VARCHAR )
List all institutions with a team name of the Cardinals.
SELECT institution FROM table_18483171_1 WHERE team_nickname = "Cardinals"
sql_create_context
CREATE TABLE table_22390 ( "Episode" text, "Garfield Episode 1" text, "U.S. Acres Episode" text, "Garfield Episode 2" text, "Original Airdate" text )
What is the name of the US Acres episode following the Garfield episode titled Robodie II?
SELECT "U.S. Acres Episode" FROM table_22390 WHERE "Garfield Episode 1" = 'Robodie II'
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 demographic (...
how many patients whose diagnoses icd9 code is 59080 and drug route is neb?
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.icd9_code = "59080" AND prescriptions.route = "NEB"
mimicsql_data
CREATE TABLE table_15463188_17 ( school_club_team VARCHAR, name VARCHAR )
Which school/club team has a player named Mark Sanford?
SELECT school_club_team FROM table_15463188_17 WHERE name = "Mark Sanford"
sql_create_context
CREATE TABLE table_20195922_3 ( prize__eur_ VARCHAR, number_of_winning_tickets VARCHAR )
What are the prizes when 1 is the number of winning tickets?
SELECT prize__eur_ FROM table_20195922_3 WHERE number_of_winning_tickets = 1
sql_create_context
CREATE TABLE table_55789 ( "Ordinary income rate" text, "Long-term capital gain rate" text, "Short-term capital gain rate" text, "Long-term gain on commercial buildings*" text, "Long-term gain on collectibles" text )
What long-term gain for collectibles coincides with ordinary income rate 15%?
SELECT "Long-term gain on collectibles" FROM table_55789 WHERE "Ordinary income rate" = '15%'
wikisql
CREATE TABLE table_name_67 ( player VARCHAR, place VARCHAR )
Who is the player with a t8 place?
SELECT player FROM table_name_67 WHERE place = "t8"
sql_create_context
CREATE TABLE table_23248 ( "Rank" real, "Couple" text, "Judges" real, "Public" real, "Total" real, "Vote percentage" text, "Result" text )
When ellery and frankie are the couple what is the highest total?
SELECT MAX("Total") FROM table_23248 WHERE "Couple" = 'Ellery and Frankie'
wikisql
CREATE TABLE table_46824 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What was the label in the region of Canada?
SELECT "Label" FROM table_46824 WHERE "Region" = 'canada'
wikisql
CREATE TABLE table_name_21 ( density_per_km² INTEGER, number__map_ VARCHAR, area_in_km² VARCHAR )
Which Density per km is the lowest one that has a Number (map) smaller than 13, and an Area in km of 11.1?
SELECT MIN(density_per_km²) FROM table_name_21 WHERE number__map_ < 13 AND area_in_km² = 11.1
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
门诊诊断为O75.901疾病的患者91426562,他的甲状旁腺素的结果定量及其单位分别是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.Y...
css
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, ...
what is the three year survival probability for the leukocytosis - leukemoid reaction patients diagnosed?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
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 procedures ( ...
how many patients are below 50 years of age and diagnosed with coronary atherosclerosis of native coronary artery?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "50" AND diagnoses.long_title = "Coronary atherosclerosis of native coronary artery"
mimicsql_data
CREATE TABLE table_203_701 ( id number, "#" number, "title" text, "featured guest(s)" text, "producer(s)" text, "length" text )
what track was next after all i got ?
SELECT "title" FROM table_203_701 WHERE "#" = (SELECT "#" FROM table_203_701 WHERE "title" = '"all i got"') + 1
squall
CREATE TABLE table_47364 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real )
What is Score, when Visitor is 'Pittsburgh', and when Points is greater than 18?
SELECT "Score" FROM table_47364 WHERE "Visitor" = 'pittsburgh' AND "Points" > '18'
wikisql
CREATE TABLE table_name_14 ( manager VARCHAR, team VARCHAR )
Which manager has Manchester City as the team?
SELECT manager FROM table_name_14 WHERE team = "manchester city"
sql_create_context
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
Show me minimal weight by sex in a histogram, I want to order names in ascending order please.
SELECT Sex, MIN(Weight) FROM people GROUP BY Sex ORDER BY Sex
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 ...
在病患61732704的检验报告单中哪些号码是检验结果指标全部不正常的?
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '61732704' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE table_name_16 ( ends_lost INTEGER, stolen_ends_for VARCHAR, stolen_ends_against VARCHAR )
What is the lowest ends lost when the stolen ends for is less than 13, and stolten ends against is 6?
SELECT MIN(ends_lost) FROM table_name_16 WHERE stolen_ends_for < 13 AND stolen_ends_against = 6
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
how many days has it been since patient 021-111547's admission to icu?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '021-111547' AND patient.unitdischargetime IS NULL
eicu
CREATE TABLE table_2248991_2 ( gdp_per_capita VARCHAR, nation VARCHAR )
How many items are listed under gdp per capita under the nation of Burkina Faso?
SELECT COUNT(gdp_per_capita) FROM table_2248991_2 WHERE nation = "Burkina Faso"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
what is the name of the drug prescribed to patient 8098 within 2 days after diagnosis of hemododialysis hypotensn in 01/last year?
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 8098 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hemodod...
mimic_iii
CREATE TABLE table_name_55 ( time VARCHAR, owner VARCHAR )
What time contains the owner of maine chance farm?
SELECT time FROM table_name_55 WHERE owner = "maine chance farm"
sql_create_context
CREATE TABLE table_18946749_2 ( col__m_ INTEGER, peak VARCHAR )
What is the col (m) of the Barurumea Ridge peak?
SELECT MAX(col__m_) FROM table_18946749_2 WHERE peak = "Barurumea Ridge"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
how many patients who were admitted before the year 2150 had an iv bolus as the drug route?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2150" AND prescriptions.route = "IV BOLUS"
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...
how many patients whose drug name is bethanechol?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Bethanechol"
mimicsql_data
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerU...
Anonymous feedback votes over time.
SELECT COUNT(*) FROM PostFeedback
sede
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...
How many female patients are American Indian/Alaska native?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
mimicsql_data
CREATE TABLE table_name_30 ( gold INTEGER, nation VARCHAR, silver VARCHAR )
With less than 7 Silver medals, how many Gold medals did Canada receive?
SELECT MAX(gold) FROM table_name_30 WHERE nation = "canada" AND silver < 7
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...
how many patients had the diagnosis icd9 code 53190?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "53190"
mimicsql_data
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
病患柏慧艳在0564335号医院中就诊期间其所看科室名字里有免疫科的所有门诊就诊记录的流水号是什么?
SELECT txmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN txmzjzjlb 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 WHERE person_info.XM = '柏慧艳' AND hz_info.YLJGDM = '0564335' AND txmzjzjlb.JZKSMC LIKE '%免疫科%' UNION SELECT ftxmzjzjlb...
css
CREATE TABLE table_name_73 ( home_team VARCHAR, away_team VARCHAR )
What home team played against Footscray as the away team?
SELECT home_team FROM table_name_73 WHERE away_team = "footscray"
sql_create_context
CREATE TABLE table_27581 ( "Player" text, "Games Played" real, "Rebounds" real, "Assists" real, "Steals" real, "Blocks" real, "Points" real )
What is every value for points if rebounds is 6 and blocks is 0?
SELECT "Points" FROM table_27581 WHERE "Rebounds" = '6' AND "Blocks" = '0'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE SuggestedEdits ( Id n...
Percentage of Questions Upvoted Lower than the Highest Upvoted Answer.
SELECT ROUND(AVG(CASE WHEN QuestionScore < HighestAnswerScore THEN 100.0 ELSE 0.0 END), 2) AS "Percentage" FROM (SELECT q.Id, MAX(q.Score) AS QuestionScore, MAX(a.Score) AS HighestAnswerScore FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id GROUP BY q.Id) AS Scores
sede
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text )
What is the total number of each fate? Give me the result in a bar graph, and could you order Y-axis from low to high order?
SELECT Fate, COUNT(Fate) FROM mission GROUP BY Fate ORDER BY COUNT(Fate)
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
How many patients are admitted before the year 2162 with procedure left heart cardiac cath?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2162" AND procedures.short_title = "Left heart cardiac cath"
mimicsql_data
CREATE TABLE table_24244 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What were the outcomes of matches with bill tilden florence ballin as opponents?
SELECT "Outcome" FROM table_24244 WHERE "Opponents" = 'Bill Tilden Florence Ballin'
wikisql
CREATE TABLE table_75362 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which Points have a Score of 4 1, and a Record of 18 10 8 1, and a January larger than 2?
SELECT AVG("Points") FROM table_75362 WHERE "Score" = '4–1' AND "Record" = '18–10–8–1' AND "January" > '2'
wikisql
CREATE TABLE table_37218 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" real, "Club/province" text )
What is the date of birth for the player from Ulster and plays at Centre position?
SELECT "Date of Birth (Age)" FROM table_37218 WHERE "Club/province" = 'ulster' AND "Position" = 'centre'
wikisql
CREATE TABLE table_32614 ( "Rank" real, "Player" text, "County" text, "Tally" text, "Total" real, "Matches" real, "Average" real )
What is the highest rank for championships with christy heffernan with over 4 matches?
SELECT MAX("Rank") FROM table_32614 WHERE "Player" = 'christy heffernan' AND "Matches" > '4'
wikisql
CREATE TABLE table_train_40 ( "id" int, "bone_marrow_transplant" bool, "organ_transplantation" bool, "systolic_blood_pressure_sbp" int, "do_not_resuscitate_dnr" bool, "autoimmune_disease" bool, "steroid_therapy" bool, "intention_to_central_venous_catheter" bool, "hematologic_disease"...
any absolute contraindication to central venous catheterization
SELECT * FROM table_train_40 WHERE intention_to_central_venous_catheter = 0
criteria2sql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLic...
Downvoted questions in the [row] tag.
SELECT Id, Score, Title FROM Posts WHERE Tags LIKE '%<row>%' AND ClosedDate IS NULL AND Score < 0 ORDER BY Score
sede
CREATE TABLE table_1040 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
What is the least amount of touchdowns scored on the chart?
SELECT MIN("Touchdowns") FROM table_1040
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
My answers in POPULAR QUESTIONS.
SELECT SUM(q.ViewCount) AS views, q.Id AS "post_link", a.Score FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE a.OwnerUserId = '##userid##' HAVING SUM(q.ViewCount) > 1000 ORDER BY views DESC
sede
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 number of patients whose discharge location is home health care and age is less than 41?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.age < "41"
mimicsql_data
CREATE TABLE table_39386 ( "Year" real, "Championship" text, "54 holes" text, "Winning score" text, "Margin" text, "Runner(s)-up" text )
What is the Winning score in 1956?
SELECT "Winning score" FROM table_39386 WHERE "Year" = '1956'
wikisql
CREATE TABLE table_43055 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Assists" real )
How many Games for Rank 2 Terrell McIntyre?
SELECT MIN("Games") FROM table_43055 WHERE "Name" = 'terrell mcintyre' AND "Rank" > '2'
wikisql
CREATE TABLE table_name_94 ( finish VARCHAR, player VARCHAR, total VARCHAR, to_par VARCHAR )
In what place did Nick Faldo, who had more than 284 points and a to par score of +5, finish?
SELECT finish FROM table_name_94 WHERE total > 284 AND to_par = "+5" AND player = "nick faldo"
sql_create_context
CREATE TABLE candidate ( Candidate_ID VARCHAR, oppose_rate VARCHAR )
Find the id of the candidate who got the lowest oppose rate.
SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1
sql_create_context
CREATE TABLE Part_Faults ( part_fault_id INTEGER, part_id INTEGER, fault_short_name VARCHAR(20), fault_description VARCHAR(255), other_fault_details VARCHAR(255) ) CREATE TABLE Staff ( staff_id INTEGER, staff_name VARCHAR(255), gender VARCHAR(1), other_staff_details VARCHAR(255) ) ...
A stacked bar chart showing the number of faults for different fault short name and skills required to fix them The x-axis is falut short name and group by skill description, and order in ascending by the X.
SELECT fault_short_name, COUNT(fault_short_name) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description, fault_short_name ORDER BY fault_short_name
nvbench
CREATE TABLE table_180802_3 ( transcription VARCHAR, sanskrit_word VARCHAR )
What is the transcription of the sanskrit word chandra?
SELECT transcription FROM table_180802_3 WHERE sanskrit_word = "Chandra"
sql_create_context
CREATE TABLE table_11916083_1 ( mintage__bu_ VARCHAR, _clarification_needed_ VARCHAR, artist VARCHAR, issue_price__proof_ VARCHAR )
What is the mintage (bu) with the artist Royal Canadian Mint Staff and has an issue price (proof) of $54.95?
SELECT mintage__bu_ AS "_clarification_needed_" FROM table_11916083_1 WHERE artist = "Royal Canadian Mint Staff" AND issue_price__proof_ = "$54.95"
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 jybgb ( BBCJBW text, BBDM tex...
08728091这个患者曾有过什么异常情况?
SELECT * FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
I want a bar chart to show the frequency of the dates that have the 5 highest cloud cover rates each day, and could you sort in descending by the Y-axis?
SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date) DESC
nvbench