context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CR... | i'd like to find the least expensive one way fare from BOSTON to PHILADELPHIA | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | atis |
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 vitalperiodic (
vitalp... | did kcl 10%, potassium chloride, or ephedrine sulfate be prescribed to patient 003-54468 in 2105? | 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 = '003-54468')) AND medication.drugname IN ('kcl 10%', 'potassium chloride', ... | eicu |
CREATE TABLE table_75241 (
"Calls" text,
"Freq." text,
"Format" text,
"Market/Market Rank" text,
"Weeknights" text,
"Saturday" text,
"Sunday" text,
"Group Owner" text
) | What is the market for the 11pm-1am Saturday game? | SELECT "Market/Market Rank" FROM table_75241 WHERE "Saturday" = '11pm-1am' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | Tell me the number of asian patients who have had a specific gravity lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "ASIAN" AND lab.label = "Specific Gravity" | mimicsql_data |
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 int
)
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working... | Return a histogram on what are the nationalities and the total ages of journalists? | SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality | nvbench |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, a bar chart shows the distribution of headquarter and the average of revenue , and group by attribute headquarter. | SELECT Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | nvbench |
CREATE TABLE table_53541 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/retired" text,
"Grid" real
) | what is the grid when the laps is more than 20? | SELECT SUM("Grid") FROM table_53541 WHERE "Laps" > '20' | wikisql |
CREATE TABLE table_204_93 (
id number,
"round" number,
"pick" number,
"player" text,
"position" text,
"nationality" text,
"team" text,
"college" text
) | what was the name of the college that the player who was the fourth pick attended ? | SELECT "college" FROM table_204_93 WHERE "pick" = 4 | squall |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Users sorted by score per answer. Votes per answer (non-CW, with at least 400 answers to their credit) | SELECT u.Id AS "user_link", u.Reputation AS "Rep", COUNT(a.Id) AS "Answers", SUM(a.Score) AS "Total Score", CAST(SUM(a.Score) AS FLOAT) / CAST(COUNT(a.Id) AS FLOAT) AS "Average" FROM Posts AS a, Users AS u WHERE a.OwnerUserId = u.Id AND a.PostTypeId = 2 AND a.CommunityOwnedDate IS NULL GROUP BY u.Id, u.Reputation HAVIN... | sede |
CREATE TABLE table_name_95 (
location VARCHAR,
previous_conference VARCHAR,
mascot VARCHAR
) | Which Location has a Previous Conference of independents, and a Mascot of hilltoppers? | SELECT location FROM table_name_95 WHERE previous_conference = "independents" AND mascot = "hilltoppers" | sql_create_context |
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,
... | How many asian patients have pneumonia as their primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.diagnosis = "PNEUMONIA" | mimicsql_data |
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 of the patients on government insurance had icd9 code 2219? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.icd9_code = "2219" | mimicsql_data |
CREATE TABLE table_name_26 (
date INTEGER,
sport VARCHAR,
medal VARCHAR
) | what is the date when the medal is bronze for athletics? | SELECT AVG(date) FROM table_name_26 WHERE sport = "athletics" AND medal = "bronze" | sql_create_context |
CREATE TABLE table_name_13 (
home_team VARCHAR,
away_team VARCHAR
) | What was the home team's score when they played Richmond? | SELECT home_team AS score FROM table_name_13 WHERE away_team = "richmond" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId numb... | Top 'R' Vote Getters with A Website. | SELECT Users.DisplayName, Users.Id, sub.totalVotes, Users.WebsiteUrl FROM (SELECT Users.Id, COUNT(*) AS totalVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND Votes.VoteTypeId = 2 INNER JOIN Users ON Posts... | sede |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
... | what is the minimum value of sao2 of patient 007-2001 on 01/22/last year? | SELECT MIN(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-2001')) AND NOT vitalperiodic.sao2 IS NULL AND DATETI... | eicu |
CREATE TABLE table_45142 (
"Episode number Production number" text,
"Title" text,
"Sydney" real,
"Melbourne" real,
"Brisbane" real,
"Adelaide" real,
"Perth" real,
"TOTAL" real,
"WEEKLY RANK" real,
"NIGHTLY RANK" real
) | What is the sum of the values for Melbourne, when Episode Number Production Number is 19 2-06, and when Sydney is less than 389,000? | SELECT SUM("Melbourne") FROM table_45142 WHERE "Episode number Production number" = '19 2-06' AND "Sydney" < '389,000' | 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_CLINIC_ID text,
MED_DIRE_CD tex... | 想知道有哪些医院给患者56628366开过厄贝沙坦片(薄膜衣) | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '56628366' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '厄贝沙坦片(薄膜衣)') | css |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | tell me the number of times that patient 5142 has received an bilirubin, total lab test in the previous month. | SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bilirubin, total') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5142) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_T... | mimic_iii |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
) | Count the number of captains younger than 50 of each rank by a bar chart, and rank by the y axis in asc. | SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_12433 (
"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 goals scored of the club with more than 3 draws, more than 1 loses, and less than 26 points? | SELECT COUNT("Goals scored") FROM table_12433 WHERE "Draws" > '3' AND "Loses" > '1' AND "Points" < '26' | wikisql |
CREATE TABLE table_31008 (
"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 wrote the episode that was directed by Milan Cheylov? | SELECT "Written by" FROM table_31008 WHERE "Directed by" = 'Milan Cheylov' | wikisql |
CREATE TABLE table_43354 (
"Spoofed Title" text,
"Actual Title" text,
"Writer" text,
"Artist" text,
"Issue" real
) | What was the actual title of the show that had an issue number less than 508, was written by Desmond Devlin, and for which Tom Richmond was the artist? | SELECT "Actual Title" FROM table_43354 WHERE "Artist" = 'tom richmond' AND "Issue" < '508' AND "Writer" = 'desmond devlin' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
... | tell me the last medicine that was prescribed to patient 11823 in 11/last year. | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11823) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', prescriptions.startdate) = '11' ORD... | mimic_iii |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 列出在08年4月2日到10年8月17日内患者云文石全部检验结果指标记录中的仪器名称以及编号都是什么啊? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybg... | css |
CREATE TABLE table_25252 (
"Stage" real,
"Winner" text,
"General Classification" text,
"Mountains Classification" text,
"Sprint Classification" text,
"Team Classification" text
) | Name the stage for no award | SELECT "Stage" FROM table_25252 WHERE "Mountains Classification" = 'no award' | wikisql |
CREATE TABLE table_203_615 (
id number,
"district" text,
"incumbent" text,
"party" text,
"first\nelected" number,
"result" text,
"candidates" text
) | what number of elections were a democratic gain ? | SELECT COUNT(*) FROM table_203_615 WHERE "result" = 'democratic gain' | squall |
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
baseprice number,
decor text
)
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults... | Find the first and last names of people who payed more than the rooms' base prices. | SELECT T1.firstname, T1.lastname FROM reservations AS T1 JOIN rooms AS T2 ON T1.room = T2.roomid WHERE T1.rate - T2.baseprice > 0 | spider |
CREATE TABLE table_name_71 (
name VARCHAR,
former_local_authority VARCHAR
) | What is the name of the parish that has a former local authority of St Neots urban district? | SELECT name FROM table_name_71 WHERE former_local_authority = "st neots urban district" | sql_create_context |
CREATE TABLE table_204_200 (
id number,
"iso/iec standard" text,
"title" text,
"status" text,
"description" text,
"wg" number
) | are there more or less than 24 titles on the chart ? | SELECT (SELECT COUNT("title") FROM table_204_200) > 24 | squall |
CREATE TABLE table_16275828_4 (
sanction VARCHAR,
track_name VARCHAR
) | Who sanctioned the event at fayette county speedway? | SELECT sanction FROM table_16275828_4 WHERE track_name = "Fayette County Speedway" | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE txmzjzjlb (
HXPLC number,
HZX... | 列出在2003年10月24日到2017年4月14日内患者曹诗蕾被开出多少检验报告单的检验报告单号? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb 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 AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '曹... | css |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Show me Computational Medicine and Bioinformatics Journal Club courses that have 14 course credits . | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Computational Medicine and Bioinformatics Journal Club%' OR name LIKE '%Computational Medicine and Bioinformatics Journal Club%') AND credits = 14 | advising |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
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 ... | Find comments containing a word. | SELECT * FROM Comments WHERE LOWER(Text) LIKE '% %' | sede |
CREATE TABLE table_71813 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | When did Final Score of 31-7 happen? | SELECT "Date" FROM table_71813 WHERE "Final Score" = '31-7' | wikisql |
CREATE TABLE table_24477075_1 (
minutes INTEGER,
starts VARCHAR
) | Name the most minutes and starts being 12 | SELECT MAX(minutes) FROM table_24477075_1 WHERE starts = 12 | sql_create_context |
CREATE TABLE university (
Enrollment INTEGER
) | What is the maximum enrollment across all schools? | SELECT MAX(Enrollment) FROM university | sql_create_context |
CREATE TABLE table_train_47 (
"id" int,
"bone_marrow_transplant" bool,
"organ_transplantation" bool,
"allergy_to_calcitriol" bool,
"serum_calcium" float,
"taking_vitamin_d" bool,
"intention_to_central_venous_catheter" bool,
"sarcoidosis" bool,
"metabolic_bone_disease" bool,
"prim... | history of hypersensitivity or any allergic reaction to calcitriol | SELECT * FROM table_train_47 WHERE allergy_to_calcitriol = 1 | criteria2sql |
CREATE TABLE table_name_81 (
round INTEGER,
school VARCHAR,
pick VARCHAR
) | What is the average round for Georgia Tech with a pick greater than 103? | SELECT AVG(round) FROM table_name_81 WHERE school = "georgia tech" AND pick > 103 | sql_create_context |
CREATE TABLE table_74441 (
"Rank" real,
"Country/Territory" text,
"Mister World" real,
"1st runner-up" real,
"2nd runner-up" real,
"3rd runner-up" real,
"4th runner-up" real,
"Semifinalists" real,
"Total" real
) | How many 3rd runner up values does Turkey have? | SELECT COUNT("3rd runner-up") FROM table_74441 WHERE "Country/Territory" = 'Turkey' | wikisql |
CREATE TABLE table_2409 (
"Episode" text,
"Broadcast date" text,
"Run time" text,
"Viewers (in millions)" text,
"Archive" text
) | When 24:31 is the run time how many measurements of viewers (in millions) are there? | SELECT COUNT("Viewers (in millions)") FROM table_2409 WHERE "Run time" = '24:31' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is the age and ethnicity of patient id 9258? | SELECT demographic.age, demographic.ethnicity FROM demographic WHERE demographic.subject_id = "9258" | mimicsql_data |
CREATE TABLE table_3892 (
"Model - Computer name" text,
"CPU type" text,
"No. of processors" text,
"Period of operation" text,
"Maximum peak performance ( Teraflops )" text,
"Use" text
) | Name the most peak performance for october 2006 - january 2010 | SELECT "Maximum peak performance ( Teraflops )" FROM table_3892 WHERE "Period of operation" = 'October 2006 - January 2010' | wikisql |
CREATE TABLE table_7836 (
"Rank" real,
"Title" text,
"Studio" text,
"Director" text,
"Gross" text
) | WHAT RANK DOES LEONARD NIMOY HAVE? | SELECT AVG("Rank") FROM table_7836 WHERE "Director" = 'leonard nimoy' | wikisql |
CREATE TABLE table_39622 (
"School" text,
"Mascot" text,
"Location" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"# / County" text
) | At Indianapolis North Central that has greater than 1,829 enrolled, what is the IHSAA Football Class? | SELECT "IHSAA Football Class" FROM table_39622 WHERE "Enrollment" > '1,829' AND "School" = 'indianapolis north central' | wikisql |
CREATE TABLE table_58910 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Club" text
) | What is the Club of the Player with a Date of Birth of 1977-02-03? | SELECT "Club" FROM table_58910 WHERE "Date of Birth" = '1977-02-03' | wikisql |
CREATE TABLE table_204_226 (
id number,
"municipality/communes" text,
"coalition for the citizen" text,
"coalition for the future" text,
"other/independent" text,
"winning party/coalition" text,
"voter turnout" text
) | what was the difference in votes -lrb- percentage -rrb- between savire hoxhaj and astrit sejdinaj in the fratar municipality ? | SELECT ABS((SELECT "coalition for the citizen" FROM table_204_226 WHERE "coalition for the citizen" = 'sabire hoxhaj') - (SELECT "coalition for the future" FROM table_204_226 WHERE "coalition for the future" = 'astrit sejdinaj')) | squall |
CREATE TABLE table_37729 (
"Favorite professional sport" text,
"2005" text,
"2008" text,
"2011" text,
"2012" text
) | What is listed as the Favorite Professional Sport that has a 2008 of 8.9%? | SELECT "Favorite professional sport" FROM table_37729 WHERE "2008" = '8.9%' | wikisql |
CREATE TABLE table_name_84 (
club VARCHAR,
try_bp VARCHAR
) | Can you tell me the Club thay has the Try BP of 0? | SELECT club FROM table_name_84 WHERE try_bp = "0" | sql_create_context |
CREATE TABLE table_18179 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many districts was Robert Livingston incumbent in? | SELECT COUNT("District") FROM table_18179 WHERE "Incumbent" = 'Robert Livingston' | wikisql |
CREATE TABLE table_name_83 (
rank VARCHAR,
year_opened VARCHAR,
state VARCHAR
) | What is the rank for the year opened in 1959 in Pennsylvania? | SELECT rank FROM table_name_83 WHERE year_opened = "1959" AND state = "pennsylvania" | sql_create_context |
CREATE TABLE table_56982 (
"Variant (with Niqqud )" text,
"without Niqqud" text,
"Phonemic Value" text,
"Phonetic Realisation" text,
"English example" text
) | Give me an english example of a variant with niqqud of ? | SELECT "English example" FROM table_56982 WHERE "Variant (with Niqqud )" = 'וֹ' | wikisql |
CREATE TABLE table_23575917_4 (
davids_team VARCHAR,
lees_team VARCHAR
) | Who is on the David's Team for the episode with the Lees Team of Jack Dee and Peter Serafinowicz | SELECT davids_team FROM table_23575917_4 WHERE lees_team = "Jack Dee and Peter Serafinowicz" | sql_create_context |
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATE,
End_Date DATE
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
... | For those payments processed with Visa, bin the payment day into the Day of week interval and count them for a bar chart. | SELECT Date_Payment_Made, COUNT(Date_Payment_Made) FROM Payments WHERE Payment_Method_Code = 'Visa' | nvbench |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
... | 报一下身高和体重,患者褚永福的 | SELECT mzjzjlb.SG, mzjzjlb.TZ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YL... | css |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by weekday, I want to rank from low to high by the Y please. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_47020 (
"Class" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Verb meaning" text
) | What is the part 4 entry for class 7b? | SELECT "Part 4" FROM table_47020 WHERE "Class" = '7b' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | how many patients are diagnosed with toxic encephalopathy and have im route of drug administration? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Toxic encephalopathy" AND prescriptions.route = "IM" | mimicsql_data |
CREATE TABLE table_name_75 (
round VARCHAR,
player VARCHAR
) | What is the total number of rounds that had Jason Missiaen? | SELECT COUNT(round) FROM table_name_75 WHERE player = "jason missiaen" | sql_create_context |
CREATE TABLE table_name_65 (
home_team VARCHAR,
date VARCHAR,
tie_no VARCHAR
) | What is Home Team, when Date is '28 January 1984', and when Tie No is '4'? | SELECT home_team FROM table_name_65 WHERE date = "28 january 1984" AND tie_no = "4" | sql_create_context |
CREATE TABLE table_56014 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When the Venue is mcg what is the Home team? | SELECT "Home team" FROM table_56014 WHERE "Venue" = 'mcg' | wikisql |
CREATE TABLE table_name_19 (
rank INTEGER,
gold VARCHAR,
bronze VARCHAR,
total VARCHAR
) | What is the average Rank when there are 2 bronze, the total is 2 and gold is less than 0? | SELECT AVG(rank) FROM table_name_19 WHERE bronze = 2 AND total = 2 AND gold < 0 | sql_create_context |
CREATE TABLE table_5987 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Rank of 5, and a Silver larger than 0 had what sum of total? | SELECT SUM("Total") FROM table_5987 WHERE "Rank" = '5' AND "Silver" > '0' | 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... | 从2005年5月20日到2014年6月18日这段期间参保人83001466花了多少门诊检查费? | SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '83001466' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2005-05-20' AND '2014-06-18' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_25997 (
"Province" text,
"Mahmoud Ahmadinejad" real,
"Mehdi Karroubi" real,
"Mir-Hossein Mousavi" real,
"Mohsen Rezaee" real,
"Spoiled ballots" real,
"Total votes" real
) | Display the lowest score for candidate Mir-Hossein Mousavi when candidate Mohsen Rezaee scored 44809 votes | SELECT MIN("Mir-Hossein Mousavi") FROM table_25997 WHERE "Mohsen Rezaee" = '44809' | wikisql |
CREATE TABLE table_16322 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What's the pick number of the player from New Mexico? | SELECT MAX("Pick #") FROM table_16322 WHERE "College" = 'New Mexico' | wikisql |
CREATE TABLE table_55436 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
) | What is the lowest Attendance when Middlesbrough played at Venue A? | SELECT MIN("Attendance") FROM table_55436 WHERE "Opponent" = 'middlesbrough' AND "Venue" = 'a' | 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_... | Before taking ENSCEN 171 do I need to take any courses ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... | advising |
CREATE TABLE table_name_14 (
result VARCHAR,
attendance VARCHAR
) | For the game with 528 attendance, what was the result? | SELECT result FROM table_name_14 WHERE attendance = "528" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | When was patient id 17519 admitted? Specify the time and location. | SELECT demographic.admission_location, demographic.admittime FROM demographic WHERE demographic.subject_id = "17519" | mimicsql_data |
CREATE TABLE table_12006 (
"Year" text,
"Name" text,
"Film" text,
"Song" text,
"Status" text
) | Which song named Tan Dun was nominated? | SELECT "Song" FROM table_12006 WHERE "Status" = 'nominated' AND "Name" = 'tan dun' | wikisql |
CREATE TABLE table_38738 (
"Year" real,
"Date" text,
"Winner" text,
"Score" text,
"To par" text,
"Winner's share ($)" real
) | What did winner Gary Player par? | SELECT "To par" FROM table_38738 WHERE "Winner" = 'gary player' | wikisql |
CREATE TABLE table_203_688 (
id number,
"category" text,
"speed\n(km/h)" number,
"speed\n(mph)" number,
"vehicle" text,
"pilot" text,
"date" text
) | what is the least fastest aircraft ? | SELECT "category" FROM table_203_688 ORDER BY "speed\n(km/h)" LIMIT 1 | squall |
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_cit... | How many regions were affected by each storm. Show a pie chart. | SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID | nvbench |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 统计年龄不低于20岁的患者医疗记录的平均医疗费总共花销是多少? | SELECT AVG(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_AGE >= 20) | css |
CREATE TABLE table_name_43 (
cover_model VARCHAR,
centerfold_model VARCHAR
) | Who was the Cover model when the Centerfold Model was Marketa Janska? | SELECT cover_model FROM table_name_43 WHERE centerfold_model = "marketa janska" | sql_create_context |
CREATE TABLE table_75679 (
"Name" text,
"State" text,
"Status" text,
"Title" text,
"Appointment" text,
"Credentials Presented" text
) | When were the credentials presented for new jersey with a status of foreign service officer? | SELECT "Credentials Presented" FROM table_75679 WHERE "State" = 'new jersey' AND "Status" = 'foreign service officer' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | calculate the maximum age of female patients who had inpatient hospital discharge. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" | mimicsql_data |
CREATE TABLE customer_orders (
order_id number,
customer_id number,
order_status text,
order_date time,
order_details text
)
CREATE TABLE customer_contact_channels (
customer_id number,
channel_code text,
active_from_date time,
active_to_date time,
contact_number text
)
CREATE ... | Find the name of the customers who use the most frequently used payment method. | SELECT customer_name FROM customers WHERE payment_method = (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1) | spider |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | count the number of patients whose primary disease is s/p hanging and drug type is main. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "S/P HANGING" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE wdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX num... | 65100285762的住院看病的出院状态代码是多少? | SELECT wdmzjzjlb.CYZTDM FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '65100285762' UNION SELECT bdmzjzjlb.CYZTDM FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '65100285762' | css |
CREATE TABLE table_17802778_1 (
miles__km_ VARCHAR,
race_time VARCHAR
) | How many total miles recorded for the racer who finished in 1:05:33? | SELECT miles__km_ FROM table_17802778_1 WHERE race_time = "1:05:33" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,... | has ever been greater than 116.0 the arterial bp mean of patient 7241 until 09/21/2104? | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7241)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' ... | mimic_iii |
CREATE TABLE table_72306 (
"Strongs #" real,
"Hebrew word" text,
"Strongs Transliteration" text,
"Strongs Words Compounded" text,
"English Spelling" text
) | What is the strong words compounded when the strongs transliteration is yowyariyb? | SELECT "Strongs Words Compounded" FROM table_72306 WHERE "Strongs Transliteration" = 'Yowyariyb' | wikisql |
CREATE TABLE table_22815568_6 (
market_income_per_capita VARCHAR,
poverty_rate VARCHAR
) | If the poverty rate is 12.9%, what is the market income per capita? | SELECT market_income_per_capita FROM table_22815568_6 WHERE poverty_rate = "12.9%" | sql_create_context |
CREATE TABLE table_name_7 (
gold INTEGER,
rank VARCHAR,
bronze VARCHAR
) | What is the smallest number of gold medals corresponding to the total rank with more than 4 bronze medals? | SELECT MIN(gold) FROM table_name_7 WHERE rank = "total" AND bronze > 4 | 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 PostsWithDeleted (
Id number,
PostTyp... | Pending dup closevotes for java for those with hammers. | SELECT DISTINCT PostId AS "post_link" FROM PendingFlags WHERE NOT DuplicateOfQuestionId IS NULL AND (SELECT Id FROM Posts WHERE Id = PostId AND (NOT ClosedDate IS NULL OR (NOT Tags LIKE '%<java>%'))) IS NULL | sede |
CREATE TABLE table_29012710_1 (
number_of_dairy_cows INTEGER,
province VARCHAR
) | what is the least amount of milk cattle in ontario | SELECT MIN(number_of_dairy_cows) FROM table_29012710_1 WHERE province = "Ontario" | sql_create_context |
CREATE TABLE table_39207 (
"Isotope" text,
"Half-life" text,
"Decay mode" text,
"Discovery year" text,
"Reaction" text
) | What is the half-life discovered in 2003? | SELECT "Half-life" FROM table_39207 WHERE "Discovery year" = '2003' | wikisql |
CREATE TABLE table_52404 (
"City" text,
"Country" text,
"Region" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | Tell me the country with ICAO of zgha | SELECT "Country" FROM table_52404 WHERE "ICAO" = 'zgha' | wikisql |
CREATE TABLE table_14058433_5 (
lost VARCHAR,
club VARCHAR
) | what's the lost with club being colwyn bay rfc | SELECT lost FROM table_14058433_5 WHERE club = "Colwyn Bay RFC" | sql_create_context |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,... | list lowest cost flight from DALLAS to BALTIMORE | 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... | atis |
CREATE TABLE table_name_55 (
entries VARCHAR,
season VARCHAR,
front_row_starts VARCHAR
) | What were the total number of entries in 2001 that had a front row smaller than 13? | SELECT COUNT(entries) FROM table_name_55 WHERE season = "2001" AND front_row_starts < 13 | sql_create_context |
CREATE TABLE table_5211 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Venue" text,
"Attendance" text
) | Result of l 10-23 occurred in what week? | SELECT "Week" FROM table_5211 WHERE "Result" = 'l 10-23' | wikisql |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LNa... | What is the average age for each city and what are those cities Show bar chart, could you show bars in asc order? | SELECT city_code, AVG(Age) FROM Student GROUP BY city_code ORDER BY city_code | nvbench |
CREATE TABLE table_20866024_3 (
engine VARCHAR,
model_designation VARCHAR
) | What type of engine does the model with model designation 97100 have? | SELECT engine FROM table_20866024_3 WHERE model_designation = "97100" | sql_create_context |
CREATE TABLE table_name_85 (
owner_operator VARCHAR,
licence_number VARCHAR
) | Who is the owner operator who has license number PL 59? | SELECT owner_operator FROM table_name_85 WHERE licence_number = "pl 59" | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE lab (
labid numbe... | how much does it cost patient 015-56556's stay at the hospital a year before? | SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-56556') AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | eicu |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 在2016-11-12到2019-10-06期间,0731148医疗机构有多少次外地门诊就诊记录 | SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.YLJGDM = '0731148' AND txmzjzjlb.JZKSRQ BETWEEN '2016-11-12' AND '2019-10-06' AND txmzjzjlb.WDBZ > 0 UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.YLJGDM = '0731148' AND ftxmzjzjlb.JZKSRQ BETWEEN '2016-11-12' AND '2019-10-06' AND ftxmzjzjlb.WDBZ > 0 | css |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
... | 从14年12月31日到21年1月18日当中头颈肿瘤外科的门诊量有多少吗? | SELECT COUNT(*) FROM mzjzjlb WHERE JZKSMC = '头颈肿瘤科' AND JZKSRQ BETWEEN '2014-12-31' AND '2021-01-18' | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.