context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | what is the name of procedure patient 005-4044 has been given two or more times in the first hospital visit? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | eicu |
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Score text
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tri... | How many competitions for each country?, and list by the Y-axis from high to low. | SELECT Country, COUNT(Country) FROM competition GROUP BY Country ORDER BY COUNT(Country) DESC | nvbench |
CREATE TABLE table_name_53 (
director VARCHAR,
title VARCHAR
) | Who directed An Egg Scramble? | SELECT director FROM table_name_53 WHERE title = "an egg scramble" | sql_create_context |
CREATE TABLE table_1341423_40 (
party VARCHAR,
incumbent VARCHAR
) | what is the party with the incumbent jim demint? | SELECT party FROM table_1341423_40 WHERE incumbent = "Jim DeMint" | sql_create_context |
CREATE TABLE table_name_99 (
visiting_team VARCHAR,
stadium VARCHAR
) | During the game at Candlestick Park, who was the visiting team? | SELECT visiting_team FROM table_name_99 WHERE stadium = "candlestick park" | sql_create_context |
CREATE TABLE table_62312 (
"Year" real,
"Award Ceremony" text,
"Category" text,
"Nominee" text,
"Result" text
) | what is the result when the category is best sound design? | SELECT "Result" FROM table_62312 WHERE "Category" = 'best sound design' | wikisql |
CREATE TABLE locations (
city VARCHAR,
state_province VARCHAR,
location_id VARCHAR
)
CREATE TABLE departments (
department_name VARCHAR,
department_id VARCHAR,
location_id VARCHAR
)
CREATE TABLE employees (
first_name VARCHAR,
last_name VARCHAR,
department_id VARCHAR
) | display the first and last name, department, city, and state province for each employee. | SELECT T1.first_name, T1.last_name, T2.department_name, T3.city, T3.state_province FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id | sql_create_context |
CREATE TABLE Parties (
Party_ID INTEGER,
Party_Details VARCHAR(255)
)
CREATE TABLE Parties_in_Events (
Party_ID INTEGER,
Event_ID INTEGER,
Role_Code CHAR(15)
)
CREATE TABLE Channels (
Channel_ID INTEGER,
Other_Details VARCHAR(255)
)
CREATE TABLE Finances (
Finance_ID INTEGER,
Othe... | Give me a bar graph showing the total number of different product names. | SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name | nvbench |
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... | 从二00二年四月二十五日到二0二0年十二月二十一日这段时间,患者沈宾鸿检测超敏肌钙蛋白T找的哪些医务人员做的,这些医务人员的工号和姓名报一下 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzj... | css |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | what are the five most frequently input events during a year before? | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY intakeoutput.celllabel) AS ... | eicu |
CREATE TABLE table_36486 (
"Name v t e" text,
"Pos." text,
"Height" text,
"Weight" text,
"Club" text
) | What is the weight of the player from pvk jadran club? | SELECT "Weight" FROM table_36486 WHERE "Club" = 'pvk jadran' | wikisql |
CREATE TABLE table_14272 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which the highest Bronze of czech republic with a Total smaller than 4? | SELECT MAX("Bronze") FROM table_14272 WHERE "Nation" = 'czech republic' AND "Total" < '4' | wikisql |
CREATE TABLE table_204_698 (
id number,
"name" text,
"lifetime" text,
"nationality" text,
"notable as" text,
"notes" text
) | which nationality had the most notable poets ? | SELECT "nationality" FROM table_204_698 WHERE "notable as" = 'poet' GROUP BY "nationality" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_42286 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What was 2002, when 2011 was, 'atp masters series'? | SELECT "2002" FROM table_42286 WHERE "2011" = 'atp masters series' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
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... | Are there any upper level courses taught by Julia Sonnevend ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.ins... | advising |
CREATE TABLE table_49972 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" text
) | what is the country when the player is bill nary? | SELECT "Country" FROM table_49972 WHERE "Player" = 'bill nary' | wikisql |
CREATE TABLE table_28004 (
"Episode #" real,
"The W\u00f8rd" text,
"Guest" text,
"Introductory phrase" text,
"Original airdate" text,
"Production code" real
) | What is the episode # when the guests were julie nixon eisenhower and david eisenhower? | SELECT MIN("Episode #") FROM table_28004 WHERE "Guest" = 'Julie Nixon Eisenhower and David Eisenhower' | wikisql |
CREATE TABLE table_27004 (
"Country" text,
"Local title" text,
"Presenter(s)" text,
"Judges" text,
"Channel" text,
"Series" text
) | Which country did Johanna Klum presented the show? | SELECT "Country" FROM table_27004 WHERE "Presenter(s)" = 'Johanna Klum' | wikisql |
CREATE TABLE table_16315 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What is the position for the player with cfl team Winnipeg blue bombers? | SELECT "Position" FROM table_16315 WHERE "CFL Team" = 'Winnipeg Blue Bombers' | wikisql |
CREATE TABLE table_232458_1 (
population__2010_census_ VARCHAR,
pop_density__per_km²_ VARCHAR
) | If the population density is 7,447.32, what is the population total number? | SELECT COUNT(population__2010_census_) FROM table_232458_1 WHERE pop_density__per_km²_ = "7,447.32" | sql_create_context |
CREATE TABLE table_8390 (
"Season" text,
"Pool/Round" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Bonus" text,
"Points" real
) | Can you tell me the highest Lost that has the Pool/Round of pool 2, and the Played smaller than 6? | SELECT MAX("Lost") FROM table_8390 WHERE "Pool/Round" = 'pool 2' AND "Played" < '6' | wikisql |
CREATE TABLE player (
POSITION VARCHAR,
points INTEGER
) | find the number of players whose points are lower than 30 in each position. | SELECT COUNT(*), POSITION FROM player WHERE points < 30 GROUP BY POSITION | sql_create_context |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE flight_fare (
flight_id in... | list airports | SELECT DISTINCT airport_code FROM airport | atis |
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... | how many patients whose procedure long title is excision or destruction of other lesion or tissue of heart, open approach and lab test fluid is pleural? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Excision or destruction of other lesion or tissue of heart, open approach" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_13208 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" real,
"Time" text,
"Location" text
) | What is the total number of Round with a Method of submission (ankle lock), a Location of tokyo, japan, and a Record of 13-5-2? | SELECT SUM("Round") FROM table_13208 WHERE "Method" = 'submission (ankle lock)' AND "Location" = 'tokyo, japan' AND "Record" = '13-5-2' | wikisql |
CREATE TABLE table_28794440_1 (
branding VARCHAR,
callsign VARCHAR
) | Which branding has the callsign of DXGH? | SELECT branding FROM table_28794440_1 WHERE callsign = "DXGH" | sql_create_context |
CREATE TABLE table_43756 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
) | Which Name has a Position smaller than 2? | SELECT "Name" FROM table_43756 WHERE "Position" < '2' | wikisql |
CREATE TABLE table_name_81 (
moldovans VARCHAR,
ukrainians VARCHAR
) | what is the Moldovans number when there are 14,200 Ukrainians? | SELECT moldovans FROM table_name_81 WHERE ukrainians = "14,200" | sql_create_context |
CREATE TABLE round (
Round_ID int,
Member_ID int,
Decoration_Theme text,
Rank_in_Round int
)
CREATE TABLE member (
Member_ID int,
Name text,
Country text,
College_ID int
)
CREATE TABLE college (
College_ID int,
Name text,
Leader_Name text,
College_Location text
) | Plot how many country by grouped by country as a bar graph, show X from high to low order. | SELECT Country, COUNT(Country) FROM member GROUP BY Country ORDER BY Country DESC | nvbench |
CREATE TABLE table_2562572_27 (
settlement VARCHAR,
cyrillic_name_other_names VARCHAR
) | How many settlements have as their cyrillic name and other names ? | SELECT settlement FROM table_2562572_27 WHERE cyrillic_name_other_names = "Панонија" | 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,
... | 检验结果指标记录51351189331中,参考值范围以及范围下限和上限分别是怎么记录的 | SELECT CKZFWDX, CKZFWXX, CKZFWSX FROM jyjgzbb WHERE JYZBLSH = '51351189331' | css |
CREATE TABLE table_1971074_1 (
location VARCHAR,
nickname VARCHAR
) | Where is the school whose students are nicknamed Panthers located? | SELECT location FROM table_1971074_1 WHERE nickname = "Panthers" | sql_create_context |
CREATE TABLE table_22222 (
"Enzyme" text,
"Location" text,
"Substrate" text,
"Product" text,
"Chromosome" text,
"EC" text,
"OMIM" real,
"Porphyria" text
) | what is the subtrate for enzyme ala dehydratase | SELECT "Substrate" FROM table_22222 WHERE "Enzyme" = 'ALA dehydratase' | wikisql |
CREATE TABLE table_40565 (
"Episode number Production number" text,
"Title" text,
"Original airing" text,
"Rating" real,
"Share" real,
"18-49" real,
"Total viewers (in millions)" real,
"Rank per week" text
) | What was the date of airing for episodes with ratings under 10.1 and production number of 96 5-09? | SELECT "Original airing" FROM table_40565 WHERE "Rating" < '10.1' AND "Episode number Production number" = '96 5-09' | wikisql |
CREATE TABLE table_21161 (
"Municipality" text,
"Income Class" text,
"District" text,
"Population (2010)" real,
"Area (km\u00b2)" real
) | what is th area where the municipaity is labrador? | SELECT "Area (km\u00b2)" FROM table_21161 WHERE "Municipality" = 'Labrador' | wikisql |
CREATE TABLE Ref_Incident_Type (
incident_type_code VARCHAR(10),
incident_type_description VARCHAR(80)
)
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
gender VARCHAR(1),
cell_mobile_number VARC... | Visualize a bar chart about the distribution of date_address_to and the sum of monthly_rental , and group by attribute other_details and bin date_address_to by time. | SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 列出医院6264917所有非异地结算的医疗就诊记录在2001-05-03到2011-04-15内有哪些? | SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6264917' AND t_kc21.IN_HOSP_DATE BETWEEN '2001-05-03' AND '2011-04-15' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6264917' AND t_kc21.IN_HOSP_DATE BETWEEN '2001-05-03' AND '2011-04-15' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = ... | css |
CREATE TABLE table_name_54 (
rank INTEGER,
heat VARCHAR,
nationality VARCHAR
) | What is the highest rank of an athlete from Switzerland in a heat larger than 3? | SELECT MAX(rank) FROM table_name_54 WHERE heat > 3 AND nationality = "switzerland" | sql_create_context |
CREATE TABLE table_75690 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Distance (Miles)" text,
"Time" text
) | What was the winning time for the winning horse, Kentucky ii? | SELECT "Time" FROM table_75690 WHERE "Winner" = 'kentucky ii' | wikisql |
CREATE TABLE table_21076 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" text,
"Year named" real,
"Name origin" text
) | At what latitude can you find the diameter (km) of 500.0? | SELECT "Latitude" FROM table_21076 WHERE "Diameter (km)" = '500.0' | wikisql |
CREATE TABLE table_51386 (
"Name" text,
"Bodyweight" real,
"Snatch" real,
"Clean & jerk" real,
"Total (kg)" real
) | Which weightlifter, who had a bodyweight of less than 136.16 and a clean and jerk larger than 135, had the highest Total? | SELECT MAX("Total (kg)") FROM table_51386 WHERE "Bodyweight" < '136.16' AND "Clean & jerk" > '135' | wikisql |
CREATE TABLE table_name_55 (
date VARCHAR,
opponent VARCHAR
) | When is Northern Ireland the opponent? | SELECT date FROM table_name_55 WHERE opponent = "northern ireland" | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 医疗就诊46360643910给病员07312475开出的各药品的名称叫什么每次用量是多少?使用频次是多少次? | SELECT t_kc22.SOC_SRT_DIRE_NM, t_kc22.EACH_DOSAGE, t_kc22.USE_FRE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '46360643910' | css |
CREATE TABLE table_name_99 (
attendance VARCHAR,
date VARCHAR
) | How many people attended the May 28 game? | SELECT attendance FROM table_name_99 WHERE date = "may 28" | sql_create_context |
CREATE TABLE table_57992 (
"Player" text,
"Car." real,
"Yards" real,
"Avg." real,
"TD's" real,
"Long" real
) | How many yards for the player with over 0 TDs and an average of 2.9? | SELECT MIN("Yards") FROM table_57992 WHERE "TD's" > '0' AND "Avg." = '2.9' | wikisql |
CREATE TABLE table_3817 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | When steve holland is the writer what is the air date? | SELECT "Original air date" FROM table_3817 WHERE "Written by" = 'Steve Holland' | wikisql |
CREATE TABLE table_204_655 (
id number,
"year" number,
"winner" text,
"album" text,
"other finalists" text
) | which artists won in 2008 and 2009 respectively ? | SELECT "winner" FROM table_204_655 WHERE "year" IN (2008, 2009) | squall |
CREATE TABLE table_name_61 (
province VARCHAR,
city VARCHAR
) | Which Province has a City of hiroshima? | SELECT province FROM table_name_61 WHERE city = "hiroshima" | sql_create_context |
CREATE TABLE table_46261 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | Which Player has a To par of +9? | SELECT "Player" FROM table_46261 WHERE "To par" = '+9' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,... | For those employees who did not have any job in the past, a line chart shows the trend of department_id over hire_date . | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_24515 (
"Regional" text,
"Champions" text,
"Runners-up" text,
"Third place" text,
"Fourth place" text
) | how many persons got the fourth position when the regional was shikoku? | SELECT COUNT("Fourth place") FROM table_24515 WHERE "Regional" = 'Shikoku' | wikisql |
CREATE TABLE table_58983 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | What Championship has a Date of 26 may 1986? | SELECT "Championship" FROM table_58983 WHERE "Date" = '26 may 1986' | wikisql |
CREATE TABLE Students (
student_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
date_first_rental DATETIME,
date_left_university DATETIME,
other_student_details VARC... | A line chart shows the trend of the amount of date_address_to over date_address_to , and group by attribute date_address_to. | SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY date_address_to ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_4637 (
"Round" real,
"Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning car" text
) | Which driver drove car Wolf WR3? | SELECT "Winning driver" FROM table_4637 WHERE "Winning car" = 'wolf wr3' | wikisql |
CREATE TABLE table_12163387_1 (
womens_singles VARCHAR,
mens_singles VARCHAR
) | Who won the womens singles event the year that Jonas Lyduch won? | SELECT womens_singles FROM table_12163387_1 WHERE mens_singles = "Jonas Lyduch" | sql_create_context |
CREATE TABLE table_19021 (
"Rank" real,
"Airport" text,
"Total Passengers" real,
"% Change 2005/2006" text,
"International Passengers" real,
"Domestic Passengers" real,
"Transit Passengers" real,
"Aircraft Movements" real,
"Freight (Metric Tonnes)" real
) | what is the maximum aircraft movements with international passengers being 21002260 | SELECT MAX("Aircraft Movements") FROM table_19021 WHERE "International Passengers" = '21002260' | 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 prescription... | how many patients who had an urgent admission type were prescribed the drug with drug code clot10? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.formulary_drug_cd = "CLOT10" | mimicsql_data |
CREATE TABLE table_name_86 (
venue VARCHAR,
runner_up VARCHAR,
champion__average_in_final_ VARCHAR
) | what is the venue when the runner-up is 20,000, the champion (average in final) is phil taylor (109.35)? | SELECT venue FROM table_name_86 WHERE runner_up = "£20,000" AND champion__average_in_final_ = "phil taylor (109.35)" | sql_create_context |
CREATE TABLE table_76429 (
"Tournament" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | Which tournament has a 2013 of 1r, and a 2012 of 1r? | SELECT "Tournament" FROM table_76429 WHERE "2013" = '1r' AND "2012" = '1r' | wikisql |
CREATE TABLE table_72320 (
"Episode title" text,
"Air date" text,
"Reward" text,
"Immunity" text,
"Eliminated" text,
"Vote" text,
"Finish" text
) | What is the name of the episode in which Jenn is eliminated? | SELECT "Episode title" FROM table_72320 WHERE "Eliminated" = 'Jenn' | wikisql |
CREATE TABLE table_1341453_22 (
party VARCHAR,
district VARCHAR
) | What party was the winner in the district Maryland 6? | SELECT party FROM table_1341453_22 WHERE district = "Maryland 6" | sql_create_context |
CREATE TABLE table_72620 (
"English gloss" text,
"Santee-Sisseton" text,
"Yankton-Yanktonai" text,
"Northern Lakota" text,
"Southern Lakota" text
) | Name the santee sisseton for wi h a | SELECT "Santee-Sisseton" FROM table_72620 WHERE "Yankton-Yanktonai" = 'wičháša' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 根据不同的出院诊断疾病名字和科室名字,罗列出病人的平均年龄在这家医院5230823所有医疗就诊记录中都是多大?并且保留平均年龄大于二十九岁的记录 | SELECT MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '5230823' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM HAVING AVG(PERSON_AGE) > 29 | css |
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... | 患有精神障碍的病人在医院0440426入院期间的医疗记录中最低和最高医疗费总钱数是多少元? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '0440426' AND qtb.IN_DIAG_DIS_NM = '精神障碍' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '0440426' AND gyb.IN_DIAG_DIS_NM = '精神障碍' UNION SELECT ... | css |
CREATE TABLE table_57195 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) | What type has a date of 1 june? | SELECT "Type" FROM table_57195 WHERE "Date" = '1 june' | wikisql |
CREATE TABLE table_name_12 (
score VARCHAR,
away_team VARCHAR
) | What was the score when the way team was Wrexham? | SELECT score FROM table_name_12 WHERE away_team = "wrexham" | sql_create_context |
CREATE TABLE table_56848 (
"Rd #" real,
"Pick #" real,
"Player" text,
"Team (League)" text,
"Reg GP" real,
"Pl GP" real
) | Tell me the highest PI GP with pick # greater than 159 and reg GP more than 0 | SELECT MAX("Pl GP") FROM table_56848 WHERE "Pick #" > '159' AND "Reg GP" > '0' | wikisql |
CREATE TABLE table_51408 (
"Year" real,
"Film" text,
"Role" text,
"Leading Man" text,
"Director" text
) | What year was the role nan taylor, alias of nan ellis, aka mrs. andrews and directed by William keighley? | SELECT SUM("Year") FROM table_51408 WHERE "Role" = 'nan taylor, alias of nan ellis, aka mrs. andrews' AND "Director" = 'william keighley' | wikisql |
CREATE TABLE table_42618 (
"Name" text,
"Position" text,
"Number" real,
"School/Club Team" text,
"Season" text,
"Acquisition via" text
) | What years did Omar Sneed play? | SELECT "Season" FROM table_42618 WHERE "Name" = 'omar sneed' | wikisql |
CREATE TABLE table_54705 (
"Catches" text,
"Player" text,
"Versus" text,
"Venue" text,
"Date" text
) | How many catches does hh dippenaar have? | SELECT "Catches" FROM table_54705 WHERE "Player" = 'hh dippenaar' | wikisql |
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine (
id int,
name text,
Trade_Name... | What is the id and trade name of the medicines can interact with at least 3 enzymes, rank by the Trade_Name in asc please. | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY Trade_Name | nvbench |
CREATE TABLE table_204_975 (
id number,
"year" number,
"competition" text,
"location" text,
"event" text,
"final-rank" text,
"final-score" number,
"qualifying rank" number,
"qualifying score" number
) | what was the only event that she participated in the vault ? | SELECT "competition" FROM table_204_975 WHERE "event" = 'vault' | squall |
CREATE TABLE table_25703_1 (
birth_2013 INTEGER,
death_2012 VARCHAR
) | What is the highest birth/2013 when the death/2012 is 14,1? | SELECT MAX(birth_2013) FROM table_25703_1 WHERE death_2012 = "14,1" | sql_create_context |
CREATE TABLE table_18752986_1 (
first_season VARCHAR,
home_ground_s_ VARCHAR
) | What is the dates where Hillcrest Reserve is the home grounds? | SELECT first_season FROM table_18752986_1 WHERE home_ground_s_ = "Hillcrest Reserve" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | count the number of patients whose lab test abnormal status is abnormal and lab test name is triiodothyronine (t3). | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "abnormal" AND lab.label = "Triiodothyronine (T3)" | mimicsql_data |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE dual_carrier... | show me the cheapest fares from SAN DIEGO to MIAMI one way | 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 CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN DIEGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci... | atis |
CREATE TABLE table_45066 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | When Fred Funk had a to par of E, what was the score? | SELECT "Score" FROM table_45066 WHERE "To par" = 'e' AND "Player" = 'fred funk' | wikisql |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE... | Count of posts by week. | WITH Raw AS (SELECT DATEADD(dd, 7 * FLOOR(DATEDIFF(day, '1970-01-05', CreationDate) / 7), '1970-01-05') AS PostWeek, Id FROM Posts) SELECT PostWeek, COUNT(*) AS Count FROM Raw GROUP BY PostWeek ORDER BY PostWeek | sede |
CREATE TABLE table_47484 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Location" text
) | What is Round, when Record is '4-1'? | SELECT "Round" FROM table_47484 WHERE "Record" = '4-1' | wikisql |
CREATE TABLE table_617 (
"English Name" text,
"Simplified" text,
"Traditional" text,
"Pinyin" text,
"Area" real,
"Population" real,
"Density" real
) | What is the density of yushan county? | SELECT COUNT("Density") FROM table_617 WHERE "English Name" = 'Yushan County' | wikisql |
CREATE TABLE table_18126 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Results" text,
"Candidates" text
) | What were the results for the district oklahoma 5? | SELECT "Results" FROM table_18126 WHERE "District" = 'Oklahoma 5' | wikisql |
CREATE TABLE table_59615 (
"Combined" text,
"50 yard Freestyle" text,
"100 yard Freestyle" text,
"200 yard Freestyle" text,
"500 yard Freestyle" text,
"100 yard Backstroke" text,
"100 yard Butterfly" text
) | What 100 yard Backstroke has a 100 yard Freestyle of helen yee (sierra vista)? | SELECT "100 yard Backstroke" FROM table_59615 WHERE "100 yard Freestyle" = 'helen yee (sierra vista)' | wikisql |
CREATE TABLE table_name_84 (
location VARCHAR,
event VARCHAR
) | In which location did the Meca World Vale Tudo 6 event happen? | SELECT location FROM table_name_84 WHERE event = "meca world vale tudo 6" | 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... | 自2014.9.1起,止2020.1.14止,自付比例低于0.41的药品一共给患者65887975开出了多少 | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '65887975' AND t_kc22.STA_DATE BETWEEN '2014-09-01' AND '2020-01-14' AND t_kc22.SELF_PAY_PRO < 0.41 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '6588797... | css |
CREATE TABLE table_13722 (
"Name" text,
"Years" text,
"A-League" text,
"Finals" text,
"Total" text,
"Games per goal" real
) | Which player has a total of 8 (24)? | SELECT "Name" FROM table_13722 WHERE "Total" = '8 (24)' | wikisql |
CREATE TABLE table_79553 (
"Title" text,
"Series" text,
"Director" text,
"Production Number" real,
"Release date" text
) | What is the production number for the episode directed by Robert McKimson named Mice Follies? | SELECT COUNT("Production Number") FROM table_79553 WHERE "Director" = 'robert mckimson' AND "Title" = 'mice follies' | wikisql |
CREATE TABLE table_38058 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Which opponent has an attendance of 17,015? | SELECT "Opponent" FROM table_38058 WHERE "Attendance" = '17,015' | wikisql |
CREATE TABLE table_41065 (
"Name" text,
"Born-Died" text,
"Took Office" text,
"Left Office" text,
"Country" text
) | What is the country of the Representative that left office as incumbent? | SELECT "Country" FROM table_41065 WHERE "Left Office" = 'incumbent' | wikisql |
CREATE TABLE table_12935 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
) | What is the Country of the Player with a Score of 66-72-70-69=277? | SELECT "Country" FROM table_12935 WHERE "Score" = '66-72-70-69=277' | wikisql |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
... | what amount of topiramate has been prescribed to patient 62413 in total in 02/this year? | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 62413) AND prescriptions.drug = 'topiramate' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND ... | mimic_iii |
CREATE TABLE table_name_41 (
rank INTEGER,
director_s_ VARCHAR
) | Sum of m. night shyamalan ranks? | SELECT SUM(rank) FROM table_name_41 WHERE director_s_ = "m. night shyamalan" | sql_create_context |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_interval (
period text,
begin_time int... | what kind of ground transportation can you offer me in SEATTLE | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SEATTLE' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_48291 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | Who was the home team when Sheffield United was the away team and the date was also Sheffield United? | SELECT "Home team" FROM table_48291 WHERE "Away team" = 'sheffield united' AND "Date" = 'sheffield united' | wikisql |
CREATE TABLE table_41932 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What week of the season was December 13? | SELECT "Week" FROM table_41932 WHERE "Date" = 'december 13' | wikisql |
CREATE TABLE table_name_90 (
date VARCHAR,
away_team VARCHAR
) | What date is st kilda the Away team? | SELECT date FROM table_name_90 WHERE away_team = "st kilda" | sql_create_context |
CREATE TABLE table_name_76 (
venue VARCHAR,
score VARCHAR
) | In what Venue was the Score 1-1? | SELECT venue FROM table_name_76 WHERE score = "1-1" | sql_create_context |
CREATE TABLE table_69919 (
"Deputy Prime Minister" text,
"Took office" real,
"Left office" text,
"Prime Minister" text,
"Term" text,
"Party" text
) | Which deputy prime minister left office in 1981? | SELECT "Deputy Prime Minister" FROM table_69919 WHERE "Left office" = '1981' | wikisql |
CREATE TABLE table_39913 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text
) | What's the smallest March when the record is 22-12-6? | SELECT MIN("March") FROM table_39913 WHERE "Record" = '22-12-6' | wikisql |
CREATE TABLE table_name_21 (
rebounds INTEGER,
name VARCHAR,
rank VARCHAR
) | How many rebounds does Fedor likholitov have with a rank greater than 8? | SELECT SUM(rebounds) FROM table_name_21 WHERE name = "fedor likholitov" AND rank > 8 | sql_create_context |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
... | The course for MDE that is the easiest has who as a teacher ? | SELECT DISTINCT instructor.name, program_course.workload FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN program_course ON program_course.course_id = cour... | advising |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.