context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_26 (
driver_s_ VARCHAR,
sponsor_s_ VARCHAR
) | Which Driver has a Sponsor of pdvsa? | SELECT driver_s_ FROM table_name_26 WHERE sponsor_s_ = "pdvsa" | sql_create_context |
CREATE TABLE table_45679 (
"Lane" real,
"Name" text,
"Country" text,
"Mark" text,
"React" real,
"Points" real
) | If a country has 1008 points what's their reaction time? | SELECT MAX("React") FROM table_45679 WHERE "Points" = '1008' | wikisql |
CREATE TABLE table_24001246_2 (
world_record VARCHAR
) | If the world record is the African record, what is the 1:53.28 total number? | SELECT COUNT(1) AS :5328 FROM table_24001246_2 WHERE world_record = "African record" | sql_create_context |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
nu... | What was the topic of best paper in 2012 EMNLP-CoNLL ? | SELECT DISTINCT COUNT(DISTINCT cite.citingpaperid), paperkeyphrase.keyphraseid, paper.paperid FROM cite, paper, paperkeyphrase, venue WHERE paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2012 AND venue.venueid = paper.venueid AND venue.venuename = 'EMNLP-CoNLL' GROUP BY pa... | scholar |
CREATE TABLE table_56054 (
"Year" real,
"Song Title" text,
"Movie" text,
"Music Director" text,
"Co-Singers" text
) | What year was 'Ulike o Chilake' released? | SELECT "Year" FROM table_56054 WHERE "Song Title" = 'ulike o chilake' | wikisql |
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 with diagnoses icd9 code 2631 for whom csf lab test was ordered. | 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.icd9_code = "2631" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_204_628 (
id number,
"trial number" text,
"date" text,
"name of trial" text,
"celebrity/ies taking part" text,
"winner/number of stars" text,
"notes" text
) | what challenge came next after jungle falls ? | SELECT "name of trial" FROM table_204_628 WHERE "date" > (SELECT "date" FROM table_204_628 WHERE "name of trial" = 'jungle falls') ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE com... | Do any of the upper level classes not require 550 ? | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%topic0%' OR name LIKE '%topic0%') AND department = 'EECS' | advising |
CREATE TABLE table_866 (
"Year (Ceremony)" text,
"Film title" text,
"Language(s)" text,
"Director" text,
"Result" text
) | What was the result for the film life, above all? | SELECT "Result" FROM table_866 WHERE "Film title" = 'Life, Above All' | wikisql |
CREATE TABLE table_63970 (
"Class" text,
"Class Pos." real,
"Driver" text,
"Team/Car" text,
"Laps" real,
"Best Lap" text,
"On Lap" real
) | What is the lowest laps that has an on lap less than 4, with 35 as a class pos.? | SELECT MIN("Laps") FROM table_63970 WHERE "On Lap" < '4' AND "Class Pos." = '35' | wikisql |
CREATE TABLE table_78183 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the low lap total for henri pescarolo with a grad larger than 6? | SELECT MIN("Laps") FROM table_78183 WHERE "Grid" > '6' AND "Driver" = 'henri pescarolo' | wikisql |
CREATE TABLE table_48637 (
"Title" text,
"Writer" text,
"Format" text,
"Company" text,
"release date" text
) | Who is the company that released the album on 2008-09-18 18 September 2008? | SELECT "Company" FROM table_48637 WHERE "release date" = '2008-09-18 18 september 2008' | wikisql |
CREATE TABLE table_9265 (
"Year" real,
"Championship" text,
"Winning score" text,
"Margin" text,
"Runner(s)-up" text
) | Which Year has a Winning score of 4 (69-72-70-69=280)? | SELECT MIN("Year") FROM table_9265 WHERE "Winning score" = '–4 (69-72-70-69=280)' | wikisql |
CREATE TABLE table_71362 (
"Edition" text,
"Round" text,
"Date" text,
"Surface" text,
"Opponent" text,
"Result" text
) | Which kind of Edition that has a Surface of clay, and Park Sung-Hee as an opponent? | SELECT "Edition" FROM table_71362 WHERE "Surface" = 'clay' AND "Opponent" = 'park sung-hee' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
... | what is the first value of patient 11362's temperature c (calc) on last month/24? | 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 = 11362)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperatu... | mimic_iii |
CREATE TABLE table_34257 (
"Abbr." text,
"Name" text,
"Picture Coding Types" text,
"Chroma Format" text,
"Aspect Ratios" text,
"Scalable modes" text,
"Intra DC Precision" text
) | Name the Intra DC Precision that has the Name main profile? | SELECT "Intra DC Precision" FROM table_34257 WHERE "Name" = 'main profile' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 统计医疗记录中年龄大于17岁的患者的匀整医务费总金额是多少? | SELECT AVG(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_AGE > 17) | css |
CREATE TABLE table_26875 (
"Name" text,
"Nationality" text,
"Position" text,
"Los Angeles Sol career" text,
"Appearances" real,
"Starts" real,
"Minutes" real,
"Goals" real,
"Assists" real
) | Name the most minutes and starts being 12 | SELECT MAX("Minutes") FROM table_26875 WHERE "Starts" = '12' | wikisql |
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
)
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
) | Show names of climbers and the names of mountains they climb. | SELECT T1.name, T2.name FROM climber AS T1 JOIN mountain AS T2 ON T1.mountain_id = T2.mountain_id | spider |
CREATE TABLE table_4260 (
"Rank" real,
"Country/Territory" text,
"Mister International" real,
"1st runner-up" real,
"2nd runner-up" real,
"3rd runner-up" real,
"4th runner-up" real,
"Semifinalists" real,
"Total" real
) | Name the most total for south korea | SELECT MAX("Total") FROM table_4260 WHERE "Country/Territory" = 'South Korea' | 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,
... | 患者34820583在2013年7月20日到2018年9月21日内自付比例低于零点八八的药品量提供一下 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '34820583' AND t_kc22.STA_DATE BETWEEN '2013-07-20' AND '2018-09-21' AND t_kc22.SELF_PAY_PRO < 0.88 | css |
CREATE TABLE table_name_53 (
album VARCHAR,
artist VARCHAR,
label VARCHAR
) | Which Album has an Artist of various artists (compilation), and a Label of laface? | SELECT album FROM table_name_53 WHERE artist = "various artists (compilation)" AND label = "laface" | sql_create_context |
CREATE TABLE Physician (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
SSN INTEGER
)
CREATE TABLE Room (
RoomNumber INTEGER,
RoomType VARCHAR(30),
BlockFloor INTEGER,
BlockCode INTEGER,
Unavailable BOOLEAN
)
CREATE TABLE Nurse (
EmployeeID INTEGER,
Name VARCHA... | What are names of patients who made an appointment, and count them by a bar chart, and display by the X-axis in desc. | SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | what is the minimum value of respiration of patient 006-17553 on the last intensive care unit visit? | SELECT MIN(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-17553') AND NOT patient.unitdischargetime IS N... | eicu |
CREATE TABLE table_51282 (
"Name" text,
"Short name" text,
"City" text,
"Region" text,
"Girone" text,
"Home venue" text
) | What city has the nickname of pontisola? | SELECT "City" FROM table_51282 WHERE "Short name" = 'pontisola' | wikisql |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
dire... | show all UA flights between BOSTON and PHILADELPHIA | 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... | atis |
CREATE TABLE table_4081 (
"Player" text,
"Games" real,
"Field goals" real,
"Free throws" real,
"Points" real,
"Points per game" text
) | How many free throws did Charles Pearman score? | SELECT MAX("Free throws") FROM table_4081 WHERE "Player" = 'Charles Pearman' | wikisql |
CREATE TABLE table_39040 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | What's the sum of Losses that Scored larger than 15, has Points that's larger than 16, and Played that's larger than 9? | SELECT SUM("Losses") FROM table_39040 WHERE "Scored" > '15' AND "Points" > '16' AND "Played" > '9' | wikisql |
CREATE TABLE table_48722 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | A score of 71-71=142 earned what place? | SELECT "Place" FROM table_48722 WHERE "Score" = '71-71=142' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | Count the number of black/haitian patients who had a glucose body fluid lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND lab.label = "Glucose, Body Fluid" | mimicsql_data |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE procedures_icd (
... | how many times did patient 14982 visit the hospital? | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 14982 | mimic_iii |
CREATE TABLE table_10792 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" text
) | How many points were scored in 1:44:59.557 of time? | SELECT "Points" FROM table_10792 WHERE "Time/Retired" = '1:44:59.557' | wikisql |
CREATE TABLE table_6500 (
"Outcome" text,
"Date" text,
"Surface" text,
"Partner" text,
"Opponent" text,
"Score" text
) | Name the partner with opponent of micha lla krajicek eleni daniilidou | SELECT "Partner" FROM table_6500 WHERE "Opponent" = 'michaëlla krajicek eleni daniilidou' | wikisql |
CREATE TABLE table_24805 (
"Season" real,
"Round" real,
"Opponents" text,
"Home Leg" text,
"Away Leg" text,
"Aggregate" text
) | What was the home leg score against partizani tirana? | SELECT "Home Leg" FROM table_24805 WHERE "Opponents" = 'Partizani Tirana' | wikisql |
CREATE TABLE table_73824 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | What type of settlement has a population of 1441? | SELECT "Type" FROM table_73824 WHERE "Population (2011)" = '1441' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
Creati... | Get All User of posts comments for a particular tag. | SELECT * FROM Users WHERE Id IN (SELECT UserId FROM Comments WHERE PostId IN (SELECT Id FROM Posts WHERE Tags LIKE '%aws-lambda%')) | sede |
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
) | For those records from the products and each product's manufacturer, give me the comparison about the sum of code over the name , and group by attribute name, show X-axis from low to high order. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
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 nu... | 在2002年8月17号到2020年1月25号这期间里5039596号的医院出具的检验报告单中,不相同的检测指标名称及结果定量单位的检测指标结果定量的平均值哪一项是最大的? | SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDW, AVG(jyjgzbb.JCZBJGDL) FROM jyjgzbb JOIN jybgb_jyjgzbb JOIN jybgb ON jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id AND jybgb_jyjgzbb.YLJGDM = jybgb.YLJGDM WHERE jybgb.YLJGDM = '5039596' AND jyjgzbb.BGRQ BETWEEN '2002-08-17' AND '2020-01... | css |
CREATE TABLE table_59694 (
"Election" text,
"First member" text,
"First party" text,
"Second member" text,
"Second party" text
) | Which election has second member Charles Robert Colvile, a conservative first party, and first member William Mundy? | SELECT "Election" FROM table_59694 WHERE "Second member" = 'charles robert colvile' AND "First party" = 'conservative' AND "First member" = 'william mundy' | wikisql |
CREATE TABLE table_name_3 (
semi_finalists VARCHAR,
runner_up VARCHAR
) | Who were semi-finalists in the event with a runner-up of Lisa Raymond? | SELECT semi_finalists FROM table_name_3 WHERE runner_up = "lisa raymond" | sql_create_context |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
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,
J... | 列出在医院0345841中患者吕香馨不包含室的就诊科室名称所有门诊就诊记录的流水号是什么? | SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers... | css |
CREATE TABLE table_22600 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | Which team appointed a person on 23 December 2008? | SELECT "Team" FROM table_22600 WHERE "Date of appointment" = '23 December 2008' | wikisql |
CREATE TABLE table_name_84 (
loss VARCHAR,
opponent VARCHAR,
record VARCHAR
) | What loss was against the angels with a 50-31 record? | SELECT loss FROM table_name_84 WHERE opponent = "angels" AND record = "50-31" | sql_create_context |
CREATE TABLE table_48070 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Gold has a Nation of malaysia, and a Silver smaller than 0? | SELECT MIN("Gold") FROM table_48070 WHERE "Nation" = 'malaysia' AND "Silver" < '0' | wikisql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description... | Top 100 TensorFlow users by location. | SELECT u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND v.VoteTypeId = 2 INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.CommunityOwnedDate IS NULL AND LOWER(t.TagName) ... | sede |
CREATE TABLE table_26381 (
"No." text,
"Football Club" text,
"Continent" text,
"Associated Football Club" text,
"Seasons" text,
"Racing Drivers" text
) | what are the seasons for no 3? | SELECT "Seasons" FROM table_26381 WHERE "No." = '3' | wikisql |
CREATE TABLE table_59884 (
"Pianist" text,
"Conductor" text,
"Record Company" text,
"Year of Recording" real,
"Format" text
) | What is the year that a record was recorded with Libor Pesek as conductor? | SELECT SUM("Year of Recording") FROM table_59884 WHERE "Conductor" = 'libor pesek' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | the number of patients in ward 23 since 2103? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 23 AND STRFTIME('%y', transfers.intime) >= '2103') | mimic_iii |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TA... | Total Answers for User X. | SELECT COUNT(*) FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = '##UserId:int##' | sede |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
... | You can use a scatter chart to simply show ids and salaries for employees making more than average and who work in a department with employees who have the letter J in their first name. | SELECT EMPLOYEE_ID, SALARY FROM employees WHERE SALARY > (SELECT AVG(SALARY) FROM employees) AND DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%J%') | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | count the number of patients whose admission type is urgent and procedure long title is single internal mammary-coronary artery bypass? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.long_title = "Single internal mammary-coronary artery bypass" | mimicsql_data |
CREATE TABLE table_name_12 (
visiting_team VARCHAR,
date VARCHAR
) | What was the visiting team on November 12? | SELECT visiting_team FROM table_name_12 WHERE date = "november 12" | 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,
... | what is the number of patients whose days of hospital stay is greater than 27 and diagnoses icd9 code is 430? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "27" AND diagnoses.icd9_code = "430" | mimicsql_data |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationD... | View for Habib Ahmed Post 2014-2015. | SELECT DISTINCT (p1.Id) AS "post_link", p2.ViewCount FROM Posts AS p1 JOIN Posts AS p2 ON p1.ParentId = p2.Id WHERE p1.OwnerUserId = 961113 AND p1.CreationDate > '2015-07-01' | sede |
CREATE TABLE table_73217 (
"Starting price" text,
"Number" real,
"Name" text,
"Age" real,
"Weight (st, lb)" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Colours" text
) | How many age entries had a weight of 10-7 and an owner of Double Octagon Partnership? | SELECT COUNT("Age") FROM table_73217 WHERE "Weight (st, lb)" = '10-7' AND "Owner" = 'Double Octagon Partnership' | wikisql |
CREATE TABLE Course (
CID VARCHAR(7),
CName VARCHAR(40),
Credits INTEGER,
Instructor INTEGER,
Days VARCHAR(5),
Hours VARCHAR(11),
DNO INTEGER
)
CREATE TABLE Department (
DNO INTEGER,
Division VARCHAR(2),
DName VARCHAR(25),
Room VARCHAR(5),
Building VARCHAR(13),
DPhon... | What is the number of each course name that have at least five enrollments? Show me a bar chart, show y axis from high to low order. | SELECT T1.CName, COUNT(T1.CName) FROM Course AS T1 JOIN Enrolled_in AS T2 ON T1.CID = T2.CID GROUP BY T1.CName, T2.CID HAVING COUNT(*) >= 5 ORDER BY COUNT(T1.CName) DESC | nvbench |
CREATE TABLE table_name_40 (
station_number VARCHAR,
location VARCHAR
) | What is the station number of the station at Dogsthorpe? | SELECT station_number FROM table_name_40 WHERE location = "dogsthorpe" | sql_create_context |
CREATE TABLE table_40606 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
) | What is the lowest Games, when Name is Travis Watson, and when Rebounds is less than 136? | SELECT MIN("Games") FROM table_40606 WHERE "Name" = 'travis watson' AND "Rebounds" < '136' | wikisql |
CREATE TABLE table_name_60 (
score INTEGER,
place VARCHAR,
country VARCHAR
) | What is the average score for the player who is T5 in the United States? | SELECT AVG(score) FROM table_name_60 WHERE place = "t5" AND country = "united states" | sql_create_context |
CREATE TABLE table_77049 (
"Team" text,
"Manager" text,
"Home city" text,
"Stadium" text,
"Capacity" real
) | What team that has a Home city of Zadar? | SELECT "Team" FROM table_77049 WHERE "Home city" = 'zadar' | wikisql |
CREATE TABLE table_48138 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | what is the airport when the city is d sseldorf? | SELECT "Airport" FROM table_48138 WHERE "City" = 'düsseldorf' | wikisql |
CREATE TABLE table_name_8 (
driving_wheels VARCHAR,
original_ner_class VARCHAR
) | What driving wheels are on the m1 original NER class? | SELECT driving_wheels FROM table_name_8 WHERE original_ner_class = "m1" | sql_create_context |
CREATE TABLE table_name_33 (
attendance VARCHAR,
result VARCHAR
) | What was the Attendance when the Result was L 31 23? | SELECT attendance FROM table_name_33 WHERE result = "l 31–23" | sql_create_context |
CREATE TABLE table_78073 (
"Player" text,
"Pos." text,
"From" text,
"School/Country" text,
"Rebs" real,
"Asts" real
) | Who has the high assists in 2000? | SELECT MAX("Asts") FROM table_78073 WHERE "From" = '2000' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 列出患者窦泰河入院科室名称包含遗传的在医院1388094中有什么住院就诊记录? | SELECT * 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.person_info_XM = '窦泰河' AND hz_info.YLJGDM = '1388094' AND zyjzjlb.JZKSMC LIKE '%遗传%' | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | What is the average age of patients who are equal or more than 74 years and were admitted to the hospital in or after year 2105? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.age >= "74" AND demographic.admityear >= "2105" | mimicsql_data |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | calculate the number of times since 2 years ago patient 007-10135 has received a magnesium lab test. | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-10135')) AND lab.labname = 'magnesium' AND DATETIME(lab.labresulttime) >= DATETIME(CURRE... | eicu |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
... | how much magnesium sulfate, for the first time since 12/2105, was prescribed to patient 25733? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25733) AND prescriptions.drug = 'magnesium sulfate' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-12' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_train_175 (
"id" int,
"lipid_lowering_therapy" bool,
"hemoglobin_a1c_hba1c" float,
"diabetic" string,
"fasting_serum_triglycerides" int,
"gilbert_syndrome" bool,
"age" float,
"alanine_aminotransferase" bool,
"NOUSE" float
) | has alanine aminotransferase or aspartate aminotransferase values > 2 x upper limit of normal or total bilirubin > 1.5 x upper limit of normal unless the subject has a known history of gilbert's syndrome | SELECT * FROM table_train_175 WHERE alanine_aminotransferase = 1 OR gilbert_syndrome = 1 | criteria2sql |
CREATE TABLE table_78464 (
"Color" text,
"mass (g/mol)" text,
"Absorb (nm)" text,
"Emit (nm)" text,
"\u03b5 (M -1 cm -1 )" text
) | What is the Absorbtion (in nanometers) of the color Orange? | SELECT "Absorb (nm)" FROM table_78464 WHERE "Color" = 'orange' | wikisql |
CREATE TABLE table_name_4 (
player VARCHAR,
money___$__ VARCHAR,
score VARCHAR
) | what player has $187,500 and score 66-75-71-69=281 | SELECT player FROM table_name_4 WHERE money___$__ = "187,500" AND score = 66 - 75 - 71 - 69 = 281 | sql_create_context |
CREATE TABLE table_204_461 (
id number,
"res." text,
"record" text,
"opponent" text,
"method" text,
"event" text,
"date" text,
"round" number,
"time" text,
"location" text,
"notes" text
) | besides the loss to cody goodale , what other losses occurred ? | SELECT "opponent" FROM table_204_461 WHERE "res." = 'loss' AND "opponent" <> 'cody goodale' | squall |
CREATE TABLE table_name_59 (
pick__number VARCHAR,
position VARCHAR
) | What was the pick number for the WR position? | SELECT pick__number FROM table_name_59 WHERE position = "wr" | sql_create_context |
CREATE TABLE table_21066 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter" text,
"Year named" real,
"Namesake" text
) | Philae Sulcus has a latitude of what? | SELECT "Latitude" FROM table_21066 WHERE "Name" = 'Philae Sulcus' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | was patient 030-28944 prescribed acetaminophen (tylenol) tab 650 mg during the last hospital encounter? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-28944' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.... | eicu |
CREATE TABLE table_30100 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power kW" text,
"Coverage" text
) | Name the power for dymd-fm | SELECT "Power kW" FROM table_30100 WHERE "Callsign" = 'DYMD-FM' | wikisql |
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... | Bar chart x axis date y axis the number of date | SELECT date, COUNT(date) FROM weather | nvbench |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
t... | Do I count AAS 458 for ULCS ? | SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'AAS' AND course.number = 458 AND program_course.category LIKE '%ULCS%' | advising |
CREATE TABLE people (
People_ID int,
Age int,
Name text,
Nationality text,
Graduation_College text
)
CREATE TABLE company (
Company_ID real,
Name text,
Headquarters text,
Industry text,
Sales_in_Billion real,
Profits_in_Billion real,
Assets_in_Billion real,
Market_Va... | Stack bar chart of the number of headquarters vs Industry based on headquarters, rank by the x-axis in asc. | SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Industry, Headquarters ORDER BY Headquarters | nvbench |
CREATE TABLE table_train_154 (
"id" int,
"systolic_blood_pressure_sbp" int,
"fpg" float,
"hemoglobin_a1c_hba1c" float,
"creatinine_clearance_cl" float,
"diastolic_blood_pressure_dbp" int,
"NOUSE" float
) | fpg > 125 mg / dl or < 105 mg / dl at screening blood draw | SELECT * FROM table_train_154 WHERE fpg > 125 OR fpg < 105 | criteria2sql |
CREATE TABLE apartment_bookings (
apt_booking_id number,
apt_id number,
guest_id number,
booking_status_code text,
booking_start_date time,
booking_end_date time
)
CREATE TABLE view_unit_status (
apt_id number,
apt_booking_id number,
status_date time,
available_yn others
)
CREA... | Show each gender code and the corresponding count of guests sorted by the count in descending order. | SELECT gender_code, COUNT(*) FROM guests GROUP BY gender_code ORDER BY COUNT(*) DESC | spider |
CREATE TABLE table_name_62 (
attribute VARCHAR,
type VARCHAR
) | Let's say Type is of datasetcomplete, what is the Attribute? | SELECT attribute FROM table_name_62 WHERE type = "datasetcomplete" | sql_create_context |
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4)
)
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
production_type_code VARCHAR(15),
unit_price DECIMAL(19,4),
product_name VARCHAR(80... | Scatter plot to show order id on x axis and the total number on y axis. | SELECT order_id, COUNT(*) FROM Order_Items GROUP BY order_id | nvbench |
CREATE TABLE elimination (
Team VARCHAR
) | Show teams that have suffered more than three eliminations. | SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*) > 3 | sql_create_context |
CREATE TABLE table_name_75 (
time VARCHAR,
opponent VARCHAR
) | Can you tell me the Time that has the Opponent of phil baroni? | SELECT time FROM table_name_75 WHERE opponent = "phil baroni" | sql_create_context |
CREATE TABLE table_17812 (
"#" real,
"Name" text,
"Tenure" text,
"Courtesy title" text,
"Court Rank" text,
"Revenues" text,
"Lineage" text
) | What is the most number? | SELECT MAX("#") FROM table_17812 | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | In order to declare my major as EHS , what classes do I need to have taken ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%EHS%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id | advising |
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
) | For those products with a price between 60 and 120, visualize a bar chart about the distribution of name and code , and I want to rank by the x-axis in asc. | SELECT Name, Code FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many patients are admitted under emergency and followed the procedure icd9 code 9961? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "9961" | mimicsql_data |
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEG... | Show all dates of transactions whose type code is 'SALE', and count them by a bar chart, I want to order by the Y-axis in descending please. | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE transaction_type_code = "SALE" ORDER BY COUNT(date_of_transaction) DESC | nvbench |
CREATE TABLE table_name_93 (
number_of_seats INTEGER,
current_status VARCHAR,
year_placed_in_service VARCHAR
) | What is the smallest number of seats in a retired vehicle that was started in service in 1981? | SELECT MIN(number_of_seats) FROM table_name_93 WHERE current_status = "retired" AND year_placed_in_service = "1981" | sql_create_context |
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
)
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
) | Group by the result and count them by a bar chart, show from high to low by the y axis. | SELECT Result, COUNT(Result) FROM Acceptance GROUP BY Result ORDER BY COUNT(Result) DESC | nvbench |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_cod... | i want an early morning flight between PHILADELPHIA and PITTSBURGH on tuesday 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 22 AND date_day.month_number = 3 A... | atis |
CREATE TABLE table_test_20 (
"id" int,
"ejection_fraction_ef" int,
"anemia" bool,
"gender" string,
"bleeding" int,
"systolic_blood_pressure_sbp" int,
"left_main_coronary_artery_stenosis" int,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"creatinine_clearance_cl" float,
... | 45 to 80 years old age. | SELECT * FROM table_test_20 WHERE age >= 45 AND age <= 80 | criteria2sql |
CREATE TABLE table_203_452 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | what was the number of drivers that did not finish the race ? | SELECT COUNT("driver") FROM table_203_452 WHERE "time/retired" IS NULL | squall |
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE train_station (
Train_ID int,
Station_ID int
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
... | How many locations? Draw a bar chart, sort total number from low to high order. | SELECT Location, COUNT(Location) FROM station GROUP BY Location ORDER BY COUNT(Location) | nvbench |
CREATE TABLE table_name_58 (
bronze INTEGER,
rank VARCHAR,
total VARCHAR
) | What is the fewest bronzes for ranks of 3 with totals under 2? | SELECT MIN(bronze) FROM table_name_58 WHERE rank = "3" AND total < 2 | sql_create_context |
CREATE TABLE table_name_56 (
guest VARCHAR,
result VARCHAR
) | Who was the guest when the result was 0:3? | SELECT guest FROM table_name_56 WHERE result = "0:3" | 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 microbiologyevents... | how much does it cost for chloride, urine lab tests? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride, urine')) | mimic_iii |
CREATE TABLE table_27660 (
"Date" text,
"Tournament" text,
"Location" text,
"Opponent" text,
"Stadium" text,
"Score" text,
"Indian Scorers" text
) | If the Indian Scorers is Chinadorai Sabeeth, what is the name of the stadium? | SELECT "Stadium" FROM table_27660 WHERE "Indian Scorers" = 'Chinadorai Sabeeth' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.