context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_12 ( population__2006_ INTEGER, mother_tongue VARCHAR )
How many people ha Romanian as their mother tongue in 2006?
SELECT MAX(population__2006_) FROM table_name_12 WHERE mother_tongue = "romanian"
sql_create_context
CREATE TABLE table_15056103_1 ( playoffs VARCHAR, regular_season VARCHAR )
What was the playoff result when they finished 5th, north in the regular sesason?
SELECT playoffs FROM table_15056103_1 WHERE regular_season = "5th, North"
sql_create_context
CREATE TABLE table_59346 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
WHAT IS THE TRIES WITH POINTS 190?
SELECT "Tries for" FROM table_59346 WHERE "Points for" = '190'
wikisql
CREATE TABLE table_name_93 ( category VARCHAR, year VARCHAR, competition VARCHAR )
What are the categories of events that occurred after 2007 that were World Championships?
SELECT category FROM table_name_93 WHERE year > 2007 AND competition = "world championships"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
tell me the number of patients who have been prescribed potassium chloride (powder) drug.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Potassium Chloride (Powder)"
mimicsql_data
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Descr...
Most prominent users from Ireland.
SELECT Id, DisplayName, Reputation FROM Users WHERE Location LIKE '%Ireland%' AND Reputation > 8000 ORDER BY Reputation DESC
sede
CREATE TABLE table_67420 ( "Company" text, "Type" text, "Principal activities" text, "Incorporated in" text, "Group's Equity Shareholding (10 March 2010)" text )
Name the group's equity shareholding for company of yangtze river express.
SELECT "Group's Equity Shareholding (10 March 2010)" FROM table_67420 WHERE "Company" = 'yangtze river express'
wikisql
CREATE TABLE table_18096 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Who were the candidates when ed markey was the incumbent?
SELECT "Candidates" FROM table_18096 WHERE "Incumbent" = 'Ed Markey'
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 ...
how many hours have elapsed since patient 5828 was admitted to the intensive care unit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828) AND icustays.outtime IS NULL
mimic_iii
CREATE TABLE university ( school_id number, school text, location text, founded number, affiliation text, enrollment number, nickname text, primary_conference text ) CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_regular_season text...
What are the total enrollments of universities of each affiliation type?
SELECT SUM(enrollment), affiliation FROM university GROUP BY affiliation
spider
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by weekday, and display y axis in asc order.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE)
nvbench
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE i...
let's count the number of times patient 65401 has had a gastric oral gastric output.
SELECT COUNT(*) 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 = 65401)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gastric oral gastr...
mimic_iii
CREATE TABLE table_204_186 ( id number, "season" text, "tier" number, "division" text, "place" text )
in season 2008/09 was the place above or below 10th ?
SELECT (SELECT "place" FROM table_204_186 WHERE "season" = '2008/09') < 10
squall
CREATE TABLE table_name_26 ( attendance INTEGER, home VARCHAR, points VARCHAR )
WHAT IS THE SUM OF ATTENDANCE FOR DETROIT, WHEN POINTS ARE LARGER THAN 33?
SELECT SUM(attendance) FROM table_name_26 WHERE home = "detroit" AND points > 33
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patientheal...
since 68 months ago, when was patient 010-33968 prescribed for the last time for a drug?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-33968')) 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...
count the number of patients whose ethnicity is white - russian and admission year is less than 2151?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear < "2151"
mimicsql_data
CREATE TABLE table_19234 ( "Team" text, "Intercontinental" text, "Recopa 1996" text, "Supercopa 1996" text, "CONMEBOL 1996" text, "Copa Libertadores 1997" text )
what is th copa libertadores 1997 is qf?
SELECT "Copa Libertadores 1997" FROM table_19234 WHERE "Supercopa 1996" = 'QF'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
二零零五年二月二十七日到二零一零年四月三十日,编号为0357577的医院中多少科室在门诊就诊中开出了12张以上的检验报告单
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '0357577' AND jybgb.BGRQ BETWEEN '2005-02-27' AND '2010-04-30' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 12 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb...
css
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
in 2102 what are the five most commonly ordered lab tests for patients with age 60 or above?
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND STRFTIME('%y', lab.labresulttime) = '2102' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_25528 ( "Episode #" real, "Prod #" real, "Title" text, "Directed by" text, "Written by" text, "Originalairdate" text )
How many product # have episode 1?
SELECT MAX("Prod #") FROM table_25528 WHERE "Episode #" = '1'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
give me the number of patients whose admission location is clinic referral/premature and diagnoses long title is idiopathic normal pressure hydrocephalus (inph)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.long_title = "Idiopathic normal pressure hydrocephalus (INPH)"
mimicsql_data
CREATE TABLE table_50979 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
Which College has an Overall of 308?
SELECT "College" FROM table_50979 WHERE "Overall" = '308'
wikisql
CREATE TABLE table_26830 ( "Branding" text, "Callsign" text, "Frequency" text, "Power kW" text, "Coverage" text )
What frequency is mega manila set to?
SELECT "Frequency" FROM table_26830 WHERE "Coverage" = 'Mega Manila'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Number of Q's and A's.
SELECT COUNT(*), PostTypeId FROM Posts WHERE PostTypeId = 1 OR PostTypeId = 2 GROUP BY PostTypeId
sede
CREATE TABLE table_name_11 ( date VARCHAR, score_in_the_final VARCHAR )
Which date has a Score in the final of 4 6, 3 6?
SELECT date FROM table_name_11 WHERE score_in_the_final = "4–6, 3–6"
sql_create_context
CREATE TABLE table_name_59 ( stages VARCHAR, distance VARCHAR )
What stage was 1,648 km achieved?
SELECT stages FROM table_name_59 WHERE distance = "1,648 km"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is diagnoses icd9 code and procedure icd9 code of subject id 71798?
SELECT diagnoses.icd9_code, procedures.icd9_code FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "71798"
mimicsql_data
CREATE TABLE table_name_81 ( championship VARCHAR, opponent_in_the_final VARCHAR )
What championship had Francesca Schiavone in the finals?
SELECT championship FROM table_name_81 WHERE opponent_in_the_final = "francesca schiavone"
sql_create_context
CREATE TABLE table_name_48 ( opponents_in_final VARCHAR, score_in_final VARCHAR, surface VARCHAR )
What is the Opponents in Final in the match with a Score in Final of 4 6, 1 6 played on Clay Surface?
SELECT opponents_in_final FROM table_name_48 WHERE score_in_final = "4–6, 1–6" AND surface = "clay"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
2008-08-30到2013-04-07期间,34728428患者看过几次门诊在9353416这个医疗机构
SELECT COUNT(*) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '34728428' AND wdmzjzjlb.JZKSRQ BETWEEN '2008-08-30' AND '2013-04-07' AND wdmzjzjlb.YLJGDM = '9353416' UNION SELECT COUNT(*) FROM hz_info JOIN bdmzjzjlb ON ...
css
CREATE TABLE table_47292 ( "Artist" text, "Inst." text, "Release" text, "Format" text, "Label" text, "Year" real )
What is the label of release we are the rage with a cd format?
SELECT "Label" FROM table_47292 WHERE "Format" = 'cd' AND "Release" = 'we are the rage'
wikisql
CREATE TABLE table_8527 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
What are the highest laps for Marco Melandri?
SELECT MAX("Laps") FROM table_8527 WHERE "Rider" = 'marco melandri'
wikisql
CREATE TABLE table_23082 ( "Scorecard" real, "Date" text, "Venue" text, "Team 1" text, "Team 2" text, "Result" text, "Man of the Match" text )
What was the venue for the match on October 10?
SELECT "Venue" FROM table_23082 WHERE "Date" = 'October 10'
wikisql
CREATE TABLE table_78643 ( "Battle" text, "Date" text, "Bulgarian Commander" text, "Latin Commander" text, "Result" text )
What is the Battle with Bulgarian Commander Ivan Asen II?
SELECT "Battle" FROM table_78643 WHERE "Bulgarian Commander" = 'ivan asen ii'
wikisql
CREATE TABLE table_name_31 ( became_consort VARCHAR, spouse VARCHAR )
Name the became consort for christian ix spouse
SELECT became_consort FROM table_name_31 WHERE spouse = "christian ix"
sql_create_context
CREATE TABLE table_33014 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" text )
Who is the opponent after week 9 at rich stadium?
SELECT "Opponent" FROM table_33014 WHERE "Week" > '9' AND "Game site" = 'rich stadium'
wikisql
CREATE TABLE table_2581397_4 ( race VARCHAR, weight__kg_ VARCHAR, winner_2nd VARCHAR )
In what race was the weight in kg 55 and the winner/2nd 1st - Jim and Tonic?
SELECT race FROM table_2581397_4 WHERE weight__kg_ = "55" AND winner_2nd = "1st - Jim And Tonic"
sql_create_context
CREATE TABLE table_name_99 ( stage VARCHAR, yellow_jersey VARCHAR )
Who was the stage winner when the stage was more than 10 and yellow jersey was Joseph Planckaert?
SELECT stage AS winner FROM table_name_99 WHERE stage > 10 AND yellow_jersey = "joseph planckaert"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
how many patients are below 89 years of age and diagnosed with transient neonatal thrombocytopenia?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "89" AND diagnoses.long_title = "Transient neonatal thrombocytopenia"
mimicsql_data
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, ...
患者37544109在2015年2月26日到2020年8月30日内所做的检测丙戊酸的检查是哪个医务人员工号及姓名都是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body te...
Edits on other peoples' posts over time.
SELECT * FROM PostHistory LEFT JOIN Posts ON Posts.Id = PostHistory.PostId WHERE PostHistory.UserId != Posts.OwnerUserId
sede
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For all employees who have the letters D or S in their first name, find job_id and the sum of salary , and group by attribute job_id, and visualize them by a bar chart, and I want to sort JOB_ID from low to high order.
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_77011 ( "Player" text, "Nationality" text, "Jersey Number(s)" text, "Position" text, "Years" text, "From" text )
Tom Lagarde Category:Articles with hCards used what Jersey Number(s)?
SELECT "Jersey Number(s)" FROM table_77011 WHERE "Player" = 'tom lagarde category:articles with hcards'
wikisql
CREATE TABLE table_name_39 ( aircraft VARCHAR, type VARCHAR )
Which aircraft has heavy transport?
SELECT aircraft FROM table_name_39 WHERE type = "heavy transport"
sql_create_context
CREATE TABLE table_name_47 ( time_retired VARCHAR, laps VARCHAR, driver VARCHAR )
Tell me the time/retired with Laps of 47 and driver of ren arnoux
SELECT time_retired FROM table_name_47 WHERE laps = 47 AND driver = "rené arnoux"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
when did patient 027-28154 be admitted to the hospital via the direct admit for the first time in 2102?
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '027-28154' AND patient.hospitaladmitsource = 'direct admit' AND STRFTIME('%y', patient.hospitaladmittime) = '2102' ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_name_7 ( date VARCHAR, opponent VARCHAR, results¹ VARCHAR )
When was the game played against Norway with a result of 1:0?
SELECT date FROM table_name_7 WHERE opponent = "norway" AND results¹ = "1:0"
sql_create_context
CREATE TABLE table_name_41 ( score VARCHAR, home_team VARCHAR )
What was the score when Sydney Spirit was the home team?
SELECT score FROM table_name_41 WHERE home_team = "sydney spirit"
sql_create_context
CREATE TABLE table_178381_1 ( church_name VARCHAR, location_of_the_church VARCHAR )
What's the name of the church in Stavang?
SELECT church_name FROM table_178381_1 WHERE location_of_the_church = "Stavang"
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_req...
i need a flight from CLEVELAND to DALLAS that leaves before 1200 see if too much information
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.departure_time < 1200 AND flight.to_airport = AIRPORT_SERVICE_1.airpor...
atis
CREATE TABLE table_24547 ( "Year" real, "Horse" text, "Driver" text, "Trainer" text, "Country of owner" text, "Odds of winner" text, "Winning time (km rate)" text )
How many horses are mentioned competing in 1985?
SELECT COUNT("Horse") FROM table_24547 WHERE "Year" = '1985'
wikisql
CREATE TABLE table_70564 ( "Year" real, "Class" text, "Team" text, "Points" real, "Wins" real )
For Team AJS, what is the total number of points for drivers with 0 wins?
SELECT COUNT("Points") FROM table_70564 WHERE "Team" = 'ajs' AND "Wins" < '0'
wikisql
CREATE TABLE table_21350934_2 ( venue VARCHAR, opponent VARCHAR, date VARCHAR )
Which venue has bradford bulls as the opponent on the date of 06/09/2009?
SELECT venue FROM table_21350934_2 WHERE opponent = "Bradford Bulls" AND date = "06/09/2009"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number,...
Top editors of the site.
WITH Raw AS (SELECT DISTINCT UserId, PostId FROM PostHistory, Posts WHERE PostHistory.PostHistoryTypeId IN (4, 5, 6) AND PostHistory.PostId = Posts.Id AND PostHistory.UserId != Posts.OwnerUserId AND NOT UserId IS NULL GROUP BY UserId, PostId), Raw2 AS (SELECT UserId, COUNT(*) AS N FROM Raw GROUP BY UserId) SELECT DENSE...
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...
what is death status and procedure icd9 code of subject id 8440?
SELECT demographic.expire_flag, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "8440"
mimicsql_data
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
In Summer term what NAVSCI classes are offered ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'NAVSCI' AND semester.semester = 'Summer'
advising
CREATE TABLE table_name_75 ( rank INTEGER, bronze VARCHAR, gold VARCHAR )
What is the rank of the nation that has more than 1 Bronze medals and fewer than 4 Gold medals?
SELECT MIN(rank) FROM table_name_75 WHERE bronze > 1 AND gold < 4
sql_create_context
CREATE TABLE table_name_61 ( league_goals VARCHAR, club VARCHAR )
what was the total for the Wolverhampton Wanderers?
SELECT league_goals FROM table_name_61 WHERE club = "wolverhampton wanderers"
sql_create_context
CREATE TABLE table_21321804_5 ( college VARCHAR, player VARCHAR )
David Kasouf plays for how many colleges?
SELECT COUNT(college) FROM table_21321804_5 WHERE player = "David Kasouf"
sql_create_context
CREATE TABLE table_name_30 ( rank VARCHAR, stadium VARCHAR )
What is the Gaelic Football Stadium at McHale Park's ranking in total capacity?
SELECT COUNT(rank) FROM table_name_30 WHERE stadium = "mchale park"
sql_create_context
CREATE TABLE table_16494599_10 ( years_for_grizzlies VARCHAR, school_club_team VARCHAR )
During what years did athletes who attended school in Minnesota play for the Grizzlies?
SELECT years_for_grizzlies FROM table_16494599_10 WHERE school_club_team = "Minnesota"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
how many of the patients with dermatitis nos were on self-pay?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.short_title = "Dermatitis NOS"
mimicsql_data
CREATE TABLE table_name_10 ( length VARCHAR, date VARCHAR )
what was the length of the game on may 19
SELECT length FROM table_name_10 WHERE date = "may 19"
sql_create_context
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...
在06年11月1日到16年12月31日这么长时间里针对患者苗英光开出的所有药品的编码、名称、数量、单价、金额各是多少?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '苗英光' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-11-01' AND '2016-12-31'
css
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...
病患柏哲茂在2019-02-14以后做过的检验报告在哪些门诊?列出这些门诊就诊的流水编码
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 Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80) ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(10), order_date DATETIME ) CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept...
List the order id, customer id for orders in Cancelled status, ordered by their order dates. Show the correlation.
SELECT order_id, customer_id FROM Customer_Orders WHERE order_status_code = "Cancelled" ORDER BY order_date
nvbench
CREATE TABLE table_3660 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
When 3.89 is the production code how many season numbers are there?
SELECT COUNT("Season #") FROM table_3660 WHERE "Production code" = '3.89'
wikisql
CREATE TABLE table_79542 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
What is the IATA OF Akureyri?
SELECT "IATA" FROM table_79542 WHERE "City" = 'akureyri'
wikisql
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, ...
患者吕建茗所有检验报告单中的标本采集部位在2008年7月2日到2019年5月18日期间内都是那几个部位?
SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb 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 AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = ...
css
CREATE TABLE table_40028 ( "Position" text, "Jersey #" real, "Name" text, "Height (cm)" real, "Weight (kg)" real, "Birthdate" text, "Birthplace" text, "2009\u20132010 Team" text )
What is the birthplace of the player who played for the Calgary Flames between 2009-2010 and wears a jersey number greater than 23?
SELECT "Birthplace" FROM table_40028 WHERE "2009\u20132010 Team" = 'calgary flames' AND "Jersey #" > '23'
wikisql
CREATE TABLE table_name_35 ( d_43 VARCHAR, d_41 VARCHAR )
Name the D 43 when it has D 41 of d 56
SELECT d_43 FROM table_name_35 WHERE d_41 = "d 56"
sql_create_context
CREATE TABLE table_name_37 ( played VARCHAR, losing_bonus VARCHAR, points_against VARCHAR )
Name the played with losing bonus of 3 and points against of 426
SELECT played FROM table_name_37 WHERE losing_bonus = "3" AND points_against = "426"
sql_create_context
CREATE TABLE table_65666 ( "Name" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" real )
How many losses have jake sharp as the name, with a long less than 30?
SELECT COUNT("Loss") FROM table_65666 WHERE "Name" = 'jake sharp' AND "Long" < '30'
wikisql
CREATE TABLE table_name_78 ( transfer_window VARCHAR, country VARCHAR )
What is the transfer window for bel?
SELECT transfer_window FROM table_name_78 WHERE country = "bel"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
列出医院4124660中根据不同的科室编码和出院诊断疾病编码所有医疗就诊记录中患者的平均年龄是多少呢?
SELECT qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '4124660' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.OUT_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '4124660' GROUP BY gyb.MED_ORG_DEPT_CD, gyb....
css
CREATE TABLE table_43649 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text )
In what round did opponent Joe Lauzon play?
SELECT "Round" FROM table_43649 WHERE "Opponent" = 'joe lauzon'
wikisql
CREATE TABLE table_28098 ( "Round" real, "Circuit" text, "Location" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning team" text )
Where did Audette Racing win?
SELECT "Location" FROM table_28098 WHERE "Winning team" = 'Audette Racing'
wikisql
CREATE TABLE table_17530 ( "Number" real, "Name" text, "Titles" text, "Date" text, "Opponent" text, "Result" text, "Defenses" real )
How many times was iran barkley an opponent?
SELECT "Number" FROM table_17530 WHERE "Opponent" = 'Iran Barkley'
wikisql
CREATE TABLE table_69819 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
Who was the visitor on march 21?
SELECT "Visitor" FROM table_69819 WHERE "Date" = 'march 21'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE...
Draw a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality, could you order by the total number from low to high?
SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY COUNT(Nationality)
nvbench
CREATE TABLE table_25042332_33 ( hdi VARCHAR, life_expectancy_at_birth__2001_2002_ VARCHAR )
How many regions had a life expectancy at birth in 2001-2002 of 75.9?
SELECT COUNT(hdi) FROM table_25042332_33 WHERE life_expectancy_at_birth__2001_2002_ = "75.9"
sql_create_context
CREATE TABLE table_14514 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
Name the attendance on april 17
SELECT "Attendance" FROM table_14514 WHERE "Date" = 'april 17'
wikisql
CREATE TABLE table_name_62 ( republican_ticket VARCHAR, democratic_ticket VARCHAR )
Who's the Republican ticket with a Democratic ticket of flora d. johnson?
SELECT republican_ticket FROM table_name_62 WHERE democratic_ticket = "flora d. johnson"
sql_create_context
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TAB...
authors with at least 5 papers
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, writes WHERE writes.paperid = paper.paperid GROUP BY writes.authorid HAVING COUNT(paper.paperid) >= 5
scholar
CREATE TABLE table_44587 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
What is the verb meaning for class 4?
SELECT "Verb meaning" FROM table_44587 WHERE "Class" = '4'
wikisql
CREATE TABLE table_name_37 ( total VARCHAR, player VARCHAR, fa_cup VARCHAR )
How many totals have a Player of ahmad fouzee masuri, and an FA Cup larger than 0?
SELECT COUNT(total) FROM table_name_37 WHERE player = "ahmad fouzee masuri" AND fa_cup > 0
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 number of patients whose age is less than 89 and diagnoses long title is transient neonatal thrombocytopenia?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "89" AND diagnoses.long_title = "Transient neonatal thrombocytopenia"
mimicsql_data
CREATE TABLE table_name_44 ( opponent VARCHAR, date VARCHAR )
Who was the opponent on April 21, 2008?
SELECT opponent FROM table_name_44 WHERE date = "april 21, 2008"
sql_create_context
CREATE TABLE table_66506 ( "Debut year" real, "Player" text, "Games" real, "Goals" real, "Years at club" text )
Which Debut year has a Player of bob hayton, and Games smaller than 2?
SELECT AVG("Debut year") FROM table_66506 WHERE "Player" = 'bob hayton' AND "Games" < '2'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id ...
What are the section offerings for SPANISH 562 after 08:30 P.M. ?
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '08:30' AND course.course_id = course_offering.course_id AND course.department = 'SPANISH' AND course.number = 562 AND semester.semester = 'WN' A...
advising
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of manager_id over the job_id , and group by attribute job_id by a bar chart, display by the y axis in desc please.
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE table_name_32 ( record VARCHAR, round VARCHAR )
What was the score in Round 3?
SELECT record FROM table_name_32 WHERE round = "3"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_i...
how the percentile is the pt value of 13.8 among patients of the same age as patient 32163 during the last hospital visit?
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pt') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = (SEL...
mimic_iii
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date )
Please return me a bar chart show what are the total smallest rating of different movie title?, and I want to sort total number from low to high order.
SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY SUM(MIN(T1.stars))
nvbench
CREATE TABLE table_name_82 ( pole_position VARCHAR, location VARCHAR )
Who had the pole position in Jerez?
SELECT pole_position FROM table_name_82 WHERE location = "jerez"
sql_create_context
CREATE TABLE table_203_739 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many gold medals did the top 3 nations earn altogether ?
SELECT SUM("gold") FROM table_203_739 WHERE "rank" <= 3
squall
CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machin...
A bar chart for what are the number of the names of the technicians that are assigned to repair machines with more point values than 70?, and could you sort how many name from low to high order?
SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70 GROUP BY Name ORDER BY COUNT(Name)
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
how many medicines were prescribed during the current hospital visit to patient 006-47576?
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-47576' AND patient.hospitaldischargetime IS NULL))
eicu
CREATE TABLE table_name_85 ( tournament VARCHAR )
Which tournament had a 2008 result of 1R?
SELECT tournament FROM table_name_85 WHERE 2006 = "a" AND 2008 = "1r"
sql_create_context
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
Display a bar chart for what is the average salary for each job title?
SELECT JOB_TITLE, AVG(SALARY) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID GROUP BY T2.JOB_TITLE
nvbench