context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_18 (
location VARCHAR,
event VARCHAR
) | Where was the UFC 154 match held? | SELECT location FROM table_name_18 WHERE event = "ufc 154" | sql_create_context |
CREATE TABLE table_name_66 (
screen_pixels VARCHAR,
maker VARCHAR,
weight VARCHAR
) | For Amazon.com's device with a weight of 221g (7.8oz) how many screen pixels does the device have? | SELECT screen_pixels FROM table_name_66 WHERE maker = "amazon.com" AND weight = "221g (7.8oz)" | sql_create_context |
CREATE TABLE table_name_59 (
theme VARCHAR,
show VARCHAR,
order VARCHAR
) | For the week 1 show and order 2, what was the theme? | SELECT theme FROM table_name_59 WHERE show = "week 1" AND order = "2" | sql_create_context |
CREATE TABLE table_44933 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is Date, when High Rebounds is 'Amar'e Stoudemire (13)'? | SELECT "Date" FROM table_44933 WHERE "High rebounds" = 'amar''e stoudemire (13)' | wikisql |
CREATE TABLE table_name_52 (
wins VARCHAR,
cuts_made VARCHAR,
scoring_average VARCHAR
) | What is the total number of wins with 10 cuts made and a score average under 74.09? | SELECT COUNT(wins) FROM table_name_52 WHERE cuts_made = 10 AND scoring_average < 74.09 | sql_create_context |
CREATE TABLE table_39417 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | What is K236AM's lowest frequency in MHz? | SELECT MIN("Frequency MHz") FROM table_39417 WHERE "Call sign" = 'k236am' | wikisql |
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE party (
party_id number,
year number,
party text,
governor text,
lieutenant_governor text,
comptro... | Which people severed as comptroller most frequently? Give me the name of the person and the frequency count. | SELECT comptroller, COUNT(*) FROM party GROUP BY comptroller ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
... | what flights from SEATTLE to SALT LAKE CITY | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SEATTLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SALT L... | atis |
CREATE TABLE table_4488 (
"Region" text,
"Operator" text,
"Licence award date" text,
"On air date" text,
"Closure date" text
) | When was the ensemble closed that went on air in June 2003? | SELECT "Closure date" FROM table_4488 WHERE "On air date" = 'june 2003' | 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 sum of price over the name , and group by attribute name, and list by the total number in descending. | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Price DESC | nvbench |
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 number of patients whose marital status is widowed and procedure long title is spinal tap? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.long_title = "Spinal tap" | mimicsql_data |
CREATE TABLE table_22607 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | Who wrote 'Academic Octathalon'? | SELECT "Written by" FROM table_22607 WHERE "Title" = 'Academic Octathalon' | wikisql |
CREATE TABLE table_name_25 (
qual VARCHAR,
year VARCHAR
) | Name the qual for year of 1960 | SELECT qual FROM table_name_25 WHERE year = "1960" | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationD... | Most popular tags since 2012 started.. | SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS MayRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AN... | sede |
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID int,
Type text,
Market_ID int,
Year int
)
CREATE TABLE market (
Market_ID int,
Country text,
Number_cities int
)
CREATE TABLE film (
Film_ID int,
Title text,
Stud... | A bar chart about how films are produced by each studio?, and show Y-axis in asc order. | SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_73447 (
"County" text,
"Population" real,
"Unemployment Rate" text,
"Market Income Per Capita" text,
"Poverty Rate" text,
"Status" text
) | What is the status of the county with per capita market income of $24,326? | SELECT "Status" FROM table_73447 WHERE "Market Income Per Capita" = '$24,326' | wikisql |
CREATE TABLE table_name_1 (
grid INTEGER,
laps VARCHAR
) | What is the highest grid that has 55 laps? | SELECT MAX(grid) FROM table_name_1 WHERE laps = 55 | sql_create_context |
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE reviewer (
rid number,
name text
) | For any rating where the name of reviewer is the same as the director of the movie, return the reviewer name, movie title, and number of stars. | SELECT DISTINCT T3.name, T2.title, T1.stars FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid JOIN reviewer AS T3 ON T1.rid = T3.rid WHERE T2.director = T3.name | spider |
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... | 列举出在06年8月30日到2008年5月14日内蒋锐锋病患所有检验报告单的审核日期时间是那几天? | SELECT jybgb.SHSJ 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 mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 看下患者戚婉然在二零零五年十一月二日到二零一零年三月十八日内所有检验结果指标记录的检测人为章光济的检验指标流水号可以吗 | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 ... | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many patients less than 72 years of age have midazbase drug code? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "72" AND prescriptions.formulary_drug_cd = "MIDAZBASE" | mimicsql_data |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,... | were there any results of the microbiology tests for patient 24921 in 09/last year? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24921) AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', microbiologyevents.chartti... | mimic_iii |
CREATE TABLE table_name_42 (
winning_score VARCHAR,
runner_s__up VARCHAR,
margin_of_victory VARCHAR
) | What was the winning score when the runner-up was Beth Daniel and the margin of victory was 7 strokes? | SELECT winning_score FROM table_name_42 WHERE runner_s__up = "beth daniel" AND margin_of_victory = "7 strokes" | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE CloseAsO... | Owners of the most yearling badges. | SELECT Users.Id AS "user_link", Users.Id, Users.Reputation, COUNT(*) OVER (PARTITION BY Users.Id) AS Count, Badges.Date FROM Badges, Users WHERE Badges.Name = 'Yearling' AND Badges.UserId = Users.Id ORDER BY Count DESC, Users.Reputation, Users.Id, Badges.Date | sede |
CREATE TABLE table_204_562 (
id number,
"no." number,
"date" text,
"location" text,
"surface" text,
"opponent in final" text,
"score" text
) | where did camerin win singles after cagnes sur mer ? | SELECT "location" FROM table_204_562 WHERE "date" > (SELECT "date" FROM table_204_562 WHERE "location" = 'cagnes-sur-mer, france $100,000') ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
... | Bar chart x axis dept code y axis minimal stu gpa, I want to rank in ascending by the y axis. | SELECT DEPT_CODE, MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY MIN(STU_GPA) | nvbench |
CREATE TABLE table_2490289_1 (
pc_intro VARCHAR,
amiga_demo VARCHAR
) | What won best pc intro when my kingdom (haujobb & scoopex) won best amiga demo? | SELECT pc_intro FROM table_2490289_1 WHERE amiga_demo = "My Kingdom (Haujobb & Scoopex)" | sql_create_context |
CREATE TABLE table_70470 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Who was the runner-up for the event that ended with a winning score of 15 (66-67-70-70=273)? | SELECT "Runner(s)-up" FROM table_70470 WHERE "Winning score" = '–15 (66-67-70-70=273)' | wikisql |
CREATE TABLE table_name_9 (
grid INTEGER,
laps INTEGER
) | How many grids had more than 61 laps? | SELECT SUM(grid) FROM table_name_9 WHERE laps > 61 | sql_create_context |
CREATE TABLE table_40850 (
"Republican ticket" text,
"Democratic ticket" text,
"American Labor ticket" text,
"Communist ticket" text,
"Socialist ticket" text
) | Who's the Communist ticket with an American Labor ticket of joseph v. o'leary? | SELECT "Communist ticket" FROM table_40850 WHERE "American Labor ticket" = 'joseph v. o''leary' | wikisql |
CREATE TABLE table_23126 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | How many nationalities does Tom Colley have? | SELECT COUNT("Nationality") FROM table_23126 WHERE "Player" = 'Tom Colley' | 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... | what is the average age of patients with white ethnicity and admitted in or after 2115? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.admityear >= "2115" | mimicsql_data |
CREATE TABLE table_14877831_2 (
first_downs INTEGER,
attendance VARCHAR
) | How many first downs were there when the attendance was 13196? | SELECT MIN(first_downs) FROM table_14877831_2 WHERE attendance = 13196 | sql_create_context |
CREATE TABLE table_name_40 (
points INTEGER,
played INTEGER
) | What is the sum of all points when number played is less than 18? | SELECT SUM(points) FROM table_name_40 WHERE played < 18 | sql_create_context |
CREATE TABLE table_name_32 (
round VARCHAR,
opposition VARCHAR,
attendance VARCHAR
) | What round was adelaide united the opposition with an attendance of 18,345? | SELECT round FROM table_name_32 WHERE opposition = "adelaide united" AND attendance = "18,345" | sql_create_context |
CREATE TABLE table_6223 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" real
) | Game site of shea stadium, and a Week smaller than 10, and a Opponent of baltimore colts happened on what date? | SELECT "Date" FROM table_6223 WHERE "Game site" = 'shea stadium' AND "Week" < '10' AND "Opponent" = 'baltimore colts' | wikisql |
CREATE TABLE table_11471 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When the game was played at the Venue of Lake Oval, what was the home team score? | SELECT "Home team score" FROM table_11471 WHERE "Venue" = 'lake oval' | wikisql |
CREATE TABLE table_name_93 (
podiums VARCHAR,
class VARCHAR
) | If the class is total, what is the total number of podiums? | SELECT COUNT(podiums) FROM table_name_93 WHERE class = "total" | 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 jybgb (
BBCJBW text,
BBDM tex... | 哪个人门诊就诊中开出的检验报告单21844290233 | SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE jybgb.BGDH = '21844290233' | css |
CREATE TABLE table_name_58 (
team VARCHAR,
qual_2 VARCHAR,
best VARCHAR
) | Which team has a qualifying 2 time under 59.612 and a best of 59.14? | SELECT team FROM table_name_58 WHERE qual_2 < 59.612 AND best = 59.14 | sql_create_context |
CREATE TABLE table_11677100_11 (
hometown VARCHAR,
player VARCHAR
) | What is Jay Bruce's hometown? | SELECT hometown FROM table_11677100_11 WHERE player = "Jay Bruce" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients whose death status is 1 and drug name is levofloxacin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "Levofloxacin" | mimicsql_data |
CREATE TABLE table_19864214_3 (
wins VARCHAR,
pitcher VARCHAR
) | how many wins did pitcher jon matlack category:articles with hcards achieve | SELECT COUNT(wins) FROM table_19864214_3 WHERE pitcher = "Jon Matlack Category:Articles with hCards" | sql_create_context |
CREATE TABLE table_58979 (
"Week 9 Oct 23" text,
"Week 10 Oct 30" text,
"Week 11 Nov 6" text,
"Week 12 Nov 13" text,
"Week 13 Nov 20" text,
"Week 14 Nov 27" text,
"Week 15 (Final) Dec 3" text
) | What was Week 15 when Week 12 was Washington (9-1)? | SELECT "Week 15 (Final) Dec 3" FROM table_58979 WHERE "Week 12 Nov 13" = 'washington (9-1)' | wikisql |
CREATE TABLE table_41429 (
"Tournament" text,
"2003" text,
"2004" text,
"2012" text,
"2013" text
) | What is the result from 2003 from the US Open? | SELECT "2003" FROM table_41429 WHERE "Tournament" = 'us open' | wikisql |
CREATE TABLE table_40089 (
"Name" text,
"Status" text,
"Authors" text,
"Unit" text,
"Location" text
) | What is the status of the pterosaur named Cathayopterus? | SELECT "Status" FROM table_40089 WHERE "Name" = 'cathayopterus' | wikisql |
CREATE TABLE table_39692 (
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Game time" text,
"Record" text
) | When was the game with a record of 9-3? | SELECT "Date" FROM table_39692 WHERE "Record" = '9-3' | wikisql |
CREATE TABLE table_78258 (
"Athlete" text,
"Event" text,
"Snatch" real,
"Clean & Jerk" real,
"Total" real
) | How many snatches were there with a total of 267.5? | SELECT COUNT("Snatch") FROM table_78258 WHERE "Total" < '267.5' | wikisql |
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 diagnoses (
... | what number of patients whose admission type is elective were born before the year 2078? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dob_year < "2078" | mimicsql_data |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE T... | How many images have been uploaded to the site?. Counts the number of posts containing images hosted by imgur.com after image uploading was implemented on the site. | WITH c AS (SELECT OwnerUserId, Body, 1 AS t FROM Posts WHERE CreationDate >= 'August 13, 2010') SELECT OwnerUserId AS "user_link", SUM(t) AS Count FROM c WHERE Body LIKE '%imgur.com%' GROUP BY OwnerUserId WITH ROLLUP ORDER BY SUM(t) DESC | sede |
CREATE TABLE table_64041 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2003)" real
) | What is the average number of electorates (2003) reserved for sc with a constituency number of 50? | SELECT AVG("Number of electorates (2003)") FROM table_64041 WHERE "Reserved for ( SC / ST /None)" = 'sc' AND "Constituency number" = '50' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | how many days has it been since the last time patient 027-149724 stayed on this hospital visit in the ward 957? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '027-149724' AND patient.wardid = 957 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_61414 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
) | Which Score has an Attendance larger than 16,851, and an Away team of sheffield united? | SELECT "Score" FROM table_61414 WHERE "Attendance" > '16,851' AND "Away team" = 'sheffield united' | wikisql |
CREATE TABLE table_train_210 (
"id" int,
"serum_potassium" float,
"serum_calcium" float,
"estimated_glomerular_filtration_rate_egfr" int,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
) | serum calcium > 10.5 mg / dl | SELECT * FROM table_train_210 WHERE serum_calcium > 10.5 | criteria2sql |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE Apartments (
apt_id INTEGER,
... | Sort the gender codes in descending order of their corresponding number of guests. Return both the gender codes and counts with a pie chart. | SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC | nvbench |
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,
... | 列出患者20328161门诊诊断名称不包含失眠的门诊有什么就诊记录,在医院1257763中? | SELECT * FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i... | css |
CREATE TABLE table_47944 (
"Date" text,
"Opponents" text,
"H / A" text,
"Result F \u2013 A" text,
"Scorers" text
) | What was the H/A when the scorer was Hughes? | SELECT "H / A" FROM table_47944 WHERE "Scorers" = 'hughes' | wikisql |
CREATE TABLE table_44801 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What is Tournament, when Outcome is Winner, and when Date is 13 July 2013? | SELECT "Tournament" FROM table_44801 WHERE "Outcome" = 'winner' AND "Date" = '13 july 2013' | wikisql |
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... | 在病院1313131看病的病患34943476在入院确诊疾病名称中包含有癫痫的医疗就诊记录编号都有啥? | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '34943476' AND MED_SER_ORG_NO = '1313131' AND IN_DIAG_DIS_NM LIKE '%癫痫%' | css |
CREATE TABLE table_17291 (
"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 result of the game when the raptors played @ cleveland? | SELECT "Score" FROM table_17291 WHERE "Team" = '@ Cleveland' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose insurance is self pay and lab test name is rbc, csf? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "RBC, CSF" | mimicsql_data |
CREATE TABLE Fault_Log_Parts (
fault_log_entry_id INTEGER,
part_fault_id INTEGER,
fault_status VARCHAR(10)
)
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_by_staff_id INTEGER,
fault_log_entry_datetime DATETIME,
fault_description VARCHAR(255),
other_... | Give me a pie chart showing the number of engineers for different skill description, and display skill_description in descending order. | SELECT skill_description, COUNT(skill_description) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description ORDER BY skill_description DESC | nvbench |
CREATE TABLE table_24027047_1 (
administrative_division VARCHAR,
population_density___km²_2011_ VARCHAR
) | In what division was there a population density in km2 of 4,491.8 in 2011? | SELECT administrative_division FROM table_24027047_1 WHERE population_density___km²_2011_ = "4,491.8" | sql_create_context |
CREATE TABLE table_43126 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the most silver medals when the total is less than 4 and the rank is 12? | SELECT MAX("Silver") FROM table_43126 WHERE "Total" < '4' AND "Rank" = '12' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title te... | what are the top five most frequent diagnoses in 2104 that patients were diagnosed with within the same month after having been diagnosed with hx of thyroid malignancy? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | mimic_iii |
CREATE TABLE table_name_58 (
laps INTEGER,
time_retired VARCHAR,
grid VARCHAR
) | What is the highest number of laps with a time of +6.643 and grid less than 2? | SELECT MAX(laps) FROM table_name_58 WHERE time_retired = "+6.643" AND grid < 2 | sql_create_context |
CREATE TABLE table_37976 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | What college or club did the round 9 draft pick from Canada come from? | SELECT "College/Junior/Club Team (League)" FROM table_37976 WHERE "Round" = '9' AND "Nationality" = 'canada' | wikisql |
CREATE TABLE table_50353 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the Country of the Player with a To par of +4 and Score of 73-71-73=217? | SELECT "Country" FROM table_50353 WHERE "To par" = '+4' AND "Score" = '73-71-73=217' | wikisql |
CREATE TABLE table_58988 (
"Standard order" real,
"English translation" text,
"Transcription (based on Pinyin)" text,
"Traditional Chinese" text,
"Simplified Chinese" text
) | Which number is ? | SELECT "Standard order" FROM table_58988 WHERE "Traditional Chinese" = '國殤' | wikisql |
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stoc... | Show different carriers of phones together with the number of phones with each carrier by a bar chart. | SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier | nvbench |
CREATE TABLE table_11800 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"Attendance" text,
"Record" text
) | Who was the opponent team on September 30, 1990? | SELECT "Opponent" FROM table_11800 WHERE "Date" = 'september 30, 1990' | 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
)
... | what is religion and insurance of subject name kelly gallardo? | SELECT demographic.religion, demographic.insurance FROM demographic WHERE demographic.name = "Kelly Gallardo" | mimicsql_data |
CREATE TABLE table_58434 (
"Season" text,
"Season premiere" text,
"Season finale" text,
"TV season" text,
"Ranking" text,
"Viewers (in millions)" real
) | Which season premiered on November 27, 2012? | SELECT "Season" FROM table_58434 WHERE "Season premiere" = 'november 27, 2012' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate ti... | is the heart rate of patient 23475 measured at 2105-06-29 16:00:00 greater than measured at 2105-06-29 15:00:00? | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23475)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'h... | mimic_iii |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes nu... | Users with the most community wiki posts. | SELECT COUNT(Id), OwnerUserId AS "user_link" FROM Posts WHERE NOT CommunityOwnedDate IS NULL GROUP BY OwnerUserId ORDER BY COUNT(Id) DESC | sede |
CREATE TABLE table_11570 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What driver has a grid of under 10, and under 70 laps? | SELECT "Driver" FROM table_11570 WHERE "Grid" < '10' AND "Laps" < '70' | wikisql |
CREATE TABLE t_kc21 (
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,
... | 在2006年3月24日到2007年3月10日这段时间,投保人潘安民单一药品最大购买次数是多少? | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '潘安民' AND t_kc22.STA_DATE BETWEEN '2006-03-24' AND '2007-03-10' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT ... | css |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Tags (
Id number,
TagName text,
C... | Average view count for specific tag. | SELECT Tags.TagName, AVG(CAST(ViewCount AS INT)) AS AverageViewCount, COUNT(Posts.Id) AS QuestionCount FROM Tags JOIN PostTags ON Tags.Id = PostTags.TagId JOIN Posts ON PostTags.PostId = Posts.Id WHERE NOT AcceptedAnswerId IS NULL AND Tags.TagName = '##TagName##' GROUP BY Tags.TagName ORDER BY AverageViewCount DESC | sede |
CREATE TABLE table_78678 (
"Year" real,
"Date" text,
"Home Team" text,
"Result" text,
"Visiting Team" text,
"Venue" text
) | What was the Venue of the San Francisco 49ers Home game with a Result of 30-10? | SELECT "Venue" FROM table_78678 WHERE "Home Team" = 'san francisco 49ers' AND "Result" = '30-10' | 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... | 列出医院9767993所有医疗就诊记录的民政补助与医疗费总额的比值有什么最大值,在不同科室编码和入院诊断疾病名称下,并降序排序? | SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '9767993' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) DESC UNION SELECT fg... | css |
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... | 找出检测指标结果定量单位、检测指标结果定量、检测指标名称和检验指标记录59220260221相同的有哪些检验指标记录? | SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '59220260221') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '59220260221') AND jyjgzbb.JCZBJGDL = (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '59220260221') | css |
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 (
... | how many patients are diagnosed with the primary disease st elevated myocardial infarction or cardiac cath and had the lab test for abnormal status? | 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.flag = "abnormal" | mimicsql_data |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 患者54076263049是哪天来的门诊就诊? | SELECT mzjzjlb.JZKSRQ FROM mzjzjlb WHERE mzjzjlb.JZLSH = '54076263049' | css |
CREATE TABLE table_name_90 (
tournament VARCHAR,
score VARCHAR
) | What tournament had a Score of 6 3, 2 6, [10 8]? | SELECT tournament FROM table_name_90 WHERE score = "6–3, 2–6, [10–8]" | sql_create_context |
CREATE TABLE table_30358 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text
) | On what day did tommy ellis drive? | SELECT "Date" FROM table_30358 WHERE "Driver" = 'Tommy Ellis' | wikisql |
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 demographic (... | Count the number of patients less than 43 years of age who had a total protein body fluid lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "43" AND lab.label = "Total Protein, Body Fluid" | mimicsql_data |
CREATE TABLE table_name_15 (
record VARCHAR,
date VARCHAR
) | What was the record on May 21? | SELECT record FROM table_name_15 WHERE date = "may 21" | sql_create_context |
CREATE TABLE store_district (
store_id number,
district_id number
)
CREATE TABLE store (
store_id number,
store_name text,
type text,
area_size number,
number_of_product_category number,
ranking number
)
CREATE TABLE product (
product_id number,
product text,
dimensions tex... | What is the name of the district with the smallest area? | SELECT district_name FROM district ORDER BY city_area LIMIT 1 | spider |
CREATE TABLE table_name_59 (
time_retired VARCHAR,
grid VARCHAR
) | I want the time/retired for Grid of 13 | SELECT time_retired FROM table_name_59 WHERE grid = 13 | sql_create_context |
CREATE TABLE table_18674 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what's the result with first elected being 1922 | SELECT "Result" FROM table_18674 WHERE "First elected" = '1922' | wikisql |
CREATE TABLE market (
market_id number,
district text,
num_of_employees number,
num_of_shops number,
ranking number
)
CREATE TABLE phone (
name text,
phone_id number,
memory_in_g number,
carrier text,
price number
)
CREATE TABLE phone_market (
market_id number,
phone_id... | What are the memories and carriers of phones? | SELECT memory_in_g, carrier FROM phone | spider |
CREATE TABLE table_68986 (
"Class" text,
"Type" text,
"Fleet numbers" text,
"Quantity made" real,
"Manufacturer" text,
"Date made" text,
"Date withdrawn" text
) | What Class has a Quantity made of 5? | SELECT "Class" FROM table_68986 WHERE "Quantity made" = '5' | wikisql |
CREATE TABLE table_202_157 (
id number,
"affiliation" text,
"house members\n2000 election\nresults" number,
"house members\nat dissolution" number,
"senate members\non election\nday 2000" number,
"senate members\nat dissolution" number
) | which party had the highest number of house members in 2000 ? | SELECT "affiliation" FROM table_202_157 ORDER BY "house members\n2000 election\nresults" DESC LIMIT 1 | squall |
CREATE TABLE table_name_53 (
margin_of_victory VARCHAR,
runner_s__up VARCHAR
) | What was the margin of victory when Mark Calcavecchia was the runner-up? | SELECT margin_of_victory FROM table_name_53 WHERE runner_s__up = "mark calcavecchia" | sql_create_context |
CREATE TABLE table_17540 (
"Country" text,
"Currency" text,
"1 Euro =" text,
"1 USD =" text,
"Central bank" text
) | What's the name of the central bank in the country where Colombian Peso (cop) is the local currency? | SELECT "Central bank" FROM table_17540 WHERE "Currency" = 'Colombian peso (COP)' | wikisql |
CREATE TABLE table_name_24 (
nationality VARCHAR,
name VARCHAR,
lane VARCHAR,
rank VARCHAR
) | What is the nationality with a lane larger than 1, and a rank larger than 5, for Hsu Chi-Chieh? | SELECT nationality FROM table_name_24 WHERE lane > 1 AND rank > 5 AND name = "hsu chi-chieh" | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
... | All answers by a specific user. | SELECT Id AS "post_link", Score FROM Posts WHERE (PostTypeId = 2) AND (OwnerUserId = '##userid##') ORDER BY Id | sede |
CREATE TABLE table_42080 (
"Team" text,
"Tries for" real,
"Tries against" real,
"Try diff" text,
"Points for" real,
"Points against" real,
"Points diff" text
) | WHich Tries has a Team of pau and Points against larger than 103? | SELECT MIN("Tries for") FROM table_42080 WHERE "Team" = 'pau' AND "Points against" > '103' | wikisql |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Answer score badge acquisition for users with just one Nice-and-Great answer. | SELECT U.Id AS "user_link" FROM Users AS U INNER JOIN Posts AS A ON A.OwnerUserId = U.Id INNER JOIN PostTags AS PT ON PT.PostId = A.Id INNER JOIN Tags AS T ON T.Id = PT.TagId INNER JOIN (SELECT OwnerUserId, MAX(Score) AS MaxScore FROM Posts WHERE PostTypeId = 2 AND Score >= 10 GROUP BY OwnerUserId) AS AC ON AC.OwnerUse... | sede |
CREATE TABLE table_name_50 (
opponent VARCHAR,
tournament VARCHAR
) | Who was the Opponent in the Auckland, New Zealand Tournament? | SELECT opponent FROM table_name_50 WHERE tournament = "auckland, new zealand" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.