context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
名叫凤曼文的病人在97962620644这个医疗就诊中的检验报告是谁审核的?工作人员的工号是什么
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '97962620644'
css
CREATE TABLE table_28033 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
How many numbers were recorded on the fields goals of the Left End player?
SELECT COUNT("Field goals") FROM table_28033 WHERE "Position" = 'Left end'
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...
Draw a bar chart about the distribution of All_Home and the sum of School_ID , and group by attribute All_Home, could you show in desc by the y-axis please?
SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(School_ID) DESC
nvbench
CREATE TABLE table_20297668_1 ( standard_yarn_weight_system VARCHAR, wraps_per_inch__wpi_ VARCHAR )
Name the standard yarn weight system for 7 wpi
SELECT standard_yarn_weight_system FROM table_20297668_1 WHERE wraps_per_inch__wpi_ = "7 wpi"
sql_create_context
CREATE TABLE table_1262 ( "Name" text, "Position" text, "Number" real, "School/Club Team" text, "Season" text, "Acquisition via" text )
Nametheh school team for norman gonzales
SELECT "School/Club Team" FROM table_1262 WHERE "Name" = 'Norman Gonzales'
wikisql
CREATE TABLE table_name_51 ( points_against VARCHAR, drawn VARCHAR, tries_for VARCHAR )
For the club that had tries of 50 and drawn of 0, what were the points?
SELECT points_against FROM table_name_51 WHERE drawn = "0" AND tries_for = "50"
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 allergy ( allergy...
last time until 20 months ago when did patient 028-23341 get a prescription?
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 = '028-23341')) AND DATETIME(medication.drugstarttime) <= DATETIM...
eicu
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...
Find me the admission type and short title of procedure for the patient with patient id 2110.
SELECT demographic.admission_type, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2110"
mimicsql_data
CREATE TABLE table_name_3 ( yards INTEGER, long VARCHAR, avg VARCHAR )
Name the lowest yards for 34 long and avg less than 12.6
SELECT MIN(yards) FROM table_name_3 WHERE long = 34 AND avg < 12.6
sql_create_context
CREATE TABLE table_56314 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Who did they lose to on may 9?
SELECT "Loss" FROM table_56314 WHERE "Date" = 'may 9'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id, list x-axis in asc order please.
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_23718905_6 ( matchup_results VARCHAR, city VARCHAR )
How many different matchup/results appear in San Diego, California?
SELECT COUNT(matchup_results) FROM table_23718905_6 WHERE city = "San Diego, California"
sql_create_context
CREATE TABLE table_name_88 ( years VARCHAR, actor VARCHAR, soap_opera VARCHAR, duration VARCHAR )
What years did Marienhof run, which featured Leonore Capell and lasted 10 years?
SELECT years FROM table_name_88 WHERE soap_opera = "marienhof" AND duration = "10 years" AND actor = "leonore capell"
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, V...
Q1-1 What is the most number of comments on a single post?.
SELECT CommentCount, Id, COUNT(*) FROM Posts GROUP BY Id, CommentCount HAVING COUNT(*) > 1 ORDER BY COUNT(*) DESC
sede
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
how many hours has it been since patient 57050 stayed for the first time on the current hospital visit in ward 14?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050 AND admissions.dischtime IS NULL)) AND transfers...
mimic_iii
CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text )
Return a scatter chart about the correlation between Body_Builder_ID and Clean_Jerk .
SELECT Body_Builder_ID, Clean_Jerk FROM body_builder
nvbench
CREATE TABLE table_10312547_1 ( character VARCHAR )
How many playerd Mrs. Darling in the 1999 Broadway?
SELECT COUNT(1999 AS _broadway) FROM table_10312547_1 WHERE character = "Mrs. Darling"
sql_create_context
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, ...
what is the maximum age of patients whose death status is 0 and diagnosed with primary disease coronary artery disease\coronary artery bypass graft with mvr; ? maze?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE"
mimicsql_data
CREATE TABLE table_name_33 ( lost VARCHAR, drawn VARCHAR, tries_against VARCHAR )
What is the value for Lost when Drawn is 0, and Tries against is 41?
SELECT lost FROM table_name_33 WHERE drawn = "0" AND tries_against = "41"
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
这位86694077患者之前有过哪些疾病么?
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '86694077'
css
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
Create a bar chart showing maximal revenue across name, and I want to rank X in descending order please.
SELECT Name, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY Name DESC
nvbench
CREATE TABLE table_name_52 ( venue VARCHAR, away_team VARCHAR )
Where does South Melbourne play?
SELECT venue FROM table_name_52 WHERE away_team = "south melbourne"
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 are the procedures that are the top five most commonly received in 2100?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) = '2100' GROUP BY procedures_icd.icd9_code) AS t1 ...
mimic_iii
CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Teachers ( teacher_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), gender VARCHAR(1), cell_mobile_number VARCHA...
Give me the comparison about the sum of monthly_rental over the date_address_from , and group by attribute other_details and bin date_address_from by weekday by a bar chart.
SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
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 was the name of the laboratory test that patient 021-141335 received last in a month before?
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-141335')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_TIME()...
eicu
CREATE TABLE table_68490 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which date has a score of 2-1?
SELECT "Date" FROM table_68490 WHERE "Score" = '2-1'
wikisql
CREATE TABLE table_71745 ( "Year" real, "Opponent" text, "Competition" text, "Score" text, "Venue" text, "Attendance" text )
What year was the venue at Sydney Cricket Ground, and the opponent was Parramatta Eels?
SELECT COUNT("Year") FROM table_71745 WHERE "Venue" = 'sydney cricket ground' AND "Opponent" = 'parramatta eels'
wikisql
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE ...
what 's the earliest arriving flight between BOSTON and WASHINGTON DC
SELECT DISTINCT flight_id FROM flight WHERE ((from_airport IN (SELECT AIRPORT_SERVICEalias2.airport_code FROM airport_service AS AIRPORT_SERVICEalias2 WHERE AIRPORT_SERVICEalias2.city_code IN (SELECT CITYalias2.city_code FROM city AS CITYalias2 WHERE CITYalias2.city_name = 'BOSTON')) AND to_airport IN (SELECT AIRPORT_S...
atis
CREATE TABLE table_31998 ( "Stem Meaning" text, "2nd person sg" text, "2nd person sg honorific" text, "3rd person sg" text, "3rd person sg honorific" text )
Tell me the Stem Meaning of ical
SELECT "Stem Meaning" FROM table_31998 WHERE "3rd person sg" = 'ical'
wikisql
CREATE TABLE table_8680 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
How many wins happened when there were fewer than 2 draws?
SELECT SUM("Wins") FROM table_8680 WHERE "Draws" < '2'
wikisql
CREATE TABLE table_10749367_3 ( _number INTEGER, air_date VARCHAR )
What episode aired on 18 April 2007?
SELECT MIN(_number) FROM table_10749367_3 WHERE air_date = "18 April 2007"
sql_create_context
CREATE TABLE table_name_62 ( runner_up VARCHAR, name VARCHAR, year VARCHAR )
Who was runner-up in the 2006 Pacific Life Open?
SELECT runner_up FROM table_name_62 WHERE name = "pacific life open" AND year = "2006"
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 prescriptions ( subject_id text, hadm_id...
what is age and procedure short title of subject id 2560?
SELECT demographic.age, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_name_25 ( points_for INTEGER, record VARCHAR, points_against VARCHAR )
What is the highest Points when the record was 12 2, and the Points Against are larger than 6?
SELECT MAX(points_for) FROM table_name_25 WHERE record = "12–2" AND points_against > 6
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId ...
Top Voted Questions By Tag.
WITH ScoreByTag AS (SELECT pt.TagId, p.Score, ROW_NUMBER() OVER (PARTITION BY pt.TagId ORDER BY p.Score DESC) AS "rank" FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id) SELECT RANK() OVER (ORDER BY st.Score DESC) AS "rank", t.TagName, st.Score FROM ScoreByTag AS st INNER JOIN Tags AS t ON st.TagId = t.Id ...
sede
CREATE TABLE genre ( g_name varchar2(20), rating varchar2(10), most_popular_in varchar2(50) ) CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(5...
Show me mean rating by languages in a histogram, sort X from high to low order.
SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages DESC
nvbench
CREATE TABLE table_17347 ( "#" real, "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text, "Streak" text )
what's the score where record is 35 33
SELECT "Score" FROM table_17347 WHERE "Record" = '35–33'
wikisql
CREATE TABLE table_name_51 ( loss VARCHAR, record VARCHAR )
What was the score of the game that put the team at 27-32?
SELECT loss FROM table_name_51 WHERE record = "27-32"
sql_create_context
CREATE TABLE table_name_37 ( to_par VARCHAR, place VARCHAR, player VARCHAR )
What was the To par for bill britton when he placed t7?
SELECT to_par FROM table_name_37 WHERE place = "t7" AND player = "bill britton"
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 (...
what is the number of patients whose admission type is elective and procedure long title is laparoscopic lysis of peritoneal adhesions?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Laparoscopic lysis of peritoneal adhesions"
mimicsql_data
CREATE TABLE table_name_64 ( record VARCHAR, time VARCHAR, opponent VARCHAR )
What's the record that had an opponent of Krzysztof Soszynski and a time of 4:00?
SELECT record FROM table_name_64 WHERE time = "4:00" AND opponent = "krzysztof soszynski"
sql_create_context
CREATE TABLE table_name_35 ( status VARCHAR, date VARCHAR )
What's the status on 16/12/1995?
SELECT status FROM table_name_35 WHERE date = "16/12/1995"
sql_create_context
CREATE TABLE table_56036 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the crowd size when the visiting team scored 23.18 (156)?
SELECT COUNT("Crowd") FROM table_56036 WHERE "Away team score" = '23.18 (156)'
wikisql
CREATE TABLE table_name_77 ( frequency_mhz INTEGER, call_sign VARCHAR )
what is the highest frequency mhz with the call sign w292cu?
SELECT MAX(frequency_mhz) FROM table_name_77 WHERE call_sign = "w292cu"
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...
how many patients were prescribed 2 ml : metoclopramide hcl 5 mg/ml inj soln within 2 months since 2103 after being diagnosed with copd - no limitations?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'copd - no limitations' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2103') AS t1 JOIN (SELECT patient.uni...
eicu
CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, win...
What is the average high temperature for each day of week Plot them as bar chart, rank Y-axis in desc order.
SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY AVG(high_temperature) DESC
nvbench
CREATE TABLE table_name_14 ( production_code INTEGER, series__number VARCHAR )
What was the lowest production code value in series #10?
SELECT MIN(production_code) FROM table_name_14 WHERE series__number = 10
sql_create_context
CREATE TABLE table_56683 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What is the total of attendance with a Record of 5-9-0?
SELECT SUM("Attendance") FROM table_56683 WHERE "Record" = '5-9-0'
wikisql
CREATE TABLE table_78184 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the low lap total for a grid larger than 16 and has a Time/Retired of + 3:27.3?
SELECT MIN("Laps") FROM table_78184 WHERE "Time/Retired" = '+ 3:27.3' AND "Grid" > '16'
wikisql
CREATE TABLE table_203_778 ( id number, "representative" text, "title" text, "presentation\nof credentials" text, "termination\nof mission" text, "appointed by" text )
which reps were only appointed by franklin pierce ?
SELECT "representative" FROM table_203_778 WHERE "appointed by" = 'franklin pierce'
squall
CREATE TABLE table_52977 ( "Season" text, "UEFA Season" text, "Coeff" text, "Ranking" real, "Champions" text, "Runner-up" text, "3rd place" text, "Cup winner" text, "Cup runner-up" text )
Which Champion has a Coeff of 1.000?
SELECT "Champions" FROM table_52977 WHERE "Coeff" = '1.000'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
从06年7月5日至10年1月3日之间科室4735的住院量有那些?
SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSDM = '4735' AND zyjzjlb.RYDJSJ BETWEEN '2006-07-05' AND '2010-01-03'
css
CREATE TABLE table_62868 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What is the 2nd leg in match with team 2 of Teram?
SELECT "2nd leg" FROM table_62868 WHERE "Team 2" = 'teram'
wikisql
CREATE TABLE table_name_41 ( points INTEGER, year VARCHAR, entrant VARCHAR, engine VARCHAR )
What is the fewest number of points scored by Goulds' Garage (Bristol), engines of Maserati Straight-6, in years before 1956?
SELECT MIN(points) FROM table_name_41 WHERE entrant = "goulds' garage (bristol)" AND engine = "maserati straight-6" AND year < 1956
sql_create_context
CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Participants ( Participant_ID...
How many events have each participants attended? Show their total number by each participant type code using a bar chart, rank in asc by the total number of count(*).
SELECT T1.Participant_Type_Code, SUM(COUNT(*)) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_Type_Code ORDER BY SUM(COUNT(*))
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
how many hours have elapsed since the last time patient 005-87465 had an intake of norepinephrine on the current icu visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
eicu
CREATE TABLE table_3247 ( "Round" real, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Team" text )
On what date(s) was the winning team Prema Powerteam?
SELECT "Date" FROM table_3247 WHERE "Winning Team" = 'Prema Powerteam'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
96264599846门诊就诊的患者体征记录是哪天的
SELECT txmzjzjlb.JLSJ FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '96264599846' UNION SELECT ftxmzjzjlb.JLSJ FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '96264599846'
css
CREATE TABLE table_203_572 ( id number, "judge" text, "court" text, "began active\nservice" text, "ended active\nservice" text, "ended senior\nstatus" text )
which judge began active service first , wayne edward alley or james henry alesia ?
SELECT "judge" FROM table_203_572 WHERE "judge" IN ('wayne edward alley', 'james henry alesia') ORDER BY "began active\nservice" LIMIT 1
squall
CREATE TABLE table_name_73 ( down__up_to_kbit_s_ INTEGER, provider VARCHAR, up__up_to_kbit_s_ VARCHAR )
What is the average down (up to kbit/s) when the provider is willy.tel and the up (kbit/s) is more than 1984?
SELECT AVG(down__up_to_kbit_s_) FROM table_name_73 WHERE provider = "willy.tel" AND up__up_to_kbit_s_ > 1984
sql_create_context
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, ...
how many times does patient 010-1155 have a po liqs intake on the first icu visit?
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-1155') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unit...
eicu
CREATE TABLE table_name_40 ( date VARCHAR, competition VARCHAR, venue VARCHAR )
What date has 2006 fifa world cup qualification as the competition, and alamodome, san antonio, united States as the venue?
SELECT date FROM table_name_40 WHERE competition = "2006 fifa world cup qualification" AND venue = "alamodome, san antonio, united states"
sql_create_context
CREATE TABLE table_name_90 ( track VARCHAR )
Who won the 350cc at Sachsenring?
SELECT 350 AS _cc FROM table_name_90 WHERE track = "sachsenring"
sql_create_context
CREATE TABLE table_40323 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the name of the tournament with 11 or more events a top-5 of 0 and a top-25 of 2?
SELECT "Tournament" FROM table_40323 WHERE "Events" > '11' AND "Top-5" = '0' AND "Top-25" = '2'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALA...
Line chart, let hire data as X and salary as Y, and filter for employees without the letter M in their first name, display by the x axis in ascending.
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY HIRE_DATE
nvbench
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, ...
从08年5月20到21年3月15的这几年里,共有多少患者在医疗机构7227046的转诊门诊看病
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.YLJGDM = '7227046' AND txmzjzjlb.JZKSRQ BETWEEN '2008-05-20' AND '2021-03-15' AND txmzjzjlb.ZZBZ > 0 UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.YLJGDM = '7227046' AND ftxmzjzjlb.JZKSRQ BETWEEN '2008-05-20' AND '2021-03-15' AND ftxmzjzjlb.ZZBZ > 0
css
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
在医院4746068中,按照出院诊断疾病名称列出不同疾病的平均患者年龄
SELECT gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4746068' GROUP BY gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '4746068' GROUP BY fgwyjzb.OUT_DIAG_DIS_NM
css
CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text )
Show the number of venue from each venue
SELECT Venue, COUNT(Venue) FROM workshop GROUP BY Venue
nvbench
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, ...
对应的患者姓名在门诊就诊中开出的检验报告单99312004581上是什么?
SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE table_58322 ( "Mid Gippsland FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the largest amount of wins of someone who has an against score greater than 1249 and a number of losses less than 17?
SELECT MAX("Wins") FROM table_58322 WHERE "Against" > '1249' AND "Losses" < '17'
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and salary , and visualize them by a bar chart.
SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
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 did patient 033-3992's age be during this hospital encounter?
SELECT patient.age FROM patient WHERE patient.uniquepid = '033-3992' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE zzmzjzjlb ( 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...
在2009-10-09之前,患者吴映秋有多少门诊就诊的检验报告单?看一下门诊就诊的流水号
SELECT zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '吴映秋' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2009-10-0...
css
CREATE TABLE table_50783 ( "Tournament" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text...
What shows for 2006 when 2000 is 1r, 1996 is A, and Tournament is Cincinnati Masters?
SELECT "2006" FROM table_50783 WHERE "2000" = '1r' AND "1996" = 'a' AND "Tournament" = 'cincinnati masters'
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...
Stacked bar chart of team_id for with each ACC_Home in each acc road
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
how many patients were prescribed sodium chloride 0.9% 500 ml lvp within 2 months after the diagnosis of sepsis, since 2103?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sepsis' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2103') AS t1 JOIN (SELECT patient.uniquepid, medicat...
eicu
CREATE TABLE table_203_653 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
what countries have the same amount of bronze medals as germany ?
SELECT COUNT("nation") FROM table_203_653 WHERE "nation" <> 'germany' AND "bronze" = (SELECT "bronze" FROM table_203_653 WHERE "nation" = 'germany')
squall
CREATE TABLE table_train_64 ( "id" int, "hiv_infection" bool, "receiving_parenteral_nutrition" bool, "hypertriglyceridemia" bool, "enteral_feeding" bool, "body_mass_index_bmi" float, "diarrhea" bool, "NOUSE" float )
patients with no indication for enteral feeding or in the imminence of receiving parenteral nutrition
SELECT * FROM table_train_64 WHERE enteral_feeding = 0 OR receiving_parenteral_nutrition = 1
criteria2sql
CREATE TABLE table_44284 ( "College code" text, "Faculty name" text, "Designation" text, "Qualification" text, "Department" text, "Experience" text )
What department has an m.phil (physics) qualification?
SELECT "Department" FROM table_44284 WHERE "Qualification" = 'm.phil (physics)'
wikisql
CREATE TABLE table_name_21 ( home_team VARCHAR, venue VARCHAR )
Tell me the home team for vfl park venue
SELECT home_team FROM table_name_21 WHERE venue = "vfl park"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAc...
Answers containing search term for questions that don't.
SELECT answers.Id AS "post_link" FROM Posts AS questions INNER JOIN Posts AS answers ON answers.ParentId = questions.Id WHERE NOT (questions.Body LIKE '%shaken%') AND answers.Body LIKE '%shaken%'
sede
CREATE TABLE table_37927 ( "Date" text, "Time" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
At what time was the game when they played the White Sox and had a record of 63-70?
SELECT "Time" FROM table_37927 WHERE "Opponent" = 'white sox' AND "Record" = '63-70'
wikisql
CREATE TABLE table_57431 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What team played South Melbourne at their home game?
SELECT "Away team" FROM table_57431 WHERE "Home team" = 'south melbourne'
wikisql
CREATE TABLE table_61332 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
Which Res has a Time of 11:58?
SELECT "Res." FROM table_61332 WHERE "Time" = '11:58'
wikisql
CREATE TABLE table_name_75 ( matches INTEGER, loses VARCHAR, pos VARCHAR )
Loses of 2, and a Pos. smaller than 2 had how many highest matches?
SELECT MAX(matches) FROM table_name_75 WHERE loses = 2 AND pos < 2
sql_create_context
CREATE TABLE table_name_12 ( rank INTEGER, nation VARCHAR, silver VARCHAR )
Where does Iceland rank with under 19 silvers?
SELECT MAX(rank) FROM table_name_12 WHERE nation = "iceland" AND silver < 19
sql_create_context
CREATE TABLE table_name_98 ( song VARCHAR, language VARCHAR )
What song was in french?
SELECT song FROM table_name_98 WHERE language = "french"
sql_create_context
CREATE TABLE table_53393 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What did the home team score at Princes Park?
SELECT "Home team score" FROM table_53393 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE table_name_61 ( name VARCHAR, location VARCHAR )
What is the name of the building at the Jewellery quarter?
SELECT name FROM table_name_61 WHERE location = "jewellery quarter"
sql_create_context
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
Catalogue of Comments Including <idownvotedbecau.se> Links.
SELECT Id AS "comment_link" FROM Comments LIMIT 100
sede
CREATE TABLE table_name_32 ( head_of_household VARCHAR, married_filing_jointly_or_qualified_widow_er_ VARCHAR )
Name the head of household for married filing jointly or qualified widow(er) being $137,051 $208,850
SELECT head_of_household FROM table_name_32 WHERE married_filing_jointly_or_qualified_widow_er_ = "$137,051–$208,850"
sql_create_context
CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE tryout ( pid number, cname text, ppos text, decision text )
List all information about college sorted by enrollment number in the ascending order.
SELECT * FROM college ORDER BY enr
spider
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( ...
tell me what was the top three most common diagnosis since 4 years ago?
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3
eicu
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) ...
most popular new tags by votes.
SELECT ROW_NUMBER() OVER (ORDER BY Votes.Votes DESC) AS VoteRank, Votes.TagName AS Tag, Votes.Votes AS "Votes " FROM (SELECT Tags.TagName, COUNT(DISTINCT Votes.Id) AS Votes FROM Tags, PostTags, Posts, Votes WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostTags.PostId AND Votes.PostId = Posts.Id AND Votes.CreationDate ...
sede
CREATE TABLE table_name_63 ( record VARCHAR, date VARCHAR )
What was the record on 12 march 2008?
SELECT record FROM table_name_63 WHERE date = "12 march 2008"
sql_create_context
CREATE TABLE table_name_75 ( last_update VARCHAR, name VARCHAR )
for the name of joe surratt what is the last update?
SELECT last_update FROM table_name_75 WHERE name = "joe surratt"
sql_create_context
CREATE TABLE table_name_57 ( total INTEGER, bronze VARCHAR, gold VARCHAR )
Which Total has a Bronze larger than 1, and a Gold larger than 0?
SELECT MAX(total) FROM table_name_57 WHERE bronze > 1 AND gold > 0
sql_create_context
CREATE TABLE table_70866 ( "Goal" real, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the Result where Goal is 9?
SELECT "Result" FROM table_70866 WHERE "Goal" = '9'
wikisql
CREATE TABLE table_44146 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponent" text, "Score" text )
Who were the opponents for the event in Milan, Italy?
SELECT "Opponent" FROM table_44146 WHERE "Tournament" = 'milan, italy'
wikisql
CREATE TABLE table_36169 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text )
Who was the opponent at the game with a result of w 14 6?
SELECT "Opponent" FROM table_36169 WHERE "Result" = 'w 14–6'
wikisql