context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE requirement (
requiremen... | Does GREEKMOD 201 meet in the morning ? | 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 = 'GREEKMOD' AND course.number = 201 AND semester.semester = 'WN' AND semester.semester_id = course... | advising |
CREATE TABLE table_49692 (
"Product" text,
"Vendor" text,
"Edition" text,
"Release date" text,
"Java EE compatibility" text,
"License" text
) | What is the release date for Eclipse Foundation? | SELECT "Release date" FROM table_49692 WHERE "Vendor" = 'eclipse foundation' | wikisql |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,... | A bar graph listing the services and how many services provided by all stations, display by the bar in asc please. | SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services | nvbench |
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,
... | how many days has it been since the last time patient 031-13920 received procedure in their current hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-13920'... | eicu |
CREATE TABLE table_name_87 (
overall INTEGER,
round VARCHAR
) | Which Overall is the lowest one that has a Round of 3? | SELECT MIN(overall) FROM table_name_87 WHERE round = 3 | 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... | give me the number of patients whose admission type is emergency and procedure long title is initial insertion of dual-chamber device? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Initial insertion of dual-chamber device" | mimicsql_data |
CREATE TABLE table_20038 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Won" real,
"Drawn" real,
"Lost" real,
"For" real,
"Against" real,
"Difference" text
) | What the highest position when there is 28 against? | SELECT MAX("Position") FROM table_20038 WHERE "Against" = '28' | wikisql |
CREATE TABLE table_65872 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the number of gold for the country ranked 19? | SELECT SUM("Gold") FROM table_65872 WHERE "Rank" = '19' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ tim... | 检测指标294608的参考值范围下限和上限在哪个数值范围内,门诊可诊断患者患有病理性赌博 | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '病理性赌博' AND jyjgzbb.JCZBDM = '294608' UNION SELECT jyjgzbb.CKZFWXX,... | css |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
... | 2D Histogram of question views vs. score. | SELECT Score, ViewCount / '##dV##' AS "views" FROM Posts WHERE PostTypeId = 1 AND Score >= '##S1##' AND Score < '##S2##' AND ViewCount < '##V2##' | sede |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE... | please list fares for all the flights from ATLANTA to PHILADELPHIA on 8 the 1 | 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, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CI... | atis |
CREATE TABLE table_37392 (
"Surname" text,
"First" text,
"D.O.B." text,
"Bats" text,
"Throws" text,
"Position" text
) | Which Throws have a Position of 3b/rhp? | SELECT "Throws" FROM table_37392 WHERE "Position" = '3b/rhp' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | Comments on questions with accepted answers. | SELECT c.Id AS "comment_link" FROM Comments AS c JOIN Posts AS p ON (p.Id = PostId) WHERE NOT AcceptedAnswerId IS NULL AND c.Score IS NULL AND p.Score > 2 AND (CAST(GETUTCDATE() - c.CreationDate AS INT) > 7) ORDER BY NEWID() LIMIT 10 | sede |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | transplant self medication program is which type of drug? | SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Transplant Self Medication Program" | mimicsql_data |
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 vitalperiodic (
vitalperiodicid number,
... | what is the diagnostic cost in pneumothorax - traumatic? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'pneumothorax - traumatic') | eicu |
CREATE TABLE table_29296103_10 (
tournament VARCHAR,
week_of VARCHAR,
champion VARCHAR
) | Which tournament was on the week of 24 october and champion is matt doyle 1 6, 6 1, 6 2? | SELECT tournament FROM table_29296103_10 WHERE week_of = "24 October" AND champion = "Matt Doyle 1–6, 6–1, 6–2" | sql_create_context |
CREATE TABLE table_17326 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | What was the series count at for game 5? | SELECT "Series" FROM table_17326 WHERE "Game" = '5' | 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... | what is religion of subject id 3343? | SELECT demographic.religion FROM demographic WHERE demographic.subject_id = "3343" | mimicsql_data |
CREATE TABLE table_33956 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | What record has a score of 111-96? | SELECT "Record" FROM table_33956 WHERE "Score" = '111-96' | wikisql |
CREATE TABLE table_name_31 (
partner VARCHAR,
score_in_the_final VARCHAR
) | Who was the partner for the match with a score in the final of 4 6, 6 7? | SELECT partner FROM table_name_31 WHERE score_in_the_final = "4–6, 6–7" | sql_create_context |
CREATE TABLE table_21994729_2 (
written_by VARCHAR,
prod_code VARCHAR
) | Who wore the episode with the production code of 1apx11? | SELECT written_by FROM table_21994729_2 WHERE prod_code = "1APX11" | sql_create_context |
CREATE TABLE table_8773 (
"Song" text,
"Original Name" text,
"Country" text,
"Language" text,
"Singer(s)" text
) | What is the original name of the song performed in Swedish? | SELECT "Original Name" FROM table_8773 WHERE "Language" = 'swedish' | wikisql |
CREATE TABLE table_name_38 (
erp_w VARCHAR,
call_sign VARCHAR
) | If the call sign is w291ch what's the ERP W corresponding to that sign? | SELECT erp_w FROM table_name_38 WHERE call_sign = "w291ch" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patient... | calculate patient 028-39354's length of stay in the intensive care unit for the first time. | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-39354') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE table_27884 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | Which settlement has a cyrillic and other name of (romanian: voivodin )? | SELECT "Settlement" FROM table_27884 WHERE "Cyrillic Name Other Names" = 'Војводинци (Romanian: Voivodinţ)' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | has patient 005-87465 underwent a administration of saline solution - >250 cc/hr procedure since 3 years ago? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465')) AND treatment.treatmentname = 'administration of saline solutio... | eicu |
CREATE TABLE table_name_13 (
nationality VARCHAR,
pick__number VARCHAR,
player VARCHAR
) | Which Nationality has a Pick # smaller than 130 and a Player of tyler bunz? Question 1 | SELECT nationality FROM table_name_13 WHERE pick__number < 130 AND player = "tyler bunz" | sql_create_context |
CREATE TABLE table_name_25 (
nor_2 VARCHAR,
nor_1 VARCHAR
) | What is the nor 2 that has nor 1 as nor 1? | SELECT nor_2 FROM table_name_25 WHERE nor_1 = "nor 1" | sql_create_context |
CREATE TABLE table_name_83 (
time VARCHAR,
event VARCHAR
) | What was the time of the NJKF Titans Neo X event? | SELECT time FROM table_name_83 WHERE event = "njkf titans neo x" | sql_create_context |
CREATE TABLE table_27545 (
"Authority" text,
"Rate or precept" text,
"Budget limit (\u00a3m)" text,
"Budget plans (\u00a3m)" text,
"Rate limit (p)" text,
"Rate change (%)" text,
"Desired rate (p)" text,
"Desired rate change (%)" text
) | What is the rate limit when the desired rate (p) is 162? | SELECT "Rate limit (p)" FROM table_27545 WHERE "Desired rate (p)" = '162' | wikisql |
CREATE TABLE table_204_401 (
id number,
"rank" number,
"lane" number,
"name" text,
"nationality" text,
"react" number,
"time" number,
"notes" text
) | how long did it take elin backman to finish the race ? | SELECT "time" FROM table_204_401 WHERE "name" = 'elin backman' | squall |
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... | Of the NAVARCH classes offered this Fall , which are considered upper-level ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'NAVARCH' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fal... | advising |
CREATE TABLE table_36517 (
"Result" text,
"Opponent" text,
"Method" text,
"Event" text,
"Date" text,
"Round" text,
"Time" text,
"Location" text,
"Rules" text
) | Which Opponent has a Round of 3, a Time of n/a, and a Rules of n/a? | SELECT "Opponent" FROM table_36517 WHERE "Round" = '3' AND "Time" = 'n/a' AND "Rules" = 'n/a' | wikisql |
CREATE TABLE table_name_41 (
jobbik VARCHAR,
fidesz VARCHAR,
others VARCHAR
) | What is the Jobbik percentage with a Fidesz of 61% and others of 2%? | SELECT jobbik FROM table_name_41 WHERE fidesz = "61%" AND others = "2%" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE p... | what were the top four most common diagnosis in a year before? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE table_23014685_1 (
no INTEGER,
area_damaged VARCHAR
) | What number missile led to damage to the Islamic University campus? | SELECT MIN(no) FROM table_23014685_1 WHERE area_damaged = "Islamic University campus" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | when was the last time until 4 years ago that patient 022-30957 was discharged from the hospital? | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '022-30957' AND DATETIME(patient.hospitaldischargetime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY patient.hospitaldischargetime DESC LIMIT 1 | eicu |
CREATE TABLE table_49431 (
"Date" text,
"Time" text,
"Home" text,
"Geust" text,
"Result" text
) | What is the home of the match with a 0:2 result on 21.10.07? | SELECT "Home" FROM table_49431 WHERE "Result" = '0:2' AND "Date" = '21.10.07' | wikisql |
CREATE TABLE table_31703 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
) | How many rounds did the IFL: Oakland event have? | SELECT SUM("Round") FROM table_31703 WHERE "Event" = 'ifl: oakland' | wikisql |
CREATE TABLE table_37907 (
"Celebrity" text,
"Famous for" text,
"Entered" text,
"Exited" text,
"Finished" text
) | When did camilla dallerup finish? | SELECT "Finished" FROM table_37907 WHERE "Celebrity" = 'camilla dallerup' | wikisql |
CREATE TABLE table_18342 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many incumbents are there in district Louisiana 5? | SELECT COUNT("Incumbent") FROM table_18342 WHERE "District" = 'Louisiana 5' | wikisql |
CREATE TABLE table_22174 (
"Episodes" text,
"Monday" text,
"Tuesday" text,
"Wednesday" text,
"Thursday" text,
"Friday" text
) | What was the Tuesday episode if theThursday episode was 196 Buried? | SELECT "Tuesday" FROM table_22174 WHERE "Thursday" = '196 Buried' | wikisql |
CREATE TABLE table_35926 (
"Game #" real,
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text,
"Points" real
) | On what date does visiting team Minnesota score higher than 47 points? | SELECT "Date" FROM table_35926 WHERE "Points" > '47' AND "Visitor" = 'minnesota' | wikisql |
CREATE TABLE table_26492 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | what is the original air date for production code 216? | SELECT "Original air date" FROM table_26492 WHERE "Production code" = '216' | wikisql |
CREATE TABLE stock (
shop_id number,
device_id number,
quantity number
)
CREATE TABLE device (
device_id number,
device text,
carrier text,
package_version text,
applications text,
software_platform text
)
CREATE TABLE shop (
shop_id number,
shop_name text,
location tex... | What is the shop name corresponding to the shop that opened in the most recent year? | SELECT shop_name FROM shop ORDER BY open_year DESC LIMIT 1 | spider |
CREATE TABLE table_29626583_3 (
mls_team VARCHAR,
position VARCHAR,
player VARCHAR
) | Which team has a midfielder of konrad warzycha? | SELECT mls_team FROM table_29626583_3 WHERE position = "Midfielder" AND player = "Konrad Warzycha" | 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... | what is the number of patients whose admission type is urgent and diagnoses short title is enthesopathy of hip? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.short_title = "Enthesopathy of hip" | mimicsql_data |
CREATE TABLE table_name_42 (
stream_s__and___or_lake_s_ VARCHAR,
date_founded VARCHAR
) | what is the stream(s) and / or lake(s) when the date founded is 1959? | SELECT stream_s__and___or_lake_s_ FROM table_name_42 WHERE date_founded = 1959 | sql_create_context |
CREATE TABLE table_43653 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | Who was the opponent in a week below 3 on September 23, 1960? | SELECT "Opponent" FROM table_43653 WHERE "Week" < '3' AND "Date" = 'september 23, 1960' | wikisql |
CREATE TABLE table_30181 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | Who wrote the episode titled 'Red's Birthday'? | SELECT "Written by" FROM table_30181 WHERE "Title" = 'Red''s Birthday' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Return a bar chart about the distribution of Team_Name and School_ID , could you order from high to low by the x axis? | SELECT Team_Name, School_ID FROM basketball_match ORDER BY Team_Name DESC | nvbench |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text... | Number of active experts per week. | SELECT YR_WK, COUNT(*) AS NumActiveExperts FROM (SELECT (TIME_TO_STR(p.CreationDate, '%y') + (TIME_TO_STR(p.CreationDate, '%W') - 1) / 52.0) AS YR_WK, u.Id AS UID, COUNT(*) AS NumAnswers FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id AND p.PostTypeId = 2 AND p.Score > 0 GROUP BY (TIME_TO_STR(p.CreationDa... | sede |
CREATE TABLE table_name_60 (
score VARCHAR,
date VARCHAR
) | What was the score of the game on 19/3/00? | SELECT score FROM table_name_60 WHERE date = "19/3/00" | sql_create_context |
CREATE TABLE table_203_116 (
id number,
"no." number,
"player" text,
"birth date" text,
"weight" number,
"height" number,
"position" text,
"current club" text
) | how many players are middle blockers ? | SELECT COUNT("player") FROM table_203_116 WHERE "position" = 'middle blocker' | squall |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostHistory (
Id number,
... | Users with most questions who have not accepted any answers. | SELECT u.Id AS "user_link", COUNT(p.Id) AS Questions FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 1 AND NOT EXISTS(SELECT q.Id FROM Posts AS q WHERE q.OwnerUserId = u.Id AND NOT q.AcceptedAnswerId IS NULL) GROUP BY u.Id ORDER BY COUNT(p.Id) DESC | sede |
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... | 李高飞这个病人在医院5668122出院诊断中,有多少疾病名称中包含硬化性的医疗就诊记录,需要记录的编号 | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '李高飞' AND gwyjzb.MED_SER_ORG_NO = '5668122' AND gwyjzb.OUT_DIAG_DIS_NM LIKE '%硬化性%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '李高飞' AND fgwyjzb.MED_SER_ORG_NO = '5668122' AND fgwyjzb.OUT_DIAG_DIS_NM LIKE '%硬化性%' | css |
CREATE TABLE table_name_39 (
internet_explorer VARCHAR,
firefox VARCHAR
) | What percentage of browsers were using Internet Explorer during the period in which 27.85% were using Firefox? | SELECT internet_explorer FROM table_name_39 WHERE firefox = "27.85%" | sql_create_context |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
... | 门诊诊断的患者患有疾病J44.682的籍贯代码是多少以及名称叫什么和相应人数是多少? | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE mzjzjlb.JZZDBM = 'J44.682' GROUP BY person_info.JGDM | css |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
sub... | what are the five most frequently prescribed medicines since 5 years ago? | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 5 | mimic_iii |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | did patient 56490 have the results of the microbiology test of the blood culture in 09/last year? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 56490) AND microbiologyevents.spec_type_desc = 'blood culture' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', ... | mimic_iii |
CREATE TABLE table_54346 (
"Dismissals" text,
"Player" text,
"Versus" text,
"Venue" text,
"Date" text
) | What is the Player with a Date with 12-03-2003? | SELECT "Player" FROM table_54346 WHERE "Date" = '12-03-2003' | wikisql |
CREATE TABLE table_62190 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What was the score when the way team was Wrexham? | SELECT "Score" FROM table_62190 WHERE "Away team" = 'wrexham' | wikisql |
CREATE TABLE Apartments (
apt_number VARCHAR,
apt_type_code VARCHAR
) | Return the apartment numbers of the apartments with type code 'Flat'. | SELECT apt_number FROM Apartments WHERE apt_type_code = "Flat" | sql_create_context |
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE party (
Party_ID int,
... | Show how many delegates in each county with a pie chart. | SELECT County_name, COUNT(County_name) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY County_name | nvbench |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | how much was the hospital bill patient 54700 paid for their stay until 2 years ago? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54700) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-2 year') | mimic_iii |
CREATE TABLE table_64544 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
) | When was the game played that was at the Seattle Center Coliseum? | SELECT "Date" FROM table_64544 WHERE "Location/Attendance" = 'seattle center coliseum' | wikisql |
CREATE TABLE table_53750 (
"Total fat" text,
"Saturated fat" text,
"Monounsaturated fat" text,
"Polyunsaturated fat" text,
"Smoke point" text
) | Name the polyunsaturated fat with total fat of 100g and monounsaturated fat of 20g (84g in high oleic variety) | SELECT "Polyunsaturated fat" FROM table_53750 WHERE "Total fat" = '100g' AND "Monounsaturated fat" = '20g (84g in high oleic variety)' | wikisql |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | Find Nationality and the amount of Nationality , and group by attribute Nationality, and visualize them by a bar chart, display by the bars in descending. | SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | provide the number of patients whose admission type is elective and item id is 51274? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.itemid = "51274" | mimicsql_data |
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,... | 看一下患者21178041去医院9509335住院时的就诊记录,其中入院信息里面入院科室的名字要有针灸科的 | SELECT * FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb... | css |
CREATE TABLE table_name_47 (
draw VARCHAR,
played INTEGER
) | Name the total number of draw for played more than 18 | SELECT COUNT(draw) FROM table_name_47 WHERE played > 18 | sql_create_context |
CREATE TABLE table_76698 (
"Position" text,
"Team #1" text,
"Agg." text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | What is the 2nd leg of the 4-9 agg.? | SELECT "2nd leg" FROM table_76698 WHERE "Agg." = '4-9' | wikisql |
CREATE TABLE table_12715 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is Charlie Wi's To par? | SELECT "To par" FROM table_12715 WHERE "Player" = 'charlie wi' | wikisql |
CREATE TABLE table_name_64 (
earnings__ VARCHAR,
player VARCHAR,
rank VARCHAR
) | How much did jim colbert earned ranked above 2? | SELECT COUNT(earnings__) AS $__ FROM table_name_64 WHERE player = "jim colbert" AND rank < 2 | sql_create_context |
CREATE TABLE table_63952 (
"Name" text,
"GP-GS" text,
"Effic" real,
"Att-Cmp" text,
"TD-INT" text,
"Avg/G" real
) | Which TD-INT has an Effic larger than 111.4? | SELECT "TD-INT" FROM table_63952 WHERE "Effic" > '111.4' | wikisql |
CREATE TABLE table_41129 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | Which outcome has a partner named Mark Dickson, with the opponents of Hans Gildemeister Belus Prajoux? | SELECT "Outcome" FROM table_41129 WHERE "Partner" = 'mark dickson' AND "Opponents in the final" = 'hans gildemeister belus prajoux' | wikisql |
CREATE TABLE table_28092844_16 (
teams_classification VARCHAR,
general_classification_żółta_koszulka VARCHAR
) | Which teams classification winners had a general classification winner of Allan Davis? | SELECT teams_classification FROM table_28092844_16 WHERE general_classification_żółta_koszulka = "Allan Davis" | sql_create_context |
CREATE TABLE table_39900 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
) | Which Nationality has a School/Club Team of seattle? | SELECT "Nationality" FROM table_39900 WHERE "School/Club Team" = 'seattle' | wikisql |
CREATE TABLE table_name_69 (
nhl_team VARCHAR,
player VARCHAR
) | Tell me the NHL team for ryan johnson | SELECT nhl_team FROM table_name_69 WHERE player = "ryan johnson" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID... | For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | how many patients diagnosed with drug-induced delirium take additive drugs? | 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.long_title = "Drug-induced delirium" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_32630 (
"Rank" real,
"Player" text,
"Nation" text,
"Games" real,
"Goals" real,
"Years" text
) | What is the highest number of goals for robbie findley ranked above 10? | SELECT MAX("Goals") FROM table_32630 WHERE "Player" = 'robbie findley' AND "Rank" < '10' | wikisql |
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, give me the comparison about the sum of code over the name , and group by attribute name by a bar chart, and sort Y-axis from high to low order please. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE table_23283 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | When chris carney is the incumbent what are the results? | SELECT "Result" FROM table_23283 WHERE "Incumbent" = 'Chris Carney' | wikisql |
CREATE TABLE table_9058 (
"Event" text,
"Time" text,
"Club" text,
"Date" text,
"Meet" text,
"Location" text
) | Which Meet has a Time of 3:50.65? | SELECT "Meet" FROM table_9058 WHERE "Time" = '3:50.65' | wikisql |
CREATE TABLE table_name_37 (
format VARCHAR,
country VARCHAR
) | Which format is in Japan? | SELECT format FROM table_name_37 WHERE country = "japan" | 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... | Calculate the average age of patients admitted in or after 2197 and are 44 years or older. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.age >= "44" AND demographic.admityear >= "2197" | mimicsql_data |
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 ... | Is TURKISH 101 difficult ? | SELECT COUNT(*) > 0, program_course.workload FROM course, program_course WHERE course.department = 'TURKISH' AND course.number = 101 AND program_course.course_id = course.course_id AND program_course.workload > 3 | advising |
CREATE TABLE table_21602734_1 (
division INTEGER
) | What is the highest number of divisions mentioned? | SELECT MAX(division) FROM table_21602734_1 | sql_create_context |
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Apartment_Buildi... | What is the number of booking start dates of the apartments with more than 2 bedrooms for each year? Return a bar chart, I want to sort in descending by the y-axis. | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 ORDER BY COUNT(booking_start_date) DESC | nvbench |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE EN... | how many sections does each course has? | SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE | nvbench |
CREATE TABLE table_11403 (
"Game" real,
"Date" text,
"Score" text,
"Location" text,
"Time" text,
"Attendance" real
) | what is the attendance when the location is veterans stadium, the game is more than 3 and the time is 2:21? | SELECT AVG("Attendance") FROM table_11403 WHERE "Location" = 'veterans stadium' AND "Game" > '3' AND "Time" = '2:21' | wikisql |
CREATE TABLE table_250230_2 (
power VARCHAR,
model VARCHAR
) | What is the power for the Spirit R (Type B)? | SELECT power FROM table_250230_2 WHERE model = "Spirit R (Type B)" | sql_create_context |
CREATE TABLE table_name_81 (
player VARCHAR,
score VARCHAR
) | Which player has a score of 71-69-71-67=278? | SELECT player FROM table_name_81 WHERE score = 71 - 69 - 71 - 67 = 278 | sql_create_context |
CREATE TABLE table_name_71 (
driver VARCHAR,
type_of_vehicle VARCHAR,
year VARCHAR
) | What driver has a stock car vehicle with a year of 1999? | SELECT driver FROM table_name_71 WHERE type_of_vehicle = "stock car" AND year = 1999 | sql_create_context |
CREATE TABLE table_58294 (
"Player" text,
"Rec." real,
"Yards" real,
"Avg." real,
"TD's" real,
"Long" real
) | Name the lowest yards for 34 long and avg less than 12.6 | SELECT MIN("Yards") FROM table_58294 WHERE "Long" = '34' AND "Avg." < '12.6' | wikisql |
CREATE TABLE Ref_Detention_Type (
detention_type_code VARCHAR(10),
detention_type_description VARCHAR(80)
)
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Assessment_Notes (
notes_id INTEGER,
student_id INTEGER,
teacher_i... | Return a line chart about the change of the amount of date_address_to over date_address_to , and group by attribute other_details. | SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_78476 (
"Number" real,
"Name" text,
"Position" text,
"Height" text,
"Weight" text
) | What is the number for the player that has a k position? | SELECT "Number" FROM table_78476 WHERE "Position" = 'k' | wikisql |
CREATE TABLE table_name_28 (
track VARCHAR,
artist VARCHAR
) | What is the track that from lcd soundsystem? | SELECT track FROM table_name_28 WHERE artist = "lcd soundsystem" | 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,
... | count the number of patients whose ethnicity is american indian/alaska native and primary disease is femoral artery thrombosis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.