context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_32227 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | What was the overall pick for the player who was a guard and had a round less than 9? | SELECT AVG("Overall") FROM table_32227 WHERE "Position" = 'guard' AND "Round" < '9' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | how was patient 004-32341 admitted to the hospital since 2 years ago for the first time? | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '004-32341' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_77189 (
"Model number" text,
"Frequency" text,
"L2 cache" text,
"Mult." text,
"Voltage" text,
"Socket" text,
"Release date" text
) | Which model has a frequency of 750 mhz and a socket of bga2 pga2? | SELECT "Model number" FROM table_77189 WHERE "Frequency" = '750 mhz' AND "Socket" = 'bga2μpga2' | wikisql |
CREATE TABLE table_33151 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the listed crowd at junction oval? | SELECT "Crowd" FROM table_33151 WHERE "Venue" = 'junction oval' | wikisql |
CREATE TABLE table_name_38 (
opponent VARCHAR,
score VARCHAR
) | What team was the opponent when there was a score of 5 4 (11)? | SELECT opponent FROM table_name_38 WHERE score = "5–4 (11)" | sql_create_context |
CREATE TABLE table_name_8 (
date VARCHAR,
high_points VARCHAR,
record VARCHAR
) | On what date did the Suns have high points with a record of 33 13? | SELECT date FROM table_name_8 WHERE high_points = "suns" AND record = "33–13" | sql_create_context |
CREATE TABLE table_203_98 (
id number,
"title" text,
"year" number,
"director" text,
"budget" text,
"gross (worldwide)" text,
"notes" text
) | how many films were there in 1990 ? | SELECT COUNT("title") FROM table_203_98 WHERE "year" = 1990 | squall |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 41736838这位患者的妊娠相关性血浆蛋白-A指标在08年4月18日至10月22日期间的情况 | SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE prereq (
course_id text,
prereq_id text
)
CREATE TABLE student (
id text,
name text,
dept_name text,
tot_cred number
)
CREATE TABLE department (
dept_name text,
building text,
budget number
)
CREATE TABLE time_slot (
time_slot_id text,
day text,
start_hr n... | Find the names of the top 3 departments that provide the largest amount of courses? | SELECT dept_name FROM course GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 3 | spider |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | what flights from ST. PAUL to KANSAS CITY on friday with supper served | 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, date_day, days, flight, food_service WHERE ((date_day.day_number = 25 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.... | atis |
CREATE TABLE table_204_204 (
id number,
"rank" number,
"heat" number,
"country" text,
"cyclists" text,
"result" number,
"notes" text
) | name the team that finished directly after josiah ng 's . | SELECT "country" FROM table_204_204 WHERE "rank" = (SELECT "rank" FROM table_204_204 WHERE "cyclists" = 'josiah ng') + 1 | squall |
CREATE TABLE table_name_2 (
district VARCHAR,
incumbent VARCHAR,
first_elected VARCHAR,
result VARCHAR
) | Which District has a First elected of 1858, and a Result of retired republican gain, and an Incumbent of william millward? | SELECT district FROM table_name_2 WHERE first_elected = 1858 AND result = "retired republican gain" AND incumbent = "william millward" | sql_create_context |
CREATE TABLE table_72770 (
"School" text,
"Record" text,
"Conference" text,
"Conf. record" text,
"Regular season finish" text,
"Regular season second place" text
) | Which qualifying schools were in the Patriot conference? | SELECT "School" FROM table_72770 WHERE "Conference" = 'Patriot' | wikisql |
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 gsi (
course_offering_id int,
student_id int
)
CREATE TABLE cours... | 417 is taught in the Fall of 2006 in the afternoon ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time >= '12:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 417 AND semester.semester = 'Fall' AND semester.semester_id = course_offering.semester AND semester.year = 2006 | advising |
CREATE TABLE table_name_32 (
date VARCHAR,
score VARCHAR,
high_assists VARCHAR,
high_points VARCHAR
) | what is the date when ramon sessions (8) had the high assists, richard jefferson (29) had the high points and the score was w 107 78 (ot)? | SELECT date FROM table_name_32 WHERE high_assists = "ramon sessions (8)" AND high_points = "richard jefferson (29)" AND score = "w 107–78 (ot)" | sql_create_context |
CREATE TABLE table_33911 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | Which Date has a Home of minnesota? | SELECT "Date" FROM table_33911 WHERE "Home" = 'minnesota' | wikisql |
CREATE TABLE table_274 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | When did the episode with production code 410 air? | SELECT "Original air date" FROM table_274 WHERE "Production code" = '410' | wikisql |
CREATE TABLE table_203_118 (
id number,
"game" number,
"date" text,
"opponent" text,
"location" text,
"score" text,
"ot" text,
"attendance" number,
"record" text
) | did the anaheim storm win more home or away games ? | SELECT (SELECT COUNT(*) FROM table_203_118 WHERE "opponent" = 'home' AND "score" = 'w') > (SELECT COUNT(*) FROM table_203_118 WHERE "opponent" = 'away' AND "score" = 'w') | squall |
CREATE TABLE table_name_76 (
country VARCHAR,
score VARCHAR
) | Which Country has a Score of 69-66=135? | SELECT country FROM table_name_76 WHERE score = 69 - 66 = 135 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | count the number of patients whose age is less than 55 and days of hospital stay is greater than 4? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "55" AND demographic.days_stay > "4" | mimicsql_data |
CREATE TABLE table_19487922_2 (
championships INTEGER
) | What in the minimum number of championships won by a nation? | SELECT MIN(championships) FROM table_19487922_2 | sql_create_context |
CREATE TABLE table_name_7 (
diameter INTEGER,
name VARCHAR
) | What is dardanus sulcus' lowest diameter? | SELECT MIN(diameter) FROM table_name_7 WHERE name = "dardanus sulcus" | sql_create_context |
CREATE TABLE table_11006 (
"Country" text,
"Season" text,
"Club" text,
"League" text,
"Appearances" real,
"Goals" real
) | How many appearances with fc igea virtus and 1 goal? | SELECT AVG("Appearances") FROM table_11006 WHERE "Club" = 'fc igea virtus' AND "Goals" = '1' | wikisql |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0... | For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the sum of salary bin hire_date by time in a bar chart, I want to order by the y-axis in descending. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense... | Total votes on you by type of vote and type of post. | SELECT '##UserId##' AS "user_link", votetype.Name AS type, post.PostTypeId AS posttype, COUNT(*) AS count FROM VoteTypes AS votetype INNER JOIN Votes AS vote ON vote.VoteTypeId = votetype.Id INNER JOIN Posts AS post ON vote.PostId = post.Id AND post.OwnerUserId = '##UserId##' GROUP BY votetype.Name, post.PostTypeId | sede |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | For each bed type, find the average base price of different bed type Show bar chart, display in asc by the y axis. | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY AVG(basePrice) | nvbench |
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... | 施蕴秀这个团伙的成员最常去的医生排序情况是啥样的? | SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_NM = '施蕴秀' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC | css |
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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
... | when was the last time that patient 23237 was measured / taken a measurement of arterial bp [systolic] since 337 days ago? | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23237)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial... | mimic_iii |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | tell me the first value of creatinine in a lab test of patient 016-22566 during this month? | SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-22566')) AND lab.labname = 'creatinine' AND DATETIME(lab.labresulttime, 'start of m... | eicu |
CREATE TABLE table_name_7 (
date VARCHAR,
opponent_in_the_final VARCHAR
) | When did Mathieu play against Andrey Golubev? | SELECT date FROM table_name_7 WHERE opponent_in_the_final = "andrey golubev" | sql_create_context |
CREATE TABLE table_40162 (
"Locale" text,
"Skip" text,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot Pct." text
) | What is Madeleine Dupont's shot pct.? | SELECT "Shot Pct." FROM table_40162 WHERE "Skip" = 'madeleine dupont' | wikisql |
CREATE TABLE table_name_79 (
competition VARCHAR,
date VARCHAR
) | What was being played on Nov 23, 2006? | SELECT competition FROM table_name_79 WHERE date = "nov 23, 2006" | sql_create_context |
CREATE TABLE table_name_83 (
round VARCHAR,
h___a VARCHAR,
opponents VARCHAR
) | Rich round has an H/A of A and the opponent Sheffield United? | SELECT round FROM table_name_83 WHERE h___a = "a" AND opponents = "sheffield united" | sql_create_context |
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
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | when was patient 14054 last sputum microbiologic test during the last month? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14054) AND microbiologyevents.spec_type_desc = 'sputum' AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start ... | mimic_iii |
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 price , and group by attribute name, and show Y in asc order. | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Price | nvbench |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description... | what 's the airport at ORLANDO | SELECT DISTINCT airport.airport_code FROM airport, airport_service, city WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'ORLANDO' | atis |
CREATE TABLE table_40238 (
"Player" text,
"Position" text,
"GP (GS)" text,
"Minutes" real,
"Goals" real,
"Assists" real
) | What was the highest number of goals when 2428 minutes were played? | SELECT MAX("Goals") FROM table_40238 WHERE "Minutes" = '2428' | wikisql |
CREATE TABLE table_name_14 (
births__000s_ INTEGER,
total_fertility_rate VARCHAR,
natural_growth VARCHAR
) | What is the average birth rate that has a total fertility rate of na, and a natural growth smaller than 2.5? | SELECT AVG(births__000s_) FROM table_name_14 WHERE total_fertility_rate = "na" AND natural_growth < 2.5 | sql_create_context |
CREATE TABLE table_2602958_3 (
us_viewers__million_ VARCHAR,
no VARCHAR
) | How many viewers in millions for episode number 38? | SELECT us_viewers__million_ FROM table_2602958_3 WHERE no = 38 | sql_create_context |
CREATE TABLE table_name_29 (
wins VARCHAR,
rank VARCHAR,
college VARCHAR,
losses VARCHAR,
first_season VARCHAR
) | How many wins were there for Washington State College with losses greater than 980 and a first season before 1906 and rank greater than 42? | SELECT COUNT(wins) FROM table_name_29 WHERE losses > 980 AND first_season < 1906 AND college = "washington state" AND rank > 42 | sql_create_context |
CREATE TABLE table_50243 (
"State" text,
"Type" text,
"Name" text,
"Title" text,
"Royal house" text
) | What was the state that had the vassal name of li? | SELECT "State" FROM table_50243 WHERE "Name" = 'li' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | what is the name of the organism found in patient 025-44495's first sputum, tracheal specimen microbiological test this month? | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, tracheal specimen' AND D... | eicu |
CREATE TABLE table_52196 (
"Release format" text,
"Country" text,
"Label" text,
"Cat. No." text,
"Release date" real
) | What type of format was released after 1979? | SELECT "Release format" FROM table_52196 WHERE "Release date" > '1979' | wikisql |
CREATE TABLE table_5638 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | What league is from the United States and a round smaller than 12. | SELECT "College/Junior/Club Team (League)" FROM table_5638 WHERE "Nationality" = 'united states' AND "Round" < '12' | wikisql |
CREATE TABLE table_15670 (
"Film" text,
"Director(s)" text,
"Producer(s)" text,
"Recipient" text,
"Date" text,
"Award" text
) | What is the name of the film with an award of 5,380? | SELECT "Film" FROM table_15670 WHERE "Award" = '£5,380' | wikisql |
CREATE TABLE airports (
apid integer,
name text,
city text,
country text,
x real,
y real,
elevation bigint,
iata character varchar(3),
icao character varchar(4)
)
CREATE TABLE routes (
rid integer,
dst_apid integer,
dst_ap varchar(4),
src_apid bigint,
src_ap varc... | What are the number of the countries of all airlines whose names start with Orbit?, I want to list by the y axis in asc. | SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY COUNT(country) | nvbench |
CREATE TABLE table_name_93 (
score VARCHAR,
goal VARCHAR
) | What was the score with a goal of 16? | SELECT score FROM table_name_93 WHERE goal = 16 | sql_create_context |
CREATE TABLE table_204_365 (
id number,
"year" number,
"single" text,
"chart positions\nusa billboard hot dance club play" number,
"chart positions\npolish charts" number,
"album" text
) | what was natalia 's top single on the polish charts ? | SELECT "single" FROM table_204_365 ORDER BY "chart positions\npolish charts" LIMIT 1 | squall |
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,
... | 编号89294876的参保人在门诊就医一年共发生多少医疗费 | SELECT SUM(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '89294876' AND gwyjzb.CLINIC_TYPE = '门诊' UNION SELECT SUM(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '89294876' AND fgwyjzb.CLINIC_TYPE = '门诊' | css |
CREATE TABLE table_79680 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the fewest number of top-25s for events with more than 13 cuts made? | SELECT MIN("Top-25") FROM table_79680 WHERE "Cuts made" > '13' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | 奚雅逸患者被门诊诊断为疾病S71.943时的检测指标976587的结果定量及其单位分别是都是多少? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE table_name_16 (
martin_mcguinness VARCHAR,
david_norris VARCHAR
) | What is the Martin McGuinness with a David Norris that is 10.3%? | SELECT martin_mcguinness FROM table_name_16 WHERE david_norris = "10.3%" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,... | 给病人02234270做检验的科室编码及名称是什么,在09444918372的这次医疗就诊中 | SELECT JYKSBM, JYKSMC FROM jybgb WHERE JZLSH = '09444918372' | css |
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
... | Find the total number of students in each department Show bar chart, and I want to show by the X-axis from low to high. | SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name ORDER BY dept_name | nvbench |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
... | how many patients were diagnosed with ami inferior wall, init and they didn't come back to the hospital within 2 months in this year? | SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ami inferi... | mimic_iii |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | Tell me the number of emergency hospital admission patients who had a renal epithelial cells lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Renal Epithelial Cells" | mimicsql_data |
CREATE TABLE table_69201 (
"Venue" text,
"City" text,
"Tickets Sold / Available" text,
"Gross Revenue (1982)" text,
"Gross Revenue (2011)" text
) | What venue had gross revenues of $1,325,153 in 2011? | SELECT "Venue" FROM table_69201 WHERE "Gross Revenue (2011)" = '$1,325,153' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | , 2^n. | SELECT MIN(Posts) AS "min_posts", NULL AS "min_questions", COUNT(OwnerUserId) AS Users FROM (SELECT COUNT(*) AS Posts, OwnerUserId FROM Posts GROUP BY OwnerUserId) AS pu GROUP BY FLOOR(LN(Posts) / LN(2)) UNION SELECT NULL AS "min_posts", MIN(Questions) AS "min_questions", COUNT(OwnerUserId) AS Users FROM (SELECT COUNT(... | sede |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
air... | give me the latest flight tomorrow on UA from MILWAUKEE to TACOMA | 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, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TACOMA' AND date_day.day_number = 20 AND date_day.month_number = 1 AND ... | atis |
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartment_B... | What are the number of dates of birth of all the guests whose gender is 'Male'? | SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" | nvbench |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | how many patients whose primary disease is hyperglycemia and age is less than 56? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA" AND demographic.age < "56" | mimicsql_data |
CREATE TABLE table_25548213_1 (
production_code VARCHAR,
directed_by VARCHAR
) | List the number of episodes directed by linda mendoza. | SELECT COUNT(production_code) FROM table_25548213_1 WHERE directed_by = "Linda Mendoza" | sql_create_context |
CREATE TABLE table_19359427_6 (
manner_of_departure VARCHAR,
outgoing_manager VARCHAR
) | What was Gary Megson's manner of departure? | SELECT manner_of_departure FROM table_19359427_6 WHERE outgoing_manager = "Gary Megson" | sql_create_context |
CREATE TABLE table_name_93 (
opponent VARCHAR,
loss VARCHAR
) | Who was the opponent at the game that had a loss of Hendrickson (0-1)? | SELECT opponent FROM table_name_93 WHERE loss = "hendrickson (0-1)" | sql_create_context |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE T... | What upper-level classes have 4 credits ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 4 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE table_22951 (
"Round" real,
"Date" text,
"City and venue" text,
"Winner" text,
"Runner-up" text,
"3rd placed" text,
"4th placed" text,
"Results" text
) | How many placed 4th on April 25? | SELECT COUNT("4th placed") FROM table_22951 WHERE "Date" = 'April 25' | wikisql |
CREATE TABLE table_34074 (
"Track number" real,
"Song title" text,
"Songwriter(s)" text,
"Orchestra" text,
"Time" text
) | Name the time with track number less than 4 for you're my everything | SELECT "Time" FROM table_34074 WHERE "Track number" < '4' AND "Song title" = 'you''re my everything' | wikisql |
CREATE TABLE greatermanchestercrime (
crimeid text,
crimets time,
location text,
lsoa text,
type text,
outcome text
) | Which area do most of the crimes happen? | SELECT location FROM greatermanchestercrime GROUP BY location ORDER BY COUNT(*) DESC LIMIT 1 | greatermanchestercrime |
CREATE TABLE table_46437 (
"Finish" text,
"Race" text,
"Distance" text,
"Jockey" text,
"Time" text,
"Victory Margin (in lengths)" text,
"Runner up" text,
"Track" text,
"Surface" text,
"Date" text
) | What was the finish of the Kentucky Derby? | SELECT "Finish" FROM table_46437 WHERE "Race" = 'kentucky derby' | wikisql |
CREATE TABLE table_name_53 (
Id VARCHAR
) | What is the total 2008 value with a 2006 value greater than 322.7, a 353.9 in 2011, and a 2009 less than 392? | SELECT COUNT(2008) FROM table_name_53 WHERE 2006 > 322.7 AND 2011 = 353.9 AND 2009 < 392 | sql_create_context |
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... | 通过患者06397639的医疗记录显示其医疗费总数目比6289.51元打的次数有多少,入院诊断疾病编码和名称都是啥啊? | SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '06397639' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6289.51) UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '06397639' AND fg... | css |
CREATE TABLE table_name_77 (
visitor VARCHAR,
attendance VARCHAR,
date VARCHAR
) | Who is the visitor from the game with 7,000 in attendance on January 1? | SELECT visitor FROM table_name_77 WHERE attendance = "7,000" AND date = "january 1" | sql_create_context |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CR... | On Mondays and Wednesday , is it possible for me to take 567 ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour... | advising |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Guessing at recent favorited tags given a user ID based on activity.. | SELECT TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.OwnerUserId = @UserId GROUP BY TagName ORDER BY UpVotes DESC LIMIT 5 | sede |
CREATE TABLE table_name_98 (
game VARCHAR,
result VARCHAR
) | What game had the result of 112-100? | SELECT game FROM table_name_98 WHERE result = "112-100" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
... | when has patient 031-4423 had a microbiology test for the last time in 07/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-4423')) AND STRFTIME('%y-%m', microlab.culturetakentime) = '2... | eicu |
CREATE TABLE table_name_90 (
driver VARCHAR,
engine VARCHAR,
date VARCHAR
) | Who is the Driver, when the Engine is Chevrolet, and when the Date is October 3? | SELECT driver FROM table_name_90 WHERE engine = "chevrolet" AND date = "october 3" | sql_create_context |
CREATE TABLE resultsdata15 (
sample_pk number,
commod text,
commtype text,
lab text,
pestcode text,
testclass text,
concen number,
lod number,
conunit text,
confmethod text,
confmethod2 text,
annotate text,
quantitate text,
mean text,
extract text,
determi... | What is the most effective determinative method in terms of pesticide residues detection? | SELECT determin FROM resultsdata15 GROUP BY determin ORDER BY COUNT(*) DESC LIMIT 1 | pesticide |
CREATE TABLE table_74176 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the most rebounds and how many did they have on October 16? | SELECT "High rebounds" FROM table_74176 WHERE "Date" = 'October 16' | wikisql |
CREATE TABLE table_45620 (
"Round" text,
"Pick" real,
"Player" text,
"Position" text,
"Shoots" text,
"Nationality" text,
"League" text,
"Birthplace, Date" text,
"Height, Weight" text
) | What is the league of player ian schultz? | SELECT "League" FROM table_45620 WHERE "Player" = 'ian schultz' | wikisql |
CREATE TABLE table_75774 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the highest Drawn when the lost is 7 and the points are more than 4, and the against is less than 22? | SELECT MAX("Drawn") FROM table_75774 WHERE "Lost" = '7' AND "Points" > '4' AND "Against" < '22' | wikisql |
CREATE TABLE table_49186 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | On what Surface was the match against Ilija Bozoljac played? | SELECT "Surface" FROM table_49186 WHERE "Opponent" = 'ilija bozoljac' | wikisql |
CREATE TABLE table_27374740_2 (
_number INTEGER,
viewers__m_ VARCHAR
) | how many maximum # when viewers (m) is 8.01 | SELECT MAX(_number) FROM table_27374740_2 WHERE viewers__m_ = "8.01" | sql_create_context |
CREATE TABLE table_name_57 (
round INTEGER,
college VARCHAR,
overall VARCHAR
) | Which Round has a College of stanford, and an Overall smaller than 8? | SELECT AVG(round) FROM table_name_57 WHERE college = "stanford" AND overall < 8 | sql_create_context |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE CLASS (
CLASS_COD... | How many credits does the department offer Show bar chart, I want to order from low to high by the bars. | SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY DEPT_CODE | nvbench |
CREATE TABLE table_58276 (
"Competition" text,
"Stage" text,
"Venue" text,
"Date" text,
"Result" text
) | What was being played on Nov 23, 2006? | SELECT "Competition" FROM table_58276 WHERE "Date" = 'nov 23, 2006' | wikisql |
CREATE TABLE table_78142 (
"Code" real,
"Type" text,
"Name" text,
"Area (km 2 )" real,
"Population" real,
"Regional County Municipality" text,
"Region" real
) | Cowansville has less than 16 regions and is a Brome-Missisquoi Municipality, what is their population? | SELECT MIN("Population") FROM table_78142 WHERE "Regional County Municipality" = 'brome-missisquoi' AND "Name" = 'cowansville' AND "Region" < '16' | wikisql |
CREATE TABLE table_7155 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the sum of silver medals of the nation Cuba, which has less than 0 gold? | SELECT SUM("Silver") FROM table_7155 WHERE "Nation" = 'cuba' AND "Gold" < '0' | wikisql |
CREATE TABLE table_name_56 (
outcome VARCHAR,
opponent_in_final VARCHAR
) | Name the outcome that had an opponent in final of nina bratchikova kathrin w rle | SELECT outcome FROM table_name_56 WHERE opponent_in_final = "nina bratchikova kathrin wörle" | sql_create_context |
CREATE TABLE table_name_61 (
region VARCHAR,
catalog VARCHAR
) | What is the Region, when the Catalog is 25AP 301? | SELECT region FROM table_name_61 WHERE catalog = "25ap 301" | sql_create_context |
CREATE TABLE table_12983929_1 (
construction_start VARCHAR,
commercial_operation VARCHAR
) | When was the start of the construction of the unit that's been in commercial operation since 04.03.1987? | SELECT construction_start FROM table_12983929_1 WHERE commercial_operation = "04.03.1987" | sql_create_context |
CREATE TABLE table_12849 (
"Governorate" text,
"Cereals" real,
"Fruit Trees" real,
"Olives" real,
"Industrial crops" real,
"Vegetables" real
) | What is the lowest number of olives of the governorate with less than 247,265 industrial crops and more than 37,638 cereals? | SELECT MIN("Olives") FROM table_12849 WHERE "Industrial crops" < '247,265' AND "Cereals" > '37,638' | wikisql |
CREATE TABLE table_name_33 (
visitor VARCHAR,
series VARCHAR
) | who is the Visitor that has a Series of series tied 2 2? | SELECT visitor FROM table_name_33 WHERE series = "series tied 2–2" | sql_create_context |
CREATE TABLE table_name_11 (
tournament VARCHAR,
opponent_in_the_final VARCHAR
) | What tournament did Smeets play against Mark nielsen? | SELECT tournament FROM table_name_11 WHERE opponent_in_the_final = "mark nielsen" | sql_create_context |
CREATE TABLE table_204_296 (
id number,
"rank" number,
"athlete" text,
"qual" number,
"final" number,
"total" number,
"notes" text
) | which runners ran above 95.4 ? | SELECT "athlete" FROM table_204_296 WHERE "final" > 95.4 | squall |
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,
... | find the numner of female patients whose procedure icd9 code is 12. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "12" | mimicsql_data |
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,
... | Provide me the list of male patients with aortic insufficiency/re-do sternotomy with aortic valve replacement as the primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " | mimicsql_data |
CREATE TABLE fgwyjzb (
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,
... | 最常去的医生排序有哪些属于团伙成员施安和? | SELECT gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '施安和' GROUP BY gwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '施安和' GROUP BY fgwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_4 (
method VARCHAR,
record VARCHAR
) | Which method has the record of 11-1? | SELECT method FROM table_name_4 WHERE record = "11-1" | sql_create_context |
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 allergy (
allergy... | since 1804 days ago, had patient 007-16517 excreted any urine count? | 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 = '007-16517')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu... | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.