context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_203_76 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | which driver came after giancarlo fisichella ? | SELECT "driver" FROM table_203_76 WHERE "pos" = (SELECT "pos" FROM table_203_76 WHERE "driver" = 'giancarlo fisichella') + 1 | squall |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | how many male patients have diagnoses icd9 code 1418? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "1418" | mimicsql_data |
CREATE TABLE table_name_84 (
year INTEGER,
rank VARCHAR,
floors VARCHAR
) | Tell me the average year for rank more than 3 and 28 floors | SELECT AVG(year) FROM table_name_84 WHERE rank > 3 AND floors = 28 | sql_create_context |
CREATE TABLE table_204_530 (
id number,
"type" text,
"stage" number,
"cyclist" text,
"team" text,
"reason" text
) | how many people withdrew before the 5th stage ? | SELECT COUNT("type") FROM table_204_530 WHERE "stage" < 5 | squall |
CREATE TABLE table_name_90 (
tries_for INTEGER,
points_for VARCHAR,
tries_against VARCHAR
) | What is the average tries for less than 117 points and less than 48 tries against? | SELECT AVG(tries_for) FROM table_name_90 WHERE points_for < 117 AND tries_against < 48 | sql_create_context |
CREATE TABLE table_76156 (
"1996 general" real,
"1999 European" real,
"2001 general" real,
"2004 European" real,
"2006 general" real,
"2008 general" real,
"2009 European" real,
"2013 general" real
) | What was the value for 2004 European with less than 7.5 in general 2001, less than 6.4 in 2009 European, and less than 1.5 in general 2013 with 4.3 in 2008 general? | SELECT "2004 European" FROM table_76156 WHERE "2001 general" < '7.5' AND "2009 European" < '6.4' AND "2013 general" < '1.5' AND "2008 general" = '4.3' | wikisql |
CREATE TABLE table_51794 (
"Year" text,
"Team" text,
"Comp" text,
"Long" text,
"Rate" text,
"RAtt" text,
"RYds" text,
"RAvg" text
) | Which team has a long of 67? | SELECT "Team" FROM table_51794 WHERE "Long" = '67' | wikisql |
CREATE TABLE table_name_82 (
team VARCHAR,
qual_2 VARCHAR
) | what team had the 1:44.027 qual 2? | SELECT team FROM table_name_82 WHERE qual_2 = "1:44.027" | 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 hz_info (
KH text,
KLX number... | 在从04年7月22日直到19年1月6日期间,病患67745789的所有检验结果指标记录中的仪器编号以及名称都叫什么? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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.BG... | css |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
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,
... | 患者43148907在05年1月3日到09年12月17日,是找的哪些工号及姓名的医务人员检测免疫球蛋白M(标准)的 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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.... | css |
CREATE TABLE table_name_80 (
winner VARCHAR,
stage VARCHAR,
team_classification VARCHAR,
general_classification VARCHAR
) | Who has a Team classification of la vie claire, a stage of 20, a General classification of greg lemond? | SELECT winner FROM table_name_80 WHERE team_classification = "la vie claire" AND general_classification = "greg lemond" AND stage = "20" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose gender is f and age is less than 64? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.age < "64" | mimicsql_data |
CREATE TABLE table_name_82 (
round VARCHAR,
player VARCHAR
) | What round was matt roth drafted? | SELECT COUNT(round) FROM table_name_82 WHERE player = "matt roth" | sql_create_context |
CREATE TABLE table_11839 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What did the home team score at MCG? | SELECT "Home team score" FROM table_11839 WHERE "Venue" = 'mcg' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients are admitted under elective type and are of hispanic or latino ethnicity? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.ethnicity = "HISPANIC OR LATINO" | mimicsql_data |
CREATE TABLE fires (
fire_year number,
discovery_date number,
discovery_doy number,
discovery_time text,
stat_cause_code number,
stat_cause_descr text,
cont_date text,
cont_doy text,
cont_time text,
fire_size number,
fire_size_class text,
latitude number,
longitude nu... | How many acres burned in fires in California each year between 2000 and 2005? | SELECT SUM(fire_size), fire_year FROM fires WHERE state = "CA" AND fire_year BETWEEN 2000 AND 2005 GROUP BY fire_year | uswildfires |
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
) | Bar graph to show the total number from different team, and could you show in ascending by the y-axis please? | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY COUNT(*) | 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... | calculate the number of patients with personality disorder nos who had a hospital stay for more than 5 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "5" AND diagnoses.short_title = "Personality disorder NOS" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE i... | when was the first time that patient 005-16601 got a chest tube #1: output until 10/11/2104? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-16601')) AND intakeoutput.cellpath LIKE '%output%... | eicu |
CREATE TABLE table_25984 (
"Player" text,
"Games Played" real,
"Minutes" real,
"Field Goals" real,
"Three Pointers" real,
"Free Throws" real,
"Rebounds" real,
"Assists" real,
"Blocks" real,
"Steals" real,
"Points" real
) | If the amount of rebounds is 0, what is the maximum minutes? | SELECT MAX("Minutes") FROM table_25984 WHERE "Rebounds" = '0' | wikisql |
CREATE TABLE table_44050 (
"Class" text,
"Wheel arrangement" text,
"Manufacturer" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text
) | What is Quantity Made, when Year Made is '4-4-0 oooo american'? | SELECT "Quantity made" FROM table_44050 WHERE "Year made" = '4-4-0 — oooo — american' | wikisql |
CREATE TABLE table_name_53 (
winner VARCHAR,
season VARCHAR
) | Who was the winner in the 2008 season? | SELECT winner FROM table_name_53 WHERE season = 2008 | 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... | 患者73428643开出的药品均不低于9644.26元一共是在哪几次医疗记录中以及医疗就诊编号是多少? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '73428643' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 9644.26) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '73428643' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_k... | css |
CREATE TABLE table_62019 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Attendance" text
) | On what Date was the Attendance 63,546? | SELECT "Date" FROM table_62019 WHERE "Attendance" = '63,546' | wikisql |
CREATE TABLE Customers (
customer_id INTEGER,
coupon_id INTEGER,
good_or_bad_customer VARCHAR(4),
first_name VARCHAR(80),
last_name VARCHAR(80),
gender_mf VARCHAR(1),
date_became_customer DATETIME,
date_last_hire DATETIME
)
CREATE TABLE Discount_Coupons (
coupon_id INTEGER,
date... | What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check, and count them by a bar chart, order by the y axis from low to high. | SELECT payment_date, COUNT(payment_date) FROM Payments WHERE amount_paid > 300 OR payment_type_code = 'Check' ORDER BY COUNT(payment_date) | nvbench |
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 wdmzjzjlb (
CYBQDM text,
CYBQ... | 列出患者58482069的出院科室名称中不包含室在医院3718001中的住院就诊记录都有哪几条? | SELECT * 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 = '58482069' AND hz_info.YLJGDM = '3718001' AND NOT wdmzjzjlb.CYKSMC LIKE '%室%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND h... | css |
CREATE TABLE table_name_93 (
title_rank VARCHAR,
actor VARCHAR
) | What is the title rank of actor pauline moran? | SELECT title_rank FROM table_name_93 WHERE actor = "pauline moran" | sql_create_context |
CREATE TABLE table_48159 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Time" text
) | What is Jockey, when Time is 1:15.89? | SELECT "Jockey" FROM table_48159 WHERE "Time" = '1:15.89' | wikisql |
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(50),
country varchar2(20),
f_id number(10),
genre_is varchar2(20),
rating number(10),
languages varchar2(20),
releasedate Date,
resolution number(10)
)
CREATE TABLE artist (
artist_name varchar2(50),
country va... | Let the shortest duration as bar chart's X-axis and the most poorly rated song for each genre as the Y, could you list in asc by the total number? | SELECT MIN(T1.duration), MIN(T2.rating) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY MIN(T1.duration) ORDER BY MIN(T2.rating) | nvbench |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
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 swimme... | Show the average of id from each nationality, I want to display in ascending by the Y. | SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY AVG(ID) | nvbench |
CREATE TABLE table_name_31 (
winning_team VARCHAR,
losing_pitcher VARCHAR
) | What winning team has a losing pitcher of Juan Dominguez? | SELECT winning_team FROM table_name_31 WHERE losing_pitcher = "juan dominguez" | sql_create_context |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
... | n-th percentile score 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), Percentiles AS (SELECT perc = PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY Score) OVER () FROM AcceptedAnswersScores) SELECT AVG(CAST(perc AS FLOAT)) FROM Percentiles | sede |
CREATE TABLE table_name_53 (
laps VARCHAR,
winnings VARCHAR,
car__number VARCHAR
) | How many total laps for the driver with Winnings of $116,033, and a Car # smaller than 18? | SELECT COUNT(laps) FROM table_name_53 WHERE winnings = "$116,033" AND car__number < 18 | sql_create_context |
CREATE TABLE table_name_39 (
score VARCHAR,
home_team VARCHAR
) | What was the score of the game where the adelaide 36ers were the home team? | SELECT score FROM table_name_39 WHERE home_team = "adelaide 36ers" | sql_create_context |
CREATE TABLE table_name_22 (
player VARCHAR,
to_par VARCHAR,
score VARCHAR
) | Who had a to par of +2 and a score of 78-69-68=215? | SELECT player FROM table_name_22 WHERE to_par = "+2" AND score = 78 - 69 - 68 = 215 | sql_create_context |
CREATE TABLE table_name_76 (
Id VARCHAR
) | Which car won the same award in 2001 that the toyota 1nz-fxe hybrid prius won in 1999? | SELECT 2001 FROM table_name_76 WHERE 1999 = "toyota 1nz-fxe hybrid prius" | sql_create_context |
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,
wind_speed_mph int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local... | count services by services, and split by local authorities with a stacked bar chart. | SELECT local_authority, COUNT(local_authority) FROM station GROUP BY services, local_authority | nvbench |
CREATE TABLE table_name_62 (
arrival VARCHAR,
station_name VARCHAR
) | What is the Arrival time of the Patna Junction Station? | SELECT arrival FROM table_name_62 WHERE station_name = "patna junction" | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id... | what difference in the weight of patient 2518 last measured on the current hospital visit compared to the value second to last measured on the current hospital visit? | 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 = 2518 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM ... | mimic_iii |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_co... | how do i get from PITTSBURGH airport to downtown PITTSBURGH | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_code = airport_service.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_name = 'PITTSBURGH' AND ground_servic... | atis |
CREATE TABLE table_name_25 (
score VARCHAR,
decision VARCHAR,
record VARCHAR
) | What was the score of the game with a decision of Peeters and a record of 29 3 11? | SELECT score FROM table_name_25 WHERE decision = "peeters" AND record = "29–3–11" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | A pie chart shows the proportion of All_Home and the sum of school id. | SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home | nvbench |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | Visualize a bar chart about the number of winery of the wines whose price is bigger than 100, sort bars from high to low order please. | SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Winery ORDER BY Winery DESC | nvbench |
CREATE TABLE table_name_92 (
team_name VARCHAR,
races VARCHAR
) | Which team completed 10 races? | SELECT team_name FROM table_name_92 WHERE races = 10 | sql_create_context |
CREATE TABLE table_30916 (
"Name" text,
"#" real,
"Position" text,
"Height" text,
"Weight ( lb. )" real,
"Year" text,
"Hometown" text,
"Previous School" text
) | What is the highest number a guard from brophy college prep wore? | SELECT MAX("#") FROM table_30916 WHERE "Position" = 'Guard' AND "Previous School" = 'Brophy College Prep' | wikisql |
CREATE TABLE temperature (
city_id number,
jan number,
feb number,
mar number,
apr number,
jun number,
jul number,
aug number,
sep number,
oct number,
nov number,
dec number
)
CREATE TABLE city (
city_id number,
city text,
hanzi text,
hanyu_pinyin text,
... | Which cities' temperature in March is lower than that in July or higher than that in Oct? | SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.mar < T2.jul OR T2.mar > T2.oct | spider |
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | 1483391这个医疗机构在2000年10月8日到2014年1月6日期间一共有多少外地住院的就诊记录 | SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.ZYBMLX = '1483391' AND bdmzjzjlb.RYDJSJ BETWEEN '2000-10-08' AND '2014-01-06' | css |
CREATE TABLE table_name_34 (
us__2013_ VARCHAR
) | What was the U.S birthstone in the 15th-20th century when in 2013 it was amethyst? | SELECT 15 AS th__20th_century FROM table_name_34 WHERE us__2013_ = "amethyst" | sql_create_context |
CREATE TABLE table_54450 (
"Pick" real,
"Player" text,
"Country of origin*" text,
"PBA team" text,
"College" text
) | Where is the player with a pick smaller than 12 and a college of UV from? | SELECT "Country of origin*" FROM table_54450 WHERE "Pick" < '12' AND "College" = 'uv' | wikisql |
CREATE TABLE table_25353861_5 (
player VARCHAR,
assists VARCHAR
) | Which player had 6 assists? | SELECT player FROM table_25353861_5 WHERE assists = 6 | sql_create_context |
CREATE TABLE table_74171 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the date for cleveland | SELECT "Date" FROM table_74171 WHERE "Team" = 'Cleveland' | wikisql |
CREATE TABLE table_25042 (
"Rank MidEast" real,
"Rank Asia" real,
"Rank World" real,
"Country" text,
"2011 GDP (PPP) billions of USD" text
) | What 2011 GDP (PPP) billions of USD does Israel have? | SELECT "2011 GDP (PPP) billions of USD" FROM table_25042 WHERE "Country" = 'Israel' | wikisql |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
... | may i see all the flights from WASHINGTON to SAN FRANCISCO please | 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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN... | atis |
CREATE TABLE table_name_89 (
location VARCHAR
) | Which Location has a Time of time? | SELECT location FROM table_name_89 WHERE "time" = "time" | sql_create_context |
CREATE TABLE table_name_54 (
date VARCHAR,
attendance VARCHAR
) | On what date was the attendance of the crowd 78,431? | SELECT date FROM table_name_54 WHERE attendance = "78,431" | sql_create_context |
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,
... | tell me the cost for a therapeutic antibacterials - cephalosporin? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'therapeutic antibacterials - cephalosporin') | eicu |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(2... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the sum of employee_id over the hire_date bin hire_date by time, and sort in ascending by the total number. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(EMPLOYEE_ID) | nvbench |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
) | For each director, return the highest rating among all of their movies and the value of that rating, group by title in a scatter, and Ignore movies whose director is NULL. | SELECT stars, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY title | nvbench |
CREATE TABLE table_44321 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
) | What is the qual 1 with a 1:09.567 best? | SELECT "Qual 1" FROM table_44321 WHERE "Best" = '1:09.567' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 患者戚嘉荣在零九年二月一日到二一年十一月二十六日的时间里买西药的次数一共有多少 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '戚嘉荣' AND t_kc22.STA_DATE BETWEEN '2009-02-01' AND '2021-11-26' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE table_203_163 (
id number,
"year" number,
"total" number,
"serbs" text,
"hungarians" text,
"germans" text,
"romanians" text,
"slovaks" text
) | in 2002 , how many people in the serbian banat were either slovaks or romanians ? | SELECT "slovaks" + "romanians" FROM table_203_163 WHERE "year" = 2002 | squall |
CREATE TABLE Products (
Product_Name VARCHAR,
Product_ID VARCHAR
)
CREATE TABLE Products_in_Events (
Product_ID VARCHAR
) | Show the names of products and the number of events they are in. | SELECT T1.Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name | sql_create_context |
CREATE TABLE table_66790 (
"Rank" text,
"Goals" text,
"Player" text,
"Club" text,
"Season" text
) | How many goals did the club from Hawthorn score in the 1971 season? | SELECT "Goals" FROM table_66790 WHERE "Club" = 'hawthorn' AND "Season" = '1971' | wikisql |
CREATE TABLE table_49213 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is Date, when High Rebounds is 'Yao Ming (10)'? | SELECT "Date" FROM table_49213 WHERE "High rebounds" = 'yao ming (10)' | wikisql |
CREATE TABLE table_203_688 (
id number,
"category" text,
"speed\n(km/h)" number,
"speed\n(mph)" number,
"vehicle" text,
"pilot" text,
"date" text
) | who was the pilot for the north american x-15 ? | SELECT "pilot" FROM table_203_688 WHERE "vehicle" = 'north american x-15' | squall |
CREATE TABLE table_name_76 (
position INTEGER,
against INTEGER
) | What is the average position with an against value less than 11? | SELECT AVG(position) FROM table_name_76 WHERE against < 11 | sql_create_context |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 检验报告单54790820335的检验技师工号是多少,叫什么名字 | SELECT JYJSGH, JYJSQM FROM jybgb WHERE BGDH = '54790820335' | css |
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,
... | 患者卡号以及卡类型在门诊就诊14556788521中是什么? | SELECT txmzjzjlb.KH, txmzjzjlb.KLX FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '14556788521' UNION SELECT ftxmzjzjlb.KH, ftxmzjzjlb.KLX FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '14556788521' | 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 prescription... | How many patients were admitted to the hospital before the year 2194 who have undergone the procedure angiocardiography of right heart structures. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2194" AND procedures.long_title = "Angiocardiography of right heart structures" | mimicsql_data |
CREATE TABLE table_204_229 (
id number,
"property" text,
"test method" text,
"units" text,
"4275" text,
"4301" text,
"4435" text,
"4630" text,
"4645" text
) | are there more or less than 8 properties ? | SELECT (SELECT COUNT("property") FROM table_204_229) > 8 | squall |
CREATE TABLE table_name_58 (
bronze INTEGER,
gold INTEGER
) | What is the lowest Bronze, when Gold is less than 0? | SELECT MIN(bronze) FROM table_name_58 WHERE gold < 0 | sql_create_context |
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 hospital visits have patient 002-56853 done since 2 years ago? | SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '002-56853' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-2 year') | eicu |
CREATE TABLE table_name_23 (
catalog VARCHAR,
year INTEGER
) | What catalog came out after 2000? | SELECT catalog FROM table_name_23 WHERE year > 2000 | sql_create_context |
CREATE TABLE table_8223 (
"Date" text,
"Round" text,
"Opponents" text,
"H / A" text,
"Result F \u2013 A" text,
"Attendance" real
) | What was the result F-A for round 5? | SELECT "Result F \u2013 A" FROM table_8223 WHERE "Round" = 'round 5' | 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... | provide the number of patients whose admission type is newborn and year of birth is less than 2065? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.dob_year < "2065" | mimicsql_data |
CREATE TABLE first_notification_of_loss (
fnol_id number,
customer_id number,
policy_id number,
service_id number
)
CREATE TABLE available_policies (
policy_id number,
policy_type_code text,
customer_phone text
)
CREATE TABLE services (
service_id number,
service_name text
)
CREAT... | Find the policy types more than 4 customers use. Show their type code. | SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING COUNT(*) > 4 | spider |
CREATE TABLE table_name_10 (
agri_culture_b VARCHAR,
structural_poverty_g VARCHAR,
income_poverty_f VARCHAR,
mining_b VARCHAR
) | Income poverty f smaller than 13.6, and a Mining b of 1, and a Structural poverty g smaller than 7.8, so what is the total number of agriculture? | SELECT COUNT(agri_culture_b) FROM table_name_10 WHERE income_poverty_f < 13.6 AND mining_b = 1 AND structural_poverty_g < 7.8 | sql_create_context |
CREATE TABLE table_18426 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what is the political affiliation of the texas 12 district | SELECT "Party" FROM table_18426 WHERE "District" = 'Texas 12' | wikisql |
CREATE TABLE table_60534 (
"Data" text,
"Headcount" real,
"Percent of total" text,
"Less than $25,000" text,
"$25,000 to $40,000" text,
"$40,000 to $50,000" text,
"$50,000 to $60,000" text,
"$60,000 to $70,000" text,
"$70,000 to $80,000" text,
"More than $80,000" text,
"Mean"... | What's the mean of the $70-80k ones that have 2.80%? | SELECT "Mean" FROM table_60534 WHERE "$70,000 to $80,000" = '2.80%' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | 由于使用酒精引起的精神病性障碍的患者的在门诊诊断为检测指标686489的参考值范围下限是什么?上限是什么? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDSM = '由于使用酒精引起的精神病性障碍' AND jyjgzbb.JCZBDM = '686489' UNION SELECT jyjgzb... | css |
CREATE TABLE table_14342592_5 (
field_goals VARCHAR,
position VARCHAR
) | How many field goals were made by someone playing position of right end? | SELECT COUNT(field_goals) FROM table_14342592_5 WHERE position = "Right end" | sql_create_context |
CREATE TABLE table_62189 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What home team has a score of 2 1, when the away team was Telford United? | SELECT "Home team" FROM table_62189 WHERE "Score" = '2–1' AND "Away team" = 'telford united' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
... | For those employees who was hired before 2002-06-21, give me the trend about manager_id over hire_date , I want to rank x-axis in asc order. | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE | nvbench |
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 mzjzjlb (
HXPLC number,
HZXM ... | 列出门诊就诊90684137520的诊断名和编号 | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM mzjzjlb WHERE mzjzjlb.JZLSH = '90684137520' | css |
CREATE TABLE table_23143607_1 (
radio_stations VARCHAR,
organization VARCHAR
) | Which of the radio stations has the organization of ente p blico radio televisi n madrid (eprtvm)? | SELECT radio_stations FROM table_23143607_1 WHERE organization = "Ente Público Radio Televisión Madrid (EPRTVM)" | 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... | give me the number of patients whose ethnicity is black/cape verdean and primary disease is s/p fall? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "S/P FALL" | mimicsql_data |
CREATE TABLE Addresses (
address_id INTEGER,
address_details VARCHAR(255)
)
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Product_Suppliers (
product_id INTEGER,
supplier_id INTEGER,
date_supplied_from... | Return the names and ids of customers who have TN in their address Show bar chart, show by the X in asc. | SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_name | nvbench |
CREATE TABLE table_28498 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real,
"Nickname" text
) | How many joined the Warriors? | SELECT COUNT("Joined") FROM table_28498 WHERE "Nickname" = 'Warriors' | wikisql |
CREATE TABLE table_14209 (
"Rank" real,
"Lane" real,
"Athlete" text,
"Nationality" text,
"Time" real,
"React" real
) | What is the shortest Time for David Neville when his React time was greater than 0.183? | SELECT MIN("Time") FROM table_14209 WHERE "React" > '0.183' AND "Athlete" = 'david neville' | wikisql |
CREATE TABLE table_name_77 (
season VARCHAR,
points VARCHAR,
podiums VARCHAR,
races VARCHAR
) | Which Season has 0 Podiums, 1 Race, and 0 Points? | SELECT season FROM table_name_77 WHERE podiums = "0" AND races = "1" AND points = "0" | sql_create_context |
CREATE TABLE table_name_51 (
chassis VARCHAR,
driver VARCHAR
) | What Chassis does Reg Parnell drive? | SELECT chassis FROM table_name_51 WHERE driver = "reg parnell" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | list the four most common diagnoses that a patient was diagnosed with within 2 months after being diagnosed with brain tumor since 6 years ago. | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'brain tumor' AND DATETIME(diagnosis.diag... | eicu |
CREATE TABLE table_name_22 (
home_team VARCHAR,
venue VARCHAR
) | Who was the home team at VFL Park? | SELECT home_team FROM table_name_22 WHERE venue = "vfl park" | sql_create_context |
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Format text,
Catalogue text
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_offi... | Show all party names and the number of members in each party by a pie chart. | SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID | nvbench |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | What is the relationship between ACC_Percent and All_Games_Percent , and group by attribute All_Road? | SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY All_Road | nvbench |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight_fare (
flight_id int,
f... | information on ground transportation from airport to downtown BOS | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'BOSTON' AND ground_service.airpor... | atis |
CREATE TABLE table_78195 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" real,
"Time" text,
"Location" text
) | What method had Adriano Martins as an opponent and a time of 5:00? | SELECT "Method" FROM table_78195 WHERE "Time" = '5:00' AND "Opponent" = 'adriano martins' | wikisql |
CREATE TABLE table_61572 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | What is Status, when Opposing Teams is 'Italy'? | SELECT "Status" FROM table_61572 WHERE "Opposing Teams" = 'italy' | wikisql |
CREATE TABLE table_41351 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | Who is the leading scorer of the Villa De Los Barrios visitor? | SELECT "Leading scorer" FROM table_41351 WHERE "Visitor" = 'villa de los barrios' | wikisql |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
... | Out of the courses I 've had , are any MDE courses ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON student_record.course_id = program_course.course_id WHERE program_course.category LIKE '%MDE%' AND student_record.student_id = 1 | advising |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.