context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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 patient (
uniquep... | tell me the difference in patient 006-193056's bicarbonate levels second measured on the first hospital visit compared to the first value measured on the first hospital visit? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-193056' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hosp... | eicu |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diagnoses (
row_id n... | what are the five most frequent drugs which are prescribed to female patients in 20s within the same month after they have been diagnosed with hypertension nos since 2104? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | mimic_iii |
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 of the patients with other diagnostic procedures on nasal sinuses died in or before the year 2138? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2138.0" AND procedures.long_title = "Other diagnostic procedures on nasal sinuses" | mimicsql_data |
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
... | Show the name of each county along with the corresponding number of delegates from that county. Plot them as bar chart. | SELECT County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY T1.County_Id | nvbench |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and code , and group by attribute founder, could you rank in ascending by the X-axis? | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name | nvbench |
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... | 在74453436990门诊就诊的患者的卡号及卡类型是什么 | SELECT wdmzjzjlb.KH, wdmzjzjlb.KLX FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '74453436990' UNION SELECT bdmzjzjlb.KH, bdmzjzjlb.KLX FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '74453436990' | css |
CREATE TABLE table_74284 (
"#" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Winnings ($)" real,
"After" real,
"Before" real
) | What is the score when the player is Matt Kuchar? | SELECT "Score" FROM table_74284 WHERE "Player" = 'Matt Kuchar' | wikisql |
CREATE TABLE table_20453681_1 (
obama_number VARCHAR,
county VARCHAR
) | How many votes did Obama get in Geauga? | SELECT obama_number FROM table_20453681_1 WHERE county = "Geauga" | sql_create_context |
CREATE TABLE table_71657 (
"First game" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Percentage" text
) | What is the highest number of losses associated with 2 matches played, a first game after 1997, and more than 0 draws? | SELECT MAX("Lost") FROM table_71657 WHERE "Played" = '2' AND "First game" > '1997' AND "Drawn" > '0' | wikisql |
CREATE TABLE table_57177 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was the opponent for july 21? | SELECT "Opponent" FROM table_57177 WHERE "Date" = 'july 21' | wikisql |
CREATE TABLE table_41091 (
"Tournament" text,
"1987" text,
"1988" text,
"1989" 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... | What is 2001, when 1990 is A, when 1987 is NME, and when 1997 is 1R? | SELECT "2001" FROM table_41091 WHERE "1990" = 'a' AND "1987" = 'nme' AND "1997" = '1r' | wikisql |
CREATE TABLE table_26058 (
"Episode #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text,
"Production code #" real
) | How many different people directed the episode titled 'Fright Night'? | SELECT COUNT("Directed by") FROM table_26058 WHERE "Title" = 'Fright Night' | wikisql |
CREATE TABLE table_15624586_2 (
indigenous_mining_production_2006 VARCHAR,
_percentage_of_world_demand VARCHAR
) | Which country mines 24.0% of the world demand of uranium? | SELECT indigenous_mining_production_2006 FROM table_15624586_2 WHERE _percentage_of_world_demand = "24.0%" | sql_create_context |
CREATE TABLE table_name_64 (
member VARCHAR,
party VARCHAR,
state VARCHAR,
first_elected VARCHAR
) | Which memeber has nsw as the state, a first elected of 1952, and alp as the party? | SELECT member FROM table_name_64 WHERE state = "nsw" AND first_elected = "1952" AND party = "alp" | sql_create_context |
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... | Rampant Duplicates: Questions with the Most Duplicates. http://meta.stackexchange.com/a/244636/200117 | SELECT l.RelatedPostId AS "post_link", COUNT(l.PostId) AS "Duplicate Count" FROM PostLinks AS l WHERE l.LinkTypeId = 3 GROUP BY l.RelatedPostId ORDER BY 'Duplicate Count' DESC LIMIT 100 | sede |
CREATE TABLE table_37066 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
) | Name the opponent for 9 november 1991 | SELECT "Opponent" FROM table_37066 WHERE "Date" = '9 november 1991' | wikisql |
CREATE TABLE table_53516 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | Who was the home team on March 24? | SELECT "Home" FROM table_53516 WHERE "Date" = 'march 24' | wikisql |
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
) | What are the last names and ages of the students who are allergic to milk and cat? | SELECT lname, age FROM student WHERE stuid IN (SELECT stuid FROM has_allergy WHERE allergy = "Milk" INTERSECT SELECT stuid FROM has_allergy WHERE allergy = "Cat") | spider |
CREATE TABLE table_1341453_40 (
first_elected VARCHAR,
district VARCHAR
) | When was Chaka Fattah first elected in the Pennsylvania 2 district? | SELECT first_elected FROM table_1341453_40 WHERE district = "Pennsylvania 2" | sql_create_context |
CREATE TABLE table_23248869_10 (
score VARCHAR,
location_attendance VARCHAR,
game VARCHAR
) | What is every score for location attendance of Madison Square Garden 19,763 and game less than 80.0? | SELECT score FROM table_23248869_10 WHERE location_attendance = "Madison Square Garden 19,763" AND game < 80.0 | sql_create_context |
CREATE TABLE table_36995 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance (Away)" real
) | Name the average attendance with result of won 2-0 on 2 november 2007 | SELECT AVG("Attendance (Away)") FROM table_36995 WHERE "Result" = 'won 2-0' AND "Date" = '2 november 2007' | wikisql |
CREATE TABLE employment (
Company_ID int,
People_ID int,
Year_working int
)
CREATE TABLE people (
People_ID int,
Age int,
Name text,
Nationality text,
Graduation_College text
)
CREATE TABLE company (
Company_ID real,
Name text,
Headquarters text,
Industry text,
Sale... | Bar chart x axis headquarters y axis the total number, could you list x-axis in desc order? | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters DESC | nvbench |
CREATE TABLE table_name_72 (
record VARCHAR,
date VARCHAR
) | What was the record on the game that was played on october 27? | SELECT record FROM table_name_72 WHERE date = "october 27" | sql_create_context |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 在那些和检验指标记录47193236499有着相同的检测指标名称以及检测指标结果定量单位的记录中,存在哪些检测指标结果定量是小于或等于这个的检验指标记录呢? | SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '47193236499') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '47193236499') AND JCZBJGDL <= (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '47193236499') | css |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 在号码是8450909的医院里按照不同的科室编码还有出院诊断疾病名称进行排列的医疗就诊记录中所有的患者们的平均年龄是多些啊? | SELECT qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '8450909' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_NM UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.OUT_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '8450909' GROUP BY gyb.MED_ORG_DEPT_CD, gyb.... | css |
CREATE TABLE table_name_16 (
outcome VARCHAR,
year VARCHAR,
venue VARCHAR
) | What was the Outcome at the 1985 India Open? | SELECT outcome FROM table_name_16 WHERE year = "1985" AND venue = "india open" | sql_create_context |
CREATE TABLE table_27882867_9 (
date VARCHAR,
score VARCHAR
) | What date was the game score w 104-98? | SELECT date FROM table_27882867_9 WHERE score = "W 104-98" | sql_create_context |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | What is the correlation between the maximum price and the score of wines each year? | SELECT MAX(Price), MAX(Score) FROM wine GROUP BY MAX(Price) | nvbench |
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)... | Give me line charts of worldwide gross the number of date in location from over year date in location from by major genres Location_Code, and order X in asc order. | SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations GROUP BY Location_Code ORDER BY Date_in_Location_From | nvbench |
CREATE TABLE Tourist_Attractions (
Name VARCHAR,
Tourist_Attraction_ID VARCHAR
)
CREATE TABLE VISITS (
Tourist_Attraction_ID VARCHAR
) | Show the names and ids of tourist attractions that are visited at least two times. | SELECT T1.Name, T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING COUNT(*) >= 2 | sql_create_context |
CREATE TABLE table_27156 (
"Player" text,
"Minutes" real,
"Field Goals" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
) | What is the lowest number of minutes for a player with 47 steals? | SELECT MIN("Minutes") FROM table_27156 WHERE "Steals" = '47' | wikisql |
CREATE TABLE table_name_29 (
total_points INTEGER,
rider VARCHAR,
bonus_pts VARCHAR
) | What was the average number of points with bonus pts less than 31 with the rider dennis gavros? | SELECT AVG(total_points) FROM table_name_29 WHERE rider = "dennis gavros" AND bonus_pts < 31 | sql_create_context |
CREATE TABLE table_23017 (
"Call sign" text,
"Frequency" text,
"City of License" text,
"Licensee" text,
"Format" text
) | When 790 am is the frequency what is the format? | SELECT "Format" FROM table_23017 WHERE "Frequency" = '790 AM' | wikisql |
CREATE TABLE table_name_36 (
stolen_ends_against VARCHAR,
blank_ends_f_a VARCHAR,
country VARCHAR
) | What is the stolen ends against for a bank ends f/a of 4/7, and a country of china? | SELECT stolen_ends_against FROM table_name_36 WHERE blank_ends_f_a = "4/7" AND country = "china" | sql_create_context |
CREATE TABLE table_name_22 (
venue VARCHAR,
away_team VARCHAR
) | Which venue hosted an away team of Footscray? | SELECT venue FROM table_name_22 WHERE away_team = "footscray" | sql_create_context |
CREATE TABLE table_name_78 (
score VARCHAR,
song VARCHAR
) | What is the Score of ? | SELECT score FROM table_name_78 WHERE song = "我等的人会是谁" | 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 demographic ... | give me the number of cape speaking patients who had emergency room hospital admission. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "CAPE" AND demographic.admission_location = "EMERGENCY ROOM ADMIT" | mimicsql_data |
CREATE TABLE table_204_81 (
id number,
"rank" number,
"bib" number,
"name" text,
"country" text,
"time" text,
"deficit" text
) | who came in first place ? | SELECT "name" FROM table_204_81 WHERE id = 1 | squall |
CREATE TABLE table_61270 (
"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 Goals against have Wins larger than 12, and a Club of ud las palmas, and a Position larger than 5? | SELECT COUNT("Goals against") FROM table_61270 WHERE "Wins" > '12' AND "Club" = 'ud las palmas' AND "Position" > '5' | wikisql |
CREATE TABLE table_3991 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What episoe number in the season originally aired on February 11, 1988? | SELECT "No. in season" FROM table_3991 WHERE "Original air date" = 'February 11, 1988' | wikisql |
CREATE TABLE table_6475 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What is the pick number for the College of Central Missouri State? | SELECT "Pick #" FROM table_6475 WHERE "College" = 'central missouri state' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | when they came to the hospital first time, list the daily maximum heartrate of patient 011-36282. | SELECT MAX(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-36282' AND NOT patient.hospitaldischargetime IS ... | eicu |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id... | what is the price of AA flight 19 from NEW YORK to LOS ANGELES | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (((flight.airline_code = 'AA') AND flight.flight_number = 19) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGEL... | atis |
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 who have stayed in the hospital and were prescribed preservative free heparin sodium? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "0" AND prescriptions.drug = "Heparin Sodium (Preservative Free)" | mimicsql_data |
CREATE TABLE table_name_52 (
_percentage_of_all VARCHAR,
dennis_kucinich VARCHAR
) | What is % of All, when Dennis Kucinich is '5%'? | SELECT _percentage_of_all FROM table_name_52 WHERE dennis_kucinich = "5%" | 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... | 68054249569的检验报告单,其标本是采集的哪个部位 | SELECT jybgb.BBCJBW FROM jybgb WHERE jybgb.BGDH = '68054249569' | css |
CREATE TABLE debate_people (
debate_id number,
affirmative number,
negative number,
if_affirmative_win others
)
CREATE TABLE debate (
debate_id number,
date text,
venue text,
num_of_audience number
)
CREATE TABLE people (
people_id number,
district text,
name text,
part... | Show the names of people and the number of times they have been on the affirmative side of debates. | SELECT T2.name, COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.affirmative = T2.people_id GROUP BY T2.name | spider |
CREATE TABLE table_78896 (
"Name" text,
"Wins" real,
"Start" text,
"Duration" text,
"Defeated by" text
) | Which Start has a Duration of 6 months 2 days? | SELECT "Start" FROM table_78896 WHERE "Duration" = '6 months 2 days' | wikisql |
CREATE TABLE table_name_46 (
date VARCHAR,
surface VARCHAR,
tournament VARCHAR
) | When has a Surface of hard, a Tournament of wrexham , great britain? | SELECT date FROM table_name_46 WHERE surface = "hard" AND tournament = "wrexham , great britain" | sql_create_context |
CREATE TABLE table_name_63 (
name VARCHAR,
score VARCHAR
) | What is Name, when Score is '101'? | SELECT name FROM table_name_63 WHERE score = "101" | sql_create_context |
CREATE TABLE table_6744 (
"Buechel & Manhart spelling (pronunciation)" text,
"Ullrich" text,
"Brandon University" text,
"Deloria & Boas" text,
"Dakota Mission" text,
"Rood & Taylor" text,
"Riggs" text,
"Williamson" text,
"University of Minnesota" text,
"White Hat" text
) | Deloria & Boas of , and a Dakota Mission of un had what Buechel & Manhart spelling (pronunciation)? | SELECT "Buechel & Manhart spelling (pronunciation)" FROM table_6744 WHERE "Deloria & Boas" = 'ų' AND "Dakota Mission" = 'un' | wikisql |
CREATE TABLE table_49037 (
"Date" real,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponent in the final" text,
"Score" text
) | Where was the tournament that happened in 1987 on a clay surface? | SELECT "Tournament" FROM table_49037 WHERE "Date" = '1987' AND "Surface" = 'clay' | wikisql |
CREATE TABLE table_204_131 (
id number,
"tops design code" text,
"electrical system" text,
"max speed" text,
"weight" text,
"brakes" text,
"route availability" number,
"notes" text
) | how many designs have a weight of at least 45 ? | SELECT COUNT("tops design code") FROM table_204_131 WHERE "weight" >= 45 | squall |
CREATE TABLE table_name_63 (
home_team VARCHAR
) | What was the home score for the Home team Melbourne? | SELECT home_team AS score FROM table_name_63 WHERE home_team = "melbourne" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | count the number of patients whose admission type is urgent and lab test category is chemistry. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
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... | 在2007年12月2日到2008年6月25日这段时间,罗列出患者号码83925055所有检验报告单中的标本收集部位是那一部分? | SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGD... | css |
CREATE TABLE table_57128 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | Which mixed doubles was featured in 2006? | SELECT "Mixed doubles" FROM table_57128 WHERE "Year" = '2006' | wikisql |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | In the past , what classes has Dr. Emily Peterson taught ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour... | advising |
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 maximum days of hospital stay of patients whose primary disease is bradycardia? | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "BRADYCARDIA" | mimicsql_data |
CREATE TABLE table_44697 (
"Solution" text,
"Other Name" text,
"[Na + ](mmol/L)" real,
"[Cl - ](mmol/L)" real,
"[Glucose](mmol/L)" real,
"[Glucose](mg/dl)" real
) | What is the largest [Cl -](mmol/L) with a solution of D5NS and [Na+](mmol/L) less than 154? | SELECT MAX("[Cl - ](mmol/L)") FROM table_44697 WHERE "Solution" = 'd5ns' AND "[Na + ](mmol/L)" < '154' | 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 ... | does patient 23930 have a male or female gender? | SELECT patients.gender FROM patients WHERE patients.subject_id = 23930 | mimic_iii |
CREATE TABLE club (
Club_ID int,
Club_name text,
Region text,
Start_year int
)
CREATE TABLE match_result (
Rank int,
Club_ID int,
Gold int,
Big_Silver int,
Small_Silver int,
Bronze int,
Points int
)
CREATE TABLE coach (
Coach_ID int,
Coach_name text,
Gender text... | Show different occupations along with the number of players in each occupation with a bar chart, and could you list Y-axis in ascending order please? | SELECT Occupation, COUNT(*) FROM player GROUP BY Occupation ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_67000 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was the attendance on April 7? | SELECT SUM("Attendance") FROM table_67000 WHERE "Date" = 'april 7' | wikisql |
CREATE TABLE table_16336 (
"Season" real,
"Episodes" real,
"Time slot (EST)" text,
"Season premiere" text,
"Season finale" text,
"TV season" text,
"Rank" text,
"Viewers (in millions)" text
) | How many season premiers have a rank of #21? | SELECT "Season premiere" FROM table_16336 WHERE "Rank" = '#21' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | what was the name of the last intake of patient 002-58565 that they had on 02/09/last year? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-58565')) AND intakeoutput.cellpath LIKE '%intake%' AND D... | eicu |
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 was hired before 2002-06-21, visualize a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, list by the y-axis in desc. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE table_5775 (
"Outcome" text,
"Date" text,
"Surface" text,
"Partner" text,
"Opponent in the final" text,
"Score in the final" text
) | Which Partner has a Date of 8 february 2009? | SELECT "Partner" FROM table_5775 WHERE "Date" = '8 february 2009' | wikisql |
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... | 医疗机构6679422中哪20个科室统筹金额消耗的最多?在2000年4月5日到2005年10月9日 | SELECT qtb.MED_ORG_DEPT_CD, qtb.MED_ORG_DEPT_NM FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '6679422' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-04-05' AND '2005-10-09' GROUP BY qtb.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 20 UNION SELECT gyb.MED_ORG_DEPT_CD,... | css |
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... | 通过门诊诊断出疾病A48.710的病员的促甲状腺激素受体抗体数值的平均值和他们的最值分别是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'A48.710' AND jyjgzbb.JCZBMC = '促甲状腺激素受体抗体' | css |
CREATE TABLE table_26920192_5 (
round VARCHAR,
series VARCHAR,
circuit VARCHAR
) | How many times is the series italian and the circuit is valencia? | SELECT COUNT(round) FROM table_26920192_5 WHERE series = "Italian" AND circuit = "Valencia" | sql_create_context |
CREATE TABLE table_2602958_4 (
prod_code VARCHAR,
no VARCHAR
) | How many production codes are there for episode number 45? | SELECT COUNT(prod_code) FROM table_2602958_4 WHERE no = 45 | sql_create_context |
CREATE TABLE tracks (
composer VARCHAR,
name VARCHAR
) | Who is the composer of track Fast As a Shark? | SELECT composer FROM tracks WHERE name = "Fast As a Shark" | sql_create_context |
CREATE TABLE table_26976615_3 (
outgoing_manager VARCHAR,
team VARCHAR
) | Who was the outgoing manager for the team of t rgu mure ? | SELECT outgoing_manager FROM table_26976615_3 WHERE team = "Târgu Mureş" | 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 d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
ro... | number of patients who were admitted to the hospital since 2102. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE STRFTIME('%y', admissions.admittime) >= '2102' | mimic_iii |
CREATE TABLE table_name_64 (
result VARCHAR,
week VARCHAR,
opponent VARCHAR
) | Against the Houston Oilers after week 14, what was the result of the game? | SELECT result FROM table_name_64 WHERE week > 14 AND opponent = "houston oilers" | sql_create_context |
CREATE TABLE table_49063 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
) | What team has a grid of 15? | SELECT "Team" FROM table_49063 WHERE "Grid" = '15' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | what is the name and religion of patient id 2560? | SELECT demographic.name, demographic.religion FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, show me about the distribution of founder and the sum of price , and group by attribute founder in a bar chart. | SELECT Founder, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE table_76375 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the average total medals of the nation ranked 1 with less than 1 silver? | SELECT AVG("Total") FROM table_76375 WHERE "Rank" = '1' AND "Silver" < '1' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId n... | Most 100 popular posts with tag. | SELECT Id AS "post_link", Tags, ViewCount FROM Posts WHERE Tags LIKE '%##TagName1##%' ORDER BY ViewCount DESC LIMIT 100 | sede |
CREATE TABLE table_name_48 (
round VARCHAR,
overall VARCHAR
) | What number round has an overall of 123? | SELECT round FROM table_name_48 WHERE overall = 123 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospita... | what is the number of times that patient 003-54468 visits the hospital during this year? | SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '003-54468' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | eicu |
CREATE TABLE publication_keyword (
kid int,
pid int
)
CREATE TABLE organization (
continent varchar,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE domain (
did int,
name varchar
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE journal (
homepage varchar... | return me the number of organizations in Databases area . | SELECT COUNT(DISTINCT (organization.name)) FROM author, domain, domain_author, organization WHERE domain_author.aid = author.aid AND domain.did = domain_author.did AND domain.name = 'Databases' AND organization.oid = author.oid | academic |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | what are the five year survival rate of fetal/neonatal jaund nos patients who were prescribed with morphine sulfate? | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... | mimic_iii |
CREATE TABLE table_38794 (
"Season" text,
"Team" text,
"Wins" text,
"Losses" text,
"Draws" text
) | Which season had 10 draws? | SELECT "Season" FROM table_38794 WHERE "Draws" = '10' | wikisql |
CREATE TABLE airports (
country VARCHAR,
elevation VARCHAR
) | Which country is the airport that has the highest altitude located in? | SELECT country FROM airports ORDER BY elevation DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_name_79 (
winning_team VARCHAR,
date VARCHAR
) | What Winning team has 22 July as a Date? | SELECT winning_team FROM table_name_79 WHERE date = "22 july" | sql_create_context |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Do I need UKR 351 to graduate ? | SELECT COUNT(*) > 0 FROM course, program_course WHERE course.department = 'UKR' AND course.number = 351 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id | advising |
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_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | what are the number of patients who were admitted to hospital in a year before? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE table_29217650_1 (
december_27 VARCHAR,
movies VARCHAR
) | What is the figure for December 27 for ang tanging ina mo (last na 'to!)? | SELECT december_27 FROM table_29217650_1 WHERE movies = "Ang Tanging Ina Mo (Last na 'To!)" | sql_create_context |
CREATE TABLE table_49822 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | What is the score with a time at 18:00 and a score for set 3 of 13 25? | SELECT "Score" FROM table_49822 WHERE "Time" = '18:00' AND "Set 3" = '13–25' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Posts with links to files with particular extension (by CreationDate, only body). | SELECT Body FROM Posts WHERE Body LIKE '%http%##ext?jpg##%' AND CreationDate >= '##Date1?2019-01-01##' AND CreationDate <= '##Date2?2020-01-01##' ORDER BY Id | sede |
CREATE TABLE genre (
g_name text,
rating text,
most_popular_in text
)
CREATE TABLE artist (
artist_name text,
country text,
gender text,
preferred_genre text
)
CREATE TABLE files (
f_id number,
artist_name text,
file_size text,
duration text,
formats text
)
CREATE TABL... | What is the name and country of origin for each artist who has released a song with a resolution higher than 900? | SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.resolution > 900 GROUP BY T2.artist_name HAVING COUNT(*) >= 1 | spider |
CREATE TABLE table_name_83 (
years VARCHAR,
rank VARCHAR,
matches VARCHAR
) | What years did the player ranked less than 8 and had 447 matches play? | SELECT years FROM table_name_83 WHERE rank < 8 AND matches = 447 | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | database schema for questions and answers. | SELECT * FROM Posts WHERE Id BETWEEN 6000 AND 6500 | 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... | count the number of patients whose gender is f and year of birth is less than 2087? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.dob_year < "2087" | mimicsql_data |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | How fast do my questions get answered?. | SELECT CAST((JULIANDAY(AnswerDate) - JULIANDAY(SQ.QuestionDate)) * 1440.0 AS INT) AS Diff FROM (SELECT Questions.Id, Questions.CreationDate AS QuestionDate, MIN(Answers.CreationDate) AS AnswerDate FROM Posts AS Questions INNER JOIN Posts AS Answers ON Questions.Id = Answers.ParentId WHERE Questions.PostTypeId = 1 AND Q... | sede |
CREATE TABLE table_37421 (
"Date" text,
"Opponent" text,
"Score" text,
"Attendance" real,
"Record" text
) | What is the record for April 21? | SELECT "Record" FROM table_37421 WHERE "Date" = 'april 21' | wikisql |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TAB... | A User Rank In A Given Tag. | SELECT T2.Rank, T2.Id AS "user_link", T2.UpVotes AS "total_up_votes" FROM (SELECT ROW_NUMBER() OVER (ORDER BY T.UpVotes DESC) AS Rank, T.Id, T.UpVotes FROM (SELECT u.Id, COUNT(*) AS UpVotes FROM Tags AS t WITH (nolock) INNER JOIN PostTags AS pt WITH (nolock) ON pt.TagId = t.Id INNER JOIN Posts AS p WITH (nolock) ON p.P... | sede |
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... | 想知道有哪些医院给患者韩清怡开过072738-5这个药 | SELECT t_kc22.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '韩清怡' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '072738-5') | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.