context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | did patient 75658 have any results from the microbiology of the sputum a year before? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 75658) AND microbiologyevents.spec_type_desc = 'sputum' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 yea... | mimic_iii |
CREATE TABLE table_203_234 (
id number,
"description" text,
"total" number,
"poland" number,
"baltic states(resettled in poland during war)" number,
"resettled in poland during war(from ussr and romania)" number,
"sudetendeutsch" number,
"se europe\n(hungary, romania, yugoslavia & slovak... | what was the cause of the most deaths ? | SELECT "description" FROM table_203_234 ORDER BY "total" DESC LIMIT 1 | squall |
CREATE TABLE table_75384 (
"Polling Firm" text,
"Date" text,
"PSD - PC" text,
"UDMR" text,
"Elena B\u0103sescu" text,
"Others" text,
"Undecided" text
) | What was the UDMR for 18-22/04/2009? | SELECT "UDMR" FROM table_75384 WHERE "Date" = '18-22/04/2009' | wikisql |
CREATE TABLE table_203_421 (
id number,
"name" text,
"from" text,
"until" text,
"relationship with predecessor" text
) | who was the head of the medici for the most years ? | SELECT "name" FROM table_203_421 ORDER BY "until" - "from" DESC LIMIT 1 | squall |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For those employees who was hired before 2002-06-21, for employee_id, hire_date, visualize the trend, I want to sort by the X-axis from high to low please. | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_77724 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What is the Record when Buffalo is at Home? | SELECT "Record" FROM table_77724 WHERE "Home" = 'buffalo' | wikisql |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 统计就医记录中住院诊断为矽肺贰期的在医院序号9880958中最低和最高医疗费总额有多少? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9880958' AND gwyjzb.IN_DIAG_DIS_NM = '矽肺贰期' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9880958' AND fgwyjzb.IN_DIAG_D... | 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,
... | count the number of patients whose admission year is less than 2138 and procedure short title is endosc destr stomach les? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2138" AND procedures.short_title = "Endosc destr stomach les" | mimicsql_data |
CREATE TABLE table_76119 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | Which Home team has an Away team of everton? | SELECT "Home team" FROM table_76119 WHERE "Away team" = 'everton' | wikisql |
CREATE TABLE city (
city_id number,
city text,
country_id number,
last_update time
)
CREATE TABLE film_actor (
actor_id number,
film_id number,
last_update time
)
CREATE TABLE inventory (
inventory_id number,
film_id number,
store_id number,
last_update time
)
CREATE TABLE... | What are the full names of actors who had roles in more than 30 films? | SELECT T2.first_name, T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id HAVING COUNT(*) > 30 | spider |
CREATE TABLE table_68681 (
"Title" text,
"Year" text,
"Developer" text,
"Publisher" text,
"Platform" text
) | Who published Star Citizen in 2014? | SELECT "Publisher" FROM table_68681 WHERE "Year" = '2014' AND "Title" = 'star citizen' | wikisql |
CREATE TABLE table_name_43 (
athlete VARCHAR,
result VARCHAR
) | Which athlete, has an 18.55 result | SELECT athlete FROM table_name_43 WHERE result = 18.55 | sql_create_context |
CREATE TABLE table_27615520_1 (
form_factor VARCHAR,
product_name VARCHAR
) | List the range distroration for the ramsan-630 | SELECT form_factor FROM table_27615520_1 WHERE product_name = "RamSan-630" | sql_create_context |
CREATE TABLE table_51934 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | who is the driver with the grid of 13? | SELECT "Driver" FROM table_51934 WHERE "Grid" = '13' | wikisql |
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team i... | Show the position of players and the corresponding number of players Visualize by bar chart, rank from high to low by the total number. | SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | what were the top four most frequent laboratory tests since 3 years ago? | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | how much potassium chloride is prescribed the first time since 162 months ago to patient 27177? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27177) AND prescriptions.drug = 'potassium chloride' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-162 month') ORDER BY prescriptions.startdat... | mimic_iii |
CREATE TABLE table_70135 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Trofeo Fast Team" text
) | What is the general classification at stage 18 that has a points classification of Tony Rominger? | SELECT "General classification" FROM table_70135 WHERE "Points classification" = 'tony rominger' AND "Stage" = '18' | wikisql |
CREATE TABLE table_28019988_2 (
series__number INTEGER,
production_code VARCHAR
) | What series number is the episode with production code bdf101? | SELECT MAX(series__number) FROM table_28019988_2 WHERE production_code = "BDF101" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREA... | since 2105 has patient 025-44842 been prescribed nicoderm cq. | 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 = '025-44842')) AND medication.drugname = 'nicoderm cq' AND STRFTIME('%y', me... | eicu |
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
)
... | how many patients whose primary disease is st elevated myocardial infarction\cardiac cath and lab test fluid is blood? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE table_30824 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
) | Who was the conference player of the year when Alabama State was the tournament winner? | SELECT "Conference Player of the Year" FROM table_30824 WHERE "Tournament Winner" = 'Alabama State' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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... | What are all the employee ids and the names of the countries in which they work. Visualize by bar chart. | SELECT COUNTRY_NAME, SUM(EMPLOYEE_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID GROUP BY COUNTRY_NAME | nvbench |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | did patient 031-3355 have any microbiological test result since 12/2104? | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND STRFTIME('%y-%m', microlab.culturetakentime) >= '2104-12' | eicu |
CREATE TABLE table_name_30 (
skip VARCHAR,
second VARCHAR
) | What is the skip with a second of Philippe Caux? | SELECT skip FROM table_name_30 WHERE second = "philippe caux" | sql_create_context |
CREATE TABLE table_367 (
"Date of Issue" text,
"Theme" text,
"Denomination" text,
"Design" text,
"Illustration" text,
"Printing Process" text,
"Paper Type" text,
"First Day Cover Cancellation" text
) | How many paper types did Ian Drolet design stamps on? | SELECT COUNT("Paper Type") FROM table_367 WHERE "Design" = 'Ian Drolet' | wikisql |
CREATE TABLE table_203_663 (
id number,
"country" text,
"zone" text,
"national federation" text,
"#gm" number,
"#fide" number,
"national championship" text
) | which country has the most #gm ? | SELECT "country" FROM table_203_663 ORDER BY "#gm" DESC LIMIT 1 | squall |
CREATE TABLE table_7735 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What is the winning score of the tournament with Charles Coody as the runner-up? | SELECT "Winning score" FROM table_7735 WHERE "Runner(s)-up" = 'charles coody' | wikisql |
CREATE TABLE table_13079788_3 (
date VARCHAR,
gtc_winner VARCHAR,
gt3_winner VARCHAR
) | what are all the date for gtc winners graeme mundy jamie smyth and gt3 winners hector lester tim mullen | SELECT date FROM table_13079788_3 WHERE gtc_winner = "Graeme Mundy Jamie Smyth" AND gt3_winner = "Hector Lester Tim Mullen" | sql_create_context |
CREATE TABLE ftxmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | 在00年4月27日到07年1月1日这期间就诊于门诊中的患者被开出少于28张检验报告单的是医院4879097的哪些个科室? | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '4879097' AND jybgb.BGRQ BETWEEN '2000-04-27' AND '2007-01-01' GROUP BY jybgb.KSBM HAVING COUNT(*) < 28 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb ... | css |
CREATE TABLE table_2144436_1 (
population__2000_ INTEGER,
barangay VARCHAR
) | What was the populati in 2000 for Panlicsian? | SELECT MIN(population__2000_) FROM table_2144436_1 WHERE barangay = "Panlicsian" | sql_create_context |
CREATE TABLE table_name_72 (
bronze INTEGER,
nation VARCHAR,
silver VARCHAR
) | What is the number of bronze for Canada and silver is less than 0? | SELECT SUM(bronze) FROM table_name_72 WHERE nation = "canada" AND silver < 0 | sql_create_context |
CREATE TABLE table_name_98 (
time VARCHAR,
country VARCHAR,
rank VARCHAR,
notes VARCHAR
) | What is the Time of the Belarus Player with a Rank larger than 2 and Notes of FB? | SELECT time FROM table_name_98 WHERE rank > 2 AND notes = "fb" AND country = "belarus" | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
C... | [WIP] Who are the top answering users for a set of tags?. | SELECT a.Id, a.ParentId, a.Score, a.OwnerUserId, q.Title, q.Tags, q.AnswerCount, q.FavoriteCount FROM Posts AS a INNER JOIN Posts AS q ON q.Id = a.ParentId INNER JOIN PostTags ON q.Id = PostTags.PostId INNER JOIN Users ON a.OwnerUserId = Users.Id WHERE PostTags.TagId IN (SELECT Id FROM Tags WHERE TagName IN (SELECT * F... | sede |
CREATE TABLE ASSESSMENT_NOTES (
Id VARCHAR
) | How many assessment notes are there in total? | SELECT COUNT(*) FROM ASSESSMENT_NOTES | sql_create_context |
CREATE TABLE table_11884814_3 (
country VARCHAR,
swimsuit VARCHAR
) | Which country had the swimsuit score 9.67? | SELECT country FROM table_11884814_3 WHERE swimsuit = "9.67" | sql_create_context |
CREATE TABLE table_name_58 (
games INTEGER,
points VARCHAR
) | What game has 2 points? | SELECT MAX(games) FROM table_name_58 WHERE points = 2 | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Show me about the distribution of ACC_Road and School_ID , and group by attribute ACC_Home in a bar chart, and display in descending by the X. | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE table_name_76 (
size INTEGER,
ihsaa_class VARCHAR,
location VARCHAR
) | Which Size has an IHSAA Class of aa, and a Location of milan? | SELECT SUM(size) FROM table_name_76 WHERE ihsaa_class = "aa" AND location = "milan" | sql_create_context |
CREATE TABLE table_46836 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the score on January 26? | SELECT "Score" FROM table_46836 WHERE "Date" = 'january 26' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
... | Tags that are never used by themselves. This query shows all tags that are always used with another tag. This is a strong indication that the tag can't be stand-alone and might be a meta-tag. | WITH TagNames AS (SELECT t.Id FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.Id = pt.PostId AND p.PostTypeId = 1 WHERE p.Id NOT IN (SELECT p2.Id FROM Posts AS p2 INNER JOIN PostTags AS ptTarget ON p2.Id = ptTarget.PostId AND ptTarget.TagId = t.Id INNER JOIN PostTags AS ptNotTarge... | sede |
CREATE TABLE table_47508 (
"Team A" text,
"Team C" text,
"Team D" text,
"Team E" text,
"Team F" text
) | Who is team E when Jason Manning is Team F? | SELECT "Team E" FROM table_47508 WHERE "Team F" = 'jason manning' | wikisql |
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,... | 根据不同的科室编码和入院诊断疾病名称,列出所有医疗就诊记录在医院0314561中患者的平均年龄是多大? | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0314561' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM | css |
CREATE TABLE table_name_20 (
college VARCHAR,
pick__number VARCHAR,
round VARCHAR
) | What college(s) did the player(s) picked in round 4 with a pick number less than 98 play for? | SELECT college FROM table_name_20 WHERE pick__number < 98 AND round = "round 4" | sql_create_context |
CREATE TABLE table_16146 (
"Rd" real,
"Name" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
) | In the Datsun Twin 200 race, what was the fastest lap? | SELECT "Fastest Lap" FROM table_16146 WHERE "Name" = 'Datsun Twin 200' | wikisql |
CREATE TABLE table_name_64 (
record VARCHAR,
home VARCHAR
) | What was the record when Minnesota was the home team? | SELECT record FROM table_name_64 WHERE home = "minnesota" | sql_create_context |
CREATE TABLE table_name_59 (
league VARCHAR,
playoffs VARCHAR,
the_year VARCHAR
) | Which league did not qualify for the Playoffs, and had a Year larger than 2008? | SELECT league FROM table_name_59 WHERE playoffs = "did not qualify" AND the_year > 2008 | sql_create_context |
CREATE TABLE table_name_39 (
points VARCHAR,
team VARCHAR,
grid VARCHAR
) | What was Herdez Competition's total points with a grid larger than 1? | SELECT COUNT(points) FROM table_name_39 WHERE team = "herdez competition" AND grid > 1 | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
... | did patient 017-49538's sao2, on the current icu visit, have been normal? | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-49538') AND patient.unitdischargetime IS NULL) AND vitalperiodic... | eicu |
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,
... | give me the number of patients whose death status is 0 and procedure short title is left heart cardiac cath? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Left heart cardiac cath" | mimicsql_data |
CREATE TABLE table_204_126 (
id number,
"place" text,
"player" text,
"country" text,
"score" text,
"to par" number,
"money ($)" number
) | what is the name of the first player on this chart ? | SELECT "player" FROM table_204_126 WHERE id = 1 | squall |
CREATE TABLE table_33303 (
"Song" text,
"Release date" text,
"Release info" text,
"Formats" text,
"Album" text
) | Which album had a release of heavenly (hvn95)? | SELECT "Album" FROM table_33303 WHERE "Release info" = 'heavenly (hvn95)' | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | how many patients whose primary disease is st elevated myocardial infarction\cardiac cath and lab test fluid is ascites? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_name_91 (
first_elected VARCHAR,
district VARCHAR
) | What is the total of the first elected year of the incumbent from the washington 8 district? | SELECT COUNT(first_elected) FROM table_name_91 WHERE district = "washington 8" | sql_create_context |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar... | Which classes has Dr. Frederick Conrad taught previously ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour... | advising |
CREATE TABLE table_4156 (
"Regiment" text,
"Company" text,
"Company Commander" text,
"Date of Election/Commission" text,
"County" text
) | How many company commanders were commissioned or elected on November 12, 1861? | SELECT COUNT("Company Commander") FROM table_4156 WHERE "Date of Election/Commission" = 'November 12, 1861' | wikisql |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description ... | Most Popular Tags regarding Django. | SELECT COUNT(*) AS tag_count, Tags.TagName, Tags.Id FROM PostTags JOIN Tags ON Tags.Id = PostTags.TagId JOIN Posts ON PostTags.PostId = Posts.Id WHERE Posts.Id IN (SELECT PostId FROM PostTags WHERE TagId = 243) GROUP BY Tags.TagName, Tags.Id ORDER BY tag_count DESC | sede |
CREATE TABLE table_70411 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real
) | Which is the lowest Decile that is coed? | SELECT MIN("Decile") FROM table_70411 WHERE "Gender" = 'coed' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE TagSynonyms (
Id number... | Reputation List: Choose a location. List of users by reputation score by location. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Location, Reputation, LastAccessDate, Age FROM Users WHERE LENGTH(Location) > 1 AND LOWER(Location) LIKE LOWER('%##Location##%') ORDER BY Reputation DESC | sede |
CREATE TABLE table_name_69 (
prominence__m_ INTEGER,
elevation__m_ VARCHAR
) | COunt the sum of Prominence (m) of an Elevation (m) of 2,024? | SELECT SUM(prominence__m_) FROM table_name_69 WHERE elevation__m_ = 2 OFFSET 024 | sql_create_context |
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... | 从04年7月19日开始到2019年1月14日结束姜玉石患者被开出布洛芬片(糖衣)药物的总次数的数量有几次? | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '姜玉石' AND t_kc22.STA_DATE BETWEEN '2004-07-19' AND '2019-01-14' AND t_kc22.SOC_SRT_DIRE_NM = '布洛芬片(糖衣)' | css |
CREATE TABLE table_30707 (
"Bowl Game" text,
"Date" text,
"Stadium" text,
"City" text,
"Television" text,
"Matchups/Results" text,
"Attendance" real,
"Payout ( US$ )" text
) | What was the date of the game that had a result of Army 16, SMU 14? | SELECT "Date" FROM table_30707 WHERE "Matchups/Results" = 'Army 16, SMU 14' | wikisql |
CREATE TABLE table_62889 (
"Name" text,
"Tests" real,
"Club" text,
"Career caps" real,
"Tour Apps" real,
"Position" text
) | What is the number of career caps for a full back, when tour Apps is smaller than 29? | SELECT COUNT("Career caps") FROM table_62889 WHERE "Position" = 'full back' AND "Tour Apps" < '29' | wikisql |
CREATE TABLE table_807 (
"Rank by average" real,
"Competition finish" real,
"Couple" text,
"Total" real,
"Number of dances" real,
"Average" text
) | What is the Number of dances is 11 and competition finish is larger than 2.0 total | SELECT "Total" FROM table_807 WHERE "Number of dances" = '11' AND "Competition finish" > '2.0' | wikisql |
CREATE TABLE table_256286_14 (
no_votes INTEGER
) | Name the most no votes | SELECT MAX(no_votes) FROM table_256286_14 | sql_create_context |
CREATE TABLE table_204_487 (
id number,
"home team" text,
"score" text,
"visiting team" text,
"location" text,
"venue" text,
"door" text,
"surface" text
) | the other team besides brazil to score 5 goals | SELECT "home team" FROM table_204_487 WHERE "home team" <> 'brazil' AND "score" = 5 | squall |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 在02年01月26日到07年11月14号这期间号码是0656795的医院开出的那些检验报告单中检测指标名称以及不同检测指标结果定量单位不同时其检测指标结果定量的平均值都有哪些? | SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '0656795' AND BGRQ BETWEEN '2002-01-26' AND '2007-11-14' GROUP BY JCZBMC, JCZBJGDW | css |
CREATE TABLE table_name_7 (
attendance VARCHAR,
opponent VARCHAR
) | What is the Attendance at the game against the Cincinnati Bengals? | SELECT attendance FROM table_name_7 WHERE opponent = "cincinnati bengals" | sql_create_context |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No... | Show the proportion of the number of grape of the wines whose price is bigger than 100 ordered by year. | SELECT Grape, COUNT(Grape) FROM wine WHERE Price > 100 GROUP BY Grape | nvbench |
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 jobs (
JOB_ID varchar(... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of department_id over the hire_date bin hire_date by time, sort in descending by the y-axis. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE table_32506 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the home team that scored 13.13 (91) in front of a crowd larger than 10,000? | SELECT "Home team" FROM table_32506 WHERE "Crowd" > '10,000' AND "Home team score" = '13.13 (91)' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | what is the number of patients whose ethnicity is white - russian and item id is 51375? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND lab.itemid = "51375" | mimicsql_data |
CREATE TABLE table_67316 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Time" text,
"Att." text,
"Record" text
) | What was the record at the game against the Blue Jays with a loss of Batista (0 3)? | SELECT "Record" FROM table_67316 WHERE "Opponent" = 'blue jays' AND "Loss" = 'batista (0–3)' | wikisql |
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),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the average of department_id bin hire_date by weekday. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_name_39 (
no_5 VARCHAR,
no_4 VARCHAR,
no_8 VARCHAR,
no_10 VARCHAR
) | Name the No. 5 which has a No. 8 of logan, and a No. 10 of ethan, and a No. 4 of jacob? | SELECT no_5 FROM table_name_39 WHERE no_8 = "logan" AND no_10 = "ethan" AND no_4 = "jacob" | sql_create_context |
CREATE TABLE table_11734041_11 (
player VARCHAR,
no_s_ VARCHAR
) | Who is the player who's number is 3? | SELECT player FROM table_11734041_11 WHERE no_s_ = "3" | sql_create_context |
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type text
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance... | Bar graph to show the number of nationality from different nationality | SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality | nvbench |
CREATE TABLE table_26669939_1 (
host_city VARCHAR,
host_country VARCHAR,
edition VARCHAR
) | What was the host city of the 8th edition in the the host country of Croatia? | SELECT host_city FROM table_26669939_1 WHERE host_country = "Croatia" AND edition = "8th" | sql_create_context |
CREATE TABLE table_53178 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What competition resulted in 2-0 score, hosted in Amman? | SELECT "Competition" FROM table_53178 WHERE "Score" = '2-0' AND "Venue" = 'amman' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Undeleted accepted answers without accept vote. | SELECT p.AcceptedAnswerId AS "post_link", p.OwnerUserId AS "user_link" FROM Posts AS p INNER JOIN PostHistory AS e ON p.AcceptedAnswerId = e.PostId WHERE e.PostHistoryTypeId = 13 AND NOT p.OwnerUserId IS NULL AND p.AcceptedAnswerId NOT IN (SELECT v.PostId FROM Votes AS v WHERE v.VoteTypeId = 1) ORDER BY p.AcceptedAnswe... | sede |
CREATE TABLE table_13480 (
"School" text,
"Location" text,
"Mascot" text,
"Size" real,
"IHSAA Class" text,
"County" text
) | What is the mascot for the team smaller than 154 from 49 Marion? | SELECT "Mascot" FROM table_13480 WHERE "Size" < '154' AND "County" = '49 marion' | wikisql |
CREATE TABLE table_name_41 (
pts INTEGER,
year VARCHAR,
engine VARCHAR,
entrant VARCHAR
) | In 1972, what was the highest number of points with a Ford engine and an entrant of Brooke Bond Oxo Team Surtees? | SELECT MAX(pts) FROM table_name_41 WHERE engine = "ford" AND entrant = "brooke bond oxo team surtees" AND year = 1972 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
trea... | how many patients were given a ammonia test? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'ammonia') | eicu |
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,
... | anemia ( hemoglobin < 8.5 mg / dl ) | SELECT * FROM table_test_20 WHERE anemia = 1 OR hemoglobin_a1c_hba1c < 8.5 | criteria2sql |
CREATE TABLE table_23832 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in millions)" text
) | Who wrote the episode titled 'The Morning After Job'? | SELECT "Written by" FROM table_23832 WHERE "Title" = 'The Morning After Job' | wikisql |
CREATE TABLE table_36721 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What 2007 has 236 for 2006? | SELECT "2007" FROM table_36721 WHERE "2006" = '236' | wikisql |
CREATE TABLE table_2273 (
"-Butadiene" text,
"10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) absolute" text,
"10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) relative" text,
"\u0394H \u2021 /kcal mol \u22121" text,
"\u0394S \u2021 /cal mol \u22121 K \u22121" text
) | Name the 10 4 k /min 1 (30 c) ( 1-2%) absolute for 1.00 | SELECT "10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) absolute" FROM table_2273 WHERE "10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) relative" = '1.00' | wikisql |
CREATE TABLE table_203_171 (
id number,
"place\n(posicion)" number,
"team\n(equipo)" text,
"played\n(pj)" number,
"won\n(pg)" number,
"draw\n(pe)" number,
"lost\n(pp)" number,
"goals scored\n(gf)" number,
"goals conceded\n(gc)" number,
"+/-\n(dif.)" number,
"points\n(pts.)" n... | what was the average number of games lost ? | SELECT AVG("lost\n(pp)") FROM table_203_171 | squall |
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | Show me mean cloud cover by date in a histogram, could you display the average of cloud cover in ascending order? | SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover) | nvbench |
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 demographic ... | let me know the age and religious background of patient with patient id 17519. | SELECT demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = "17519" | mimicsql_data |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me the trend about employee_id over hire_date with a line chart, and display by the X-axis in descending. | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC | 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 whose death status is 0 and procedure long title is suture of laceration of bladder? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Suture of laceration of bladder" | mimicsql_data |
CREATE TABLE table_27293285_2 (
points_for VARCHAR,
club VARCHAR
) | How many points for did Munster have? | SELECT points_for FROM table_27293285_2 WHERE club = "Munster" | sql_create_context |
CREATE TABLE table_55192 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which home team plays at Punt Road Oval? | SELECT "Home team" FROM table_55192 WHERE "Venue" = 'punt road oval' | wikisql |
CREATE TABLE table_name_17 (
number_of_deputies INTEGER,
number_of_votes_received VARCHAR,
election_date VARCHAR
) | What was deputies with the lowest number of unknown received votes, in an election year after 1986? | SELECT MIN(number_of_deputies) FROM table_name_17 WHERE number_of_votes_received = "unknown" AND election_date > 1986 | sql_create_context |
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 demographic (
subject_id text,
hadm_id t... | count the number of white-russian ethnic background patients who had emergency hospital admission. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.ethnicity = "WHITE - RUSSIAN" | mimicsql_data |
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 employees (
EMPLOYEE_I... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the amount of job_id over the job_id , and group by attribute job_id, and I want to sort y axis in ascending order. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) | nvbench |
CREATE TABLE table_73770 (
"Rank" real,
"Rank w/o Hydropower" real,
"State" text,
"% Renewable" text,
"% Renewable w/o Hydro" text,
"Renewable electricity (GW\u2022h)" real,
"Renewable electricity w/o Hydro (GW\u2022h)" real,
"Total electricity (GW\u2022h)" real
) | What is the percentage of renewable electricity without hydrogen power in the state of South Dakota? | SELECT "% Renewable w/o Hydro" FROM table_73770 WHERE "State" = 'South Dakota' | wikisql |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE route (
train_id int,
... | Find the id and local authority of the station whose maximum precipitation is higher than 50 Visualize by bar chart, I want to list in asc by the bars. | SELECT local_authority, id FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id ORDER BY local_authority | nvbench |
CREATE TABLE table_1773 (
"Parish (Prestegjeld)" text,
"Sub-Parish (Sogn)" text,
"Church Name" text,
"Year Built" real,
"Location of the Church" text
) | What is the total number of churches named H yanger Kyrkje? | SELECT COUNT("Sub-Parish (Sogn)") FROM table_1773 WHERE "Church Name" = 'Høyanger kyrkje' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.