context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | what is the maximum cost in a hospital involving a laboratory test for cpk-mb index since 5 years ago? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'cpk-mb index')) AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TI... | eicu |
CREATE TABLE table_60183 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the place of the player with a 71-69-66=206 score? | SELECT "Place" FROM table_60183 WHERE "Score" = '71-69-66=206' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id n... | what is the marital status of patient 10855 on their current hospital visit. | SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 10855 AND admissions.dischtime IS NULL | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is the number of patients whose admission year is less than 2197 and drug name is tamsulosin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2197" AND prescriptions.drug = "Tamsulosin" | mimicsql_data |
CREATE TABLE table_58072 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which Away team that has a Crowd greater than 15,481, and a Home team score of 20.17 (137)? | SELECT "Away team" FROM table_58072 WHERE "Crowd" > '15,481' AND "Home team score" = '20.17 (137)' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | get the number of patients who had biopsy of tonsil and adenoids and were admitted before 2138. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2138" AND procedures.short_title = "Tonsil&adenoid biopsy" | mimicsql_data |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid... | in 12/2105 has patient 006-158338's systemicdiastolic been normal? | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-158338')) AND vitalperiodic.systemicdiastolic BETWEEN diastolic_... | eicu |
CREATE TABLE table_48376 (
"Country" text,
"Year" real,
"Total" real,
"Hydroelectricity" real,
"Wind Power" real,
"Biomass and Waste" text,
"Solar" real
) | In 2011 with a hydroelectricity less than 119.6, what was the solar? | SELECT "Solar" FROM table_48376 WHERE "Year" = '2011' AND "Hydroelectricity" < '119.6' | wikisql |
CREATE TABLE table_25042332_33 (
gdp__ppp__per_capita__2008_ INTEGER,
combined_gross_enrollment_ratio__2009_ VARCHAR
) | What is the gdp per capita in 2008 for the region that had a combined gross enrollment ration of 89.0? | SELECT MIN(gdp__ppp__per_capita__2008_) FROM table_25042332_33 WHERE combined_gross_enrollment_ratio__2009_ = "89.0" | sql_create_context |
CREATE TABLE table_68511 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
) | Name the total number of rank for lane 7 | SELECT COUNT("Rank") FROM table_68511 WHERE "Lane" = '7' | wikisql |
CREATE TABLE table_44286 (
"Date" text,
"Round" text,
"Opponents" text,
"H / A" text,
"Result F \u2013 A" text,
"Attendance" real
) | What is the round when they played against Middlesbrough, and the h/a was h? | SELECT "Round" FROM table_44286 WHERE "Opponents" = 'middlesbrough' AND "H / A" = 'h' | wikisql |
CREATE TABLE table_28717 (
"Monarch" text,
"Heir" text,
"Status" text,
"Relationship to Monarch" text,
"Became heir; reason" text,
"Ceased to be heir; reason" text,
"Next in succession" text
) | What is the status for the monarch Mingyinyo? | SELECT "Status" FROM table_28717 WHERE "Monarch" = 'Mingyinyo' | wikisql |
CREATE TABLE table_name_13 (
mascot VARCHAR,
previous_conference VARCHAR,
location VARCHAR
) | What is the Mascot for the team from leo that had a Previous Conference value of independent? | SELECT mascot FROM table_name_13 WHERE previous_conference = "independent" AND location = "leo" | sql_create_context |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases IN... | List the grape and winery of the wines whose price is bigger than 100, visualize them with a stacked bar chart, the x-axis is winery and group the grape, and y-axis is the number of wineries, and show y-axis in asc order. | SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Grape, Winery ORDER BY COUNT(Winery) | nvbench |
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE market (
Market_ID int,
Country text,
Number_cities int
)
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID ... | Please list the years of film market estimations when the market is in country 'Japan' in descending order, and count them by a bar chart | SELECT Year, COUNT(Year) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = "Japan" ORDER BY T1.Year DESC | nvbench |
CREATE TABLE table_name_20 (
against VARCHAR,
status VARCHAR
) | How many against have a status of first test? | SELECT COUNT(against) FROM table_name_20 WHERE status = "first test" | sql_create_context |
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,
... | 姜岚翠这个病人的检验报告结果指标均正常的有哪些?检验报告单号是什么 | SELECT jyjgzbb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info... | css |
CREATE TABLE table_65528 (
"Country" text,
"Builder" text,
"Location" text,
"Ship" text,
"Class / type" text
) | What country was Brage, built by karljohansverns verft, from? | SELECT "Country" FROM table_65528 WHERE "Builder" = 'karljohansverns verft' AND "Ship" = 'brage' | wikisql |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | What are the names and average prices of products for manufacturers whose products cost on average 150 or more. Plot them as bar chart. | SELECT T2.Name, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | nvbench |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purc... | what flights go from CHICAGO to SEATTLE on saturday on CO | 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 = 'SEATTLE' AND date_day.day_number = 26 AND date_day.month_number = 7 AND ... | atis |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom t... | have patient 24921's respiratory rate's been less than 15.0 in 09/last year? | SELECT COUNT(*) > 0 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 = 24921)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respiratory rate'... | 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... | give me the number of patients whose ethnicity is american indian/alaska native and diagnoses icd9 code is 59654? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND diagnoses.icd9_code = "59654" | mimicsql_data |
CREATE TABLE table_29704430_1 (
w INTEGER
) | What is the least w? | SELECT MIN(w) FROM table_29704430_1 | sql_create_context |
CREATE TABLE table_name_91 (
years VARCHAR,
decile VARCHAR
) | The Decile of 6 has which corresponding Years? | SELECT years FROM table_name_91 WHERE decile = "6" | sql_create_context |
CREATE TABLE table_49984 (
"Name" text,
"Built" text,
"Listed" text,
"Location" text,
"County" text
) | What is the date Listed of the Bridge Built in 1864? | SELECT "Listed" FROM table_49984 WHERE "Built" = '1864' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_... | list the patient ids of those patients who in 2105 had been diagnosed with adv eff medicinal nec. | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'adv eff medicinal nec') AND STRFTIME('%y', diagnoses_icd.charttime) = '210... | mimic_iii |
CREATE TABLE county_public_safety (
county_id number,
name text,
population number,
police_officers number,
residents_per_officer number,
case_burden number,
crime_rate number,
police_force text,
location text
)
CREATE TABLE city (
city_id number,
county_id number,
name ... | Count the number of countries. | SELECT COUNT(*) FROM county_public_safety | spider |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | give me the number of patients whose admission year is less than 2131 and procedure short title is open biopsy soft tissue? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2131" AND procedures.short_title = "Open biopsy soft tissue" | mimicsql_data |
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 posts vs. number of bounties. | WITH bounties_cte AS (SELECT COUNT(v.BountyAmount) AS bnt, p.Id AS pid, p.ViewCount AS vc FROM Posts AS p JOIN Votes AS v ON v.PostId = p.Id WHERE v.VoteTypeId = 8 GROUP BY p.Id, p.ViewCount) SELECT bnt AS "bounties_count", COUNT(pid) FROM bounties_cte GROUP BY bnt ORDER BY bnt | sede |
CREATE TABLE zyb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | 看看患者29650849来之前是怎么治疗的 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '29650849' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE ... | css |
CREATE TABLE table_name_96 (
language VARCHAR,
country VARCHAR
) | Name the langauge for switzerland | SELECT language FROM table_name_96 WHERE country = "switzerland" | sql_create_context |
CREATE TABLE table_name_28 (
rank VARCHAR,
gold VARCHAR,
bronze VARCHAR,
silver VARCHAR
) | Tell me the rank for bronze less than 17 and gold less than 1 | SELECT rank FROM table_name_28 WHERE bronze < 17 AND silver > 1 AND gold < 1 | sql_create_context |
CREATE TABLE teachers (
lastname text,
firstname text,
classroom number
)
CREATE TABLE list (
lastname text,
firstname text,
grade number,
classroom number
) | Find the number of teachers who teach the student called MADLOCK RAY. | SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "MADLOCK" AND T1.lastname = "RAY" | spider |
CREATE TABLE table_203_189 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | did they finish in a better position in portugal or greece ? | SELECT "venue" FROM table_203_189 WHERE "venue" IN ('portugal', 'greece') ORDER BY "position" LIMIT 1 | squall |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
... | how many hours are passed since the last time patient 70267 stayed in careunit micu during their current hospital visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70267 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_73 (
opponent VARCHAR,
club VARCHAR,
score VARCHAR
) | Which opponent has a Club of essendon, and a Score of 13.4.82? | SELECT opponent FROM table_name_73 WHERE club = "essendon" AND score = "13.4.82" | sql_create_context |
CREATE TABLE table_203_309 (
id number,
"team" text,
"winners" number,
"runners-up" number,
"years won" text,
"years lost" text
) | which teams have the most number of wins ? | SELECT "team" FROM table_203_309 WHERE "winners" = (SELECT MAX("winners") FROM table_203_309) | squall |
CREATE TABLE table_5851 (
"Designation" text,
"Car numbers" text,
"Manufacturer" text,
"Model No." text,
"First used" text,
"Quantity" real
) | Which Designation has a Manufacturer of siemens, and a Quantity of 52? | SELECT "Designation" FROM table_5851 WHERE "Manufacturer" = 'siemens' AND "Quantity" = '52' | wikisql |
CREATE TABLE table_203_485 (
id number,
"year" text,
"show" text,
"role" text,
"notes" text
) | what was the first tv series that gauri tejwani appeared in ? | SELECT "show" FROM table_203_485 ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_43622 (
"Developer(s)" text,
"Release date" text,
"Required OS" text,
"Genre" text,
"Type" text
) | What type of 3D game did Valve Corporation release? | SELECT "Genre" FROM table_43622 WHERE "Type" = '3d' AND "Developer(s)" = 'valve corporation' | 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 6983? | SELECT demographic.religion FROM demographic WHERE demographic.subject_id = "6983" | mimicsql_data |
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... | A bar chart for what are the number of the name of rooms booked by customers whose first name has 'ROY' in part?, could you display from high to low by the names? | SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY roomName DESC | nvbench |
CREATE TABLE table_69787 (
"Rank" real,
"Player" text,
"Years" text,
"Games" real,
"PPG Avg." real,
"Total Points" real
) | What was the average of points with ranks smaller than 7 but with total point games of 113? | SELECT AVG("Total Points") FROM table_69787 WHERE "Games" = '113' AND "Rank" < '7' | wikisql |
CREATE TABLE table_72249 (
"#" real,
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text,
"Streak" text
) | what is the total number of record where streak is l2 and leading scorer is roy : 23 | SELECT COUNT("Record") FROM table_72249 WHERE "Streak" = 'L2' AND "Leading scorer" = 'Roy : 23' | wikisql |
CREATE TABLE table_name_23 (
loss VARCHAR,
date VARCHAR
) | what team lost on july 30 | SELECT loss FROM table_name_23 WHERE date = "july 30" | 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,... | 查一下患者吕秀媛之前是在哪个医院看病的 | (SELECT mzjzjlb.YLJGDM 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 person_info.XM = '吕秀媛') UNION (SELECT zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = h... | css |
CREATE TABLE table_203_688 (
id number,
"category" text,
"speed\n(km/h)" number,
"speed\n(mph)" number,
"vehicle" text,
"pilot" text,
"date" text
) | what is the next fastest after the rocket powered aircraft ? | SELECT "category" FROM table_203_688 WHERE "speed\n(km/h)" < (SELECT "speed\n(km/h)" FROM table_203_688 WHERE "category" = 'rocket-powered aircraft') ORDER BY "speed\n(km/h)" DESC LIMIT 1 | squall |
CREATE TABLE diagnoses (
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 whose drug code is vori200? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "VORI200" | mimicsql_data |
CREATE TABLE table_name_98 (
silver INTEGER,
gold VARCHAR,
bronze VARCHAR,
rank VARCHAR
) | what is the least silver when bronze is 1, rank is less than 2 and gold is more than 4? | SELECT MIN(silver) FROM table_name_98 WHERE bronze = 1 AND rank < 2 AND gold > 4 | sql_create_context |
CREATE TABLE table_21468 (
"Athlete" text,
"Event" text,
"Round of 64" text,
"Round of 32" text,
"Round of 16" text,
"Quarterfinals" text
) | What was round of 64 of the singles event when the result of round 16 was did not advance and the athlete was Iveta Bene ov ? | SELECT "Round of 64" FROM table_21468 WHERE "Event" = 'Singles' AND "Round of 16" = 'Did not advance' AND "Athlete" = 'Iveta Benešová' | wikisql |
CREATE TABLE mountain (
Name VARCHAR,
Height VARCHAR
) | What is the name of the highest mountain? | SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_name_76 (
city VARCHAR,
venue VARCHAR,
year VARCHAR,
score VARCHAR
) | What city had a score of 20 in aigburth after 1907? | SELECT city FROM table_name_76 WHERE year > 1907 AND score > 20 AND venue = "aigburth" | sql_create_context |
CREATE TABLE table_68944 (
"Year" text,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | who won the women's singles in 1992? | SELECT "Women's singles" FROM table_68944 WHERE "Year" = '1992' | wikisql |
CREATE TABLE table_57092 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many people were in attendance at Hawthorn's home match? | SELECT MIN("Crowd") FROM table_57092 WHERE "Home team" = 'hawthorn' | wikisql |
CREATE TABLE table_name_57 (
attendance INTEGER,
opponent VARCHAR
) | What is the average attendance against the expos? | SELECT AVG(attendance) FROM table_name_57 WHERE opponent = "expos" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diag... | when was patient 027-203413's urinary catheter output: indwelling/continuous ure output for the last time on this month/19? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-203413')) AND intakeoutput.cellpath LIKE '%output... | eicu |
CREATE TABLE table_name_71 (
minister VARCHAR,
term_end VARCHAR
) | Who is the minister with a term end on 10 March 1974? | SELECT minister FROM table_name_71 WHERE term_end = "10 march 1974" | sql_create_context |
CREATE TABLE table_54931 (
"Grade" text,
"Points" real,
"Sit-up (reps)" text,
"Standing Broad Jump (cm)" text,
"Chin-up (reps)" text,
"Shuttle Run (sec)" text,
"2.4km Run (min:sec)" text
) | Which standing broad jump (cm) had the b grade? | SELECT "Standing Broad Jump (cm)" FROM table_54931 WHERE "Grade" = 'b' | wikisql |
CREATE TABLE table_name_60 (
attendance VARCHAR,
competition VARCHAR,
date VARCHAR
) | How many people attended the Scottish Cup on 29.02.2000? | SELECT attendance FROM table_name_60 WHERE competition = "scottish cup" AND date = "29.02.2000" | sql_create_context |
CREATE TABLE table_12094609_1 (
swimsuit VARCHAR,
average VARCHAR
) | what's the swimsuit where average is 8.670 | SELECT swimsuit FROM table_12094609_1 WHERE average = "8.670" | sql_create_context |
CREATE TABLE table_7513 (
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text
) | What is airing at 9:30 on the channel that airs Heroes at 9:00? | SELECT "9:30" FROM table_7513 WHERE "9:00" = 'heroes' | wikisql |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZ... | 从2007年11月6日开始,截止到2012年5月8日,请把47198797的这位病人总共被开出的检验报告单的审核日期时间给列出来 | SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info ON 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 person_info_hz_info.KH = hz_info.KH AND pers... | css |
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 for the first time since 05/2102 was patient 006-146580 prescribed aspirin and 2 ml vial : famotidine 10 mg/ml iv soln at the same time? | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'aspirin' AND patient.uniquepid = '006-146580' AND STRFTIME('%y-%m', medication.drugstarttime) >= '2102-05') AS t1 JOIN (S... | eicu |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
) | What is the average number of stars that each reviewer awards for a movie Show bar chart, and rank in ascending by the y-axis. | SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY AVG(T1.stars) | nvbench |
CREATE TABLE table_6472 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text
) | What was the Score when the Loss was ruthven (1-4)? | SELECT "Score" FROM table_6472 WHERE "Loss" = 'ruthven (1-4)' | wikisql |
CREATE TABLE table_78043 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text,
"Report" text
) | For a date of 29 Sep and a time of 16:40, what is the corresponding Set 3? | SELECT "Set 3" FROM table_78043 WHERE "Date" = '29 sep' AND "Time" = '16:40' | wikisql |
CREATE TABLE table_15213 (
"Game" real,
"Date" text,
"Score" text,
"Location" text,
"Time" text,
"Attendance" real
) | What was the average Game, when the attendance was higher than 56,040? | SELECT AVG("Game") FROM table_15213 WHERE "Attendance" > '56,040' | wikisql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuest... | Exemplo de busca de coment rios de Java. | SELECT * FROM Comments WHERE Text LIKE '%java%' | sede |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
... | get me the top four most common treatments during this year? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of ye... | mimic_iii |
CREATE TABLE table_name_11 (
week_2 VARCHAR,
week_3 VARCHAR
) | When Star Zemba was featured in Week 3, who was the cyber girl for Week 2? | SELECT week_2 FROM table_name_11 WHERE week_3 = "star zemba" | sql_create_context |
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_DIRE_CD text,
MED_DIRE_NM text,... | 把团伙成员65616004最常选择去的几家医院排序查看一下 | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '65616004' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_80 (
week INTEGER,
result VARCHAR
) | What is the average Week, when Result is l 37 34? | SELECT AVG(week) FROM table_name_80 WHERE result = "l 37–34" | sql_create_context |
CREATE TABLE table_name_61 (
host_team VARCHAR,
visiting_team VARCHAR
) | Who is the Host team that has a chicago bears as a visiting team? | SELECT host_team FROM table_name_61 WHERE visiting_team = "chicago bears" | sql_create_context |
CREATE TABLE table_60236 (
"Commercial balance" text,
"2003" real,
"2004" real,
"2005" real,
"2006" real
) | How much 2005 has a 2006 larger than 4,67, and a 2004 of -14,76? | SELECT COUNT("2005") FROM table_60236 WHERE "2006" > '4,67' AND "2004" = '-14,76' | wikisql |
CREATE TABLE table_name_25 (
leftfielder VARCHAR,
year VARCHAR,
shortstop VARCHAR,
second_baseman VARCHAR
) | What is the name of the Leftfielder when the Shortstop was bill russell, and the Second Baseman was steve sax in 1983? | SELECT leftfielder FROM table_name_25 WHERE shortstop = "bill russell" AND second_baseman = "steve sax" AND year = 1983 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
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,
JCZBJGDX text... | 在患者卫光临的诊疗记录里,从04年6月8日到21年1月17日这期间,为其检测指标224990的医务人员有哪几位,报一下工号及姓名 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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 mzjzj... | css |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
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 T... | flights from ATLANTA to WASHINGTON | 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 = 'WASHIN... | atis |
CREATE TABLE table_1342149_42 (
result VARCHAR,
candidates VARCHAR
) | What is the candidates result that is tom j. murray (d) unopposed? | SELECT result FROM table_1342149_42 WHERE candidates = "Tom J. Murray (D) Unopposed" | sql_create_context |
CREATE TABLE table_38882 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | What was the number of Laps with a Grid of more than 3 and Time of 39:24.967? | SELECT MIN("Laps") FROM table_38882 WHERE "Grid" > '3' AND "Time" = '39:24.967' | wikisql |
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE flight (
flno number(4,0),
origin var... | Return a bar chart on what are the names and distances for all airplanes?, and could you rank by the x axis in desc? | SELECT name, distance FROM aircraft ORDER BY name DESC | nvbench |
CREATE TABLE table_28749 (
"Song title" text,
"Artist" text,
"Year Year of songs original release, as listed in Rock Band 3" real,
"Genre" text,
"Keyboard support" text,
"Vocal parts" real,
"Nintendo DS setlist" text
) | How many different genres appear for the Jimi Hendrix Experience? | SELECT COUNT("Genre") FROM table_28749 WHERE "Artist" = 'The Jimi Hendrix Experience' | wikisql |
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 died in or before 2158 and primarily had st elevated myocardial infraction\cardiac cath? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.dod_year <= "2158.0" | mimicsql_data |
CREATE TABLE table_7850 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Who was the runner-up with the margin of victory of 8 strokes? | SELECT "Runner(s)-up" FROM table_7850 WHERE "Margin of victory" = '8 strokes' | wikisql |
CREATE TABLE table_name_21 (
away_team VARCHAR
) | What was St Kilda's away team score? | SELECT away_team AS score FROM table_name_21 WHERE away_team = "st kilda" | sql_create_context |
CREATE TABLE table_41107 (
"Rank" real,
"City 1" text,
"City 2" text,
"2012 Passengers (in millions)" real,
"2011 Passengers (in millions)" text,
"Distance" text
) | What is the City 1 that has less than 8.211 million passengers and traveled 1075km in distance? | SELECT "City 1" FROM table_41107 WHERE "2012 Passengers (in millions)" < '8.211' AND "Distance" = '1075km' | wikisql |
CREATE TABLE table_name_21 (
revenue__ VARCHAR,
operating_income__$m_ VARCHAR,
country VARCHAR,
team VARCHAR
) | Name the total number of revenue for italy with team of internazionale with operating income less than 27 | SELECT COUNT(revenue__) AS $m_ FROM table_name_21 WHERE country = "italy" AND team = "internazionale" AND operating_income__$m_ < 27 | sql_create_context |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int... | For artist names who are not from the United States, how many names in each year?, and I want to sort by the y axis in descending. | SELECT Year_Join, COUNT(Year_Join) FROM artist WHERE Country <> 'United States' GROUP BY Name ORDER BY COUNT(Year_Join) DESC | nvbench |
CREATE TABLE table_26781017_1 (
moto2_winner VARCHAR,
grand_prix VARCHAR
) | Who are all the Moto2 winners when the grand prix was Shell Advance Malaysian Grand Prix? | SELECT moto2_winner FROM table_26781017_1 WHERE grand_prix = "Shell Advance Malaysian grand_prix" | sql_create_context |
CREATE TABLE table_12591022_2 (
program VARCHAR,
focus VARCHAR
) | What is the program where the focus is risk management and regulation? | SELECT program FROM table_12591022_2 WHERE focus = "Risk Management and Regulation" | sql_create_context |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,... | All my posts with Github Lines (convert to tagged repo). | SELECT q.Id AS "post_link", a.Body FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id WHERE a.OwnerUserId = '##UserId##' | sede |
CREATE TABLE table_203_717 (
id number,
"number" number,
"year built" number,
"livery" text,
"current status" text,
"notes" text
) | how many of these cars are operational ? | SELECT COUNT(*) FROM table_203_717 WHERE "current status" = 'operational' | squall |
CREATE TABLE table_28190534_1 (
constructor VARCHAR,
no VARCHAR
) | Name the constructor for number 10 | SELECT constructor FROM table_28190534_1 WHERE no = 10 | sql_create_context |
CREATE TABLE table_name_65 (
established VARCHAR,
sport VARCHAR,
venue VARCHAR
) | What is the total number of Established for soccer plated in kuntz stadium? | SELECT COUNT(established) FROM table_name_65 WHERE sport = "soccer" AND venue = "kuntz stadium" | 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_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | when is the first procedure patient 52018 received in 2104? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52018) AND STRFTIME('%y', procedures_icd.charttime) = '2104' ORDER BY procedures_icd.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_19605700_1 (
capital VARCHAR,
area_km² VARCHAR
) | Which capitals have an area of exactly 377930 square km? | SELECT capital FROM table_19605700_1 WHERE area_km² = 377930 | sql_create_context |
CREATE TABLE table_name_14 (
apparent_magnitude VARCHAR,
ngc_number VARCHAR
) | what is the apparent magnitude of NGC number 6027d? | SELECT apparent_magnitude FROM table_name_14 WHERE ngc_number = "6027d" | sql_create_context |
CREATE TABLE table_name_22 (
erp_w INTEGER,
call_sign VARCHAR
) | What is listed as the highest ERP W with a Call sign of W262AC? | SELECT MAX(erp_w) FROM table_name_22 WHERE call_sign = "w262ac" | sql_create_context |
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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
... | For those employees who did not have any job in the past, show me about the distribution of job_id and the average of department_id , and group by attribute job_id in a bar chart, I want to list from high to low by the y axis. | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE table_28395 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined MAC" real
) | What is the highest enrollment schools that joined the mac in 1997? | SELECT MAX("Enrollment") FROM table_28395 WHERE "Joined MAC" = '1997' | wikisql |
CREATE TABLE table_name_23 (
player VARCHAR,
round VARCHAR
) | What is the Player in Round 5? | SELECT player FROM table_name_23 WHERE round = 5 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.