context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_76 (
co_drivers VARCHAR,
year VARCHAR
) | What were the co-drivers in 2008? | SELECT co_drivers FROM table_name_76 WHERE year = 2008 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | provide the number of patients whose admission type is urgent and diagnoses icd9 code is 2948? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.icd9_code = "2948" | mimicsql_data |
CREATE TABLE table_55378 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many people attended game 42? | SELECT "Location Attendance" FROM table_55378 WHERE "Game" = '42' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | calculate the number of patients with cerebral mass of unknown etiology - likely tumor diagnosed during a year before. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'cerebral mass of unknown etiology - likely tumor' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year'... | eicu |
CREATE TABLE table_32805 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the away team when the away team score is 10.10 (70)? | SELECT "Away team" FROM table_32805 WHERE "Away team score" = '10.10 (70)' | wikisql |
CREATE TABLE table_57408 (
"Crew" real,
"Year 10 1st Quad" text,
"Year 10 2nd Quad" text,
"Year 10 3rd Quad" text,
"Year 10 4th Quad" text,
"Year 10 Single Scull" text,
"Year 9 1st Quad" text,
"Year 9 2nd Quad" text,
"Year 9 3rd Quad" text,
"Year 9 4th Quad" text,
"Year 9 Sin... | In the Crews beyond 2006 what was the Year 8 1st Quads that exists in the same row that had the year 9 2nd Quads of BGGS? | SELECT "Year 8 1st Quad" FROM table_57408 WHERE "Year 9 2nd Quad" = 'bggs' AND "Crew" > '2006' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
ro... | what are the five most frequently ordered lab tests for patients that have already been diagnosed with esoph varice oth dis nos within 2 months,? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.i... | mimic_iii |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE status (
station_i... | A line chart for what are the number of the dates that have an average sea level pressure between 30.3 and 31? | SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 GROUP BY date | nvbench |
CREATE TABLE table_name_72 (
became_dauphine VARCHAR,
birth VARCHAR
) | When was became dauphine when birth is 1393? | SELECT became_dauphine FROM table_name_72 WHERE birth = "1393" | sql_create_context |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE... | For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, display in ascending by the y-axis. | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_name_89 (
date VARCHAR,
week VARCHAR
) | What date was the week 10 game? | SELECT date FROM table_name_89 WHERE week = 10 | sql_create_context |
CREATE TABLE table_36888 (
"Year" real,
"Trim" text,
"Engine" text,
"Power" text,
"Torque" text,
"EPA (2008) City" text
) | Which Engine has a Year that's Larger than 2006 and Power of BHP (KW)? | SELECT "Engine" FROM table_36888 WHERE "Year" > '2006' AND "Power" = 'bhp (kw)' | wikisql |
CREATE TABLE table_203_54 (
id number,
"selected\nlatin american\ncountries" text,
"internl.\ntourism\narrivals\n2010\n(x 1000)" number,
"internl.\ntourism\nreceipts.\n2010\n(usd\n(x1000)" number,
"average\nreceipt\nper visitor\n2009\n(usd/turista)" number,
"tourist\narrivals\nper\n1000 inhab\n(... | what is the name of the country that had the most international tourism arrivals in 2010 ? | SELECT "selected\nlatin american\ncountries" FROM table_203_54 ORDER BY "internl.\ntourism\narrivals\n2010\n(x 1000)" DESC LIMIT 1 | squall |
CREATE TABLE table_name_21 (
rank VARCHAR,
constituency VARCHAR,
result VARCHAR,
winning_party_2003 VARCHAR,
swing_to_gain VARCHAR
) | Which rank had the Labour party winning in 2003, a swing to gain that was larger than 2.13, a lab hold as a result, and which took place in the Linlithgow constituency? | SELECT rank FROM table_name_21 WHERE winning_party_2003 = "labour" AND swing_to_gain > 2.13 AND result = "lab hold" AND constituency = "linlithgow" | sql_create_context |
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE writes (
paperid int,
authori... | How many papers does Graham Neubig have in TACL ? | SELECT DISTINCT COUNT(paper.paperid) FROM author, paper, venue, writes WHERE author.authorname = 'Graham Neubig' AND venue.venueid = paper.venueid AND venue.venuename = 'TACL' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
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,
... | give me the number of patients whose days of hospital stay is greater than 2 and lab test name is anion gap? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "2" AND lab.label = "Anion Gap" | mimicsql_data |
CREATE TABLE table_name_93 (
railway_number_s_ VARCHAR,
year_s__of_manufacture VARCHAR
) | Which Railway number(s) has a Year(s) of manufacture of 1899 1907? | SELECT railway_number_s_ FROM table_name_93 WHERE year_s__of_manufacture = "1899–1907" | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABL... | SO age rep post review. | SELECT age, COUNT(*) AS programmers, AVG(CAST(Reputation AS FLOAT)) AS avg_reputation, SUM(CAST(Reputation AS FLOAT)) AS total_reputation, STDEV(CAST(Reputation AS FLOAT)) AS stdev_reputation, SUM(CAST(DATEDIFF(month, CreationDate, GETDATE()) AS FLOAT)) AS person_months FROM Users WHERE NOT age IS NULL AND age BETWEEN ... | sede |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time... | i need a flight from PITTSBURGH to NEW YORK departing after 1700 | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW YORK' AND flight.departure_time > 1700 AND flight.to_airport = AIRPORT_SERVICE_1.airp... | atis |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password... | A bar chart about what are the student IDs and middle names of the students enrolled in at most two courses?, and display in desc by the Y. | SELECT T2.middle_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.student_id DESC | nvbench |
CREATE TABLE table_10551 (
"Name" text,
"Number" text,
"Builder" text,
"Date built" text,
"Wheel arrangement" text,
"Driving wheels" text,
"Cylinders" text,
"Boiler pressure" text,
"Notes" text
) | What is the wheel arrangement for the model with 10' x 15' cylinders? | SELECT "Wheel arrangement" FROM table_10551 WHERE "Cylinders" = '10" x 15' | wikisql |
CREATE TABLE table_name_45 (
away_team VARCHAR,
venue VARCHAR
) | Who is the away team when the venue is cairns convention centre? | SELECT away_team FROM table_name_45 WHERE venue = "cairns convention centre" | sql_create_context |
CREATE TABLE table_25970 (
"Rank" real,
"Runs" real,
"Player" text,
"Matches" real,
"Innings" real,
"Not Out" real,
"Average" text
) | What is the name of the player if the innings is 82? | SELECT "Player" FROM table_25970 WHERE "Innings" = '82' | wikisql |
CREATE TABLE table_name_24 (
losses INTEGER,
wins VARCHAR,
against VARCHAR,
wimmera_fl VARCHAR
) | What's the least losses for Horsham Saints with more than 13 wins and less than 1211 against? | SELECT MIN(losses) FROM table_name_24 WHERE against < 1211 AND wimmera_fl = "horsham saints" AND wins > 13 | sql_create_context |
CREATE TABLE table_61075 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | Which player who won in 1977 and scored great than 155 was the closest to par? | SELECT MAX("To par") FROM table_61075 WHERE "Year(s) won" = '1977' AND "Total" > '155' | 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... | how many patients whose discharge location is snf and primary disease is coronary artery disease\coronary artery bypass graft with mvr; ? maze? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" | mimicsql_data |
CREATE TABLE physician (
name VARCHAR,
EmployeeID VARCHAR
)
CREATE TABLE affiliated_with (
physician VARCHAR,
department VARCHAR,
PrimaryAffiliation VARCHAR
)
CREATE TABLE department (
name VARCHAR,
DepartmentID VARCHAR
) | Find the names of all physicians and their primary affiliated departments' names. | SELECT T1.name, T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1 | sql_create_context |
CREATE TABLE table_203_418 (
id number,
"#" number,
"player" text,
"position" text,
"height" number,
"current club" text
) | how many players play the position of point guard ? | SELECT COUNT("player") FROM table_203_418 WHERE "position" = 'point guard' | squall |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
... | tell me the lab tests that were four most common? | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE table_45834 (
"Continent" text,
"Structure" text,
"Height" text,
"Year" real,
"Country" text
) | What year was the Mercury City Tower? | SELECT MIN("Year") FROM table_45834 WHERE "Structure" = 'mercury city tower' | wikisql |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees who was hired before 2002-06-21, show me about the distribution of job_id and the amount of job_id , and group by attribute job_id in a bar chart. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID | nvbench |
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... | 患者01912667的住院就诊检验报告单中有哪些报告的日期是在09年5月30日以后的?查询这些住院就诊的流水号 | SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '01912667' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2009-05-30' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb... | css |
CREATE TABLE table_48856 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What is Outcome, when Partner is 'Byron Black', and when Opponents is 'Goran Ivani evi Brian Macphie'? | SELECT "Outcome" FROM table_48856 WHERE "Partner" = 'byron black' AND "Opponents" = 'goran ivanišević brian macphie' | wikisql |
CREATE TABLE table_name_92 (
res VARCHAR,
round VARCHAR,
event VARCHAR
) | What is Res., when Round is greater than 2, and when Event is 'Midwest Cage Championships 25: Inferno'? | SELECT res FROM table_name_92 WHERE round > 2 AND event = "midwest cage championships 25: inferno" | sql_create_context |
CREATE TABLE table_1771 (
"Parish (Prestegjeld)" text,
"Sub-Parish (Sogn)" text,
"Church Name" text,
"Year Built" real,
"Location of the Church" text
) | What is the sub-parish for the church names H yanger Kyrkje? | SELECT "Sub-Parish (Sogn)" FROM table_1771 WHERE "Church Name" = 'Høyanger kyrkje' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 把团伙成员32360025最常开的药品排序查询出来 | 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 = '32360025' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC 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.ME... | css |
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,
... | provide the number of patients whose admission year is less than 2173 and drug route is buccal? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2173" AND prescriptions.route = "BUCCAL" | mimicsql_data |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
Du... | Length of a given user's comments. | SELECT COUNT(c.Id) AS "# comments", c.UserId AS "user_link" FROM Comments AS c WHERE LENGTH(c.Text) = 600 GROUP BY c.UserId ORDER BY COUNT(c.Id) DESC | sede |
CREATE TABLE table_name_61 (
english_translation VARCHAR,
artist VARCHAR
) | Can you tell me the English translation that has the Artist of camillo felgen? | SELECT english_translation FROM table_name_61 WHERE artist = "camillo felgen" | sql_create_context |
CREATE TABLE table_203_244 (
id number,
"pos" text,
"rider" text,
"manufacturer" text,
"time/retired" text,
"points" number
) | how many number of riders rode motorcycles by honda ? | SELECT COUNT("rider") FROM table_203_244 WHERE "manufacturer" = 'honda' | squall |
CREATE TABLE table_name_14 (
team_1 VARCHAR
) | What was the 1st leg score for the match with Lesotho as team 1? | SELECT 1 AS st_leg FROM table_name_14 WHERE team_1 = "lesotho" | sql_create_context |
CREATE TABLE table_46299 (
"Rank" real,
"Heat" real,
"Name" text,
"Nationality" text,
"Time" text
) | what is the nationality when the heat is less than 3 and the time is 2:35.31? | SELECT "Nationality" FROM table_46299 WHERE "Heat" < '3' AND "Time" = '2:35.31' | wikisql |
CREATE TABLE Ref_colors (
color_code VARCHAR
)
CREATE TABLE products (
color_code VARCHAR
) | How many colors are never used by any product? | SELECT COUNT(*) FROM Ref_colors WHERE NOT color_code IN (SELECT color_code FROM products) | sql_create_context |
CREATE TABLE table_name_3 (
lifetime VARCHAR,
name VARCHAR
) | Which lifetime has alan gendreau? | SELECT lifetime FROM table_name_3 WHERE name = "alan gendreau" | sql_create_context |
CREATE TABLE table_16028 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | How many matched scored 3 6, 7 6(5), 6 3? | SELECT COUNT("Surface") FROM table_16028 WHERE "Score" = '3–6, 7–6(5), 6–3' | wikisql |
CREATE TABLE election (
election_id number,
representative_id number,
date text,
votes number,
vote_percent number,
seats number,
place number
)
CREATE TABLE representative (
representative_id number,
name text,
state text,
party text,
lifespan text
) | What states have at least two representatives? | SELECT state FROM representative GROUP BY state HAVING COUNT(*) >= 2 | spider |
CREATE TABLE table_57694 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings( $ )" real,
"Wins" real
) | What's jim colbert's highest rank? | SELECT MAX("Rank") FROM table_57694 WHERE "Player" = 'jim colbert' | wikisql |
CREATE TABLE table_name_71 (
river_mile INTEGER,
pool_length__miles_ VARCHAR,
lock_lift_drop__in_feet_ VARCHAR
) | What is the highest River Mile that has a pool length of 42.2 miles or a lock/lift drop of 21 feet? | SELECT MAX(river_mile) FROM table_name_71 WHERE pool_length__miles_ = "42.2" AND lock_lift_drop__in_feet_ = "21" | sql_create_context |
CREATE TABLE table_39501 (
"Pos." text,
"Player" text,
"Team" text,
"Height" text,
"Weight" real
) | What is the weight of the player from the Philadelphia 76ers? | SELECT COUNT("Weight") FROM table_39501 WHERE "Team" = 'philadelphia 76ers' | wikisql |
CREATE TABLE table_name_76 (
tally VARCHAR,
opposition VARCHAR
) | Name the Tally of an Opposition of westmeath? | SELECT tally FROM table_name_76 WHERE opposition = "westmeath" | sql_create_context |
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... | Show me about the distribution of Team_Name and School_ID in a bar chart. | SELECT Team_Name, School_ID FROM basketball_match | nvbench |
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... | 在医院0960685门诊就诊的就诊记录里面,找出叫姜慧丽的这个患者被诊断的病名不包括紧张的就诊记录 | SELECT * 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 hz_info.YLJGDM = '0960685' AND NOT txmzjzjlb.JZZDSM LIKE '%紧张%' UNION SELECT * FROM person_info JO... | css |
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,
... | what is the date of birth and diagnoses short title of subject id 66411? | SELECT demographic.dob, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "66411" | mimicsql_data |
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 prescriptions... | tell me the number of patients diagnosed with other staphylococcus pneumonia who have delta abnormal lab test status. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Other Staphylococcus pneumonia" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_65285 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Rank has a Total larger than 9, and a Gold larger than 6? | SELECT "Rank" FROM table_65285 WHERE "Total" > '9' AND "Gold" > '6' | wikisql |
CREATE TABLE table_name_58 (
opponent VARCHAR,
attendance VARCHAR
) | Attendance of 55,340 had what opponent? | SELECT opponent FROM table_name_58 WHERE attendance = "55,340" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labi... | how many patients had been staying in ward 25? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 25) | mimic_iii |
CREATE TABLE table_12432 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
) | What is the total number of games played of the club with less than 40 goals scored, 9 losses, 39 goals conceded, and more than 2 draws? | SELECT COUNT("Games played") FROM table_12432 WHERE "Goals scored" < '40' AND "Loses" = '9' AND "Goals conceded" = '39' AND "Draws" > '2' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | when was the first time a egd with closed biopsy procedure was given to patient 26757? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'egd with closed biopsy') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26757) ORDER... | mimic_iii |
CREATE TABLE table_name_26 (
rider VARCHAR,
manufacturer VARCHAR
) | WWhich rder had a vehicle manufactured by kr211v? | SELECT rider FROM table_name_26 WHERE manufacturer = "kr211v" | sql_create_context |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate ... | Select * From Users. | SELECT * FROM Users | sede |
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,
... | 在2004年8月14日到2017年5月20日内有多少医生接诊了名叫柏梦竹的患者? | SELECT COUNT(wdmzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '柏梦竹' AND wdmzjzjlb.JZKSRQ BETWEEN '2004-08-14' AND '2017-05-20' UNION SELECT COUNT(bd... | css |
CREATE TABLE table_17839_1 (
future_stock VARCHAR,
map_colour VARCHAR
) | When green is the map colour what is the future stock? | SELECT future_stock FROM table_17839_1 WHERE map_colour = "Green" | sql_create_context |
CREATE TABLE table_53527 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | Which lowest goals for number had a played number of less than 34? | SELECT MIN("Goals for") FROM table_53527 WHERE "Played" < '34' | wikisql |
CREATE TABLE table_26607 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | Who directed episode 28 in the series? | SELECT "Directed by" FROM table_26607 WHERE "No. in series" = '28' | wikisql |
CREATE TABLE table_37166 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | What day in october was game number 4 with under 3 points? | SELECT COUNT("October") FROM table_37166 WHERE "Game" = '4' AND "Points" < '3' | wikisql |
CREATE TABLE table_name_21 (
album VARCHAR,
label VARCHAR,
year VARCHAR
) | What album had the reunion label in 2006? | SELECT album FROM table_name_21 WHERE label = "reunion" AND year = 2006 | sql_create_context |
CREATE TABLE table_75090 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Points have a Score of 4 1? | SELECT MAX("Points") FROM table_75090 WHERE "Score" = '4–1' | wikisql |
CREATE TABLE table_171236_1 (
status VARCHAR,
census_ranking VARCHAR
) | If the census ranking is 693 of 5,008, what is the status? | SELECT status FROM table_171236_1 WHERE census_ranking = "693 of 5,008" | 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,... | 在2010年12月7日到2019年8月7日期间内名叫韩文惠的参保人的门诊西药费是多些啊? | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '韩文惠' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2010-12-07' AND '2019-08-07' AND t_kc22.MED_INV_IT... | css |
CREATE TABLE market (
Market_ID int,
Country text,
Number_cities int
)
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID ... | A bar chart about how films are produced by each studio?, and show by the x-axis from low to high. | SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY Studio | nvbench |
CREATE TABLE table_name_89 (
bronze INTEGER,
silver VARCHAR,
rank VARCHAR
) | What is the sum of the bronze medals when there were more than 2 silver medals and a rank larger than 6? | SELECT SUM(bronze) FROM table_name_89 WHERE silver > 2 AND rank > 6 | sql_create_context |
CREATE TABLE table_3636 (
"No" real,
"Origin City (Country)" text,
"Destination City (Country)" text,
"Train Name No" text,
"Operator Name" text,
"Distance" text,
"No. of Stops" text,
"Frequency" text,
"Scheduled running time" text
) | What is the distance for the train nameno is hapa sup express /12997? | SELECT "Distance" FROM table_3636 WHERE "Train Name No" = 'Hapa sup Express /12997' | wikisql |
CREATE TABLE table_23097 (
"Districts of Bihar" text,
"Total Population 2001" real,
"Male Population 2001" real,
"Female Population 2001" real,
"Growth Rate 1981-91" text,
"Growth Rate 1991-01" text,
"Sex Ratio \u2021 1991" real,
"Sex Ratio \u2021 2001" real,
"Population density \u20... | What districts of Bihar have a sex ratio in 1991 of 864? | SELECT "Districts of Bihar" FROM table_23097 WHERE "Sex Ratio \u2021 1991" = '864' | wikisql |
CREATE TABLE table_46081 (
"Name" text,
"Born-Died" text,
"Term start" text,
"Term end" text,
"Political Party" text
) | What is Term Start, when Born-Died is Prime Ministers 1939 - 1943? | SELECT "Term start" FROM table_46081 WHERE "Born-Died" = 'prime ministers 1939 - 1943' | wikisql |
CREATE TABLE table_name_47 (
story VARCHAR,
issue VARCHAR
) | What story title was included in Issue #8? | SELECT story FROM table_name_47 WHERE issue = "#8" | sql_create_context |
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 procedured with icd9 code 5771 and suggested with additive drug type? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "5771" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_name_81 (
stadium VARCHAR,
city VARCHAR
) | What stadium is in the city of Debrecen? | SELECT stadium FROM table_name_81 WHERE city = "debrecen" | sql_create_context |
CREATE TABLE table_15382 (
"Category" text,
"Film" text,
"Director(s)" text,
"Country" text,
"Nominating Festival" text
) | (A) Torzija was nominated in which category? | SELECT "Category" FROM table_15382 WHERE "Film" = '(a) torzija' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolea... | Questions eligible for APL bounty by Bubbler. | SELECT Q.Id AS "post_link", Q.Score, Q.AnswerCount FROM Posts AS Q WHERE Q.AnswerCount = 1 ORDER BY Q.Score DESC | sede |
CREATE TABLE table_32416 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What was date of the bye week 11? | SELECT "Date" FROM table_32416 WHERE "Attendance" = 'bye' AND "Week" = '11' | wikisql |
CREATE TABLE table_27713583_2 (
record VARCHAR,
team VARCHAR
) | What is the record for the game against team @ Minnesota? | SELECT record FROM table_27713583_2 WHERE team = "@ Minnesota" | sql_create_context |
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
)
... | give me the number of patients whose drug route is id? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "ID" | mimicsql_data |
CREATE TABLE table_name_46 (
partner VARCHAR,
opponents_in_the_final VARCHAR
) | Name the partner for opponents of franti ek erm k michal merti k | SELECT partner FROM table_name_46 WHERE opponents_in_the_final = "františek čermák michal mertiňák" | sql_create_context |
CREATE TABLE table_name_38 (
category VARCHAR,
award VARCHAR
) | what is the category that has the people's choice awards? | SELECT category FROM table_name_38 WHERE award = "people's choice awards" | sql_create_context |
CREATE TABLE table_52947 (
"English Name" text,
"Japanese orthography" text,
"Pronouciation" text,
"abbreviation" text,
"Provider(national government)" text,
"Foundation" real
) | What is the Japanese orthography for the abbreviation of ndmc? | SELECT "Japanese orthography" FROM table_52947 WHERE "abbreviation" = 'ndmc' | wikisql |
CREATE TABLE table_name_83 (
tie_no VARCHAR,
away_team VARCHAR
) | What is the Tie no when Chester is the away team? | SELECT tie_no FROM table_name_83 WHERE away_team = "chester" | sql_create_context |
CREATE TABLE table_name_31 (
class VARCHAR,
frequency VARCHAR
) | Which class has a frequency of 91.9 fm? | SELECT class FROM table_name_31 WHERE frequency = "91.9 fm" | sql_create_context |
CREATE TABLE table_8682 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Grizzlies" text,
"School/Club Team" text
) | What year were the Grizzlies in Providence? | SELECT "Years for Grizzlies" FROM table_8682 WHERE "School/Club Team" = 'providence' | wikisql |
CREATE TABLE table_59922 (
"Week 8 Oct 26" text,
"Week 10 Nov 9" text,
"Week 11 Nov 16" text,
"Week 12 Nov 23" text,
"Week 13 Nov 30" text,
"Week 14 (Final) Dec 7" text
) | What is the week 13 Nov 30 standing with USC (7-3) on week 11 Nov 16? | SELECT "Week 13 Nov 30" FROM table_59922 WHERE "Week 11 Nov 16" = 'usc (7-3)' | wikisql |
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Nu... | How many storms occured in each region. Visualize by bar chart. | SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id | nvbench |
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,... | provide the number of patients whose discharge location is disch-tran to psych hosp and procedure short title is conduit left ventr-aorta? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.short_title = "Conduit left ventr-aorta" | mimicsql_data |
CREATE TABLE table_23168 (
"RPM" real,
"Standard HP" text,
"Standard torque (lb/ft)" text,
"Standard speed (6th gear)" text,
"Modified speed (6th gear)" real,
"Modified HP" text,
"Modified torque (lb/ft)" text
) | When the standard torque (lb/ft) is 11.53 how much does more is the modified hp? | SELECT "Modified HP" FROM table_23168 WHERE "Standard torque (lb/ft)" = '11.53' | wikisql |
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,... | TOP 10 USERS FOR COUNTRY. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%##CountryName##%') ORDER BY Reputation DESC LIMIT 10 | sede |
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, show me about the distribution of name and the sum of code , and group by attribute name in a bar chart, and sort y-axis in desc order. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE table_name_65 (
to_par INTEGER,
player VARCHAR
) | What is the total of all to par with player Bob Rosburg? | SELECT SUM(to_par) FROM table_name_65 WHERE player = "bob rosburg" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_... | how much is the yearly maximum value of rdw for patient 4758 since 2105? | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4758) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rdw') AND STRFTIME('%y', labevents.charttime) >= '2105' GROUP BY STRFTIME('%... | mimic_iii |
CREATE TABLE HOST (
Name VARCHAR,
Host_ID VARCHAR
)
CREATE TABLE party_host (
Host_ID VARCHAR,
Party_ID VARCHAR
)
CREATE TABLE party (
Party_Theme VARCHAR,
Party_ID VARCHAR
) | Show the themes of parties and the names of the party hosts. | SELECT T3.Party_Theme, T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID | sql_create_context |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
e... | I want a bar chart to show the frequency of the dates that have the 5 highest cloud cover rates each year, display how many date in asc order please. | SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date) | nvbench |
CREATE TABLE table_name_49 (
date VARCHAR,
score VARCHAR,
set_2 VARCHAR
) | Which Date has a Score of 0 3, and a Set 2 of 16 25? | SELECT date FROM table_name_49 WHERE score = "0–3" AND set_2 = "16–25" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.