context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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 products with a price between 60 and 120, return a bar chart about the distribution of name and code , and I want to rank by the x-axis in asc. | SELECT Name, Code FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name | nvbench |
CREATE TABLE table_62586 (
"Medal" text,
"Name" text,
"Games" text,
"Sport" text,
"Event" text
) | In what Event did Dorcus Inzikuru compete? | SELECT "Event" FROM table_62586 WHERE "Name" = 'dorcus inzikuru' | wikisql |
CREATE TABLE table_name_24 (
nationality VARCHAR,
college_junior_club_team VARCHAR,
player VARCHAR
) | What nationality is Mark Hirth from Michigan State University (NCAA)? | SELECT nationality FROM table_name_24 WHERE college_junior_club_team = "michigan state university (ncaa)" AND player = "mark hirth" | sql_create_context |
CREATE TABLE table_name_46 (
year INTEGER,
version VARCHAR
) | What year was Mother's Live remix created? | SELECT SUM(year) FROM table_name_46 WHERE version = "mother's live remix" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | count the number of patients whose lab test fluid is blood. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.fluid = "Blood" | mimicsql_data |
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... | 列出病人48858661医疗记录中医疗费总额大于759.51元的入院诊断疾病编码和名称 | SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '48858661' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 759.51) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '48858661' AND gyb.MED_CLINIC_ID IN (SELECT t_... | css |
CREATE TABLE manufacturers (
code number,
name text,
headquarter text,
founder text,
revenue number
)
CREATE TABLE products (
code number,
name text,
price number,
manufacturer number
) | What is the average price of products with manufacturer codes equal to 2? | SELECT AVG(price) FROM products WHERE manufacturer = 2 | spider |
CREATE TABLE table_20924 (
"Country" text,
"Region" text,
"Joined OPEC" real,
"Population (July 2012)" real,
"Area (km\u00b2)" real,
"Production ( bbl /day)" text
) | Which regions had a production (bbl/day) of 1,213,000 (21st)? | SELECT "Region" FROM table_20924 WHERE "Production ( bbl /day)" = '1,213,000 (21st)' | wikisql |
CREATE TABLE table_3842 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had high assists in the game played at Oklahoma city arena 17,509? | SELECT "High assists" FROM table_3842 WHERE "Location Attendance" = 'Oklahoma City Arena 17,509' | wikisql |
CREATE TABLE table_2226817_8 (
written_by VARCHAR,
no_in_season VARCHAR
) | Who is the writer of episode 13? | SELECT COUNT(written_by) FROM table_2226817_8 WHERE no_in_season = 13 | sql_create_context |
CREATE TABLE table_35779 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the record of the Hartford Whalers home team with the April 13 game date? | SELECT "Record" FROM table_35779 WHERE "Home" = 'hartford whalers' AND "Date" = 'april 13' | wikisql |
CREATE TABLE table_27599216_6 (
founded INTEGER,
team VARCHAR
) | What is the year founded for the team Dinos? | SELECT MAX(founded) FROM table_27599216_6 WHERE team = "Dinos" | sql_create_context |
CREATE TABLE table_name_84 (
home VARCHAR,
guest VARCHAR
) | Who was the home team when FK kom were the guests? | SELECT home FROM table_name_84 WHERE guest = "fk kom" | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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... | For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by weekday, order from low to high by the Y please. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_name_67 (
qual VARCHAR,
laps VARCHAR
) | When completing 182 laps, what was the qual.? | SELECT qual FROM table_name_67 WHERE laps = 182 | sql_create_context |
CREATE TABLE table_34459 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
) | what game was played on june 14 | SELECT "Type of game" FROM table_34459 WHERE "Date" = 'june 14' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | what is the number of patients whose gender is f and admission type is newborn? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admission_type = "NEWBORN" | mimicsql_data |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_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 ti... | what is patient 42757's age during their first hospital visit? | SELECT admissions.age FROM admissions WHERE admissions.subject_id = 42757 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | provide the number of patients whose admission location is clinic referral/premature and diagnoses short title is chr tot occlus cor artry? | 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.short_title = "Chr tot occlus cor artry" | mimicsql_data |
CREATE TABLE table_name_6 (
electorate VARCHAR,
member VARCHAR,
state VARCHAR,
party VARCHAR
) | Which Electorate is from vic, a labor party, and is David Charles a member of? | SELECT electorate FROM table_name_6 WHERE state = "vic" AND party = "labor" AND member = "david charles" | sql_create_context |
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... | 病患76177334在08年7月12日到09年7月19日内的全部检测结果指标记录的检查员为39427347的检验指标流水号是多少? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM A... | css |
CREATE TABLE table_29250534_1 (
manager VARCHAR,
club VARCHAR
) | Who is the manager for the fc inter club? | SELECT manager FROM table_29250534_1 WHERE club = "FC Inter" | sql_create_context |
CREATE TABLE book (
Title VARCHAR,
Book_ID VARCHAR
)
CREATE TABLE publication (
Publication_Date VARCHAR,
Book_ID VARCHAR
) | Show the title and publication dates of books. | SELECT T1.Title, T2.Publication_Date FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID | 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... | 在0六年二月十九日到一三年十二月十八日这段时间内,医院9587006医治病人时总共记录有多少购药数量 | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9587006' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-02-19' AND '2013-12-18' AND t_kc21.CLINIC_TYPE = '购药' | css |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | how many days have elapsed since patient 006-158338 had received an ph lab test for the first time in the current hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-158338' AND patient.hosp... | eicu |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight_fare (
flight_id int,
f... | am flights from ATLANTA to PHILADELPHIA | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILA... | atis |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod tim... | what were the four most frequently prescribed drugs to the patients aged 20s within 2 months after they had been diagnosed with diaphragmatic hernia until 1 year ago? | 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 table_name_88 (
precincts VARCHAR,
g_hager VARCHAR
) | Which Precincts has a G. Hager of 2,260 (15%)? | SELECT precincts FROM table_name_88 WHERE g_hager = "2,260 (15%)" | sql_create_context |
CREATE TABLE table_name_12 (
broadcaster VARCHAR,
territory VARCHAR
) | Who broadcasts in malaysia? | SELECT broadcaster FROM table_name_12 WHERE territory = "malaysia" | sql_create_context |
CREATE TABLE table_name_18 (
position VARCHAR,
college VARCHAR,
overall VARCHAR
) | Which Position has a College of washington, and an Overall of 46? | SELECT position FROM table_name_18 WHERE college = "washington" AND overall = 46 | sql_create_context |
CREATE TABLE table_25085059_1 (
cfl_team VARCHAR,
position VARCHAR,
college VARCHAR
) | What CFL team obtained a draft pick from North Dakota who plays OL position? | SELECT cfl_team FROM table_25085059_1 WHERE position = "OL" AND college = "North Dakota" | sql_create_context |
CREATE TABLE tweets (
followers INTEGER,
UID VARCHAR
)
CREATE TABLE user_profiles (
followers INTEGER,
UID VARCHAR
) | Find the average number of followers for the users who do not have any tweet. | SELECT AVG(followers) FROM user_profiles WHERE NOT UID IN (SELECT UID FROM tweets) | sql_create_context |
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,
... | provide me the number of patients taking base type drug prescription who have diagnoses icd9 code 28860. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "28860" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_38971 (
"Year" text,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | Name the men's doubles for 2010 | SELECT "Men's doubles" FROM table_38971 WHERE "Year" = '2010' | wikisql |
CREATE TABLE table_name_21 (
home_team VARCHAR,
venue VARCHAR
) | What is the home team of Lake Oval? | SELECT home_team FROM table_name_21 WHERE venue = "lake oval" | sql_create_context |
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Activity (
actid INTEGER,
a... | Show me a bar chart for how many faculty members do we have for each faculty rank? | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank | nvbench |
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
) | For each submission, group its acceptance result and count them Visualize them in a bar chart, and could you order by the Y in desc? | SELECT Result, COUNT(Result) FROM Acceptance GROUP BY Result ORDER BY COUNT(Result) DESC | nvbench |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Give me the comparison about School_ID over the Team_Name . | SELECT Team_Name, School_ID FROM basketball_match | nvbench |
CREATE TABLE table_57415 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
) | Who has an away team score of 2.2 (14)? | SELECT "Home team" FROM table_57415 WHERE "Away team score" = '2.2 (14)' | wikisql |
CREATE TABLE table_18843 (
"Autonomous Community" text,
"Hydroelectric power" real,
"Wind power" real,
"Solar power" real,
"Biomass power" real,
"Solid waste power" real,
"Total Renewable Generation" real,
"Total Electricity Demand" real,
"% Renewable of Total Electricity Demand" tex... | What is the lowest numbered hydroelectric power when the renewable electricity demand is 21.5%? | SELECT MIN("Hydroelectric power") FROM table_18843 WHERE "% Renewable of Total Electricity Demand" = '21.5%' | 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,
... | what is drug route of drug name influenza virus vaccine? | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Influenza Virus Vaccine" | mimicsql_data |
CREATE TABLE table_name_51 (
venue VARCHAR,
away_team VARCHAR
) | Where did Richmond play as the away team? | SELECT venue FROM table_name_51 WHERE away_team = "richmond" | sql_create_context |
CREATE TABLE table_31459 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many teams did inge 6 have the high assists with? | SELECT COUNT("Team") FROM table_31459 WHERE "High assists" = 'Inge – 6' | wikisql |
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 ethnicity is black/haitian and drug name is fentanyl citrate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND prescriptions.drug = "Fentanyl Citrate" | mimicsql_data |
CREATE TABLE table_203_761 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | how many total laps did alex figge complete ? | SELECT "laps" FROM table_203_761 WHERE "driver" = 'alex figge' | squall |
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 discharge location of subject id 6983? | SELECT demographic.discharge_location FROM demographic WHERE demographic.subject_id = "6983" | mimicsql_data |
CREATE TABLE zyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 在6110632这家医院所有医疗的就诊记录里,计算不同科室编码下统筹基金和全部医疗费的平均比 | SELECT qtb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '6110632' GROUP BY qtb.MED_ORG_DEPT_CD UNION SELECT gyb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_... | css |
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, return a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, and display from low to high by the y axis. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(SALARY) | nvbench |
CREATE TABLE table_19502 (
"Week" real,
"Opponent" text,
"Result" text,
"Stadium" text,
"Record" text,
"Attendance" real
) | Type the record details if any result has L 3-6 in it? | SELECT "Record" FROM table_19502 WHERE "Result" = 'L 3-6' | wikisql |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
U... | Number of times that questions have gone through the Reopen review queue. | SELECT ReviewTasks.PostId AS "post_link", COUNT(*) AS NumberOfReviews, Posts.CreationDate FROM ReviewTasks JOIN Posts ON ReviewTasks.PostId = Posts.Id WHERE ReviewTasks.ReviewTaskTypeId = 6 GROUP BY ReviewTasks.PostId, Posts.CreationDate ORDER BY NumberOfReviews DESC | sede |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
pro... | show all nonstop flights from BOSTON to SAN FRANCISCO | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FR... | atis |
CREATE TABLE table_79104 (
"Year" real,
"Theme" text,
"Face Value" text,
"Weight" text,
"Diameter" text,
"Mintage" real,
"Issue Price" text
) | What is the Year of the Coin with an Issue Price of $1089.95 and Mintage less than 900? | SELECT SUM("Year") FROM table_79104 WHERE "Issue Price" = '$1089.95' AND "Mintage" < '900' | wikisql |
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
)
... | Get the number of patients who had a creatine kinase mb isoenzyme lab test that are taking a base type drug. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "BASE" AND lab.label = "Creatine Kinase, MB Isoenzyme" | mimicsql_data |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_r... | what are the top five most common output events since 5 years ago? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 5) | mimic_iii |
CREATE TABLE table_23649 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" text,
"2nd (m)" text,
"Points" text,
"Overall NT points" text,
"Overall WC points (Rank)" text
) | Name the overall nt points for 2nd m 127.5 | SELECT "Overall NT points" FROM table_23649 WHERE "2nd (m)" = '127.5' | wikisql |
CREATE TABLE table_29703 (
"Model" text,
"PPI (pixels per inch )" real,
"ppcm (pixels per cm )" real,
"Resolution" text,
"Typical viewing distance (in/cm)" text,
"Pixels per degree (PPD)" real
) | How many different PPI does the model with ppcm of 87 have? | SELECT COUNT("PPI (pixels per inch )") FROM table_29703 WHERE "ppcm (pixels per cm )" = '87' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | when was the last time patient 009-2181 had a stool output since 218 days ago? | SELECT 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 = '009-2181')) AND intakeoutput.cellpath LIKE '%output%'... | eicu |
CREATE TABLE table_51791 (
"Election" text,
"D\u00e1il" text,
"Share of votes" text,
"Seats" real,
"Total seats" real
) | with shares of 45.3% and total seats less than 166. what is the greatest number of seat? | SELECT MAX("Seats") FROM table_51791 WHERE "Share of votes" = '45.3%' AND "Total seats" < '166' | wikisql |
CREATE TABLE table_2342078_5 (
title VARCHAR,
written_by VARCHAR
) | What's the title of the episode written by Harry Winkler? | SELECT title FROM table_2342078_5 WHERE written_by = "Harry Winkler" | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE wdmzjzjlb (
CYBQDM text,
CYBQ... | 从2014-03-30到2020-03-19,哪个工号什么名字的医务人员在患者奚信瑞就诊时为其检测罗马指数(绝经前)的 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = 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_MZJZJLB AND jy... | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | how many patients whose admission type is emergency and admission year is less than 2164? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.admityear < "2164" | mimicsql_data |
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE party (
... | What are the maximum and minimum population of the counties? | SELECT MAX(population), MIN(population) FROM county | spider |
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... | 患者袁英武自付比例低于0.03的药品量有多少,时间是在03年7月4日到10年2月19日内 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '袁英武' AND t_kc22.STA_DATE BETWEEN '2003-07-04' AND '2010-02-19' AND t_kc22.SELF_PAY_PRO < 0.03 | css |
CREATE TABLE table_name_8 (
data_limit__gb VARCHAR,
company VARCHAR
) | What is the data limit for vodafone? | SELECT data_limit__gb FROM table_name_8 WHERE company = "vodafone" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is the number of patients whose discharge location is short term hospital and procedure long title is intravenous infusion of clofarabine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.long_title = "Intravenous infusion of clofarabine" | mimicsql_data |
CREATE TABLE table_50146 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the most rebounds in the game against Chicago? | SELECT "High rebounds" FROM table_50146 WHERE "Team" = 'chicago' | wikisql |
CREATE TABLE table_name_40 (
method VARCHAR,
time VARCHAR
) | What is Method, when Time is '3:20'? | SELECT method FROM table_name_40 WHERE time = "3:20" | sql_create_context |
CREATE TABLE table_52276 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text,
"Team" text
) | What was the team that held the race title of Mallala? | SELECT "Team" FROM table_52276 WHERE "Race Title" = 'mallala' | wikisql |
CREATE TABLE table_43791 (
"Region (year)" text,
"No. 1" text,
"No. 2" text,
"No. 3" text,
"No. 4" text,
"No. 5" text,
"No. 6" text,
"No. 7" text,
"No. 8" text,
"No. 9" text,
"No. 10" text
) | Name the No. 5 which has a No. 8 of logan, and a No. 10 of ethan, and a No. 4 of jacob? | SELECT "No. 5" FROM table_43791 WHERE "No. 8" = 'logan' AND "No. 10" = 'ethan' AND "No. 4" = 'jacob' | wikisql |
CREATE TABLE table_17288825_8 (
record VARCHAR,
score VARCHAR
) | Name the record for score of l 93 104 (ot) | SELECT record FROM table_17288825_8 WHERE score = "L 93–104 (OT)" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)... | what number of hours has passed since patient 018-20179 was admitted to the hospital? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '018-20179' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_5968 (
"Round" real,
"Club" text,
"Home" text,
"Away" text,
"Aggregate" text
) | What is NK Rijeka's away score in Round 2? | SELECT "Away" FROM table_5968 WHERE "Round" < '2' AND "Club" = 'nk rijeka' | wikisql |
CREATE TABLE table_66449 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
) | Which platform was Red Dead Redemption for? | SELECT "Platform(s)" FROM table_66449 WHERE "Game" = 'red dead redemption' | wikisql |
CREATE TABLE table_29572583_20 (
status VARCHAR,
seed VARCHAR
) | what is the status for seed 14 | SELECT status FROM table_29572583_20 WHERE seed = 14 | sql_create_context |
CREATE TABLE table_203_809 (
id number,
"date" text,
"time" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
) | what is the number of ranked teams georgia played in 2006 ? | SELECT COUNT(*) FROM table_203_809 WHERE NOT "rank#" IS NULL | squall |
CREATE TABLE table_4693 (
"Played" real,
"Lost" real,
"Drawn" real,
"Tries" real,
"Points" real,
"% Won" real
) | What is the number of tries for the player who is larger than 16? | SELECT SUM("Tries") FROM table_4693 WHERE "Played" > '16' | wikisql |
CREATE TABLE table_2847477_2 (
pinyin VARCHAR,
english_name VARCHAR
) | What is the pinyin name for the english name xin county? | SELECT pinyin FROM table_2847477_2 WHERE english_name = "Xin County" | 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,
... | when was the last hospital admission time that patient 022-166510 was admitted through an acute care/floor until 4 years ago? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '022-166510' AND patient.hospitaladmitsource = 'acute care/floor' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
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 wdmzjzjlb (
CYBQDM text,
CYBQ... | 卫星纬这位患者的204895指标在零一年四月三十日至零六年一月三十一日期间的情况 | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = 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_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
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 diagnosis (
diagnosisid number,
patie... | the number of patients who have been admitted to hospital in 2102. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE STRFTIME('%y', patient.hospitaladmittime) = '2102' | 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... | Get the list of patients diagnosed with personal history of malignant neoplasm of bladder who have a prescription for base type drug. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hx of bladder malignancy" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 由门诊诊断为硅肺Ⅲ期的检测的三碘甲状腺原氨酸数值的平均值以及最值分别是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjl... | css |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area... | Return a bar chart about the number of counties for all appellations?, and could you display in ascending by the Y? | SELECT County, COUNT(County) FROM appellations GROUP BY County ORDER BY COUNT(County) | nvbench |
CREATE TABLE SportsInfo (
StuID INTEGER,
SportName VARCHAR(32),
HoursPerWeek INTEGER,
GamesPlayed INTEGER,
OnScholarship VARCHAR(1)
)
CREATE TABLE Plays_Games (
StuID INTEGER,
GameID INTEGER,
Hours_Played INTEGER
)
CREATE TABLE Video_Games (
GameID INTEGER,
GName VARCHAR(40),
... | What are the number of the last names for all scholarship students?, and show in ascending by the x-axis. | SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName ORDER BY LName | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | what is the total enteral tubefeed dose that patient 016-6134 had received until 03/22/2103? | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-6134')) AND intakeoutput.celllabel = 'entera... | eicu |
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 headquarter and the amount of headquarter , and group by attribute headquarter in a bar chart, I want to order total number in desc order. | SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY COUNT(Headquarter) DESC | nvbench |
CREATE TABLE table_40039 (
"Country" text,
"Local name" text,
"Host" text,
"Network" text,
"Date premiered" text
) | Which Local name has a Network of nova tv? | SELECT "Local name" FROM table_40039 WHERE "Network" = 'nova tv' | wikisql |
CREATE TABLE table_name_88 (
losses INTEGER,
wins VARCHAR,
last_appearance VARCHAR
) | What is the highest Losses, when Wins is greater than 1, and when Last Appearance is 2003? | SELECT MAX(losses) FROM table_name_88 WHERE wins > 1 AND last_appearance = "2003" | sql_create_context |
CREATE TABLE table_29540 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. No." real,
"Viewers (millions)" text
) | What is the production number for the episode called 'Random on Purpose'? | SELECT "Prod. No." FROM table_29540 WHERE "Title" = 'Random on Purpose' | wikisql |
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 marital status is divorced and lab test name is lactate dehydrogenase (ld)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Lactate Dehydrogenase (LD)" | mimicsql_data |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 病患73140420出院诊断疾病名称不包含活动在医院2020501的医疗就诊记录编号是多少? | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '73140420' AND MED_SER_ORG_NO = '2020501' AND NOT OUT_DIAG_DIS_NM LIKE '%活动%' | css |
CREATE TABLE table_8881 (
"Title" text,
"Writer" text,
"Doctor" text,
"Format" text,
"Company" text,
"release date" text
) | What is Release Date, when Title is Aladdin Time? | SELECT "release date" FROM table_8881 WHERE "Title" = 'aladdin time' | wikisql |
CREATE TABLE table_name_97 (
time_retired VARCHAR,
laps VARCHAR,
grid VARCHAR
) | Tell me the time/retired for Laps larger than 63 and has a grid of 20 | SELECT time_retired FROM table_name_97 WHERE laps > 63 AND grid = 20 | sql_create_context |
CREATE TABLE table_13482 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What was the score that has a To par of 3, for Branden Grace? | SELECT "Score" FROM table_13482 WHERE "To par" = '−3' AND "Player" = 'branden grace' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | calculate the length of the hospital stay of patient 013-12480's first intensive care unit stay. | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-12480') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE finrev_fed_17 (
state_code number,
idcensus number,
school_district text,
nces_id text,
yr_data number,
t_fed_rev number,
c14 number,
c25 number
)
CREATE TABLE finrev_fed_key_17 (
state_code number,
state text,
#_records text
)
CREATE TABLE ndecoreexcel_math_gr... | What are the top 10 states that have the highest average math score and federal revenue they got through different categories? | SELECT T2.state, SUM(c14), SUM(c25) FROM finrev_fed_17 AS T1 JOIN finrev_fed_key_17 AS T2 ON T1.state_code = T2.state_code JOIN ndecoreexcel_math_grade8 AS T3 ON T2.state = T3.state GROUP BY T2.state ORDER BY T3.average_scale_score DESC LIMIT 10 | studentmathscore |
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... | Find Answers with Really low scores. | SELECT Id AS "post_link" FROM Posts WHERE PostTypeId = 2 AND LENGTH(Body) <= '##length##' AND Score <= '##Score##' ORDER BY Score | sede |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,... | how many dose of tricor has been prescribed to patient 29741 in the first hospital encounter? | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29741 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'tricor' | mimic_iii |
CREATE TABLE table_51832 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text,
"Notes" text
) | What was the notes of the 400 m event before 2004 with a position of 12th (h)? | SELECT "Notes" FROM table_51832 WHERE "Event" = '400 m' AND "Year" < '2004' AND "Position" = '12th (h)' | wikisql |
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 vitalperiodi... | what is the name of the intake that patient 030-6441 last had on 08/31/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 = '030-6441')) AND intakeoutput.cellpath LIKE '%intake%' AND DA... | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.