context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_35291 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What is the winning score of the tournament on 16 May 1993? | SELECT "Winning score" FROM table_35291 WHERE "Date" = '16 may 1993' | wikisql |
CREATE TABLE table_27756164_2 (
date VARCHAR,
high_points VARCHAR
) | When did the Roy Hibbert (27) did the high points? | SELECT date FROM table_27756164_2 WHERE high_points = "Roy Hibbert (27)" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarter and the sum of code , and group by attribute headquarter, and list in ascending by the bar please. | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter | nvbench |
CREATE TABLE table_204_135 (
id number,
"position" number,
"club" text,
"played" number,
"points" number,
"wins" number,
"draws" number,
"losses" number,
"goals for" number,
"goals against" number,
"goal difference" number
) | which is the only team that had more than 21 losses ? | SELECT "club" FROM table_204_135 WHERE "losses" > 21 | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | how many divorced patients had the drug route iv? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "DIVORCED" AND prescriptions.route = "IV" | mimicsql_data |
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... | 在2005年11月3日到2007年9月11日期间患者张嘉惠就诊医生数有多少人? | SELECT COUNT(zzmzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '张嘉惠' AND zzmzjzjlb.JZKSRQ BETWEEN '2005-11-03' AND '2007-09-11' UNION SELECT COUNT(fz... | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number... | how much is patient 016-6134's weight for the last time until 07/2103? | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-6134') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) <= '2103-07' ORDER BY patient.unitadmittime DESC LIMIT ... | eicu |
CREATE TABLE table_48972 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" text,
"To par" real
) | What player has a total of 158/ | SELECT "Player" FROM table_48972 WHERE "Total" = '158' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 中奥卡西平片(薄膜衣)的剂型和规格在医疗就诊30755778025均为什么? | SELECT DOSE_FORM, SPEC FROM t_kc22 WHERE MED_CLINIC_ID = '30755778025' AND SOC_SRT_DIRE_NM = '奥卡西平片(薄膜衣)' | css |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE prescriptions (
row_id number,
s... | when was the first time since 06/16/2105 patient 28443 arterial bp [systolic] was measured/taken? | SELECT chartevents.charttime 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 = 28443)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial... | mimic_iii |
CREATE TABLE table_2668367_21 (
district VARCHAR,
incumbent VARCHAR
) | Name the distrct for thomas wilson | SELECT district FROM table_2668367_21 WHERE incumbent = "Thomas Wilson" | sql_create_context |
CREATE TABLE table_17453 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | what college has nhl team chicago black hawks? | SELECT "College/junior/club team" FROM table_17453 WHERE "NHL team" = 'Chicago Black Hawks' | wikisql |
CREATE TABLE table_name_16 (
population__2010_census_ INTEGER,
administrative_division VARCHAR,
area__km²_ VARCHAR
) | What was the sum of the population in 2010 for the division of japeri with an area of 82.9 squared km? | SELECT SUM(population__2010_census_) FROM table_name_16 WHERE administrative_division = "japeri" AND area__km²_ < 82.9 | sql_create_context |
CREATE TABLE table_name_20 (
country VARCHAR
) | What is the 2013 press freedom index of the country Egypt? | SELECT 2013 AS _press_freedom_index FROM table_name_20 WHERE country = "egypt" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 患者陈雅惠之前哪些检查已经做了 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '陈雅惠' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLIN... | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many patients survived and were diagnosed with cl skul base fx-coma nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.short_title = "Cl skul base fx-coma NOS" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 门诊就诊69348543973的诊断编码是多少?诊断名称叫什么? | SELECT wdmzjzjlb.JZZDBM, wdmzjzjlb.JZZDSM FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '69348543973' UNION SELECT bdmzjzjlb.JZZDBM, bdmzjzjlb.JZZDSM FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '69348543973' | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | what is maximum age of patients whose discharge location is short term hospital and days of hospital stay is 15? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.days_stay = "15" | mimicsql_data |
CREATE TABLE table_name_67 (
decile VARCHAR,
authority VARCHAR,
area VARCHAR
) | What Decile has State Authority and Raumati South Area? | SELECT decile FROM table_name_67 WHERE authority = "state" AND area = "raumati south" | sql_create_context |
CREATE TABLE table_57503 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many bronze medals were won when the total was larger than 2 and the more than 2 gold medals were won? | SELECT SUM("Bronze") FROM table_57503 WHERE "Total" > '2' AND "Gold" > '2' | wikisql |
CREATE TABLE table_name_99 (
place VARCHAR,
player VARCHAR
) | What place did Keith Clearwater get? | SELECT place FROM table_name_99 WHERE player = "keith clearwater" | sql_create_context |
CREATE TABLE table_39459 (
"Year" real,
"Class" text,
"Team" text,
"Machine" text,
"Points" real,
"Rank" text,
"Wins" real
) | What class has nsr250 as the machine, with points greater than 97? | SELECT "Class" FROM table_39459 WHERE "Machine" = 'nsr250' AND "Points" > '97' | wikisql |
CREATE TABLE table_68600 (
"Outcome" text,
"Year" real,
"Tournament" text,
"Partner" text,
"Opponent" text,
"Score" text
) | What tournament has an opponent jung jae-sung lee yong-dae? | SELECT "Tournament" FROM table_68600 WHERE "Opponent" = 'jung jae-sung lee yong-dae' | wikisql |
CREATE TABLE table_35508 (
"Dish" text,
"Callsign" text,
"Network" text,
"Resolution" text,
"City of License" text,
"Official Website" text
) | What is the resolution of the network Carismatv? | SELECT "Resolution" FROM table_35508 WHERE "Network" = 'carismatv' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age te... | what was the last height of patient 028-70851. | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-70851') AND NOT patient.admissionheight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_1594 (
"Official Name" text,
"Status" text,
"Area km 2" text,
"Population" real,
"Census Ranking" text
) | What is the name of the parish where the area is 508.30? | SELECT COUNT("Official Name") FROM table_1594 WHERE "Area km 2" = '508.30' | wikisql |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 医院6176731一共诊治过多少住院病人,在09-12-18到11-08-05这期间 | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6176731' AND gwyjzb.IN_HOSP_DATE BETWEEN '2009-12-18' AND '2011-08-05' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6176731' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2009-12-18' AND '2011-08-05' AND fgwyjzb.CLINIC_TY... | css |
CREATE TABLE table_12564 (
"Tie no" real,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
) | What is the total attendance when Stourbridge is the home team? | SELECT COUNT("Attendance") FROM table_12564 WHERE "Home team" = 'stourbridge' | wikisql |
CREATE TABLE table_name_98 (
original_canadian_air_date VARCHAR,
director VARCHAR
) | What is the Original Canadian air-date that was directed by Michael Tolkin? | SELECT original_canadian_air_date FROM table_name_98 WHERE director = "michael tolkin" | sql_create_context |
CREATE TABLE table_name_43 (
record VARCHAR,
event VARCHAR
) | What was the record at WEC 24? | SELECT record FROM table_name_43 WHERE event = "wec 24" | sql_create_context |
CREATE TABLE table_8578 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who has the highest assists in game 72? | SELECT "High assists" FROM table_8578 WHERE "Game" = '72' | wikisql |
CREATE TABLE table_19294812_2 (
team_1 VARCHAR,
team_2 VARCHAR
) | Who is team 1 when team 2 is koper? | SELECT team_1 FROM table_19294812_2 WHERE team_2 = "Koper" | sql_create_context |
CREATE TABLE table_name_1 (
player VARCHAR,
country VARCHAR,
score VARCHAR
) | What is Player, when Country is United States, and when Score is 70-72-70=212? | SELECT player FROM table_name_1 WHERE country = "united states" AND score = 70 - 72 - 70 = 212 | sql_create_context |
CREATE TABLE table_16904 (
"number" real,
"date of debut" text,
"name" text,
"date of birth" text,
"number of caps" real,
"number of goals" real,
"date of death\u2020" text
) | What was the date of Henk Hordijk's death? | SELECT "date of death\u2020" FROM table_16904 WHERE "name" = 'Henk Hordijk' | wikisql |
CREATE TABLE table_26662 (
"Province, Community" text,
"Contestant" text,
"Age" real,
"Height" text,
"Hometown" text,
"Geographical Regions" text
) | How old is the person with the height of m (ft 3 4 in)? | SELECT "Age" FROM table_26662 WHERE "Height" = 'm (ft 3⁄4 in)' | wikisql |
CREATE TABLE table_80429 (
"Season" text,
"Team Name" text,
"Games" real,
"Losses" real,
"Points" real
) | What's the sum of points for the 1963 season when there are more than 30 games? | SELECT SUM("Points") FROM table_80429 WHERE "Season" = '1963' AND "Games" > '30' | wikisql |
CREATE TABLE table_49639 (
"County" text,
"Kerry%" text,
"Kerry#" real,
"Bush%" text,
"Bush#" real,
"Others%" text,
"Others#" real,
"2000 result" text
) | What percentage of other candidates did the county which voted 52.1% for Kerry vote for? | SELECT MAX("Others#") FROM table_49639 WHERE "Kerry%" = '52.1%' | wikisql |
CREATE TABLE table_name_87 (
league VARCHAR,
school VARCHAR
) | In what League is the Reed School? | SELECT league FROM table_name_87 WHERE school = "reed" | sql_create_context |
CREATE TABLE Staff (
staff_id INTEGER,
staff_address_id INTEGER,
nickname VARCHAR(80),
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
date_of_birth DATETIME,
date_joined_staff DATETIME,
date_left_staff DATETIME
)
CREATE TABLE Customers (
customer_id INTE... | What is the date of birth of every customer whose status code is 'Good Customer', and count them by a line chart | SELECT date_of_birth, COUNT(date_of_birth) FROM Customers WHERE customer_status_code = 'Good Customer' | nvbench |
CREATE TABLE table_9376 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | Which Score has a Place of t1, and a Player of scott simpson? | SELECT COUNT("Score") FROM table_9376 WHERE "Place" = 't1' AND "Player" = 'scott simpson' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
la... | when was patient 018-81471 discharged from the hospital for the first time? | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '018-81471' ORDER BY patient.hospitaldischargetime LIMIT 1 | eicu |
CREATE TABLE table_54128 (
"Date of Issue" text,
"Denomination" text,
"Design" text,
"Paper Type" text,
"First Day Cover Cancellation" text
) | What's the Denomination listed for the Date of Issue 12 April 2005? | SELECT "Denomination" FROM table_54128 WHERE "Date of Issue" = '12 april 2005' | wikisql |
CREATE TABLE table_203_131 (
id number,
"pos." number,
"car #" number,
"driver" text,
"make" text,
"team" text
) | the number of cars finishing in the top ten for braun racing . | SELECT COUNT(*) FROM table_203_131 WHERE "team" = 'braun racing' | squall |
CREATE TABLE table_2507 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | What was the average finish in 2007? | SELECT "Avg. Finish" FROM table_2507 WHERE "Year" = '2007' | wikisql |
CREATE TABLE table_25748 (
"#" text,
"Original title" text,
"Directed by" text,
"Written by" text,
"Original air dates" text,
"Prod. code" real
) | Name the written by for prod code being 206 | SELECT "Written by" FROM table_25748 WHERE "Prod. code" = '206' | wikisql |
CREATE TABLE table_43108 (
"Team" text,
"Dance" text,
"Music" text,
"Points jury" text,
"Place" text
) | What is the Music for Team anna guzik & rafa kami ski that has a Points Jury of 24 (7,5,6,6)? | SELECT "Music" FROM table_43108 WHERE "Team" = 'anna guzik & rafał kamiński' AND "Points jury" = '24 (7,5,6,6)' | wikisql |
CREATE TABLE table_203_793 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | what was the date of the last game ? | SELECT "date" FROM table_203_793 ORDER BY "date" DESC LIMIT 1 | squall |
CREATE TABLE table_5401 (
"Score" real,
"Opposition" text,
"Venue" text,
"City" text,
"Year" real
) | Which Opposition has a Year smaller than 1977, and a City of manchester? | SELECT "Opposition" FROM table_5401 WHERE "Year" < '1977' AND "City" = 'manchester' | wikisql |
CREATE TABLE table_3270 (
"Episode Number" text,
"Episode" text,
"Original Airdate" text,
"Rating" text,
"Share" text,
"Rating/Share (18\u201349)" text,
"Viewers (millions)" text,
"Weekly Rank" real
) | What is the rating/share for 18-49 for Week 6, Part 1? | SELECT "Rating/Share (18\u201349)" FROM table_3270 WHERE "Episode" = 'Week 6, Part 1' | wikisql |
CREATE TABLE table_51345 (
"Year" real,
"Award" text,
"Category" text,
"Type" text,
"Title" text
) | What award was won in the best sound category for the exorcist before 1998? | SELECT "Award" FROM table_51345 WHERE "Year" < '1998' AND "Type" = 'won' AND "Category" = 'best sound' AND "Title" = 'the exorcist' | wikisql |
CREATE TABLE qtb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | 药品963819在哪几家医院患者27333560被开出过? | SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '27333560' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '963819') UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '27333560' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE... | css |
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Rankin... | Give me a histogram for what are the memories and carriers of phones?, list by the x axis in desc. | SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY Carrier DESC | nvbench |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | 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 first_name and manager_id , I want to rank in asc by the y-axis. | SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID | nvbench |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)... | i need to take ten people from DENVER to SAN DIEGO with a stopover in PHOENIX please give me the flights | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND CITY_2.... | atis |
CREATE TABLE table_78242 (
"Model" text,
"Build year" text,
"Total produced" real,
"Wheel arrangement" text,
"Prime mover" text,
"Power output" text
) | Which is the smallest Total produced with a model of FM H-15-44? | SELECT MIN("Total produced") FROM table_78242 WHERE "Model" = 'fm h-15-44' | wikisql |
CREATE TABLE table_name_26 (
record VARCHAR,
home VARCHAR
) | Can you tell me the Record that has the Home of ny islanders? | SELECT record FROM table_name_26 WHERE home = "ny islanders" | sql_create_context |
CREATE TABLE table_11677100_12 (
school VARCHAR,
position VARCHAR
) | What school did the catcher attend? | SELECT school FROM table_11677100_12 WHERE position = "Catcher" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId numb... | Finds all posts that have embedded images, but do not contain 'imgur.com'. Finds all posts that have embedded images, but do not contain 'imgur.com'. Useful for finding old posts with images that may need uploading to imgur or are already broken. Sorted by last activity because of the Archaeologist badge. | SELECT P.Id AS "post_link" FROM Posts AS P INNER JOIN Users AS U ON P.OwnerUserId = U.Id AND P.Body LIKE '%img src%' AND NOT P.Body LIKE '%imgur%' | sede |
CREATE TABLE table_name_11 (
votes VARCHAR,
artist VARCHAR
) | What are the Votes for the Song by Artist Filipa Batista? | SELECT votes FROM table_name_11 WHERE artist = "filipa batista" | 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 aged below 54 years had the lab test name specific gravity? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "54" AND lab.label = "Specific Gravity" | mimicsql_data |
CREATE TABLE table_name_32 (
attendance VARCHAR,
visitor VARCHAR,
date VARCHAR
) | What is the attendance at the game where San Jose was the visitor on May 4? | SELECT attendance FROM table_name_32 WHERE visitor = "san jose" AND date = "may 4" | sql_create_context |
CREATE TABLE table_256862_1 (
finish VARCHAR,
entries VARCHAR,
winning_yacht VARCHAR
) | Name the number of finishes for 15 entries 15 and l'esprit d'equipe | SELECT COUNT(finish) FROM table_256862_1 WHERE entries = "15" AND winning_yacht = "L'Esprit d'Equipe" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 在2012年8月24日到2015年7月31日之间医院2003934有多少科室在门诊就诊中开出检验报告单不超过12张? | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM wdmzjzjlb JOIN jybgb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE wdmzjzjlb.YLJGDM = '2003934' AND jybgb.BGRQ BETWEEN '2012-08-24' AND '2015-07-31' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 12 UNION SELECT jybgb.KSBM FROM bdmzjzjlb ... | css |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
"Home Town" text
)
CREATE TABLE perpetrator (
Perpetrator_ID int,
People_ID int,
Date text,
Year real,
Location text,
Country text,
Killed int,
Injured int
) | What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there Plot them as bar chart, I want to show names from low to high order. | SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY Country | nvbench |
CREATE TABLE table_33344 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What was the attendance of the game in week 6? | SELECT "Attendance" FROM table_33344 WHERE "Week" = '6' | wikisql |
CREATE TABLE table_name_38 (
crowd INTEGER,
home_team VARCHAR
) | What is the smallest crowd for a game when Melbourne is the home team? | SELECT MIN(crowd) FROM table_name_38 WHERE home_team = "melbourne" | sql_create_context |
CREATE TABLE table_203_364 (
id number,
"year" number,
"driver" text,
"nation of citizenship" text,
"racing series" text,
"type of vehicle" text
) | jimmy johnson won how many consecutive espy awards ? | SELECT COUNT(*) FROM table_203_364 WHERE "driver" = 'jimmie johnson' | squall |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fl... | i need a flight tomorrow from ATLANTA 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 20 AND date_day.month_number = 1 AND... | atis |
CREATE TABLE table_26250199_1 (
theme VARCHAR,
episode VARCHAR
) | In episode Top 16 (8 Men), what are the themes? | SELECT theme FROM table_26250199_1 WHERE episode = "Top 16 (8 Men)" | sql_create_context |
CREATE TABLE table_name_84 (
order VARCHAR,
species_authority VARCHAR
) | What order has the Species Authority of hydrochaeris hydrochaeris (linnaeus, 1766)? | SELECT order FROM table_name_84 WHERE species_authority = "hydrochaeris hydrochaeris (linnaeus, 1766)" | sql_create_context |
CREATE TABLE table_name_35 (
extra_points INTEGER,
field_goals VARCHAR,
touchdowns VARCHAR,
player VARCHAR
) | How many extra points are there that Herrnstein had with less than 2 touchdowns and less than 0 field goals? | SELECT AVG(extra_points) FROM table_name_35 WHERE touchdowns < 2 AND player = "herrnstein" AND field_goals < 0 | sql_create_context |
CREATE TABLE table_69599 (
"Event" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real,
"Ranking" text
) | What Gold has a Silver greater than 30 and a Total less than 107? | SELECT "Gold" FROM table_69599 WHERE "Silver" > '30' AND "Total" < '107' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
... | Next semester how many classes are offered ? | SELECT COUNT(DISTINCT course_offering.course_id) FROM course_offering, semester WHERE semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE table_name_42 (
type VARCHAR,
artist VARCHAR
) | What Type has the Artist of Hiroyuki Takami? | SELECT type FROM table_name_42 WHERE artist = "hiroyuki takami" | 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 patient (
uniquep... | since 06/2105 has patient 022-198713 had any allergies? | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-198713')) AND STRFTIME('%y-%m', allergy.allergytime) >= '2105-06' | eicu |
CREATE TABLE table_name_4 (
venue VARCHAR,
date VARCHAR
) | What was the Venue on November 26? | SELECT venue FROM table_name_4 WHERE date = "november 26" | sql_create_context |
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... | 列出在2015年5月8日到17年10月15日内病号葛承泽所有检验结果指标记录中的仪器编号以及名称都是啥? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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.JZL... | css |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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 ... | 从08年5月3日到11年5月6日患者77333677检查的次数是多少? | 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_ID = '77333677' AND t_kc22.STA_DATE BETWEEN '2008-05-03' AND '2011-05-06' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_29793 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code(s)" real,
"U.S. viewers (millions)" text
) | who are the writers of the episode whose production code(s) is 225560? | SELECT "Written by" FROM table_29793 WHERE "Production code(s)" = '225560' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | calculate the number of medicines that patient 57050 had been prescribed since 03/2105. | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-03' | mimic_iii |
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... | 在2004年4月22日到2008年12月14日期间在医疗机构1540750有多少新生儿有过门诊就诊记录? | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '1540750' AND wdmzjzjlb.JZKSRQ BETWEEN '2004-04-22' AND '2008-12-14' AND wdmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '1540750' AND bdmzjzjlb.JZKSRQ BETWEEN '2004-04-22' AND '2008-12-14' AND bdmzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE table_10015132_14 (
no VARCHAR,
player VARCHAR
) | Which number was Patrick O'Bryant? | SELECT no FROM table_10015132_14 WHERE player = "Patrick O'Bryant" | sql_create_context |
CREATE TABLE table_name_98 (
attendance INTEGER,
score VARCHAR
) | How many Attendance in a match which scores 0:0 - 4:1 (pen) | SELECT AVG(attendance) FROM table_name_98 WHERE score = "0:0 - 4:1 (pen)" | sql_create_context |
CREATE TABLE table_80096 (
"Round" text,
"Date" text,
"Opponent" text,
"Venue" text,
"Attendance" real
) | What day was the game held at Firhill against AYR United? | SELECT "Date" FROM table_80096 WHERE "Venue" = 'firhill' AND "Opponent" = 'ayr united' | wikisql |
CREATE TABLE table_name_16 (
points INTEGER,
performer VARCHAR
) | What is the total sum of points for songs performed by Partners in Crime? | SELECT SUM(points) FROM table_name_16 WHERE performer = "partners in crime" | sql_create_context |
CREATE TABLE table_name_61 (
date_of_birth VARCHAR,
pos VARCHAR,
height VARCHAR
) | What is the Date of Birth of the CB Player with a Height of m (ft 4in)? | SELECT date_of_birth FROM table_name_61 WHERE pos = "cb" AND height = "m (ft 4in)" | sql_create_context |
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,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 患者53751020全部检验报告单中的标本采集部位在2000年10月30日到2002年2月6日内都是哪一部位? | (SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '53751020' AND jybgb.BGRQ BETWEEN '2000-10-30' AND '2002-02-06') U... | css |
CREATE TABLE table_name_39 (
lost VARCHAR,
points VARCHAR,
drawn VARCHAR
) | Which Lost has Points smaller than 12, and a Drawn larger than 1? | SELECT COUNT(lost) FROM table_name_39 WHERE points < 12 AND drawn > 1 | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TA... | Does PHYSIOL 545 offer a section after 16:30 P.M. ? | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '16:30' AND course.course_id = course_offering.course_id AND course.department = 'PHYSIOL' AND course.number = 545 AND semester.semester = 'WN' A... | advising |
CREATE TABLE table_name_10 (
circuit VARCHAR,
event VARCHAR
) | Which Circuit has an Event of international procar meeting? | SELECT circuit FROM table_name_10 WHERE event = "international procar meeting" | 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
) | Draw a bar chart for what are the names and average prices of products for manufacturers whose products cost on average 150 or more?, and list in descending by the Name. | SELECT T2.Name, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC | nvbench |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Na... | SELECT * From Badges LEFT JOIN Users on Badges.Id = Users.Id. | SELECT Id, TagName FROM Tags LIMIT 90 | sede |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id... | what was patient 7241's weight the last time in 05/2103? | 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 = 7241)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' ... | mimic_iii |
CREATE TABLE table_29400 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Points" text
) | Name the total number of points for for played | SELECT COUNT("Points for") FROM table_29400 WHERE "Played" = 'Played' | wikisql |
CREATE TABLE table_name_25 (
opponent VARCHAR,
week VARCHAR,
game_site VARCHAR
) | Who did the Giants play before week 7 in Tulane Stadium? | SELECT opponent FROM table_name_25 WHERE week < 7 AND game_site = "tulane stadium" | sql_create_context |
CREATE TABLE table_name_27 (
ravg VARCHAR,
ratt VARCHAR
) | What is the RAvg of the year with Ratt of 9? | SELECT ravg FROM table_name_27 WHERE ratt = "9" | sql_create_context |
CREATE TABLE table_name_3 (
tries_for VARCHAR,
points VARCHAR,
tries_against VARCHAR
) | How many tries for are associated with 5 points and 2 tries against? | SELECT tries_for FROM table_name_3 WHERE points = "5" AND tries_against = "2" | sql_create_context |
CREATE TABLE table_18268826_1 (
no_in_season INTEGER,
us_viewers__million_ VARCHAR
) | What's the season number of the episode viewed by 3.19 million people in the US? | SELECT MAX(no_in_season) FROM table_18268826_1 WHERE us_viewers__million_ = "3.19" | sql_create_context |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Search tag wiki history example. | SELECT * FROM PostHistory AS ph WHERE ph.PostId = (SELECT t.WikiPostId FROM Tags AS t WHERE t.TagName = '##TagName:string##') ORDER BY CreationDate | sede |
CREATE TABLE stock (
Shop_ID int,
Device_ID int,
Quantity int
)
CREATE TABLE device (
Device_ID int,
Device text,
Carrier text,
Package_Version text,
Applications text,
Software_Platform text
)
CREATE TABLE shop (
Shop_ID int,
Shop_Name text,
Location text,
Open_Dat... | Create a bar chart showing how many location across location | SELECT Location, COUNT(Location) FROM shop GROUP BY Location | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.