context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREAT... | Show all destinations and the number of flights to each destination by a bar chart, rank in desc by the total number. | SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_2102714_1 (
episode VARCHAR,
run_time VARCHAR
) | What episode had a run time of 24:53? | SELECT episode FROM table_2102714_1 WHERE run_time = "24:53" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | count the number of patients admitted before 2184 who had other transplant of liver. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2184" AND procedures.long_title = "Other transplant of liver" | mimicsql_data |
CREATE TABLE table_44337 (
"Team" text,
"Tries for" text,
"Tries against" text,
"Try diff" text,
"Points for" text,
"Points against" text,
"Points diff" text
) | What is the Tries against for the team that has 207 points for? | SELECT "Tries against" FROM table_44337 WHERE "Points for" = '207' | wikisql |
CREATE TABLE table_49805 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is the sum of November, when Game is '17'? | SELECT SUM("November") FROM table_49805 WHERE "Game" = '17' | wikisql |
CREATE TABLE table_name_16 (
goals INTEGER,
date VARCHAR
) | What is the sum of the goals on 2007-06-16? | SELECT SUM(goals) FROM table_name_16 WHERE date = "2007-06-16" | sql_create_context |
CREATE TABLE table_18328 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | When was Stephen J. Solarz first elected? | SELECT MIN("First elected") FROM table_18328 WHERE "Incumbent" = 'Stephen J. Solarz' | wikisql |
CREATE TABLE table_name_30 (
took_office VARCHAR,
party VARCHAR,
name VARCHAR
) | Which Took Office that has a Party of democrat, under the name of John Hancock | SELECT took_office FROM table_name_30 WHERE party = "democrat" AND name = "john hancock" | sql_create_context |
CREATE TABLE table_name_80 (
works_number VARCHAR,
name VARCHAR
) | What is the work number for Victor? | SELECT works_number FROM table_name_80 WHERE name = "victor" | sql_create_context |
CREATE TABLE table_72887 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the total number of score for staples center 13,266 | SELECT COUNT("Score") FROM table_72887 WHERE "Location Attendance" = 'Staples Center 13,266' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutpu... | has patient 033-9204 ever had a respiration of greater than 10.0 on last month/26? | 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 = '033-9204')) AND vitalperiodic.respiration > 10.0 AND NOT vitalperiod... | eicu |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar... | I 'm trying to find out if CLCIV 499 has morning classes ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'CLCIV' AND course.number = 499 AND semester.semester = 'WN' AND semester.semester_id = course_of... | advising |
CREATE TABLE table_43221 (
"Year" real,
"Gross domestic product" real,
"US dollar exchange" text,
"Nominal per-capita GDP (as % of USA)" real,
"PPP capita GDP (as % of USA)" text
) | How many years did the USD Exchange have 225.82 and a gross domestic product larger than 240,707,315? | SELECT COUNT("Year") FROM table_43221 WHERE "US dollar exchange" = '¥225.82' AND "Gross domestic product" > '240,707,315' | wikisql |
CREATE TABLE table_204_49 (
id number,
"city" text,
"country" text,
"iata" text,
"icao" text,
"airport" text,
"commenced" number,
"ended" text
) | which one is last on the chart | SELECT "city" FROM table_204_49 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_39938 (
"singular" text,
"singular gender" text,
"plural" text,
"plural gender" text,
"meaning" text
) | What is the plural if the meaning is python and the plural gender is n? | SELECT "plural" FROM table_39938 WHERE "plural gender" = 'n' AND "meaning" = 'python' | wikisql |
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... | 从2004年1月24日至2010年9月24日至内患者88197061医保的个人账户一共支出是多少钱? | SELECT SUM(PER_ACC_PAY) FROM t_kc24 WHERE PERSON_ID = '88197061' AND CLINIC_SLT_DATE BETWEEN '2004-01-24' AND '2010-09-24' | css |
CREATE TABLE table_68524 (
"Season" text,
"League" text,
"Winner" text,
"Goals" real,
"Assists" real,
"Points" real
) | In what Season were there 86 Assists in the WCJHL League? | SELECT "Season" FROM table_68524 WHERE "League" = 'wcjhl' AND "Assists" = '86' | 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,
... | give me the number of patients whose primary disease is aortic insufficiency\re-do sternotomy; aortic valve replacement and admission year is less than 2198? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.admityear < "2198" | mimicsql_data |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org... | how many patients until 2103 had nutren pulmonary intake? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'nutren pulmonary' A... | mimic_iii |
CREATE TABLE table_name_23 (
score VARCHAR,
surface VARCHAR,
date VARCHAR
) | What was the score of the game played on a clay surface on June 6, 2005? | SELECT score FROM table_name_23 WHERE surface = "clay" AND date = "june 6, 2005" | sql_create_context |
CREATE TABLE table_name_84 (
name VARCHAR,
date VARCHAR,
sunk_by VARCHAR
) | What is the name of the ship sunk by U-305 on 17 March 1943? | SELECT name FROM table_name_84 WHERE date = "17 march 1943" AND sunk_by = "u-305" | sql_create_context |
CREATE TABLE table_name_39 (
electorate VARCHAR,
member VARCHAR,
party VARCHAR,
state VARCHAR
) | What is Electorate, when Party is 'Country', when State is 'WA', and when Member is 'John Hallett'? | SELECT electorate FROM table_name_39 WHERE party = "country" AND state = "wa" AND member = "john hallett" | 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... | how many patients were admitted in the emergency room and tested for hemoglobin in lab? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND lab.label = "Hemoglobin" | mimicsql_data |
CREATE TABLE table_name_27 (
years VARCHAR,
roll VARCHAR,
decile VARCHAR
) | Name the Years of schools with a Roll Larger than 23 and a Decile greater than 5. | SELECT years FROM table_name_27 WHERE roll > 23 AND decile > 5 | sql_create_context |
CREATE TABLE table_18868 (
"District" text,
"2010 Population (000)" real,
"2008 GDP (USD bn) a" text,
"2008 GDP per capita (USD) a" real,
"Agri culture b" text,
"Mining b" text,
"Manufac turing b" text,
"Services & cons truction b" text,
"Exports (USD mn) 2011" real,
"Median mo. ... | What was head count in 2010 where the farm production is 6.9? | SELECT MAX("2010 Population (000)") FROM table_18868 WHERE "Agri culture b" = '6.9' | wikisql |
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... | what were the five most commonly given diagnoses for patients who had been previously diagnosed with liver ca - hepatocellular ca during the same hospital encounter? | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'liver... | eicu |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_date DATETIME,
order_status_code VARCHAR(15)
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
order_quantity VARCHAR(80)
)
CREATE TABLE Customers (
customer_id INTEG... | Show the number of products with price higher than 1000 or lower than 500 for each product type code in a pie chart. | SELECT product_type_code, COUNT(product_type_code) FROM Products WHERE product_price > 1000 OR product_price < 500 GROUP BY product_type_code | nvbench |
CREATE TABLE table_69130 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Intergiro classification" text,
"Trofeo Fast Team" text
) | Name trofeo fast team with young rider classification of francesco casagrande and stage of 10 | SELECT "Trofeo Fast Team" FROM table_69130 WHERE "Young rider classification" = 'francesco casagrande' AND "Stage" = '10' | wikisql |
CREATE TABLE table_name_89 (
rank INTEGER,
taijiquan VARCHAR,
total VARCHAR
) | What is the lowest rank of the athlete with a taijiquan greater than 9.42 and a 19.02 total? | SELECT MIN(rank) FROM table_name_89 WHERE taijiquan > 9.42 AND total = 19.02 | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | calculate the average age of widow patients who had office admission. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.admission_location = "CLINIC REFERRAL/PREMATURE" | mimicsql_data |
CREATE TABLE table_50795 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" text
) | What is the number of points for the 7th placed song with a draw greater than 8? | SELECT MIN("Points") FROM table_50795 WHERE "Place" = '7th' AND "Draw" > '8' | wikisql |
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... | tell me the total amount that patient 032-8005 had received on the first icu visit? | 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 = '032-8005') AND NOT patient.unitdischargetime IS ... | eicu |
CREATE TABLE table_25380472_2 (
game_site VARCHAR,
team_record VARCHAR
) | What game sites are where the team record is 1 6? | SELECT game_site FROM table_25380472_2 WHERE team_record = "1–6" | sql_create_context |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course (
c... | What PreMajor classes are available next Winter ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... | advising |
CREATE TABLE table_name_40 (
host VARCHAR,
city VARCHAR
) | Which host university is based in Missoula? | SELECT host FROM table_name_40 WHERE city = "missoula" | 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... | how many patients are primarily diagnosed for s/p hanging and died in or before 2126? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P HANGING" AND demographic.dod_year <= "2126.0" | mimicsql_data |
CREATE TABLE table_1973321_5 (
new_points INTEGER,
player VARCHAR
) | Name the least new points for steffi graf | SELECT MIN(new_points) FROM table_1973321_5 WHERE player = "Steffi Graf" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 何阳夏患者的检验报告单对应的检验结果指标均异常有哪些?列出异常的检验报告单号都是哪些? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '何... | css |
CREATE TABLE table_23274 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many different pairs of candidates were there for the district first elected in 1988? | SELECT COUNT("Candidates") FROM table_23274 WHERE "First elected" = '1988' | wikisql |
CREATE TABLE table_1866 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What is the original air date in series 360? | SELECT COUNT("Original air date") FROM table_1866 WHERE "No. in series" = '360' | wikisql |
CREATE TABLE table_name_63 (
year INTEGER,
team VARCHAR,
player VARCHAR
) | What most recent year had North Melbourne as a team and Hamish Mcintosh as a player? | SELECT MAX(year) FROM table_name_63 WHERE team = "north melbourne" AND player = "hamish mcintosh" | sql_create_context |
CREATE TABLE table_name_8 (
state_territory VARCHAR,
winning_driver VARCHAR,
round VARCHAR
) | What is the state the winning driver Jamie Whincup from in round 2? | SELECT state_territory FROM table_name_8 WHERE winning_driver = "jamie whincup" AND round = 2 | sql_create_context |
CREATE TABLE table_name_51 (
chassis VARCHAR,
drivers VARCHAR
) | What chassis doe Ross Davis use? | SELECT chassis FROM table_name_51 WHERE drivers = "ross davis" | sql_create_context |
CREATE TABLE table_36300 (
"Distribution" text,
"x86-64" text,
"ia64" text,
"ppc64" text,
"sparc32" text,
"hppa" text,
"mips" text,
"s390" text,
"s390x" text,
"alpha" text,
"m68k" text
) | Which Alpha contains ia64 with discontinued 3.5-3.8 4.1-4.7? | SELECT "alpha" FROM table_36300 WHERE "ia64" = 'discontinued 3.5-3.8 4.1-4.7' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE i... | how many hours have passed since the admission of patient 17667 to the hospital? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 17667 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_11441 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text
) | What is the Right Ascension with a Diffuse Nebula Object Type has a 42 30 Declination and a NGC less than 6995? | SELECT "Right ascension ( J2000 )" FROM table_11441 WHERE "NGC number" < '6995' AND "Object type" = 'diffuse nebula' AND "Declination ( J2000 )" = '°42′30″' | wikisql |
CREATE TABLE table_2255 (
"Barangay" text,
"Location" text,
"Classification" text,
"Population (May, 2000)" real,
"Population (May, 2010)" real
) | What was the population in May of 2000 when In may 2010 it was 2262? | SELECT MIN("Population (May, 2000)") FROM table_2255 WHERE "Population (May, 2010)" = '2262' | wikisql |
CREATE TABLE table_name_56 (
date VARCHAR,
circuit VARCHAR
) | The Eastern Creek Raceway circuit is on what date? | SELECT date FROM table_name_56 WHERE circuit = "eastern creek raceway" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and manufacturer , and group by attribute headquarter. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name | nvbench |
CREATE TABLE table_name_84 (
player VARCHAR,
s_wicket VARCHAR
) | Which player has a s wicket at 48? | SELECT player FROM table_name_84 WHERE s_wicket = "48" | sql_create_context |
CREATE TABLE table_31818 (
"Week" real,
"Date" text,
"Opponent" text,
"Time ( ET )" text,
"Game Site" text,
"Final Score" text
) | What date is the 1:00 pm game at arrowhead stadium? | SELECT "Date" FROM table_31818 WHERE "Time ( ET )" = '1:00 pm' AND "Game Site" = 'arrowhead stadium' | wikisql |
CREATE TABLE table_14855 (
"Game" real,
"Date" text,
"Score" text,
"Location" text,
"Time" text,
"Attendance" real
) | Name the attendance for time of 1:31 | SELECT "Attendance" FROM table_14855 WHERE "Time" = '1:31' | wikisql |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
) | Compare the total number of captains with different classes using a bar graph, and order from high to low by the the number of class. | SELECT Class, COUNT(Class) FROM captain GROUP BY Class ORDER BY COUNT(Class) DESC | nvbench |
CREATE TABLE table_56882 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | Name the circuit for italian grand prix | SELECT "Circuit" FROM table_56882 WHERE "Race" = 'italian grand prix' | wikisql |
CREATE TABLE table_204_109 (
id number,
"district" text,
"incumbent" text,
"party" text,
"first\nelected" text,
"result" text,
"candidates" text
) | how many candidates were there for virginia 17 district ? | SELECT "candidates" FROM table_204_109 WHERE "district" = 'virginia 17' | squall |
CREATE TABLE table_22532 (
"Ethnic Group" text,
"2001 (%)" text,
"2001 (people)" text,
"2006 (%)" text,
"2006 (people)" real
) | How many percentages were recorded under 2006 when in 2001 was 14.6%? | SELECT COUNT("2006 (%)") FROM table_22532 WHERE "2001 (%)" = '14.6' | wikisql |
CREATE TABLE table_name_22 (
week INTEGER,
result VARCHAR
) | On what Week was the Result W 34 24? | SELECT AVG(week) FROM table_name_22 WHERE result = "w 34–24" | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructo... | Is the only person who teaches Engr Prop Soil , Prof. Huffman ? | SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Engr Prop Soil%' AND NOT instructor.name LIKE '%Huffman%' AND offering_instructor.instructor_id = instruc... | advising |
CREATE TABLE table_name_76 (
outcome VARCHAR,
date VARCHAR
) | Name the outcome for 6 march 2000 | SELECT outcome FROM table_name_76 WHERE date = "6 march 2000" | sql_create_context |
CREATE TABLE table_59917 (
"7:00 am" text,
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"4:00 pm" text,
"5:00 pm" text,
"6:30 pm" ... | What is on at 7:00am, when the 1:00 is just local programs? | SELECT "7:00 am" FROM table_59917 WHERE "1:00 pm" = 'local programs' | wikisql |
CREATE TABLE table_48118 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text
) | Which January has an Opponent of toronto maple leafs? | SELECT "January" FROM table_48118 WHERE "Opponent" = 'toronto maple leafs' | wikisql |
CREATE TABLE table_55742 (
"Rank" real,
"Name" text,
"Location" text,
"Country" text,
"Designer, Year" text
) | Where was the location with Muirfield in Scotland? | SELECT "Location" FROM table_55742 WHERE "Country" = 'scotland' AND "Name" = 'muirfield' | wikisql |
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... | 看看编号为3026245的医院在一二年八月十二日到二零年六月十六日的这段时间里,有多少医疗费总额在82.99元以下的科室 | SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '3026245' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-08-12' AND '2020-06-16' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 82.99 UNION SELECT fgwyjzb.ME... | css |
CREATE TABLE table_23285805_6 (
high_rebounds VARCHAR,
game VARCHAR
) | Who has the most rebounds for game 42? | SELECT high_rebounds FROM table_23285805_6 WHERE game = 42 | sql_create_context |
CREATE TABLE table_name_77 (
max_aperture VARCHAR,
focal_length VARCHAR
) | What is the maximum aperture of the lens(es) with a focal length of 20mm? | SELECT max_aperture FROM table_name_77 WHERE focal_length = "20mm" | sql_create_context |
CREATE TABLE table_31781 (
"Nomination" text,
"Actor's Name" text,
"Film Name" text,
"Director" text,
"Country" text
) | Tell me the actors name for barhanov and his bodyguard | SELECT "Actor's Name" FROM table_31781 WHERE "Film Name" = 'barhanov and his bodyguard' | wikisql |
CREATE TABLE table_74292 (
"Player" text,
"Starts" real,
"Cuts made" real,
"Best finish" text,
"Money list rank" real,
"Earnings (\u20ac)" real
) | How many cuts did the player who earned 210408 Euro make? | SELECT "Cuts made" FROM table_74292 WHERE "Earnings (\u20ac)" = '210408' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org... | how much fluocinonide 0.05% ointment is it? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'fluocinonide 0.05% ointment') | mimic_iii |
CREATE TABLE table_name_18 (
elected VARCHAR,
incumbent VARCHAR
) | What is the 2008 Candidates Elected before 1994 with Incumbent Jim McDermott? | SELECT 2008 AS _candidates FROM table_name_18 WHERE elected < 1994 AND incumbent = "jim mcdermott" | sql_create_context |
CREATE TABLE table_name_18 (
october VARCHAR,
game VARCHAR,
points VARCHAR
) | What day in october was game number 4 with under 3 points? | SELECT COUNT(october) FROM table_name_18 WHERE game = 4 AND points < 3 | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
... | 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 last_name and manager_id , order X from low to high order. | SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME | nvbench |
CREATE TABLE table_2639433_4 (
market_share__overall_ VARCHAR,
viewers__in_millions_overall_ VARCHAR
) | If the overall viewers were 1.83 millions, what was the overall market share? | SELECT market_share__overall_ FROM table_2639433_4 WHERE viewers__in_millions_overall_ = "1.83" | sql_create_context |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE... | what is the cheapest one way flight from ATLANTA to BOSTON | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city... | atis |
CREATE TABLE table_name_54 (
points INTEGER,
driver VARCHAR
) | What is the average points that the driver Ryan Hunter-Reay has? | SELECT AVG(points) FROM table_name_54 WHERE driver = "ryan hunter-reay" | sql_create_context |
CREATE TABLE table_50100 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Grizzlies" text,
"School/Club Team" text
) | What is the position of Tayshaun Prince? | SELECT "Position" FROM table_50100 WHERE "Player" = 'tayshaun prince' | wikisql |
CREATE TABLE table_name_16 (
score VARCHAR,
tie_no VARCHAR
) | What was the score in Tie number 16? | SELECT score FROM table_name_16 WHERE tie_no = "16" | sql_create_context |
CREATE TABLE table_name_25 (
driver VARCHAR,
entrant VARCHAR,
rounds VARCHAR
) | Which Driver has an Entrant of Arrows Racing Team and Rounds 1-3? | SELECT driver FROM table_name_25 WHERE entrant = "arrows racing team" AND rounds = "1-3" | sql_create_context |
CREATE TABLE table_14352 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | Name the most week for record of 1-2 and attendance more than 61,602 | SELECT MAX("Week") FROM table_14352 WHERE "Record" = '1-2' AND "Attendance" > '61,602' | wikisql |
CREATE TABLE table_name_66 (
away_team VARCHAR,
home_team VARCHAR
) | Which away team played against the home team of St Kilda? | SELECT away_team FROM table_name_66 WHERE home_team = "st kilda" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)... | how many patients have been discharged from hospital. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_train_240 (
"id" int,
"anemia" bool,
"gender" string,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"estimated_glomerular_filtration_rate_egfr" int,
"diastolic_blood_pressure_dbp" int,
"insulin_requirement" float,
"kidney_disease" bool,
"body... | uncontrolled arterial hypertension ( resting diastolic blood pressure > 90 mmhg and / or systolic blood pressure > 160 mmhg ) at the time of screening | SELECT * FROM table_train_240 WHERE hypertension = 1 OR (diastolic_blood_pressure_dbp > 90 OR systolic_blood_pressure_sbp > 160) | criteria2sql |
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,
... | get me the number of patients on additive type drug prescription who have diagnoses icd9 code 45981. | 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 = "45981" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_name_53 (
leading_scorer VARCHAR,
home VARCHAR,
visitor VARCHAR
) | Who was the leading scorer of the game where the Knicks were the home team and the Warriors were the visiting team? | SELECT leading_scorer FROM table_name_53 WHERE home = "knicks" AND visitor = "warriors" | sql_create_context |
CREATE TABLE table_23819979_3 (
last_match VARCHAR,
final_place VARCHAR
) | Name the last match for argentina - estadio jos mar a minella | SELECT last_match FROM table_23819979_3 WHERE final_place = "Argentina - Estadio José María Minella" | sql_create_context |
CREATE TABLE table_75917 (
"Name" text,
"Height" text,
"Position" text,
"Year" text,
"Home Town" text
) | How tall is the freshman guard Cetera Degraffenreid? | SELECT "Height" FROM table_75917 WHERE "Position" = 'guard' AND "Year" = 'freshman' AND "Name" = 'cetera degraffenreid' | wikisql |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | do you have a UA flight from DALLAS 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | atis |
CREATE TABLE table_name_67 (
grid VARCHAR,
time VARCHAR
) | What is the grid with a +0.180 time? | SELECT grid FROM table_name_67 WHERE time = "+0.180" | sql_create_context |
CREATE TABLE table_1206114_2 (
comments VARCHAR,
vendor_and_type VARCHAR
) | What are the comments when the vendor and type is alcatel-lucent routers? | SELECT comments FROM table_1206114_2 WHERE vendor_and_type = "Alcatel-Lucent routers" | sql_create_context |
CREATE TABLE table_name_5 (
location_attendance VARCHAR,
game VARCHAR,
date VARCHAR
) | How many attended the game on march 16 after over 64 games? | SELECT location_attendance FROM table_name_5 WHERE game > 64 AND date = "march 16" | sql_create_context |
CREATE TABLE player (
player_id text,
birth_year text,
birth_month text,
birth_day text,
birth_country text,
birth_state text,
birth_city text,
death_year text,
death_month text,
death_day text,
death_country text,
death_state text,
death_city text,
name_first tex... | What are the minimum votes needed to enter hall of fame for each year since 1871? | SELECT MIN(votes), yearid FROM hall_of_fame WHERE inducted = "Y" AND yearid >= 1871 GROUP BY yearid | thehistoryofbaseball |
CREATE TABLE table_22883210_10 (
score VARCHAR,
record VARCHAR
) | Name the score for 49-31 | SELECT score FROM table_22883210_10 WHERE record = "49-31" | sql_create_context |
CREATE TABLE table_27494 (
"Season" real,
"Champion" text,
"Runner-up" text,
"Third Place" text,
"Top scorer" text,
"Best Player" text
) | Who is the best player in the 1998 season? | SELECT "Best Player" FROM table_27494 WHERE "Season" = '1998' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TAB... | since 2105, what was the yearly maximum value of the bedside glucose of patient 012-25893? | SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-25893')) AND lab.labname = 'bedside glucose' AND STRFTIME('%y', lab.labresultt... | eicu |
CREATE TABLE exhibition_record (
exhibition_id number,
date text,
attendance number
)
CREATE TABLE artist (
artist_id number,
name text,
country text,
year_join number,
age number
)
CREATE TABLE exhibition (
exhibition_id number,
year number,
theme text,
artist_id numbe... | What are the names of artist whose exhibitions draw over 200 attendees on average? | SELECT T3.name FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id JOIN artist AS T3 ON T3.artist_id = T2.artist_id GROUP BY T3.artist_id HAVING AVG(T1.attendance) > 200 | spider |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
ni... | do you have an afternoon flight leaving in the afternoon going from BOSTON to SAN FRANCISCO with a stopover in DALLAS | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CI... | atis |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | 查查医疗机构5666230使用次数top23的项目都是哪些项目 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '5666230' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 23 | css |
CREATE TABLE table_51354 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the highest crowd number for the home team Richmond? | SELECT MAX("Crowd") FROM table_51354 WHERE "Home team" = 'richmond' | wikisql |
CREATE TABLE player_coach (
player_id number,
coach_id number,
starting_year number
)
CREATE TABLE club (
club_id number,
club_name text,
region text,
start_year number
)
CREATE TABLE match_result (
rank number,
club_id number,
gold number,
big_silver number,
small_silv... | List the names of players in ascending order of votes. | SELECT player_name FROM player ORDER BY votes | spider |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age te... | had patient 010-25029 had the urine output on the first intensive care unit visit? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-25029') AND NOT patient.unitdischargetime IS NULL ORDER BY patient... | eicu |
CREATE TABLE table_name_75 (
country VARCHAR,
total INTEGER
) | Which Country has a Total smaller than 284? | SELECT country FROM table_name_75 WHERE total < 284 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.