context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_57316 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | Who was the opponent on November 5, 1944 with more than 24,123 people to watch? | SELECT "Opponent" FROM table_57316 WHERE "Attendance" > '24,123' AND "Date" = 'november 5, 1944' | wikisql |
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 compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE restriction (
... | i also need to go to SAN FRANCISCO on wednesday evening from DALLAS | 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 (((flight.departure_time BETWEEN 1800 AND 2200) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_... | atis |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | give the number of patients whose admission location is transfer from hosp/extram and who were admitted before the year 2167. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.admityear < "2167" | mimicsql_data |
CREATE TABLE table_train_34 (
"id" int,
"gender" string,
"allergy_to_adhesive" bool,
"contraception" bool,
"use_of_cyclosporin" bool,
"use_of_digoxin" bool,
"liver_disease" bool,
"rhabomyolysis" bool,
"allergy_to_hydrocortisone" bool,
"use_of_statins" bool,
"NOUSE" float
) | effective contraception in fertile female | SELECT * FROM table_train_34 WHERE contraception = 1 AND gender = 'female' | criteria2sql |
CREATE TABLE table_49776 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
) | Which round has a record of 5-3 (1)? | SELECT MIN("Round") FROM table_49776 WHERE "Record" = '5-3 (1)' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
... | how many patients until 2 years ago were prescribed levothyroxine sodium during the same month after diagnosis of pneumonia? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumonia' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-2 year')) AS t1 JOIN (SELECT ... | eicu |
CREATE TABLE table_1233808_2 (
date_and_time VARCHAR,
competition VARCHAR
) | For the competition Mithras Cup 2nd Rd (2nd Leg), what is the date and time? | SELECT date_and_time FROM table_1233808_2 WHERE competition = "Mithras Cup 2nd Rd (2nd Leg)" | sql_create_context |
CREATE TABLE table_name_85 (
total INTEGER,
bronze VARCHAR,
nation VARCHAR
) | What is the lowest total when the Bronze metals are larger than 0 and the nation is France (fra)? | SELECT MIN(total) FROM table_name_85 WHERE bronze > 0 AND nation = "france (fra)" | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 哪几个医院给患者31744716开了名为连花清瘟胶囊的药 | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '31744716' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '连花清瘟胶囊') | css |
CREATE TABLE table_name_86 (
firefox VARCHAR,
chrome VARCHAR
) | What was the firefox % was chrome was 25.08%? | SELECT firefox FROM table_name_86 WHERE chrome = "25.08%" | sql_create_context |
CREATE TABLE table_name_76 (
visitor VARCHAR,
home VARCHAR
) | Who were the visitors when the home team were the ny rangers? | SELECT visitor FROM table_name_76 WHERE home = "ny rangers" | sql_create_context |
CREATE TABLE captain (
captain_id number,
name text,
ship_id number,
age text,
class text,
rank text
)
CREATE TABLE ship (
ship_id number,
name text,
type text,
built_year number,
class text,
flag text
) | What are the names of ships that are commanded by both captains with the rank of Midshipman and captains with the rank of Lieutenant? | SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Lieutenant' | spider |
CREATE TABLE table_26007767_1 (
localities INTEGER
) | What is the highest localities? | SELECT MAX(localities) FROM table_26007767_1 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 患者褚雯华在04年11月9日到19年1月17日,是找的哪些工号及姓名的医务人员检测甲状腺素的 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy... | css |
CREATE TABLE table_16593 (
"Finishing position" text,
"Points awarded (Platinum)" real,
"Points awarded (Gold)" real,
"Points awarded (Silver)" real,
"Points awarded (Satellite)" real
) | How many platinum points were awarded when 70 silver points were awarded? | SELECT "Points awarded (Platinum)" FROM table_16593 WHERE "Points awarded (Silver)" = '70' | wikisql |
CREATE TABLE table_name_77 (
ship_type VARCHAR,
name VARCHAR
) | What type of ship was the Shinano? | SELECT ship_type FROM table_name_77 WHERE name = "shinano" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | when was the last time in 09/2105 patient 010-17316 was prescribed a drug via the im route? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-17316')) AND medication.routeadmin = 'im' AND STRFTIME('%y... | eicu |
CREATE TABLE table_26466528_1 (
join_date INTEGER
) | Name the least join date | SELECT MIN(join_date) FROM table_26466528_1 | sql_create_context |
CREATE TABLE problem_category_codes (
problem_category_code text,
problem_category_description text
)
CREATE TABLE problem_status_codes (
problem_status_code text,
problem_status_description text
)
CREATE TABLE problems (
problem_id number,
product_id number,
closure_authorised_by_staff_id... | List all the distinct product names ordered by product id? | SELECT DISTINCT product_name FROM product ORDER BY product_id | spider |
CREATE TABLE table_27927 (
"meas. num" real,
"passed" text,
"YES votes" real,
"NO votes" real,
"% YES" text,
"Const. Amd.?" text,
"type" text,
"description" text
) | What is the description of the measure that got 39.57% yes votes? | SELECT "description" FROM table_27927 WHERE "% YES" = '39.57%' | wikisql |
CREATE TABLE table_name_92 (
city_or_town VARCHAR,
top_division_titles VARCHAR
) | Which City or town has a Top division titles of 17 | SELECT city_or_town FROM table_name_92 WHERE top_division_titles = "17" | sql_create_context |
CREATE TABLE table_name_94 (
week_3 VARCHAR,
week_6 VARCHAR
) | Name the week 3 with week 6 of 31+40=71 | SELECT week_3 FROM table_name_94 WHERE week_6 = 31 + 40 = 71 | sql_create_context |
CREATE TABLE table_17641206_4 (
duration VARCHAR,
written_by VARCHAR
) | How many episodes of 30 minutes were written by John Sullivan? | SELECT COUNT(duration) FROM table_17641206_4 WHERE written_by = "John Sullivan" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,... | what was the name of the intake that patient 017-60306 had a first on the last intensive care unit visit? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-60306') AND NOT patient.unitdischargetime IS NULL ORDER ... | eicu |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | Show all allergy types and the number of allergies in each type. Visualize by pie chart. | SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType | nvbench |
CREATE TABLE table_name_53 (
winning_driver VARCHAR,
winning_constructor VARCHAR,
name VARCHAR
) | Which winning driver of the Roussillon Grand Prix had an Alfa Romeo? | SELECT winning_driver FROM table_name_53 WHERE winning_constructor = "alfa romeo" AND name = "roussillon grand prix" | sql_create_context |
CREATE TABLE table_203_375 (
id number,
"name" text,
"year built" text,
"country" text,
"town" text,
"height" text,
"remarks" text
) | how many pylons are in austria ? | SELECT COUNT("name") FROM table_203_375 WHERE "country" = 'austria' | squall |
CREATE TABLE table_name_78 (
title VARCHAR,
name VARCHAR
) | What is the title of Senusret I? | SELECT title FROM table_name_78 WHERE name = "senusret i" | 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,
... | specify duration of hospital stay and drug route of patient gus marques | SELECT demographic.days_stay, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Gus Marques" | mimicsql_data |
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 d... | tell me the total output on the current icu visit for patient 021-111547. | 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 = '021-111547') AND patient.unitdischargetime IS NU... | eicu |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | How old is each gender, on average Plot them as bar chart, order by the X-axis in ascending. | SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY gender | nvbench |
CREATE TABLE table_37272 (
"Name" text,
"Date" text,
"Goals" real,
"Assists" real,
"Team" text,
"Venue" text,
"Opponent" text,
"Competition" text,
"Total Goals" real,
"Total Assists" real
) | What competition had more than 40 assists? | SELECT "Competition" FROM table_37272 WHERE "Assists" > '40' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
... | how many patients until 2104 got a microbiological wound, decubitus test? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'wound, decubitus' AND STRFTIME('%y', microlab.culturetakentime) <= '2104') | eicu |
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,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 沈雅懿患者的检验报告单对应的检验结果指标均异常都是哪些?列出对应的检验报告单号都是啥? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '沈雅懿' AND NOT ... | css |
CREATE TABLE table_name_2 (
score VARCHAR,
competition VARCHAR
) | WHAT IS THE SCORE WHEN THE COMPETITION WAS 1978 world cup qualification? | SELECT score FROM table_name_2 WHERE competition = "1978 world cup qualification" | sql_create_context |
CREATE TABLE table_50047 (
"Rank" real,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | What is the 2013 with virgin in 2009? | SELECT "2013" FROM table_50047 WHERE "2009" = 'virgin' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE... | Average Posting Stats per Posting Type. | SELECT PostTypes.Name AS PostType, AVG(Posts.Score) AS AvgScore FROM Posts, PostTypes WHERE PostTypes.Id = 1 AND Posts.ClosedDate IS NULL AND PostTypes.Id = Posts.PostTypeId GROUP BY PostTypes.Name | sede |
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... | in 2105, what were the top five most frequently diagnosed diagnoses that patients were diagnosed with in the same month after being diagnosed with acute copd exacerbation - with baseline hypercarbia? | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute copd exacerbation - with baseline ... | eicu |
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... | 列出有哪些名称包含儿童的科室开出的所有医疗费用明细项目在医疗就诊94504683785中? | SELECT * FROM t_kc22 WHERE MED_CLINIC_ID = '94504683785' AND MED_ORG_DEPT_NM LIKE '%儿童%' | css |
CREATE TABLE table_54169 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) | What type is the sorrento to sapri course with a distance of km (mi)? | SELECT "Type" FROM table_54169 WHERE "Distance" = 'km (mi)' AND "Course" = 'sorrento to sapri' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate tim... | Average daily score per month. | SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, AVG(CAST(Posts.Score AS FLOAT)) AS Score FROM Posts LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE PostTypes.Name IN ('Question') GROUP BY YEAR(Posts.CreationDate), MONTH(Posts.CreationDate) ORDER BY YE... | sede |
CREATE TABLE table_34464 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Which cornerback has the lowest overall and a pick number smaller than 16? | SELECT MIN("Overall") FROM table_34464 WHERE "Position" = 'cornerback' AND "Pick #" < '16' | wikisql |
CREATE TABLE table_19279 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | Was there a starter when 3 touchdowns were scored? | SELECT "Starter" FROM table_19279 WHERE "Touchdowns" = '3' | wikisql |
CREATE TABLE table_name_57 (
loss VARCHAR,
date VARCHAR
) | What loss occurred on August 21? | SELECT loss FROM table_name_57 WHERE date = "august 21" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
KH te... | 进行住院就诊的53408787768其入院途径代码还有名称都是啥? | SELECT zyjzjlb.RYTJDM, zyjzjlb.RYTJMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '53408787768' | css |
CREATE TABLE table_60634 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What is Brian Gay's place? | SELECT "Place" FROM table_60634 WHERE "Player" = 'brian gay' | wikisql |
CREATE TABLE table_1341690_9 (
first_elected INTEGER
) | What is the last year that someone is first elected? | SELECT MAX(first_elected) FROM table_1341690_9 | sql_create_context |
CREATE TABLE table_1015914_24 (
them_two__the_two_ VARCHAR,
you_and_i VARCHAR
) | What is them two (the two) when you and i is ng balngu? | SELECT them_two__the_two_ FROM table_1015914_24 WHERE you_and_i = "ngœbalngu" | sql_create_context |
CREATE TABLE table_26448179_2 (
written_by VARCHAR,
production_code VARCHAR
) | He wrote production number 102? | SELECT written_by FROM table_26448179_2 WHERE production_code = "102" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | indicate the daily average dose of ns ivf that patient 031-13920 has received on the first icu visit. | SELECT AVG(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 = '031-13920') AND NOT patient.unitdischargetime IS... | eicu |
CREATE TABLE Channels (
Channel_ID INTEGER,
Other_Details VARCHAR(255)
)
CREATE TABLE Products_in_Events (
Product_in_Event_ID INTEGER,
Event_ID INTEGER,
Product_ID INTEGER
)
CREATE TABLE Agreements (
Document_ID INTEGER,
Event_ID INTEGER
)
CREATE TABLE Parties (
Party_ID INTEGER,
... | Visualize a bar chart for showing the total number of different product type codes, and order from low to high by the total number. | SELECT Product_Type_Code, COUNT(Product_Type_Code) FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(Product_Type_Code) | nvbench |
CREATE TABLE table_name_32 (
outcomes VARCHAR,
launch_date VARCHAR
) | Which Outcome has a Launch Date of march 18, 1964; 14:50 gmt? | SELECT outcomes FROM table_name_32 WHERE launch_date = "march 18, 1964; 14:50 gmt" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id numbe... | retrieve the top five most commonly prescribed drugs until 1 year ago for patients of age 50s. | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 50 AND 59) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY pres... | mimic_iii |
CREATE TABLE party (
party_id number,
year number,
party text,
governor text,
lieutenant_governor text,
comptroller text,
attorney_general text,
us_senate text
)
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE el... | Which committees have delegates from the Democratic party? | SELECT T1.committee FROM election AS T1 JOIN party AS T2 ON T1.party = T2.party_id WHERE T2.party = "Democratic" | spider |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | 从00年2月1日开始06年5月3日结束患者89244700所有检验结果指标记录中的仪器编号以及名称都是啥吗? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = ... | css |
CREATE TABLE table_name_32 (
score VARCHAR,
date VARCHAR
) | What was the score of the game played on 16 August 2006? | SELECT score FROM table_name_32 WHERE date = "16 august 2006" | sql_create_context |
CREATE TABLE table_52075 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where did a home team score 23.20 (158)? | SELECT "Venue" FROM table_52075 WHERE "Home team score" = '23.20 (158)' | wikisql |
CREATE TABLE table_35740 (
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2013" text,
"Total" real
) | What is the 2008 value with a 7 in 2010? | SELECT "2008" FROM table_35740 WHERE "2010" = '7' | wikisql |
CREATE TABLE table_204_468 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | how many drivers did not complete 95 laps ? | SELECT COUNT("driver") FROM table_204_468 WHERE "laps" <> 95 | squall |
CREATE TABLE table_204_808 (
id number,
"team" text,
"no" number,
"driver" text,
"class" text,
"chassis" text,
"engine" text
) | which engine was used the most by teams this season ? | SELECT "engine" FROM table_204_808 GROUP BY "engine" ORDER BY COUNT("team") DESC LIMIT 1 | squall |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 在编号为24475565910的这次医疗就诊中,统筹基金的支出占医疗费总额的百分比是多少 | SELECT (SELECT t_kc24.OVE_PAY FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '24475565910') / (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID = '24475565910') | css |
CREATE TABLE table_203_608 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the only nation to have one silver medal ? | SELECT "nation" FROM table_203_608 WHERE "silver" = 1 | squall |
CREATE TABLE table_16629 (
"Crew" real,
"Open 1st VIII" text,
"Open 2nd VIII" text,
"Open 3rd VIII" text,
"U16 1st VIII" text,
"U16 2nd VIII" text,
"U16 3rd VIII" text,
"U15 1st IV" text,
"U15 2nd IV" text,
"U15 3rd IV" text,
"U15 4th IV" text,
"U15 5th IV" text,
"U15... | how many open 2nd viii had u15 3rd iv being gt | SELECT COUNT("Open 2nd VIII") FROM table_16629 WHERE "U15 3rd IV" = 'GT' | wikisql |
CREATE TABLE Visitors (
Tourist_ID INTEGER,
Tourist_Details VARCHAR(255)
)
CREATE TABLE Ref_Hotel_Star_Ratings (
star_rating_code CHAR(15),
star_rating_description VARCHAR(80)
)
CREATE TABLE Visits (
Visit_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Tourist_ID INTEGER,
Visit_Date DATETI... | What are the distinct visit dates, and count them by a bar chart, list in descending by the y-axis. | SELECT Visit_Date, COUNT(Visit_Date) FROM Visits ORDER BY COUNT(Visit_Date) DESC | nvbench |
CREATE TABLE table_name_24 (
reimboldsh VARCHAR,
willingshain VARCHAR,
gersdorf VARCHAR
) | What Reimboldsh has Willingshain of 268 and Gersdorf 194? | SELECT reimboldsh FROM table_name_24 WHERE willingshain = "268" AND gersdorf = "194" | sql_create_context |
CREATE TABLE table_182499_1 (
substrate VARCHAR,
enzyme VARCHAR
) | what is the subtrate for enzyme ala dehydratase | SELECT substrate FROM table_182499_1 WHERE enzyme = "ALA dehydratase" | sql_create_context |
CREATE TABLE table_name_23 (
game INTEGER,
venue VARCHAR,
attendance VARCHAR
) | Which game had an attendance of 5,000 and was away? | SELECT AVG(game) FROM table_name_23 WHERE venue = "away" AND attendance = 5 OFFSET 000 | sql_create_context |
CREATE TABLE table_name_70 (
format VARCHAR,
frequency VARCHAR,
station VARCHAR
) | Which format has a Frequency larger than 1050, and a Station of kvto? | SELECT format FROM table_name_70 WHERE frequency > 1050 AND station = "kvto" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
Parent... | UWP top all-time open questions by viewcount. | SELECT p.Id AS "post_link", p.Title AS "Title", p.Tags AS Tags, p.ViewCount AS "Views", p.Score AS "Score", p.AnswerCount AS "Answers", DATEDIFF(day, p.CreationDate, GETDATE()) AS "Age (days)" FROM Posts AS p WHERE p.AcceptedAnswerId IS NULL AND (p.Tags LIKE '%<uwp>%' OR p.Tags LIKE '%<windows-10-universal>%' OR (p.Tag... | sede |
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperdataset (
paperid int,
datase... | papers by stefan savage | SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'stefan savage' AND writes.authorid = author.authorid | scholar |
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... | Give me the comparison about Team_ID over the ACC_Regular_Season , could you order from low to high by the X-axis please? | SELECT ACC_Regular_Season, Team_ID FROM basketball_match ORDER BY ACC_Regular_Season | nvbench |
CREATE TABLE table_name_35 (
away_team VARCHAR,
home_team VARCHAR
) | What was the away team's score in the game against North Melbourne? | SELECT away_team AS score FROM table_name_35 WHERE home_team = "north melbourne" | sql_create_context |
CREATE TABLE table_100518_1 (
direction VARCHAR,
graha__planet_ VARCHAR
) | What are the directions for the guardian whose graha (planet) is b haspati (Jupiter)? | SELECT direction FROM table_100518_1 WHERE graha__planet_ = "Bṛhaspati (Jupiter)" | sql_create_context |
CREATE TABLE table_train_5 (
"id" int,
"pregnancy_or_lactation" bool,
"severe_sepsis" bool,
"protein_c" int,
"liver_disease" bool,
"chronic_respiratory_disease" bool,
"child_pugh_score" int,
"septic_shock" bool,
"myocardial_infarction" bool,
"NOUSE" float
) | severe sepsis or septic shock with plasma activity of protein c < 60 % | SELECT * FROM table_train_5 WHERE (severe_sepsis = 1 OR septic_shock = 1) AND protein_c < 60 | criteria2sql |
CREATE TABLE table_52031 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | Who is the center position of Years for Jazz, Greg Ostertag? | SELECT "Years for Jazz" FROM table_52031 WHERE "Position" = 'center' AND "Player" = 'greg ostertag' | wikisql |
CREATE TABLE table_6082 (
"Image" text,
"Father" text,
"Birth" text,
"Ceased to be Duchess" text,
"Death" text,
"Husband" text
) | Who was the husband of marie of baden-sponheim? | SELECT "Husband" FROM table_6082 WHERE "Image" = 'marie of baden-sponheim' | wikisql |
CREATE TABLE table_204_635 (
id number,
"round" number,
"selection" number,
"player" text,
"position" text,
"college" text
) | how many different colleges did the players come from ? | SELECT COUNT(DISTINCT "college") FROM table_204_635 | squall |
CREATE TABLE table_23292220_13 (
episode VARCHAR,
seans_team VARCHAR
) | What was the episode that had Jack Dee and Stacey Solomon on Sean's team? | SELECT episode FROM table_23292220_13 WHERE seans_team = "Jack Dee and Stacey Solomon" | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_s... | do you have any direct flights from PITTSBURGH to ATLANTA | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'AT... | atis |
CREATE TABLE table_17751942_4 (
years_of_appearance VARCHAR,
team VARCHAR
) | What is the year of appearance for the Prince Albert Raiders? | SELECT years_of_appearance FROM table_17751942_4 WHERE team = "Prince Albert Raiders" | sql_create_context |
CREATE TABLE table_204_850 (
id number,
"name" text,
"railway" text,
"series" text,
"maker" text,
"dates" text,
"drive" text,
"wheel arrangement" text,
"weight" text,
"power" text,
"notes" text
) | what is the difference in weight between the 060 ea and the challenger ? | SELECT ABS((SELECT "weight" FROM table_204_850 WHERE "name" = '060-ea') - (SELECT "weight" FROM table_204_850 WHERE "name" = 'challenger')) | squall |
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... | Give me the comparison about Team_ID over the All_Neutral , and I want to display by the Y-axis from high to low please. | SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY Team_ID DESC | nvbench |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | A pie chart shows the proportion of All_Road and School_ID. | SELECT All_Road, School_ID FROM basketball_match | nvbench |
CREATE TABLE Vehicles (
Id VARCHAR
) | How many vehicle in total? | SELECT COUNT(*) FROM Vehicles | sql_create_context |
CREATE TABLE table_train_264 (
"id" int,
"stroke" bool,
"hematocrit_hct" float,
"serum_psa" float,
"coronary_artery_disease_cad" bool,
"international_prostate_symptom_score_ipss" int,
"hypertension" bool,
"NOUSE" float
) | a hematocrit of > 50 % | SELECT * FROM table_train_264 WHERE hematocrit_hct > 50 | criteria2sql |
CREATE TABLE table_name_87 (
nation VARCHAR,
gold VARCHAR,
bronze VARCHAR,
silver VARCHAR
) | Which nation has a Bronze and Silver smaller than 1 and a Gold larger than 1? | SELECT nation FROM table_name_87 WHERE bronze < 1 AND silver < 1 AND gold > 1 | sql_create_context |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground_service (
city_code text,
airp... | what 's the last flight from ATLANTA to BOSTON | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTO... | atis |
CREATE TABLE table_name_4 (
interview INTEGER,
swimsuit VARCHAR,
state VARCHAR,
average VARCHAR,
evening_gown VARCHAR
) | What is the sum of the interview scores from North Dakota that have averages less than 8.697, evening gown scores less than 8.73, and swimsuit scores greater than 8.41? | SELECT SUM(interview) FROM table_name_4 WHERE average < 8.697 AND evening_gown < 8.73 AND state = "north dakota" AND swimsuit > 8.41 | sql_create_context |
CREATE TABLE table_31767 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | Tell me the sum of week for result of l 24 21 | SELECT SUM("Week") FROM table_31767 WHERE "Result" = 'l 24–21' | wikisql |
CREATE TABLE table_63124 (
"Place" text,
"Code" real,
"Area (km 2 )" real,
"Population" real,
"Most spoken language" text
) | What is the total code number for Amadiba? | SELECT COUNT("Code") FROM table_63124 WHERE "Place" = 'amadiba' | wikisql |
CREATE TABLE characteristics (
characteristic_id number,
characteristic_type_code text,
characteristic_data_type text,
characteristic_name text,
other_characteristic_details text
)
CREATE TABLE product_characteristics (
product_id number,
characteristic_id number,
product_characteristic... | List the all the distinct names of the products with the characteristic name 'warm'. | SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = "warm" | spider |
CREATE TABLE table_47250 (
"Barangay" text,
"Urban/rural" text,
"Geographic character" text,
"Population (2007)" real,
"Population (2010)" real
) | WHAT IS THE TYPE OF LAND WITH A 2007 POPULATION SMALLER THAN 4346, 2010 POPULATION LARGER THAN 3385, FROM BARANGAY OF MANALONGON? | SELECT "Geographic character" FROM table_47250 WHERE "Population (2007)" < '4346' AND "Population (2010)" > '3385' AND "Barangay" = 'manalongon' | wikisql |
CREATE TABLE table_18088 (
"#" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Originalairdate" text,
"Repeatairdate(s)" text,
"Prod.Code" text
) | What is the original date of the repeat air date of 26/01/1969? | SELECT "Originalairdate" FROM table_18088 WHERE "Repeatairdate(s)" = '26/01/1969' | wikisql |
CREATE TABLE table_6441 (
"Location" text,
"Culture" text,
"# found" text,
"Ball diameter" text,
"Period" text
) | What's the Period with # found of 5? | SELECT "Period" FROM table_6441 WHERE "# found" = '5' | wikisql |
CREATE TABLE table_23914 (
"School" text,
"Location(s)" text,
"Control" text,
"Type" text,
"Accreditation" text,
"Founded" real,
"Enrollment" text
) | What type of school is Stratford University? | SELECT "Type" FROM table_23914 WHERE "School" = 'Stratford University' | 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,
... | How many patients are diagnosed with other second degree atrioventricular block were suggested the oral drug route? | 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 = "Other second degree atrioventricular block" AND prescriptions.route = "ORAL" | mimicsql_data |
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 days of hospital stay and admission time of subject id 15061? | SELECT demographic.days_stay, demographic.admittime FROM demographic WHERE demographic.subject_id = "15061" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is average age of patients whose marital status is single and admission location is trsf within this facility? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admission_location = "TRSF WITHIN THIS FACILITY" | mimicsql_data |
CREATE TABLE operate_company (
id number,
name text,
type text,
principal_activities text,
incorporated_in text,
group_equity_shareholding number
)
CREATE TABLE flight (
id number,
vehicle_flight_number text,
date text,
pilot text,
velocity number,
altitude number,
a... | Which of the airport names contains the word 'international'? | SELECT name FROM airport WHERE name LIKE '%international%' | spider |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | how many patients with ruq pain stayed in the hospital for more than 2 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.days_stay > "2" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.