context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_1561 (
"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
) | Namee the title for production code for 4014 | SELECT "Title" FROM table_1561 WHERE "Production code" = '4014' | wikisql |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | For employees without the letter M in their first name, give me a line chart to show the salary change over their hire date using a line chart, and I want to sort by the X-axis from high to low please. | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_33853 (
"Celebrity" text,
"Famous for" text,
"Entered" text,
"Exited" text,
"Finished" text
) | What place did the celebrity who is famous for being an athlete finish? | SELECT "Finished" FROM table_33853 WHERE "Famous for" = 'athlete' | wikisql |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | A bar chart shows the distribution of meter_700 and ID , I want to rank in ascending by the Y. | SELECT meter_700, ID FROM swimmer ORDER BY ID | nvbench |
CREATE TABLE table_name_67 (
year INTEGER,
type VARCHAR,
catalog__number VARCHAR
) | What is the earliest year catalog # ual 24033 had an LP? | SELECT MIN(year) FROM table_name_67 WHERE type = "lp" AND catalog__number = "ual 24033" | sql_create_context |
CREATE TABLE table_67144 (
"Year" real,
"Theme" text,
"Artist" text,
"Issue price" real,
"Special notes" text
) | What are the special notes for an issue price under 24.95 with an edmonton oilers theme? | SELECT "Special notes" FROM table_67144 WHERE "Issue price" < '24.95' AND "Theme" = 'edmonton oilers' | wikisql |
CREATE TABLE table_name_47 (
altitude__mslm_ INTEGER,
city VARCHAR,
population VARCHAR
) | Which Altitude (mslm) is the highest one that has a City of legnano, and a Population larger than 59492? | SELECT MAX(altitude__mslm_) FROM table_name_47 WHERE city = "legnano" AND population > 59492 | sql_create_context |
CREATE TABLE table_name_34 (
transfer_fee VARCHAR,
moving_from VARCHAR
) | What is the transfer fee of the move from Port Vale? | SELECT transfer_fee FROM table_name_34 WHERE moving_from = "port vale" | 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... | provide the number of patients whose diagnoses short title is fall nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Fall NOS" | mimicsql_data |
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type text
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance... | Create a pie chart showing the total number across nationality. | SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | provide the number of patients whose year of birth is less than 2200 and drug name is aluminum hydroxide suspension? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2200" AND prescriptions.drug = "Aluminum Hydroxide Suspension" | mimicsql_data |
CREATE TABLE table_33394 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"College" text
) | What is the average overall value for a round less than 4 associated with the College of Georgia? | SELECT AVG("Overall") FROM table_33394 WHERE "Round" < '4' AND "College" = 'georgia' | 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 admission year is less than 2198 and lab test name is gamma glutamyltransferase? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2198" AND lab.label = "Gamma Glutamyltransferase" | mimicsql_data |
CREATE TABLE table_76700 (
"Club" text,
"City" text,
"Sport" text,
"League" text,
"Venue" text
) | Which venue held a basketball team? | SELECT "Venue" FROM table_76700 WHERE "Sport" = 'basketball' | wikisql |
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 has patient 031-23605 been given a microbiology test for the last time until 08/2104? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND STRFTIME('%y-%m', microlab.culturetakentime) <= ... | eicu |
CREATE TABLE table_23871828_1 (
theme VARCHAR,
week__number VARCHAR
) | List all themes from the top 9. | SELECT theme FROM table_23871828_1 WHERE week__number = "Top 9" | sql_create_context |
CREATE TABLE table_13684 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Who is the runner(s)-up with a winning score of 5 (72-71-68=211)? | SELECT "Runner(s)-up" FROM table_13684 WHERE "Winning score" = '−5 (72-71-68=211)' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CR... | what were the five most commonly given laboratory tests for patients who were previously diagnosed with malign neopl thyroid during the same hospital visit, in 2105? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W... | mimic_iii |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDa... | Find question or answer from revisionGUID. | SELECT PostId AS "post_link" FROM PostHistory WHERE RevisionGUID = '865e9305-bef6-4397-9097-2848d0dc1233' | sede |
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... | 对应的患者姓名在门诊就诊中开出的检验报告单99312004581上是什么? | SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE zyjybgb.BGDH = '99312... | css |
CREATE TABLE table_22644 (
"HR no." text,
"HR name" text,
"CR no." real,
"LMS no." real,
"Built" text,
"Works" text,
"Withdrawn" text
) | What is the highest cr number? | SELECT MAX("CR no.") FROM table_22644 | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | until 01/06/2103 was the heartrate of patient 012-35970 ever less than 71.0? | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-35970')) AND vitalperiodic.heartrate < 71.0 AND NOT vitalperiodi... | eicu |
CREATE TABLE table_41576 (
"Rank" text,
"s Wicket" text,
"Player" text,
"Matches" text,
"Season" text
) | What Rank has a 65 s Wicket? | SELECT "Rank" FROM table_41576 WHERE "s Wicket" = '65' | wikisql |
CREATE TABLE table_69171 (
"Film" text,
"Director(s)" text,
"Producer(s)" text,
"Writer(s)" text,
"Date" text,
"Award" text
) | What director worked with Al Mackay as writer? | SELECT "Director(s)" FROM table_69171 WHERE "Writer(s)" = 'al mackay' | 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... | 在2014年9月24日到2016年6月21日内病患90342065的住院次数有多少次? | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '90342065' AND gwyjzb.IN_HOSP_DATE BETWEEN '2014-09-24' AND '2016-06-21' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '90342065' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2014-09-24' AND '2016-06-21' AND fgwyjzb.CLINIC_TYPE = '住院... | css |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program (
program_id int,
name v... | What are the upper level CS classes that are available next semester ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE program_course.catego... | advising |
CREATE TABLE table_name_65 (
no_9 VARCHAR,
no_5 VARCHAR,
no_3 VARCHAR
) | Who was No. 9 when No. 5 Mason and No. 3 Aiden? | SELECT no_9 FROM table_name_65 WHERE no_5 = "mason" AND no_3 = "aiden" | sql_create_context |
CREATE TABLE table_name_40 (
from_club VARCHAR,
transfer_fee VARCHAR
) | Which From club had a Transfer fee of 3.87m? | SELECT from_club FROM table_name_40 WHERE transfer_fee = "£3.87m" | sql_create_context |
CREATE TABLE table_72346 (
"Institution" text,
"Team" text,
"City" text,
"Province" text,
"First season" real,
"Head coach" text,
"Enrollment" real,
"Endowment" text,
"Football stadium" text,
"Capacity" real
) | What year did University of Saskatchewan have their first season? | SELECT MAX("First season") FROM table_72346 WHERE "Institution" = 'University of Saskatchewan' | wikisql |
CREATE TABLE conference (
cid int,
homepage varchar,
name varchar
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE journal (
homepage varchar,
jid int,
name varchar
)
CREATE TABLE keyword (
keyword varchar,
kid int
)
CREATE TABLE author (
aid int,
homepage v... | return me the number of papers by ' H. V. Jagadish ' on VLDB conference . | SELECT COUNT(DISTINCT (publication.title)) FROM author, conference, publication, writes WHERE author.name = 'H. V. Jagadish' AND conference.name = 'VLDB' AND publication.cid = conference.cid AND writes.aid = author.aid AND writes.pid = publication.pid | academic |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0... | For all employees who have the letters D or S in their first name, show me about the distribution of hire_date and the average of employee_id bin hire_date by weekday in a bar chart. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_9005 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What is the Money of the T4 Place Player with a Score of 71-66-74-67=278? | SELECT AVG("Money ( $ )") FROM table_9005 WHERE "Place" = 't4' AND "Score" = '71-66-74-67=278' | wikisql |
CREATE TABLE table_name_9 (
deorbit_date VARCHAR,
launch_date VARCHAR
) | When did the ATV that launched on 9 March 2008, deorbit? | SELECT deorbit_date FROM table_name_9 WHERE launch_date = "9 march 2008" | sql_create_context |
CREATE TABLE table_23741 (
"County" text,
"Obama%" text,
"Obama#" real,
"McCain%" text,
"McCain#" real
) | What percentage of the vote did McCain win in Waynesboro (city)? | SELECT "McCain%" FROM table_23741 WHERE "County" = 'Waynesboro (city)' | wikisql |
CREATE TABLE table_name_85 (
year VARCHAR,
chassis VARCHAR,
points VARCHAR
) | Name the total number of years for chassis of maserati 250f and points less than 0 | SELECT COUNT(year) FROM table_name_85 WHERE chassis = "maserati 250f" AND points < 0 | sql_create_context |
CREATE TABLE table_17323092_8 (
location_attendance VARCHAR,
high_assists VARCHAR
) | Where was the location and what was the attendance in the game that Anthony Parker (7) earned high assists? | SELECT location_attendance FROM table_17323092_8 WHERE high_assists = "Anthony Parker (7)" | sql_create_context |
CREATE TABLE table_19255192_2 (
Id VARCHAR
) | Name the least 4 car sets | SELECT MIN(4 AS _car_sets) FROM table_19255192_2 | sql_create_context |
CREATE TABLE table_203_573 (
id number,
"name" text,
"rank - 2000" number,
"number" number,
"country of origin" text,
"england - 2001" text
) | what is the number of last names listed that have an english origin ? | SELECT COUNT("name") FROM table_203_573 WHERE "country of origin" = 'england' | squall |
CREATE TABLE table_76938 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
) | What is the T8 Place Player? | SELECT "Player" FROM table_76938 WHERE "Place" = 't8' | wikisql |
CREATE TABLE table_48058 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Nation has a Gold larger than 0, and a Bronze smaller than 2, and a Total larger than 3, and a Silver larger than 1? | SELECT "Nation" FROM table_48058 WHERE "Gold" > '0' AND "Bronze" < '2' AND "Total" > '3' AND "Silver" > '1' | wikisql |
CREATE TABLE table_15327489_1 (
poles VARCHAR,
year VARCHAR
) | Name the poles for 2011 | SELECT poles FROM table_15327489_1 WHERE year = 2011 | sql_create_context |
CREATE TABLE table_name_48 (
date VARCHAR,
region VARCHAR,
catalog VARCHAR
) | What Date is listed for the Region of France and Catalog of 82876-70291-2? | SELECT date FROM table_name_48 WHERE region = "france" AND catalog = "82876-70291-2" | sql_create_context |
CREATE TABLE table_20090682_4 (
pos INTEGER,
driver VARCHAR
) | what is the lowest position of brendan sole | SELECT MAX(pos) FROM table_20090682_4 WHERE driver = "Brendan Sole" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | what is drug name of drug code alte1/2i? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ALTE1/2I" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | provide the number of patients whose ethnicity is hispanic or latino and lab test name is cd34? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND lab.label = "CD34" | mimicsql_data |
CREATE TABLE table_37143 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
) | How many Events have Earnings ($) of 2,054,334? | SELECT COUNT("Events") FROM table_37143 WHERE "Earnings ( $ )" = '2,054,334' | wikisql |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int... | which airlines have DAILY flights from BOSTON to DALLAS | SELECT DISTINCT airline.airline_code FROM airline, 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_n... | atis |
CREATE TABLE table_dev_59 (
"id" int,
"gender" string,
"st_elevation" int,
"tow_contiguous_limb" bool,
"body_weight" float,
"renal_disease" bool,
"estimated_glomerular_filtration_rate_egfr" int,
"two_contiguous_precordial_leads" bool,
"unprotected_left_main_stenosis" int,
"body_m... | unprotected left main stenosis more than 50 % . | SELECT * FROM table_dev_59 WHERE unprotected_left_main_stenosis > 50 | criteria2sql |
CREATE TABLE table_204_340 (
id number,
"name" text,
"year inducted" number,
"position" text,
"apps" number,
"goals" number
) | what is the combined number of goals earned by the hall of famers of 2006 , 2010 , and 2012 ? | SELECT SUM("goals") FROM table_204_340 WHERE "year inducted" IN (2006, 2010, 2012) | squall |
CREATE TABLE table_45270 (
"Year" real,
"Tournaments played" real,
"Cuts made" real,
"Wins" real,
"Best finish" text,
"Earnings ( $ )" real,
"Money list rank" text
) | what is the year when tournaments played is less than 2, cuts made is 1 and earnings ($) is less than 10,547? | SELECT SUM("Year") FROM table_45270 WHERE "Tournaments played" < '2' AND "Cuts made" = '1' AND "Earnings ( $ )" < '10,547' | wikisql |
CREATE TABLE table_50109 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
) | What is Score, when Date is February 5? | SELECT "Score" FROM table_50109 WHERE "Date" = 'february 5' | wikisql |
CREATE TABLE table_74850 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Which overall's pick number was 14? | SELECT "Overall" FROM table_74850 WHERE "Pick #" = '14' | wikisql |
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 cost (
costid num... | what are the specimen tests top five most frequently ordered during this year? | SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE DATETIME(microlab.culturetakentime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_317 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | Where is longview high school | SELECT "Hometown" FROM table_317 WHERE "School" = 'Longview High School' | wikisql |
CREATE TABLE table_52162 (
"Year" real,
"Name" text,
"Western States" text,
"Vermont" text,
"Leadville" text,
"Wasatch" text,
"Total time" text
) | What Wasatch time corresponds to a total time of 122:13:40? | SELECT "Wasatch" FROM table_52162 WHERE "Total time" = '122:13:40' | wikisql |
CREATE TABLE table_name_46 (
score VARCHAR,
goal VARCHAR
) | What is the score of the game with 4 goals? | SELECT score FROM table_name_46 WHERE goal = 4 | sql_create_context |
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... | 根据科室编码和入院诊断疾病编码的不同看看医院8056118全部诊疗记录中大病支付和全部医疗费用的比值最小有多少 | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '8056118' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD | css |
CREATE TABLE table_38229 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | What is the date for the grass surface final against Nathan Healey? | SELECT "Date" FROM table_38229 WHERE "Surface" = 'grass' AND "Opponent in the final" = 'nathan healey' | wikisql |
CREATE TABLE table_37362 (
"Year" text,
"Played" real,
"Wins" real,
"Losses" real,
"No Result" real,
"% Win" text
) | WHAT kind of No Result has Wins smaller than 2, and Losses larger than 1? | SELECT "No Result" FROM table_37362 WHERE "Wins" < '2' AND "Losses" > '1' | wikisql |
CREATE TABLE table_name_51 (
opponent VARCHAR,
score VARCHAR,
tournament VARCHAR,
surface VARCHAR,
outcome VARCHAR
) | Which opponent has a Surface of clay, an Outcome of winner, a Tournament of bogot , and a Score of 6 0, 6 4? | SELECT opponent FROM table_name_51 WHERE surface = "clay" AND outcome = "winner" AND tournament = "bogotá" AND score = "6–0, 6–4" | sql_create_context |
CREATE TABLE table_34695 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | On what date was the attendance 24,976? | SELECT "Date" FROM table_34695 WHERE "Attendance" = '24,976' | wikisql |
CREATE TABLE table_5311 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text
) | What party was re-elected as an incumbent of robert p. Kennedy? | SELECT "Party" FROM table_5311 WHERE "Result" = 're-elected' AND "Incumbent" = 'robert p. kennedy' | wikisql |
CREATE TABLE table_45725 (
"Year" real,
"Category" text,
"President" text,
"Nominee" text,
"Film" text,
"Result" text
) | What is the film that Raymond Massey was nominated for? | SELECT "Film" FROM table_45725 WHERE "Nominee" = 'raymond massey' | wikisql |
CREATE TABLE gwyjzb (
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,
... | 列出在医院4562632患者73880776的某次出院诊断结果是什么,其中出院诊断医生姓魏? | SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '73880776' AND gwyjzb.MED_SER_ORG_NO = '4562632' AND gwyjzb.OUT_DIAG_DOC_NM LIKE '魏%' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '73880776' AND fgwyjzb.MED_SER_ORG_NO = '4... | css |
CREATE TABLE table_77210 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Who is the player with a 75-68-70=213 score? | SELECT "Player" FROM table_77210 WHERE "Score" = '75-68-70=213' | wikisql |
CREATE TABLE table_204_628 (
id number,
"trial number" text,
"date" text,
"name of trial" text,
"celebrity/ies taking part" text,
"winner/number of stars" text,
"notes" text
) | who won the trial before phina ? | SELECT "winner/number of stars" FROM table_204_628 WHERE "date" < (SELECT "date" FROM table_204_628 WHERE "winner/number of stars" = 'phina') ORDER BY "date" DESC LIMIT 1 | squall |
CREATE TABLE table_65313 (
"Pick" real,
"Team" text,
"Player" text,
"Position" text,
"College" text
) | Which college has their team as the New York Jets? | SELECT "College" FROM table_65313 WHERE "Team" = 'new york jets' | wikisql |
CREATE TABLE table_name_54 (
class VARCHAR,
call_sign VARCHAR,
erp_w VARCHAR,
frequency_mhz VARCHAR
) | Which Class has a ERP W larger than 205, and a Frequency MHz smaller than 93.9, and a Call sign of k210cb? | SELECT class FROM table_name_54 WHERE erp_w > 205 AND frequency_mhz < 93.9 AND call_sign = "k210cb" | sql_create_context |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as ... | What grades did I get in class from Prof. Bookstein ? | SELECT DISTINCT student_record.grade FROM student_record INNER JOIN offering_instructor ON student_record.offering_id = offering_instructor.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE LOWER(instructor.name) LIKE '%Bookstein%' AND student_record.student_id = 1 | advising |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean... | JanitorTags: tagged linux and with a Linux distro - research. | SELECT * FROM Tags JOIN Posts ON Posts.Id = Tags.WikiPostId OR Posts.Id = Tags.ExcerptPostId WHERE Tags.TagName LIKE '%linux%' OR Posts.Body LIKE '%linux%' | sede |
CREATE TABLE table_23162 (
"Year" text,
"Number of Candidates" real,
"Total votes" real,
"Average voters per candidate" real,
"Percentage of vote" text,
"Saved deposits" real,
"Change (percentage points)" text,
"Number of MPs" real
) | How many candidates were there in the year of 1987? | SELECT "Number of Candidates" FROM table_23162 WHERE "Year" = '1987' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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_diag... | is there any microbiology test history for patient 71558's viral culture: r/o cytomegalovirus since 10/2102? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 71558) AND microbiologyevents.spec_type_desc = 'viral culture: r/o cytomegalovirus' AND STRFTIME('%y-%m', microbiologyevents.charttime) >= '2102-10' | mimic_iii |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, and display by the mean employee id from high to low. | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_42777 (
"Name" text,
"Appointed" real,
"Term expiration" real,
"Appointing Governor" text,
"Law School Attended" text
) | Who attended Columbia law school and was appointed in 2004? | SELECT "Name" FROM table_42777 WHERE "Law School Attended" = 'columbia law school' AND "Appointed" = '2004' | wikisql |
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,
... | 编号为97657668的病患的医疗记录中药品消费不低于9132.88元的医疗就诊编号是啥 | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '97657668' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 9132.88) | css |
CREATE TABLE table_name_56 (
city_of_license VARCHAR,
age_watt VARCHAR
) | Name the city of license which has age Watt of 160 watts | SELECT city_of_license FROM table_name_56 WHERE age_watt = "160 watts" | sql_create_context |
CREATE TABLE table_name_95 (
winning_driver VARCHAR,
constructor VARCHAR,
race_name VARCHAR
) | What driver won in the xv grand prix de l'albigeois in a vehicle by ferrari? | SELECT winning_driver FROM table_name_95 WHERE constructor = "ferrari" AND race_name = "xv grand prix de l'albigeois" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | how many time did patient 006-124193 get a pao2 test in this month? | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-124193')) AND lab.labname = 'pao2' AND DATETIME(lab.labresulttime, 'start of month') = D... | eicu |
CREATE TABLE table_48773 (
"Block" real,
"Episode Title" text,
"Director" text,
"Writer" text,
"Producer" text,
"Code" text
) | Who was the writer that the director was Alice Troughton and the producer was Phil Collinson? | SELECT "Writer" FROM table_48773 WHERE "Producer" = 'phil collinson' AND "Director" = 'alice troughton' | wikisql |
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,
... | 医疗记录中岁数低于8岁的患者,统计其平均看病费总额一共是多少? | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE < 8) | css |
CREATE TABLE table_2380212_1 (
avg_attendance INTEGER,
regular_season VARCHAR
) | How many people saw the 3rd, Central regular season on average? | SELECT MIN(avg_attendance) FROM table_2380212_1 WHERE regular_season = "3rd, Central" | sql_create_context |
CREATE TABLE table_37076 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Total has a Nation of japan (jpn), and a Silver smaller than 1? | SELECT AVG("Total") FROM table_37076 WHERE "Nation" = 'japan (jpn)' AND "Silver" < '1' | wikisql |
CREATE TABLE table_10798 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the smallest crowd number for a team that has an Away team score of 15.11 (101)? | SELECT MIN("Crowd") FROM table_10798 WHERE "Away team score" = '15.11 (101)' | wikisql |
CREATE TABLE table_73048 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text
) | When danilo di luca is the winner who is the general classification? | SELECT "General classification" FROM table_73048 WHERE "Winner" = 'Danilo Di Luca' | wikisql |
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,
... | what is drug name and drug dose of subject name betty campbell? | SELECT prescriptions.drug, prescriptions.drug_dose FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Betty Campbell" | mimicsql_data |
CREATE TABLE table_29778616_1 (
intro_date VARCHAR,
price VARCHAR
) | How many intro dates have the price of 686 ? | SELECT COUNT(intro_date) FROM table_29778616_1 WHERE price = "686€" | sql_create_context |
CREATE TABLE table_name_36 (
class VARCHAR,
quantity_made VARCHAR,
fleet_number_s_ VARCHAR
) | What class had 1 made and fleet number of 406? | SELECT class FROM table_name_36 WHERE quantity_made = "1" AND fleet_number_s_ = "406" | sql_create_context |
CREATE TABLE table_25005714_3 (
bus_type VARCHAR,
texture___gt__s_ VARCHAR
) | What is every bus type for the texture of fillrate? | SELECT bus_type FROM table_25005714_3 WHERE texture___gt__s_ = "Fillrate" | sql_create_context |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airline (
airline_code... | OAKLAND 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 = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILAD... | atis |
CREATE TABLE table_45356 (
"Team" text,
"Tries for" text,
"Tries against" text,
"Try diff" text,
"Points for" text,
"Points against" text,
"Points diff" text
) | What is Team, when Tries Against is 8? | SELECT "Team" FROM table_45356 WHERE "Tries against" = '8' | wikisql |
CREATE TABLE table_13334 (
"Season" text,
"Rounds" real,
"Champion" text,
"Most tries" text,
"Player of the Year" text
) | What are the rounds for champion New Zealand (130 points)? | SELECT AVG("Rounds") FROM table_13334 WHERE "Champion" = 'new zealand (130 points)' | wikisql |
CREATE TABLE table_67556 (
"Builder" text,
"Construct- tion no." real,
"Date ordered" text,
"Wheel arrange- ment" text,
"s Cylinder" text,
"Engine weight" text,
"TC&StL no. (1883\u201384)" real
) | Who built the order on November 1881 of more than 54 TC&StL no. (1883 84)? | SELECT "Builder" FROM table_67556 WHERE "TC&StL no. (1883\u201384)" > '54' AND "Date ordered" = 'november 1881' | wikisql |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varch... | earliest flight 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 table_name_58 (
country VARCHAR,
score VARCHAR
) | What is the Country of the Player with a Score of 73-71-76-70=290? | SELECT country FROM table_name_58 WHERE score = 73 - 71 - 76 - 70 = 290 | sql_create_context |
CREATE TABLE table_76996 (
"Date" text,
"Opponents" text,
"H / A" text,
"Result F \u2013 A" text,
"Attendance" real
) | When did Manchester United play against Bristol City with an H/A of A? | SELECT "Date" FROM table_76996 WHERE "H / A" = 'a' AND "Opponents" = 'bristol city' | wikisql |
CREATE TABLE table_name_56 (
vessel_name VARCHAR,
built VARCHAR,
class VARCHAR,
flag VARCHAR,
type VARCHAR
) | What is the name of the Malta vessel built after 2010 that is a GL class Panamax vessel? | SELECT vessel_name FROM table_name_56 WHERE flag = "malta" AND type = "panamax" AND class = "gl" AND built > 2010 | sql_create_context |
CREATE TABLE table_76237 (
"Season" text,
"Appearance" real,
"Tries" real,
"Goals" real,
"Points" real
) | How many times is tries 0 and appearance less than 0? | SELECT COUNT("Points") FROM table_76237 WHERE "Tries" = '0' AND "Appearance" < '0' | wikisql |
CREATE TABLE table_29954 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many high assists where there for the team of caja laboral? | SELECT COUNT("High assists") FROM table_29954 WHERE "Team" = 'Caja Laboral' | wikisql |
CREATE TABLE table_name_35 (
losses VARCHAR,
place VARCHAR,
ties VARCHAR
) | Name the total losses for 4 place and ties less than 0 | SELECT COUNT(losses) FROM table_name_35 WHERE place = 4 AND ties < 0 | sql_create_context |
CREATE TABLE table_72068 (
"Player" text,
"No." text,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
) | How many schools did player number 3 play at? | SELECT COUNT("School/Club Team") FROM table_72068 WHERE "No." = '3' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.