context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_59 (
silver VARCHAR,
rank VARCHAR,
total VARCHAR
) | What is the total number of silver medals of the team ranked 7 with more than 1 total medal? | SELECT COUNT(silver) FROM table_name_59 WHERE rank = "7" AND total > 1 | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, a scatter chart shows the correlation between price and manufacturer , and group by attribute founder. | SELECT Price, Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE table_48404 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | Who was the visiting team on April 6? | SELECT "Visitor" FROM table_48404 WHERE "Date" = 'april 6' | wikisql |
CREATE TABLE table_14342367_11 (
position VARCHAR,
player VARCHAR
) | What position did Joe Maddock play? | SELECT position FROM table_14342367_11 WHERE player = "Joe Maddock" | sql_create_context |
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,
... | what is the five year survival rate of patients with congestive heart failure - combined systolic and diastolic diagnosed? | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... | eicu |
CREATE TABLE table_name_57 (
score VARCHAR,
date VARCHAR
) | What was the score on March 3, 2008? | SELECT score FROM table_name_57 WHERE date = "march 3, 2008" | sql_create_context |
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name V... | List the name and the number of enrolled student for each course in a bar chart. | SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name | 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,
... | what were the five most frequent drugs prescribed within the same month to the patients aged 60 or above after they had been diagnosed with hepatic dysfunction - chronic,? | SELECT t3.drugname FROM (SELECT t2.drugname, 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 = 'hepatic dysfunction - chronic') AS t1 JOIN (SELECT... | eicu |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what is the maximum total cost of a hospital involving a laboratory test for hyaline casts until 2101? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hyaline casts')) AND STRFTIME('%y', cost.chargetime) <= '2101' GROUP BY cost.hadm_id) AS t1 | mimic_iii |
CREATE TABLE affected_region (
region_id number,
storm_id number,
number_city_affected number
)
CREATE TABLE region (
region_id number,
region_code text,
region_name text
)
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions... | What are the names of regions with two or more storms? | SELECT T1.region_name FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id HAVING COUNT(*) >= 2 | spider |
CREATE TABLE table_name_30 (
tournament VARCHAR
) | What is the tournament that had a result of A in 1954 and NH in 1942? | SELECT tournament FROM table_name_30 WHERE 1954 = "a" AND 1942 = "nh" | sql_create_context |
CREATE TABLE table_15965 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What positions do the hartford whalers nhl team have? | SELECT "Position" FROM table_15965 WHERE "NHL team" = 'Hartford Whalers' | 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 ftxmzjzjlb (
HXPLC number,
HZ... | 从2007年4月24到2014年10月25日的这段时间里,看看病患彭馨欣在医疗机构4381298的门诊记录 | SELECT COUNT(*) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '彭馨欣' AND txmzjzjlb.JZKSRQ BETWEEN '2007-04-24' AND '2014-10-25' AND txmzjzjlb.YLJGDM = '4381298' UNI... | css |
CREATE TABLE table_name_36 (
date VARCHAR,
circuit VARCHAR
) | What Date has a Circuit of cremona? | SELECT date FROM table_name_36 WHERE circuit = "cremona" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalpe... | what were the five drugs that were ordered the most frequently in this year? | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE procedures (
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 diagnoses (
... | how many patients died in or before year 2174 with the drug code ibup600? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2174.0" AND prescriptions.formulary_drug_cd = "IBUP600" | 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... | From which location was the patient Thomas Nazario admitted to the hospital? | SELECT demographic.admission_location FROM demographic WHERE demographic.name = "Thomas Nazario" | mimicsql_data |
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,
... | 在2012年8月24日到2020年5月4日内病人尤云霞被开出的所有检验报告单的检验报告单号都有哪些? | SELECT zyjybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE person_info.XM = '尤云霞' ... | css |
CREATE TABLE table_203_678 (
id number,
"rank" number,
"wrestler" text,
"no. of reigns" number,
"combined\ndefenses" number,
"combined\ndays" number
) | the difference between the 1 rank defenses and days | SELECT ABS("combined\ndefenses" - "combined\ndays") FROM table_203_678 WHERE "rank" = 1 | squall |
CREATE TABLE table_17200372_2 (
departure VARCHAR,
going_to VARCHAR
) | Name the departure for spalding | SELECT departure FROM table_17200372_2 WHERE going_to = "Spalding" | sql_create_context |
CREATE TABLE table_44996 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What's the score of Jeff Maggert in T2 place? | SELECT "Score" FROM table_44996 WHERE "Place" = 't2' AND "Player" = 'jeff maggert' | 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,
... | count the number of patients whose diagnoses short title is anorexia and drug route is neb? | 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.short_title = "Anorexia" AND prescriptions.route = "NEB" | mimicsql_data |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Top 500 answerers on the site for CUDA. A list of the top 500 users with the highest average answer score excluding
community wiki / closed posts or users with less than 10 answers | SELECT Users.Id AS "user_link", COUNT(a.Id) AS Answers, CAST(AVG(CAST(a.Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_answer_score" FROM (SELECT b.* FROM Posts AS b INNER JOIN PostTags AS pt ON pt.PostId = b.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE TagName IN ('cuda') AND b.PostTypeId = 0 AND CommunityOwnedDate ... | sede |
CREATE TABLE table_203_367 (
id number,
"year" text,
"driver" text,
"constructor" text,
"location" text,
"report" text
) | who won previous to graham hill ? | SELECT "driver" FROM table_203_367 WHERE id = (SELECT id FROM table_203_367 WHERE "driver" = 'graham hill') - 1 | squall |
CREATE TABLE table_29701 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
) | What are the wins for the 7th position? | SELECT "Wins" FROM table_29701 WHERE "Position" = '7th' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate ti... | Top users by City (Juiz de Fora). | SELECT Id, Reputation, DisplayName, Location FROM Users WHERE UPPER(Location) LIKE '%BARDUFOSS, NORGE%' ORDER BY Reputation DESC | sede |
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... | provide the number of patients whose diagnoses long title is sepsis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Sepsis" | mimicsql_data |
CREATE TABLE table_name_11 (
platform VARCHAR,
system VARCHAR
) | What is the name of the platform used for various computers and consoles? | SELECT platform FROM table_name_11 WHERE system = "various computers and consoles" | sql_create_context |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | i need information on flights leaving DALLAS arriving in BOSTON leaving DALLAS early in the morning | 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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON... | atis |
CREATE TABLE table_name_85 (
away_team VARCHAR,
venue VARCHAR
) | What did the away team score at Kardinia Park? | SELECT away_team AS score FROM table_name_85 WHERE venue = "kardinia park" | sql_create_context |
CREATE TABLE table_name_49 (
team__number1 VARCHAR
) | What is the second leg that has kk bosna? | SELECT 2 AS nd_leg FROM table_name_49 WHERE team__number1 = "kk bosna" | sql_create_context |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row... | count the number of patients who have been dead after having been diagnosed with chronic sinusitis nos in the same month until 2 years ago. | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... | mimic_iii |
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
) | A bar chart for what are the number of the names of products with price at most 200?, and rank by the X from low to high. | SELECT Name, COUNT(Name) FROM Products WHERE Price <= 200 GROUP BY Name ORDER BY Name | nvbench |
CREATE TABLE table_name_58 (
replication_site VARCHAR,
envelopment VARCHAR,
family VARCHAR
) | What is the replication site when the species is enveloped and is of the bunyaviridae family? | SELECT replication_site FROM table_name_58 WHERE envelopment = "enveloped" AND family = "bunyaviridae" | sql_create_context |
CREATE TABLE table_26866299_1 (
original_airdate VARCHAR,
writer VARCHAR
) | What was the original air date of the episode written by michael glassberg? | SELECT original_airdate FROM table_26866299_1 WHERE writer = "Michael Glassberg" | sql_create_context |
CREATE TABLE mzb (
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... | 二零零四年四月二十一日到二零一三年三月十八日,查一下在这段时间患者彭志勇买西药的次数 | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '彭志勇' AND t_kc22.STA_DATE BETWEEN '2004-04-21' AND '2013-03-18' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '彭志勇' A... | css |
CREATE TABLE table_25042332_27 (
region VARCHAR,
vehicle VARCHAR
) | Name the region for 39.2% vehicle | SELECT region FROM table_25042332_27 WHERE vehicle = "39.2%" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type t... | what was the name of the laboratory test that patient 96774 has received for the first time on the first hospital encounter? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96774 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime LI... | mimic_iii |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
r... | flights from ST. PAUL to HOUSTON | 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 = 'ST. PAUL' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUST... | atis |
CREATE TABLE table_train_258 (
"id" int,
"gender" string,
"autoimmune_disease" bool,
"renal_disease" bool,
"hepatic_disease" bool,
"immune_deficiency_disorder" bool,
"active_hepatitis" bool,
"body_mass_index_bmi" float,
"NOUSE" float
) | active autoimmune or immune deficiency disorder | SELECT * FROM table_train_258 WHERE autoimmune_disease = 1 OR immune_deficiency_disorder = 1 | criteria2sql |
CREATE TABLE table_40082 (
"Round" real,
"Location" text,
"Circuit" text,
"Date" text,
"Winning Driver" text,
"Winning Team" text
) | Which date has a round more than 9? | SELECT "Date" FROM table_40082 WHERE "Round" > '9' | wikisql |
CREATE TABLE table_204_639 (
id number,
"poll company" text,
"source" text,
"publication date" text,
"psuv" number,
"opposition" number,
"undecided" number
) | which poll company has the most opposition ? | SELECT "poll company" FROM table_204_639 ORDER BY "opposition" DESC LIMIT 1 | squall |
CREATE TABLE table_2190919_3 (
team_s_ VARCHAR,
avg_start VARCHAR
) | If the average start is 11.8, what was the team name? | SELECT team_s_ FROM table_2190919_3 WHERE avg_start = "11.8" | sql_create_context |
CREATE TABLE table_name_24 (
distance VARCHAR,
race VARCHAR
) | What is the distance of the Sam's town 250 race? | SELECT distance FROM table_name_24 WHERE race = "sam's town 250" | sql_create_context |
CREATE TABLE table_2477 (
"Period" text,
"Civilians" real,
"Security forces" real,
"Insurgents" real,
"Total per period" real
) | How many insurgents have 602 as the total per period? | SELECT MAX("Insurgents") FROM table_2477 WHERE "Total per period" = '602' | wikisql |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number ... | At what times in the morning is the course WOMENSTD 698 ? | SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year 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 = 'WOMENSTD' AND... | advising |
CREATE TABLE table_1341453_34 (
party VARCHAR,
incumbent VARCHAR
) | What party is John McHugh a member of? | SELECT party FROM table_1341453_34 WHERE incumbent = "John McHugh" | sql_create_context |
CREATE TABLE table_71467 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What was the score when St. Louis was the visiting team? | SELECT "Score" FROM table_71467 WHERE "Visitor" = 'st. louis' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
... | had patient 007-2001 undergone anticonvulsant - phenytoin? | 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 = '007-2001')) AND treatment.treatmentname = 'anticonvulsant - phenytoin' | eicu |
CREATE TABLE table_1245350_1 (
production_period VARCHAR,
units_produced VARCHAR
) | When were 668 units produced? | SELECT production_period FROM table_1245350_1 WHERE units_produced = 668 | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_i... | how many hours does it have passed since patient 92846 was admitted to the icu? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92846) AND icustays.outtime 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many patients whose ethnicity is black/african american and drug type is additive? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_10360656_1 (
round INTEGER,
player_name VARCHAR
) | What round was Steve Stonebreaker drafted? | SELECT MAX(round) FROM table_10360656_1 WHERE player_name = "Steve Stonebreaker" | sql_create_context |
CREATE TABLE table_name_2 (
races INTEGER,
series VARCHAR,
team VARCHAR
) | How many races did the Formula Three Euroseries signature team have? | SELECT SUM(races) FROM table_name_2 WHERE series = "formula three euroseries" AND team = "signature" | sql_create_context |
CREATE TABLE table_21350934_2 (
result VARCHAR,
round VARCHAR
) | What is the result of the qf round? | SELECT result FROM table_21350934_2 WHERE round = "QF" | sql_create_context |
CREATE TABLE table_29716 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Table" text,
"Incoming manager" text,
"Date of appointment" text
) | What is the date of appointment when the date of vacancy is 24 november 2010? | SELECT "Date of appointment" FROM table_29716 WHERE "Date of vacancy" = '24 November 2010' | wikisql |
CREATE TABLE table_203_696 (
id number,
"year" number,
"single" text,
"charts\nfr" number,
"charts\nbel\nwa" number,
"charts\nswi" number,
"certification" number,
"album" text
) | what is the name of the single that was not released before 2012 ? | SELECT "single" FROM table_203_696 WHERE "year" >= 2012 | squall |
CREATE TABLE table_name_17 (
gold VARCHAR,
rank VARCHAR,
total VARCHAR
) | How many golds have 3 as the rank, with a total greater than 7? | SELECT COUNT(gold) FROM table_name_17 WHERE rank = "3" AND total > 7 | sql_create_context |
CREATE TABLE table_name_94 (
home_team VARCHAR,
game VARCHAR
) | Who is the home team in game 2? | SELECT home_team FROM table_name_94 WHERE game = "game 2" | sql_create_context |
CREATE TABLE constructorStandings (
constructorStandingsId INTEGER,
raceId INTEGER,
constructorId INTEGER,
points REAL,
position INTEGER,
positionText TEXT,
wins INTEGER
)
CREATE TABLE constructorResults (
constructorResultsId INTEGER,
raceId INTEGER,
constructorId INTEGER,
... | Find the id and location of circuits that belong to France or Belgium Plot them as bar chart, order in asc by the names. | SELECT location, circuitId FROM circuits WHERE country = "France" OR country = "Belgium" ORDER BY location | nvbench |
CREATE TABLE table_name_42 (
silver INTEGER,
country VARCHAR,
total VARCHAR
) | When the country is Cambodia and the total is smaller than 1 what's the lowest silver? | SELECT MIN(silver) FROM table_name_42 WHERE country = "cambodia" AND total < 1 | sql_create_context |
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,
... | Get the number of patients with a 2108-10-04 05:05:00 lab test chart time. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2108-10-04 05:05:00" | mimicsql_data |
CREATE TABLE table_name_22 (
e_coli VARCHAR,
substrates VARCHAR
) | Which E. coli has a substrate of uracil? | SELECT e_coli FROM table_name_22 WHERE substrates = "uracil" | sql_create_context |
CREATE TABLE table_76626 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Time" text
) | What was the resolution for the fight against tom bolger by submission (guillotine choke)? | SELECT "Res." FROM table_76626 WHERE "Method" = 'submission (guillotine choke)' AND "Opponent" = 'tom bolger' | wikisql |
CREATE TABLE table_23322 (
"Vehicle Category" text,
"Till Aligarh" real,
"Till Mathura" real,
"Till Agra" real,
"For Round Trip" real
) | If the vehicle category is multi-axle vehicle, what is the till aligarh? | SELECT MIN("Till Aligarh") FROM table_23322 WHERE "Vehicle Category" = 'Multi-axle Vehicle' | wikisql |
CREATE TABLE table_15621965_17 (
no INTEGER,
position VARCHAR,
school_club_team VARCHAR
) | What is the latest number of the guard position from the Wake Forest school team? | SELECT MAX(no) FROM table_15621965_17 WHERE position = "Guard" AND school_club_team = "Wake Forest" | sql_create_context |
CREATE TABLE table_56968 (
"Track" real,
"Title" text,
"Translation" text,
"Composer" text,
"Recorded" text
) | WhatTranslation has a Composer of jacques brel, rod mckuen? | SELECT "Translation" FROM table_56968 WHERE "Composer" = 'jacques brel, rod mckuen' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org... | what was the last height of patient 28959 until 41 months ago? | SELECT chartevents.valuenum 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 = 28959)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'... | 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... | what is drug code and drug route of drug name ferrous sulfate? | SELECT prescriptions.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Ferrous Sulfate" | mimicsql_data |
CREATE TABLE table_name_31 (
digital_channel VARCHAR,
network VARCHAR
) | Network of nbc is what digital channel? | SELECT digital_channel FROM table_name_31 WHERE network = "nbc" | sql_create_context |
CREATE TABLE table_train_73 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"severe_sepsis" bool,
"in_another_study" bool,
"systolic_blood_pressure_sbp" int,
"skin_mottling_score" int,
"glasgow_come_score_gcs" int,
"mr_scanning" bool,
"age" float,
"NOUSE" float
) | patients with contraindications to mr scanning. | SELECT * FROM table_train_73 WHERE mr_scanning = 0 | criteria2sql |
CREATE TABLE table_203_95 (
id number,
"year" text,
"democratic\nparty" number,
"republican\nparty" number,
"independent\n/ other" text,
"majority" number
) | in what years did independent/other party have majority control in the south carolina house of representatives ? | SELECT "year" FROM table_203_95 WHERE "independent\n/ other" > "republican\nparty" AND "independent\n/ other" > "democratic\nparty" | squall |
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 lab (
subject_id text,
hadm_id text,
... | what is gender and lab test name of subject id 2560? | SELECT demographic.gender, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_65057 (
"Heat" real,
"Name" text,
"Nationality" text,
"Reaction" real,
"Result" text
) | What is the average reaction for brigitte foster-hylton after heat 1? | SELECT AVG("Reaction") FROM table_65057 WHERE "Heat" > '1' AND "Name" = 'brigitte foster-hylton' | wikisql |
CREATE TABLE table_18607260_6 (
points INTEGER,
team VARCHAR
) | Name the maximum points for libertad | SELECT MAX(points) FROM table_18607260_6 WHERE team = "Libertad" | sql_create_context |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty_Participates_in (
Fac... | For each faculty rank, show the number of faculty members who have it Show bar chart, and could you order from low to high by the bar? | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY Rank | nvbench |
CREATE TABLE table_23927 (
"Name" text,
"#" real,
"Height" text,
"Weight" real,
"Position" text,
"Year" text,
"Home Town" text,
"High School" text
) | What position is the player from Chapel Hill, NC? | SELECT "Position" FROM table_23927 WHERE "Home Town" = 'Chapel Hill, NC' | wikisql |
CREATE TABLE table_name_60 (
status VARCHAR,
area_km_2 VARCHAR,
census_ranking VARCHAR
) | What is the status of the community that has an area larger than 5.2 sq km, and a Census Ranking of 2,531 of 5,008? | SELECT status FROM table_name_60 WHERE area_km_2 > 5.2 AND census_ranking = "2,531 of 5,008" | sql_create_context |
CREATE TABLE submission (
College VARCHAR
) | Show the most common college of authors of submissions. | SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_2562572_27 (
settlement VARCHAR,
cyrillic_name_other_names VARCHAR
) | How many places have as their cyrillic name and other names ? | SELECT COUNT(settlement) FROM table_2562572_27 WHERE cyrillic_name_other_names = "Његошево" | sql_create_context |
CREATE TABLE table_21368 (
"Official Name" text,
"Status" text,
"Area km 2" text,
"Population" real,
"Census Ranking" text
) | What was the population for census ranking 782 of 5,008? | SELECT "Population" FROM table_21368 WHERE "Census Ranking" = '782 of 5,008' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 前往9414834医院就诊的患者03371547入院科室的名字没有造口的住院就诊记录都有啥? | SELECT * FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i... | css |
CREATE TABLE table_54841 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | Atlanta was a visitor on December 8, what was their record? | SELECT "Record" FROM table_54841 WHERE "Visitor" = 'atlanta' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
... | 那个名叫孙泽语的病患在医院6562227中就诊时诊科室名称不包含血液病的所有医疗就诊记录都列出一下? | SELECT * FROM t_kc21 WHERE t_kc21.PERSON_NM = '孙泽语' AND t_kc21.MED_SER_ORG_NO = '6562227' AND NOT t_kc21.MED_ORG_DEPT_NM LIKE '%血液病%' | css |
CREATE TABLE table_name_80 (
other VARCHAR,
atheism VARCHAR
) | What is the value of other religions associated with atheism at 1.86%? | SELECT other FROM table_name_80 WHERE atheism = "1.86%" | sql_create_context |
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... | List all comments for a tag for a user. | SELECT C.Id AS "comment_link", * FROM Comments AS C WHERE UserId = @UserId ORDER BY C.CreationDate DESC | sede |
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Format text,
Catalogue text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int... | How many parties of the time they took office, binning the took office into Year interval, and then split by the minister's name. | SELECT Took_office, COUNT(Took_office) FROM party GROUP BY Minister | nvbench |
CREATE TABLE table_name_80 (
rank INTEGER,
singapore_cup VARCHAR,
name VARCHAR
) | What is the sum of Rank that when the Singapore Cup is 0 (1), and the Name is masrezwan masturi? | SELECT SUM(rank) FROM table_name_80 WHERE singapore_cup = "0 (1)" AND name = "masrezwan masturi" | sql_create_context |
CREATE TABLE table_54787 (
"Type" text,
"Sign" real,
"Exponent" real,
"Significand" real,
"Total bits" real,
"Exponent bias" real,
"Bits precision" real,
"Number of decimal digits" text
) | What's the sum of significand with ~34.0 decimal digits and an exponent bias larger than 16383? | SELECT SUM("Significand") FROM table_54787 WHERE "Number of decimal digits" = '~34.0' AND "Exponent bias" > '16383' | wikisql |
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,
... | what is the name of the treatment that patient 008-32147 had been given two or more times until 03/2102? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | eicu |
CREATE TABLE table_35196 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | What is the segment for Netflix episode S08E04? | SELECT "Segment A" FROM table_35196 WHERE "Netflix" = 's08e04' | wikisql |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | show me the price of all flights from ATLANTA to WASHINGTON | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city... | atis |
CREATE TABLE table_name_92 (
segment_c VARCHAR,
segment_b VARCHAR
) | When segment B is s pineapple, what is the segment C? | SELECT segment_c FROM table_name_92 WHERE segment_b = "s pineapple" | sql_create_context |
CREATE TABLE table_name_35 (
round VARCHAR,
opponent VARCHAR
) | What is the Round with an Opponent that is torpedo moscow? | SELECT round FROM table_name_35 WHERE opponent = "torpedo moscow" | sql_create_context |
CREATE TABLE table_204_114 (
id number,
"pos" text,
"rider" text,
"manufacturer" text,
"time/retired" text,
"grid" number,
"points" number
) | who received more points , alex debon or toni elias ? | SELECT "rider" FROM table_204_114 WHERE "rider" IN ('alex debon', 'toni elias') ORDER BY "points" DESC LIMIT 1 | squall |
CREATE TABLE table_name_2 (
away_team VARCHAR,
home_team VARCHAR
) | what is the away team score when the home team is essendon? | SELECT away_team AS score FROM table_name_2 WHERE home_team = "essendon" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
... | have any microbiological testing been done on patient 42473's fluid wound in this month? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42473) AND microbiologyevents.spec_type_desc = 'fluid wound' AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', ... | mimic_iii |
CREATE TABLE table_name_94 (
visitor VARCHAR,
date VARCHAR
) | Who is the Visitor on april 8? | SELECT visitor FROM table_name_94 WHERE date = "april 8" | sql_create_context |
CREATE TABLE table_9881 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | Who were the opponents when the score was 2 6, 3 6? | SELECT "Opponents in the final" FROM table_9881 WHERE "Score in the final" = '2–6, 3–6' | wikisql |
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 ... | 被诊断为疾病F95.742的患者张兴邦,他的检测指标517400的结果定量和单位如何 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.