context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases IN... | Show me a scatter plot of avg(price) and the average of score for . | SELECT AVG(Price), AVG(Score) FROM wine GROUP BY AVG(Price) | nvbench |
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... | 患者13034482在2003年4月25日到2009年2月2日内曾在医院一共就诊多少次? | SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON 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.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_... | css |
CREATE TABLE table_44683 (
"Rank" real,
"Mine" text,
"County and State" text,
"Operator" text,
"Source of copper" text,
"Capacity (thousands of metric tons)" real
) | In Silver Bow County, Montana, when the capicity is more than 45 tons, what's the highest rank found? | SELECT MAX("Rank") FROM table_44683 WHERE "County and State" = 'silver bow county, montana' AND "Capacity (thousands of metric tons)" > '45' | wikisql |
CREATE TABLE table_name_71 (
la_crescenta__montrose VARCHAR,
tujunga VARCHAR
) | When Tujunga is moderate, what is La Crescenta-Montrose? | SELECT la_crescenta__montrose FROM table_name_71 WHERE tujunga = "moderate" | sql_create_context |
CREATE TABLE table_name_77 (
away_team VARCHAR,
venue VARCHAR
) | Which Away team uses Princes Park as it's venue? | SELECT away_team FROM table_name_77 WHERE venue = "princes park" | sql_create_context |
CREATE TABLE match (
Round real,
Location text,
Country text,
Date text,
Fastest_Qualifying text,
Winning_Pilot text,
Winning_Aircraft text
)
CREATE TABLE airport (
Airport_ID int,
Airport_Name text,
Total_Passengers real,
%_Change_2007 text,
International_Passengers rea... | List the names of aircrafts and the number of times it won matches by a bar chart, and list y axis in desc order. | SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_24 (
game INTEGER,
opponent VARCHAR
) | How many games had Montreal Canadiens as an opponent? | SELECT SUM(game) FROM table_name_24 WHERE opponent = "montreal canadiens" | sql_create_context |
CREATE TABLE table_17620 (
"Number in series" real,
"Broadcast Order" text,
"Title" text,
"Villain/s" text,
"U.S. Air Date" text,
"Production Code" text
) | What's the number of episodes with a broadcast order s04 e07? | SELECT COUNT("Number in series") FROM table_17620 WHERE "Broadcast Order" = 'S04 E07' | wikisql |
CREATE TABLE table_2374338_2 (
croats VARCHAR,
romanians VARCHAR
) | What is every value for Croats when value for Romanians is 16.65%? | SELECT croats FROM table_2374338_2 WHERE romanians = "16.65%" | sql_create_context |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence... | what are the cost of morning flights from ATLANTA to BALTIMORE | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.cit... | atis |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod... | what are the methods of consumption of levetiracetam solution? | SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'levetiracetam solution' | mimic_iii |
CREATE TABLE table_64406 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | Can you tell me the Time that has the Lane of 8? | SELECT "Time" FROM table_64406 WHERE "Lane" = '8' | wikisql |
CREATE TABLE table_47291 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
) | Who was the opponent, during the game at the location of keyarena at seattle center? | SELECT "Opponent" FROM table_47291 WHERE "Location/Attendance" = 'keyarena at seattle center' | wikisql |
CREATE TABLE table_40710 (
"Location" text,
"Control" text,
"Type" text,
"Enrollment" real,
"Founded" real
) | What is the enrollment number for the public institution in Golden, Colorado founded after 1874? | SELECT AVG("Enrollment") FROM table_40710 WHERE "Control" = 'public' AND "Location" = 'golden, colorado' AND "Founded" > '1874' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId n... | User List: Top N - Location/abbreviation. Enter more than one character for location. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, LastAccessDate, UpVotes, DownVotes FROM Users WHERE LOWER(Location) LIKE LOWER('%##Location##%') OR Location LIKE UPPER('%##LocAbbreviation##') AND LENGTH(Location) > 1 LIMIT 100 | sede |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | how many patients have received a blood, venipuncture test this year? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'blood, venipuncture' AND DATETIME(microlab.culturetakentime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) | eicu |
CREATE TABLE table_name_45 (
manager VARCHAR,
playoffs VARCHAR,
year VARCHAR
) | Name the manager for playoffs of missed for 1999 | SELECT manager FROM table_name_45 WHERE playoffs = "missed" AND year = "1999" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 在2010-11-01之后,患者17949881有哪些住院就诊的检验报告单?看一下住院就诊的流水号 | SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '17949881' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2010-11-01') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN... | css |
CREATE TABLE table_22133 (
"Standard order" real,
"English translation" text,
"Transcription (based on Pinyin)" text,
"Traditional Chinese" text,
"Simplified Chinese" text
) | What is the Pinyin transcription for 'Alas for the Days Gone By'? | SELECT "Transcription (based on Pinyin)" FROM table_22133 WHERE "English translation" = 'Alas for the Days Gone By' | wikisql |
CREATE TABLE table_13492 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | what is the highest attendance for week 6? | SELECT MAX("Attendance") FROM table_13492 WHERE "Week" = '6' | wikisql |
CREATE TABLE people (
people_id number,
district text,
name text,
party text,
age number
)
CREATE TABLE debate_people (
debate_id number,
affirmative number,
negative number,
if_affirmative_win others
)
CREATE TABLE debate (
debate_id number,
date text,
venue text,
... | Show the names of people who have been on the negative side of debates at least twice. | SELECT T2.name FROM debate_people AS T1 JOIN people AS T2 ON T1.negative = T2.people_id GROUP BY T2.name HAVING COUNT(*) >= 2 | spider |
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... | Get me the list of patients taking succinylcholine who had elective hospital admission. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Succinylcholine" | mimicsql_data |
CREATE TABLE table_name_79 (
drawn VARCHAR,
try_bp VARCHAR
) | What is the number drawn when the try BP is 1? | SELECT drawn FROM table_name_79 WHERE try_bp = "1" | sql_create_context |
CREATE TABLE table_16882 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Featured character(s)" text,
"Original air date" text,
"U.S. viewers (million)" text
) | What date got 9.82 million viewers? | SELECT "Original air date" FROM table_16882 WHERE "U.S. viewers (million)" = '9.82' | 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... | 60676464号病人的检验报告单对应的检验结果指标均异常的检验报告单号有哪些 | SELECT jybgb.BGDH FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '60676464' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FRO... | css |
CREATE TABLE table_67431 (
"Team" text,
"Miles [One Way]" real,
"Home Result" text,
"Fans Brought" text,
"Away Result" text,
"Fans Took" text,
"Points Gained" real
) | Which team had fans took of 288? | SELECT "Team" FROM table_67431 WHERE "Fans Took" = '288' | 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 prescriptions (
subject_id text,
hadm_id... | find the number of patients whose language is english and diagnoses is atriovent block complete. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.language = "ENGL" AND diagnoses.short_title = "Atriovent block complete" | mimicsql_data |
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... | 自二零一零年六月十日到二零一八年五月四日,名叫韦烨烨的病人在医院9170359开过哪些药?列出编码和名称 | SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '韦烨烨' AND MED_SER_ORG_NO = '9170359' AND IN_HOSP_DATE BETWEEN '2010-06-10' AND '2018-05-04') | css |
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),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For all employees who have the letters D or S in their first name, draw a line chart about the change of employee_id over hire_date , and sort HIRE_DATE in asc order. | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_name_84 (
result VARCHAR,
date VARCHAR
) | What was the result when they had their bye week? | SELECT result FROM table_name_84 WHERE date = "bye" | sql_create_context |
CREATE TABLE table_75505 (
"Season" text,
"Competition" text,
"Round" text,
"Club" text,
"Home result" text,
"Away result" text
) | Home result of 1 0, and a Away result of 0 1 involves what club? | SELECT "Club" FROM table_75505 WHERE "Home result" = '1–0' AND "Away result" = '0–1' | wikisql |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
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,
... | For MATSCIE 550 , what is the number of sections available that are not before 10 A.M. ? | SELECT COUNT(*) FROM course, course_offering, semester WHERE course_offering.start_time > '10:00:00' AND course.course_id = course_offering.course_id AND course.department = 'MATSCIE' AND course.number = 550 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id... | since 2 years ago, how many patients was given venous cath nec two or more times? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'venous cath nec') AND... | mimic_iii |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | what is drug name of drug code nalo4i? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "NALO4I" | mimicsql_data |
CREATE TABLE table_203_537 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | how many games took place in ostrava ? | SELECT COUNT(DISTINCT "date") FROM table_203_537 WHERE "venue" = 'ostrava' | squall |
CREATE TABLE table_name_4 (
result VARCHAR,
opponent VARCHAR
) | Which Result has an Opponent of steve walker? | SELECT result FROM table_name_4 WHERE opponent = "steve walker" | sql_create_context |
CREATE TABLE table_51536 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | Who was the opponent on August 30? | SELECT "Opponent" FROM table_51536 WHERE "Date" = 'august 30' | wikisql |
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, give me the comparison about the average of code over the name , and group by attribute name, and sort in ascending by the x axis. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name | nvbench |
CREATE TABLE table_name_33 (
party VARCHAR,
opinion_research_centre__opc_ VARCHAR
) | What is Party, when Opinion Research Centre (OPC) is 1.5%? | SELECT party FROM table_name_33 WHERE opinion_research_centre__opc_ = "1.5%" | sql_create_context |
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE journal (
journalid int,
jo... | What is the latest paper by emanuel todorov ? | SELECT DISTINCT writes.paperid FROM author, paper, writes WHERE author.authorname = 'emanuel todorov' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year DESC | scholar |
CREATE TABLE table_15621965_18 (
no VARCHAR,
position VARCHAR,
school_club_team VARCHAR
) | WHAT WAS THE JERSEY NUMBER OF THE ROSTER PLAYER FROM OKLAHOMA STATE WHO PLAYED GUARD? | SELECT no FROM table_15621965_18 WHERE position = "Guard" AND school_club_team = "Oklahoma State" | sql_create_context |
CREATE TABLE table_24575253_4 (
season VARCHAR,
division_two VARCHAR
) | When racing epsom is in division two how many seasons are there? | SELECT COUNT(season) FROM table_24575253_4 WHERE division_two = "Racing Epsom" | sql_create_context |
CREATE TABLE table_54624 (
"Pitcher" text,
"Date" text,
"Team" text,
"Result" text,
"Site" text
) | I want the date for an bal s nchez | SELECT "Date" FROM table_54624 WHERE "Pitcher" = 'aníbal sánchez' | wikisql |
CREATE TABLE coach (
Coach_ID int,
Coach_name text,
Gender text,
Club_ID int,
Rank int
)
CREATE TABLE player (
Player_ID int,
Sponsor_name text,
Player_name text,
Gender text,
Residence text,
Occupation text,
Votes int,
Rank text
)
CREATE TABLE club (
Club_ID in... | Show different occupations along with the number of players in each occupation Show bar chart, and show x-axis from high to low order. | SELECT Occupation, COUNT(*) FROM player GROUP BY Occupation ORDER BY Occupation DESC | nvbench |
CREATE TABLE table_name_89 (
show VARCHAR,
character VARCHAR
) | Which show has a character of Rohan? | SELECT show FROM table_name_89 WHERE character = "rohan" | sql_create_context |
CREATE TABLE table_40756 (
"Season" text,
"Games" real,
"Lost" real,
"Tied" real,
"Points" real,
"Pct %" real,
"Goals for" real,
"Goals against" real
) | What is the number of games for the season with 10 ties? | SELECT "Games" FROM table_40756 WHERE "Tied" = '10' | wikisql |
CREATE TABLE table_29978 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | What was the production code of the episode with an audience of 14.79 million in the US? | SELECT "Production code" FROM table_29978 WHERE "U.S. viewers (million)" = '14.79' | wikisql |
CREATE TABLE table_203_44 (
id number,
"stage" text,
"date" text,
"route" text,
"terrain" text,
"length" text,
"winner" text
) | which route had plain stage terrain and was used on the 27th of june ? | SELECT "route" FROM table_203_44 WHERE "terrain" = 'plain stage' AND "date" = '27 june' | squall |
CREATE TABLE table_name_67 (
district INTEGER,
took_office VARCHAR,
senator VARCHAR
) | What is the sum of District, when Took Office is greater than 1981, and when Senator is Cyndi Taylor Krier? | SELECT SUM(district) FROM table_name_67 WHERE took_office > 1981 AND senator = "cyndi taylor krier" | sql_create_context |
CREATE TABLE table_62937 (
"Year" real,
"Class" text,
"Tyres" text,
"Team" text,
"Co-Drivers" text,
"Laps" real,
"Pos." text
) | How many years have toyota team tom's as the team, with Laps greater than 64? | SELECT COUNT("Year") FROM table_62937 WHERE "Team" = 'toyota team tom''s' AND "Laps" > '64' | wikisql |
CREATE TABLE table_6228 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
) | Name the most game with opponent of hartford whalers | SELECT MAX("Game") FROM table_6228 WHERE "Opponent" = 'hartford whalers' | 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... | 门诊就诊78636762762给出的中医诊断和诊断编码是什么 | SELECT wdmzjzjlb.MZZYZDZZBM, wdmzjzjlb.MZZYZDZZMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '78636762762' UNION SELECT bdmzjzjlb.MZZYZDZZBM, bdmzjzjlb.MZZYZDZZMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '78636762762' | css |
CREATE TABLE table_40263 (
"Date" text,
"Time" text,
"Home" text,
"Away" text,
"Score" text,
"Ground" text
) | What is the Time with an Away that is broadview hawks? | SELECT "Time" FROM table_40263 WHERE "Away" = 'broadview hawks' | wikisql |
CREATE TABLE ref_shipping_agents (
shipping_agent_code text,
shipping_agent_name text,
shipping_agent_description text
)
CREATE TABLE draft_copies (
document_id number,
draft_number number,
copy_number number
)
CREATE TABLE circulation_history (
document_id number,
draft_number number,... | What is the mail date of the document with id 7? | SELECT mailing_date FROM documents_mailed WHERE document_id = 7 | spider |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
... | until 1 year ago what was the three most frequently given procedure for patients 40s? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... | mimic_iii |
CREATE TABLE table_41182 (
"Name" text,
"Novelty" text,
"Status" text,
"Authors" text,
"Unit" text,
"Location" text
) | What is the Location when the novelty is gen? | SELECT "Location" FROM table_41182 WHERE "Novelty" = 'gen' | wikisql |
CREATE TABLE table_name_11 (
outcome VARCHAR,
surface VARCHAR
) | When the Surface was Carpet (i), what was the Outcome? | SELECT outcome FROM table_name_11 WHERE surface = "carpet (i)" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 从11年6月26日开始至12年2月8日内体检因腔隙性脑梗死住院的平均费用用了多少钱? | SELECT AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_NM = '体检科' AND gwyjzb.IN_HOSP_DATE BETWEEN '2011-06-26' AND '2012-02-08' AND gwyjzb.IN_DIAG_DIS_NM = '腔隙性脑梗死' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_NM = '体检科' AND fgwyjzb.IN_HOSP_DATE B... | css |
CREATE TABLE table_74111 (
"Artist" text,
"Country" text,
"Number-one single(s)" text,
"Year" real,
"Weeks at #1" real,
"Straight to #1 ?" text
) | How many years have a weeks at #1 value of exactly 8? | SELECT COUNT("Year") FROM table_74111 WHERE "Weeks at #1" = '8' | wikisql |
CREATE TABLE txmzjzjlb (
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,
MZZYZDZ... | 病患云鸿运在2009-07-30之前做过的检验报告在哪些门诊,列出这些门诊就诊的流水编码 | SELECT txmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '云鸿运' AND NOT txmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2009-07-3... | css |
CREATE TABLE table_name_72 (
team VARCHAR,
ravg VARCHAR
) | What team had a Ravg of 3.4? | SELECT team FROM table_name_72 WHERE ravg = "3.4" | sql_create_context |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zo... | what are the flights from ST. LOUIS to CHARLOTTE NORTH CAROLINA leaving on friday | SELECT DISTINCT flight_id FROM flight WHERE ((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 25 AND DATE_DAYalias0.month_number = 6 AND DATE_DAYalias0.year = 1991)) AND to_... | atis |
CREATE TABLE table_name_27 (
written_by VARCHAR,
season_no VARCHAR,
series_no VARCHAR
) | Who wrote the series number 49 with a season larger than 4? | SELECT written_by FROM table_name_27 WHERE season_no > 4 AND series_no = 49 | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
Rejectio... | Median vote on accepted answers. | WITH AcceptedAnswersScores AS (SELECT a.Score FROM Posts AS a INNER JOIN Posts AS q ON q.AcceptedAnswerId = a.Id WHERE a.PostTypeId = 2), Medians AS (SELECT median = PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY Score) OVER () FROM AcceptedAnswersScores) SELECT AVG(CAST(median AS FLOAT)) FROM Medians | sede |
CREATE TABLE table_9978 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | what is the 2008 when 2007 is A, 2011 is A and tournament is san jose? | SELECT "2008" FROM table_9978 WHERE "2007" = 'a' AND "2011" = 'a' AND "Tournament" = 'san jose' | wikisql |
CREATE TABLE table_77135 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | What is Michael Del Zotto's nationality? | SELECT "Nationality" FROM table_77135 WHERE "Player" = 'michael del zotto' | wikisql |
CREATE TABLE table_name_65 (
runner_s__up VARCHAR,
tournament VARCHAR
) | Which Runner(s)-up has a Tournament of general foods pga seniors' championship? | SELECT runner_s__up FROM table_name_65 WHERE tournament = "general foods pga seniors' championship" | sql_create_context |
CREATE TABLE table_34373 (
"Place" real,
"Nation" text,
"6 Ropes" real,
"4 Hoops, 2 Clubs" real,
"Total" real
) | What is the lowest 4 hoops, 2 clubs of the nation with a total of 38.25? | SELECT MIN("4 Hoops, 2 Clubs") FROM table_34373 WHERE "Total" = '38.25' | wikisql |
CREATE TABLE table_2679061_2 (
nationality VARCHAR,
player VARCHAR
) | What is the nationality when the player is randy heath? | SELECT nationality FROM table_2679061_2 WHERE player = "Randy Heath" | sql_create_context |
CREATE TABLE table_204_756 (
id number,
"year" number,
"team" text,
"games" number,
"combined tackles" number,
"tackles" number,
"assisted tackles" number,
"sacks" number,
"forced fumbles" number,
"fumble recoveries" number,
"fumble return yards" number,
"interceptions" n... | what is the average number of tackles this player has had over his career ? | SELECT AVG("tackles") FROM table_204_756 | squall |
CREATE TABLE table_10577579_3 (
current_conference VARCHAR,
location VARCHAR
) | Which conference is in Jackson, Mississippi? | SELECT current_conference FROM table_10577579_3 WHERE location = "Jackson, Mississippi" | sql_create_context |
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Ac... | How many documents for different document name? Draw a bar chart, could you sort in ascending by the Y? | SELECT Document_Name, COUNT(Document_Name) FROM Documents GROUP BY Document_Name ORDER BY COUNT(Document_Name) | nvbench |
CREATE TABLE table_37859 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Crowd" text,
"Report" text
) | On what date was the score 0-0? | SELECT "Date" FROM table_37859 WHERE "Score" = '0-0' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | count the number of black/cape verdean patients who were hospitalized for more than 8 days in hospital. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay > "8" | mimicsql_data |
CREATE TABLE table_204_427 (
id number,
"creature (other planes)" text,
"page" text,
"other appearances" text,
"variants" text,
"description" text
) | what is the description next to medusa ? | SELECT "description" FROM table_204_427 WHERE "creature (other planes)" = 'medusa' | squall |
CREATE TABLE individuals (
individual_id number,
individual_first_name text,
individual_middle_name text,
inidividual_phone text,
individual_email text,
individual_address text,
individual_last_name text
)
CREATE TABLE services (
service_id number,
service_type_code text,
servic... | Find the payment method code used by more than 3 parties. | SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING COUNT(*) > 3 | spider |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
) | Show the stars of each director by a bar chart, and could you order stars in asc order? | SELECT director, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY stars | nvbench |
CREATE TABLE table_203_592 (
id number,
"institution" text,
"location" text,
"athletic nickname" text,
"undergraduate enrollment" number,
"graduate enrollment" number,
"total enrollment" number,
"2013 endowment\n(and us rank)" text,
"academic staff" number,
"motto" text
) | which university has the least in endowment ? | SELECT "institution" FROM table_203_592 ORDER BY "2013 endowment\n(and us rank)" LIMIT 1 | squall |
CREATE TABLE table_name_89 (
player VARCHAR,
year_s__won VARCHAR
) | Who won in 1991? | SELECT player FROM table_name_89 WHERE year_s__won = "1991" | sql_create_context |
CREATE TABLE table_42858 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"Location Attendance" text,
"Record" text
) | What is the sum of Game with a Score that is w 104 90 (ot)? | SELECT SUM("Game") FROM table_42858 WHERE "Score" = 'w 104–90 (ot)' | wikisql |
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, give me the comparison about the average of revenue over the founder , and group by attribute founder by a bar chart, display X in descending order. | SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC | nvbench |
CREATE TABLE table_19761 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
) | Name the result for milwaukee county stadium | SELECT "Result" FROM table_19761 WHERE "Game Site" = 'Milwaukee County Stadium' | wikisql |
CREATE TABLE table_2603017_2 (
ba___running_bear VARCHAR,
b___bishop VARCHAR
) | what is ba - running bear where b - bishop is rn - running stag? | SELECT ba___running_bear FROM table_2603017_2 WHERE b___bishop = "RN - Running Stag" | sql_create_context |
CREATE TABLE table_16980 (
"Total No." real,
"Celebrity" text,
"Director" text,
"Original air date" text,
"Viewers" text
) | Which viewers had Matt Gallagher as the director? | SELECT "Viewers" FROM table_16980 WHERE "Director" = 'Matt Gallagher' | wikisql |
CREATE TABLE table_203_583 (
id number,
"title" text,
"release" number,
"6th gen" text,
"handheld" text,
"note" text
) | what is the number of titles released by psikyo in 2004 ? | SELECT COUNT("title") FROM table_203_583 WHERE "release" = 2004 | squall |
CREATE TABLE table_67584 (
"Model" text,
"Specification" text,
"Build date" text,
"Total produced" real,
"Wheel arrangement" text,
"Prime mover" text,
"Power output" text
) | What is the prime mover of the locomotive with a fa-2 model? | SELECT "Prime mover" FROM table_67584 WHERE "Model" = 'fa-2' | wikisql |
CREATE TABLE table_17971449_2 (
military_expenditures__2011 VARCHAR,
_us$_millions_ VARCHAR,
country VARCHAR
) | Name the military expenditures for 2011 for romania | SELECT military_expenditures__2011, _us$_millions_ FROM table_17971449_2 WHERE country = "Romania" | sql_create_context |
CREATE TABLE table_name_5 (
theme_song_s_ VARCHAR,
japanese_title VARCHAR
) | What is the Theme Song of ? | SELECT theme_song_s_ FROM table_name_5 WHERE japanese_title = "働きマン" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of revenue , and group by attribute name, and sort X-axis in descending order. | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_203_707 (
id number,
"rank" number,
"npc" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the difference between the gold medals won by china and its total medal winnings ? | SELECT "total" - "gold" FROM table_203_707 WHERE "npc" = 'china' | squall |
CREATE TABLE table_15463188_1 (
position VARCHAR,
name VARCHAR
) | Name the position for judy-ann ramirez | SELECT position FROM table_15463188_1 WHERE name = "judy-ann ramirez" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | how many patients until 3 years ago were prescribed acetaminophen in the same hospital visit after the therapeutic antibacterials - empiric antibacterial coverage? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'therapeutic antibacterials - empiric antibacterial coverage' AND DATETIME... | eicu |
CREATE TABLE table_17684 (
"Track Name" text,
"Location" text,
"Length" text,
"Seating" real,
"Year Opened" real,
"Year Acquired [A ]" real
) | What is the length of the track named michigan international speedway? | SELECT "Length" FROM table_17684 WHERE "Track Name" = 'Michigan International Speedway' | wikisql |
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
win... | Plot how many name by grouped by name as a bar graph, order in ascending by the x-axis. | SELECT name, COUNT(name) FROM train GROUP BY name ORDER BY name | nvbench |
CREATE TABLE customers (
id INTEGER,
first_name VARCHAR(40),
last_name VARCHAR(20),
company VARCHAR(80),
address VARCHAR(70),
city VARCHAR(40),
state VARCHAR(40),
country VARCHAR(40),
postal_code VARCHAR(10),
phone VARCHAR(24),
fax VARCHAR(24),
email VARCHAR(60),
supp... | Show me a bar chart for how many invoices were billed from each state?, and show by the Y-axis in desc. | SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | Return a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality, list by the bars in desc. | SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC | nvbench |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id nu... | what was the price of patient 16572's hospital stay until 1 year ago? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16572) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-1 year') | mimic_iii |
CREATE TABLE table_5171 (
"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 March 5 at Vancouver? | SELECT "Score" FROM table_5171 WHERE "Date" = 'march 5' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 以前患者07290816有过什么异常情况吗? | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '... | css |
CREATE TABLE Addresses (
address_id INTEGER,
address_content VARCHAR(80),
city VARCHAR(50),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(50),
country VARCHAR(50),
other_address_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
payment_method VARCHAR(15)... | Find the number of the 'date became customers' of the customers whose ID is between 10 and 20, and order by the Y in ascending. | SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer) | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.