context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_6557 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text
) | Which Result has a Party of republican, and a First elected smaller than 1856? | SELECT "Result" FROM table_6557 WHERE "Party" = 'republican' AND "First elected" < '1856' | wikisql |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId n... | vote split by month for specified user. comparison of upvotes to downvotes on answers posted by the specified user. 'all-time up to last month | SELECT LAST_DATE_OF_MONTH(a.CreationDate) AS "month", SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS Upvotes, SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS Downvotes FROM Posts AS a LEFT OUTER JOIN Votes AS v ON v.PostId = a.Id JOIN Users AS u ON a.OwnerUserId = u.Id WHERE VoteTypeId IN (2, 3) AND a.OwnerUserI... | sede |
CREATE TABLE table_34670 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What number of rank has more than 2 medals in total with less than 4 bronze? | SELECT COUNT("Rank") FROM table_34670 WHERE "Total" > '2' AND "Bronze" < '4' | wikisql |
CREATE TABLE table_24666 (
"Team" text,
"Truck(s)" text,
"#" real,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Listed Owner(s)" text,
"Crew Chief" text
) | Name the listed owners for brevak racing | SELECT "Listed Owner(s)" FROM table_24666 WHERE "Team" = 'Brevak Racing' | wikisql |
CREATE TABLE table_204_234 (
id number,
"round" text,
"100 yd (91 m)" text,
"80 yd (73 m)" text,
"60 yd (55 m)" text,
"50 yd (46 m)" text,
"40 yd (37 m)" text
) | who shot the least at 40 yd | SELECT "round" FROM table_204_234 ORDER BY "40 yd (37 m)" LIMIT 1 | squall |
CREATE TABLE table_41495 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the total number of Top-25, when Events is greater than 86? | SELECT COUNT("Top-25") FROM table_41495 WHERE "Events" > '86' | wikisql |
CREATE TABLE table_name_29 (
player VARCHAR,
weight VARCHAR
) | What player weight 235? | SELECT player FROM table_name_29 WHERE weight = 235 | sql_create_context |
CREATE TABLE table_12999 (
"Province" text,
"Inhabitants" real,
"established" real,
"President" text,
"Party" text,
"Election" real
) | What party established in 1797 won an election in 2007? | SELECT "Party" FROM table_12999 WHERE "established" > '1797' AND "Election" = '2007' | wikisql |
CREATE TABLE table_11927 (
"Number & name" text,
"Description" text,
"Current status" text,
"Livery" text,
"Date" text
) | When was the livery of Kinneil Sandy Red? | SELECT "Date" FROM table_11927 WHERE "Livery" = 'kinneil sandy red' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | count the number of patients who have had a po meds intake in 2105. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'po meds' AND intakeoutput.cellpath LIKE '%input%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) = '2105') | eicu |
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 jyjgzbb (
BGDH text,
BGRQ tim... | 在医疗就诊61422826297的病人昌子真查询检验报告单数据结果是怎么样的? | SELECT * FROM jybgb WHERE jybgb.JZLSH = '61422826297' | css |
CREATE TABLE table_name_77 (
main_location_s_ VARCHAR,
_percentage_of_national VARCHAR
) | What is listed for the Main Location(s) that has a % of National of 2.05%? | SELECT main_location_s_ FROM table_name_77 WHERE _percentage_of_national = "2.05%" | sql_create_context |
CREATE TABLE table_52461 (
"Tournament" text,
"1972" text,
"1973" text,
"1974" text,
"1975" text,
"1976" text,
"1977" text,
"1978" text
) | What is the 1977 value that has a 1974 a value? | SELECT "1977" FROM table_52461 WHERE "1974" = 'a' | wikisql |
CREATE TABLE table_78468 (
"Color" text,
"mass (g/mol)" text,
"Absorb (nm)" text,
"Emit (nm)" text,
"\u03b5 (M -1 cm -1 )" text
) | Which (M -1 cm -1) has a molar mass of 1008 g/mol? | SELECT "\u03b5 (M -1 cm -1 )" FROM table_78468 WHERE "mass (g/mol)" = '1008' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | what were the drugs added to patient 19412 today as compared to the one yesterday? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19412) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE... | mimic_iii |
CREATE TABLE table_25286976_2 (
november_3 VARCHAR,
june_10_11 VARCHAR
) | When 127 is on June 10th to 11th what is November 3rd? | SELECT november_3 FROM table_25286976_2 WHERE june_10_11 = "127" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Return a bar chart about the distribution of ACC_Road and Team_ID , and group by attribute All_Home, sort in desc by the Team_ID. | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY Team_ID DESC | nvbench |
CREATE TABLE table_name_57 (
engine INTEGER,
model VARCHAR,
year_from VARCHAR
) | Which Engine has a Model of sl500, and a Year From larger than 1999? | SELECT MAX(engine) FROM table_name_57 WHERE model = "sl500" AND year_from > 1999 | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Find ACC_Regular_Season and ACC_Percent , and visualize them by a bar chart. | SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match | nvbench |
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
... | List all headquarters and the number of companies in each headquarter with a bar chart, could you display by the the total number from high to low? | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_74144 (
"Date" text,
"Player" text,
"Injury" text,
"Date of injury" text,
"Number of matches (Total)" text,
"Source" text
) | What is the date of injury for player Wesley sneijder (2)? | SELECT "Date of injury" FROM table_74144 WHERE "Player" = 'Wesley Sneijder (2)' | wikisql |
CREATE TABLE table_59335 (
"White" text,
"Black" text,
"Year" real,
"Result" text,
"Moves" real,
"Tournament" text,
"Opening" text
) | What is Result, when Year is greater than 1999, when White is 'Kramnik', and when Tournament is 'Mainz CC Champions Duel (5)'? | SELECT "Result" FROM table_59335 WHERE "Year" > '1999' AND "White" = 'kramnik' AND "Tournament" = 'mainz cc champions duel (5)' | wikisql |
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE cite (
... | How many papers does kentaro toyama have ? | SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'kentaro toyama' AND writes.authorid = author.authorid | scholar |
CREATE TABLE table_60466 (
"Golden Rivers" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is th average dras when wins are less than 12 and the against is 989? | SELECT AVG("Draws") FROM table_60466 WHERE "Against" = '989' AND "Wins" < '12' | wikisql |
CREATE TABLE table_3745 (
"Version" text,
"Codename" text,
"Edition" text,
"Code Base" text,
"Compatible repository" text,
"Default desktop environment" text,
"Release date" text
) | What is the default desktop environment when the edition is kde and the compatible repository is ubuntu 13.04? | SELECT "Default desktop environment" FROM table_3745 WHERE "Edition" = 'KDE' AND "Compatible repository" = 'Ubuntu 13.04' | wikisql |
CREATE TABLE table_28081876_6 (
season_no VARCHAR,
production_code VARCHAR
) | What season number was assigned to the episode identified with the production code 401? | SELECT season_no FROM table_28081876_6 WHERE production_code = 401 | sql_create_context |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 门诊诊断为检测指标976714谵妄的病患的数值的平均值是多少?最值是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '谵妄' AND jyjgzbb.JCZBDM = '976714' | css |
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age... | Show the total number of the first year of parties with the theme 'Spring' or 'Teqnology' with a bar chart, bin the first year into weekday interval and count the first year, rank by the Y in descending please. | SELECT First_year, COUNT(First_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" ORDER BY COUNT(First_year) DESC | nvbench |
CREATE TABLE table_47965 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | Which Opponent has a Result of l 24 3? | SELECT "Opponent" FROM table_47965 WHERE "Result" = 'l 24–3' | wikisql |
CREATE TABLE table_17103645_10 (
record VARCHAR,
date VARCHAR
) | Name the record for july 18 | SELECT record FROM table_17103645_10 WHERE date = "July 18" | sql_create_context |
CREATE TABLE table_name_38 (
exposure_fusion VARCHAR,
name VARCHAR
) | What's the exposure fusion of Panoramaplus x4? | SELECT exposure_fusion FROM table_name_38 WHERE name = "panoramaplus x4" | sql_create_context |
CREATE TABLE table_40675 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
) | What is the HDTV of the Music Content Channel? | SELECT "HDTV" FROM table_40675 WHERE "Content" = 'music' | wikisql |
CREATE TABLE table_name_70 (
ship VARCHAR,
builder VARCHAR
) | What Ship was Built by Cammell Laird? | SELECT ship FROM table_name_70 WHERE builder = "cammell laird" | sql_create_context |
CREATE TABLE table_name_22 (
venue VARCHAR,
balls VARCHAR
) | What is Venue, when Balls is '148'? | SELECT venue FROM table_name_22 WHERE balls = 148 | sql_create_context |
CREATE TABLE table_254234_1 (
abbreviation_symbol VARCHAR,
chinese_name VARCHAR
) | What is the abbreviation/symbol of li on ng sh ng? | SELECT abbreviation_symbol FROM table_254234_1 WHERE chinese_name = "辽宁省 Liáoníng Shěng" | sql_create_context |
CREATE TABLE table_32976 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What did the away team score when the home team scored 14.15 (99)? | SELECT "Away team score" FROM table_32976 WHERE "Home team score" = '14.15 (99)' | wikisql |
CREATE TABLE table_76484 (
"Model" text,
"Sensor Size" text,
"Resolution" text,
"Active Pixels" text,
"Display" text
) | What are the active pixels of the cantare model? | SELECT "Active Pixels" FROM table_76484 WHERE "Model" = 'cantare' | wikisql |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cine... | For each cinema, show the price and group them by film title in a stacked bar chart, and could you list from high to low by the total number? | SELECT Title, Price FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Name, Title ORDER BY Price DESC | nvbench |
CREATE TABLE table_71402 (
"Date" text,
"Tournament" text,
"Surface" text,
"Tier" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
) | What is the score in the touranament of Antalya-Belek? | SELECT "Score" FROM table_71402 WHERE "Tournament" = 'antalya-belek' | wikisql |
CREATE TABLE table_36152 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | After week 11, what was the Result on December 13, 1964? | SELECT "Result" FROM table_36152 WHERE "Week" > '11' AND "Date" = 'december 13, 1964' | wikisql |
CREATE TABLE table_16412 (
"Romaji title" text,
"Japanese title" text,
"Release date" text,
"Reference" text,
"Oricon" real
) | what are the title in japanese where the reference is kids-430? | SELECT "Japanese title" FROM table_16412 WHERE "Reference" = 'KIDS-430' | wikisql |
CREATE TABLE table_name_63 (
series VARCHAR,
director VARCHAR,
release_date VARCHAR
) | What was the series of the episode directed by Abe Levitow released on 1959-06-27? | SELECT series FROM table_name_63 WHERE director = "abe levitow" AND release_date = "1959-06-27" | sql_create_context |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what was the simethicone dosage that patient 5395 was first prescribed since 49 months ago? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5395) AND prescriptions.drug = 'simethicone' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-49 month') ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | when was patient 027-155345's first discharge from the hospital since 5 years ago? | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '027-155345' AND DATETIME(patient.hospitaldischargetime) >= DATETIME(CURRENT_TIME(), '-5 year') ORDER BY patient.hospitaldischargetime LIMIT 1 | eicu |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | what was the last time patient 2425 received a prescription for thiamine, since 04/2101? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2425) AND prescriptions.drug = 'thiamine' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2101-04' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE country (
Country_ID int,
Name text,
Population int,
Area int,
Languages text
)
CREATE TABLE roller_coaster (
Roller_Coaster_ID int,
Name text,
Park text,
Country_ID int,
Length real,
Height real,
Speed text,
Opened text,
Status text
) | Show the names of countries and the average speed of roller coasters from each country with a bar chart. | SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name | nvbench |
CREATE TABLE table_31650 (
"Year" real,
"Championship" text,
"Winning score" text,
"Margin" text,
"Runner(s)-up" text
) | What was the margin in 2001 at the McDonald's LPGA Championship? | SELECT "Margin" FROM table_31650 WHERE "Year" = '2001' AND "Championship" = 'mcdonald''s lpga championship' | wikisql |
CREATE TABLE table_29334 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"Pro Team" text,
"College" text
) | If the college is SMU, what is the position? | SELECT "Position" FROM table_29334 WHERE "College" = 'SMU' | wikisql |
CREATE TABLE table_26330 (
"Sector" text,
"Establishments" real,
"Sales, receipts, or shipments ($1,000)" real,
"Annual payroll ($1,000)" real,
"Paid employees" real
) | What is the sector is the establishment is 110313? | SELECT "Sector" FROM table_26330 WHERE "Establishments" = '110313' | wikisql |
CREATE TABLE table_23181 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real
) | When was the private/non-sectarian school founded? | SELECT "Founded" FROM table_23181 WHERE "Type" = 'Private/Non-sectarian' | wikisql |
CREATE TABLE table_name_37 (
source VARCHAR,
desus VARCHAR
) | What is the source for 7% DeSUS? | SELECT source FROM table_name_37 WHERE desus = "7%" | sql_create_context |
CREATE TABLE diagnoses (
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,
... | give me the number of patients whose primary disease is complete heart block and drug type is main? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_19375 (
"Tour" text,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) | Name the mens singles when womens singles is wang lin and mixed doubles is joachim fischer nielsen christinna pedersen | SELECT "Mens singles" FROM table_19375 WHERE "Womens singles" = 'Wang Lin' AND "Mixed doubles" = 'Joachim Fischer Nielsen Christinna Pedersen' | wikisql |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as ... | The Other requirement is satisfied by which courses in Experimental Philosophy ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Experimental Philosophy%' OR course.description LIKE '%Experimental Philosophy%' OR course.name ... | advising |
CREATE TABLE table_name_54 (
game VARCHAR,
opponent VARCHAR
) | Which game did New Jersey Devils played in? | SELECT game FROM table_name_54 WHERE opponent = "new jersey devils" | sql_create_context |
CREATE TABLE table_79373 (
"Brand" text,
"Product Name" text,
"Focal Length" text,
"35mm EFL and equivalent aperture" text,
"Max. aperture" text
) | What is the brand of the Sigma 30mm f2.8 DN, which has a maximum aperture of f /2.8 and a focal length of 30mm? | SELECT "Brand" FROM table_79373 WHERE "Max. aperture" = 'f /2.8' AND "Focal Length" = '30mm' AND "Product Name" = 'sigma 30mm f2.8 dn' | wikisql |
CREATE TABLE party (
Number_of_hosts INTEGER
) | What is the average number of hosts for parties? | SELECT AVG(Number_of_hosts) FROM party | sql_create_context |
CREATE TABLE table_name_58 (
population_2000_census VARCHAR,
area__km²_ VARCHAR,
population_density_2010___km²_ VARCHAR
) | What is the total population from the 2000 census for the municipality that has a 464.5 square km area and a population density in 2010 larger than 1840? | SELECT COUNT(population_2000_census) FROM table_name_58 WHERE area__km²_ = 464.5 AND population_density_2010___km²_ > 1840 | sql_create_context |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course (
c... | How long has it been since the school started offering MACROMOL 995 ? | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MACROMOL' AND course.number = 995 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1 | advising |
CREATE TABLE table_4435 (
"Pick #" real,
"MLS team" text,
"Player" text,
"Position" text,
"Affiliation" text
) | Tell me the lowest pick number for new england revolution | SELECT MIN("Pick #") FROM table_4435 WHERE "MLS team" = 'new england revolution' | wikisql |
CREATE TABLE table_train_128 (
"id" int,
"vascular" bool,
"mania" bool,
"pulmonary_disease" bool,
"cardiac" bool,
"stroke" bool,
"substance_dependence" bool,
"schizophrenia" bool,
"cerebrovascular_disease" bool,
"hematologic_disease" bool,
"adverse_reactions_venlaflaxine" boo... | previous history of schizophrenia, mania, or major depression. | SELECT * FROM table_train_128 WHERE schizophrenia = 1 OR mania = 1 OR major_depression = 1 | criteria2sql |
CREATE TABLE table_74181 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the score for jos juan barea (8) | SELECT "Score" FROM table_74181 WHERE "High assists" = 'José Juan Barea (8)' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | provide the number of patients whose diagnoses icd9 code is 4280 and drug type is main? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "4280" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE Genre (
GenreId integer,
Name varchar(120)
)
CREATE TABLE Employee (
EmployeeId integer,
LastName varchar(20),
FirstName varchar(20),
Title varchar(30),
ReportsTo integer,
BirthDate datetime,
HireDate datetime,
Address varchar(70),
City varchar(40),
State va... | What are the phone numbers for each employee, and count them by a bar chart | SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone | nvbench |
CREATE TABLE Flight (
origin VARCHAR
) | Which origin has most number of flights? | SELECT origin FROM Flight GROUP BY origin ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_25616 (
"date (dd.mm.yyyy)" text,
"Tail number" text,
"Location" text,
"Fatalities" text,
"Brief description" text
) | When did the airplane with tail number RA-85282 crash? | SELECT "date (dd.mm.yyyy)" FROM table_25616 WHERE "Tail number" = 'RA-85282' | wikisql |
CREATE TABLE table_name_10 (
points_1 VARCHAR,
lost VARCHAR,
goals_for VARCHAR
) | What is the total number of Points 1, when Lost is less than 20, and when Goals For is greater than 92? | SELECT COUNT(points_1) FROM table_name_10 WHERE lost < 20 AND goals_for > 92 | sql_create_context |
CREATE TABLE table_name_4 (
city VARCHAR,
arena VARCHAR
) | What city is Kara Ali Acar Sport Hall located in? | SELECT city FROM table_name_4 WHERE arena = "kara ali acar sport hall" | sql_create_context |
CREATE TABLE table_43972 (
"Player" text,
"Nationality" text,
"Jersey Number(s)" real,
"Position" text,
"Years" text,
"From" text
) | Where is the player from that has a Jersey Number(s) greater than 0 in the year 2003? | SELECT "From" FROM table_43972 WHERE "Jersey Number(s)" > '0' AND "Years" = '2003' | wikisql |
CREATE TABLE table_16585 (
"Country" text,
"Carbon dioxide emissions per year (10 6 Tons) (2006)" real,
"Percentage of global total" text,
"Avg. emission per km 2 of its land (tons)" real,
"Carbon dioxide emissions per year (Tons per person) (2007)" text
) | HOW MUCH IS THE PERCENTAGE OF GLOBAL TOTAL EMISSIONS IN THE COUNTRY THAT PRODUCED 4.9 TONS PER PERSON IN 2007? | SELECT "Percentage of global total" FROM table_16585 WHERE "Carbon dioxide emissions per year (Tons per person) (2007)" = '4.9' | wikisql |
CREATE TABLE table_7749 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the sum of Gold, when Total is greater than 2, when Bronze is greater than 1, and when Silver is less than 1? | SELECT SUM("Gold") FROM table_7749 WHERE "Total" > '2' AND "Bronze" > '1' AND "Silver" < '1' | wikisql |
CREATE TABLE table_204_136 (
id number,
"year" number,
"final" text,
"semi" text
) | what is the first country listed on this chart ? | SELECT "final" FROM table_204_136 WHERE id = 1 | squall |
CREATE TABLE table_65841 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
) | What is the lowest league goals that has fw as the position, total goals greater than 9, with league cup goals greater than 4? | SELECT MIN("League Goals") FROM table_65841 WHERE "Position" = 'fw' AND "Total Goals" > '9' AND "League Cup Goals" > '4' | wikisql |
CREATE TABLE table_13667 (
"Driver" text,
"Starts" real,
"Finishes" real,
"Wins" real,
"Podiums" real,
"Stage wins" real,
"Points" real
) | What is the number of finishes associated with 13 starts, more than 169 points, and 96 stage wins? | SELECT "Finishes" FROM table_13667 WHERE "Starts" = '13' AND "Points" > '169' AND "Stage wins" = '96' | wikisql |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | What is the average age for a male in each job Visualize by bar chart, and sort X-axis from low to high order. | SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY job | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | what was patient 031-22988's first tested specimen until 24 months ago? | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND DATETIME(microlab.culturetakentime) <= DATETIME(CURRE... | eicu |
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 | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team | nvbench |
CREATE TABLE table_78636 (
"Nat." text,
"Name" text,
"Since" real,
"App(GS/Sub)" text,
"Goals" real,
"Ends" real,
"Transfer fee" text
) | What is the greatest goals for Curtis Davies if ends is greater than 2012? | SELECT MAX("Goals") FROM table_78636 WHERE "Name" = 'curtis davies' AND "Ends" > '2012' | wikisql |
CREATE TABLE table_train_234 (
"id" int,
"orthostatic_hypotension" bool,
"systolic_blood_pressure_sbp" int,
"estimated_glomerular_filtration_rate_egfr" int,
"postural_fall_of_dbp" int,
"diastolic_blood_pressure_dbp" int,
"postural_fall_of_sbp" int,
"allergy_to_sglt_2_inhibitors" bool,
... | orthostatic hypotension defined as standing bp < 100 / 60 or postural fall of sbp > 20 or dbp > 10 | SELECT * FROM table_train_234 WHERE orthostatic_hypotension = 1 OR (systolic_blood_pressure_sbp < 100 OR diastolic_blood_pressure_dbp < 60 OR postural_fall_of_sbp > 20 OR postural_fall_of_dbp > 10) | criteria2sql |
CREATE TABLE pitching (
player_id TEXT,
year INTEGER,
stint INTEGER,
team_id TEXT,
league_id TEXT,
w INTEGER,
l INTEGER,
g INTEGER,
gs INTEGER,
cg INTEGER,
sho INTEGER,
sv INTEGER,
ipouts NUMERIC,
h INTEGER,
er INTEGER,
hr INTEGER,
bb INTEGER,
so I... | For each year, bin the year into day of the week interval, and return the total number of times the team Boston Red Stockings won in the postseasons using a line chart, could you list in ascending by the X? | SELECT year, SUM(COUNT(*)) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY year | nvbench |
CREATE TABLE table_85 (
"Country" text,
"Players" real,
"Standard" real,
"Minor" real,
"First title" real,
"Last title" real
) | What's the standard of the country who won its first title in 1992? | SELECT MAX("Standard") FROM table_85 WHERE "First title" = '1992' | wikisql |
CREATE TABLE table_37399 (
"Year" text,
"Winner" text,
"Runner-Up" text,
"Semi-Finalists" text,
"Quarter-Finalists" text,
"Last 16" text,
"Last 32" text,
"Last 64" text,
"Total" text
) | Which Runner-Up has a Total of 31,200? | SELECT "Runner-Up" FROM table_37399 WHERE "Total" = '£31,200' | wikisql |
CREATE TABLE table_name_65 (
martyred INTEGER,
canonised VARCHAR,
beatified VARCHAR,
name VARCHAR
) | When was Laurent-Marie-Joseph Imbert / St. Imbert, who was beatified after 1909 and canonised after 1984, martyred? | SELECT MAX(martyred) FROM table_name_65 WHERE beatified > 1909 AND name = "laurent-marie-joseph imbert / st. imbert" AND canonised > 1984 | sql_create_context |
CREATE TABLE table_79016 (
"Year" real,
"US Billboard" real,
"US Cash Box" text,
"US AC" text,
"CAN AC" text,
"Title" text
) | What is the US cash box before 1978 with a US billboard of 35? | SELECT "US Cash Box" FROM table_79016 WHERE "Year" < '1978' AND "US Billboard" = '35' | wikisql |
CREATE TABLE table_20847 (
"City" text,
"Chinese" text,
"Pinyin" text,
"Province" text,
"Urban Population (2010)" real,
"Administrative Population (2010)" real
) | What province has the Chinese translation ? | SELECT COUNT("Province") FROM table_20847 WHERE "Chinese" = '重庆' | wikisql |
CREATE TABLE table_20079 (
"No. in season" real,
"No. disc" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What was the original air date of Stargate SG-1 written by Peter Deluise? | SELECT "Original air date" FROM table_20079 WHERE "Written by" = 'Peter DeLuise' | wikisql |
CREATE TABLE table_name_28 (
status VARCHAR,
country VARCHAR,
name VARCHAR
) | What is the status of the Eng Country from the Maynard name? | SELECT status FROM table_name_28 WHERE country = "eng" AND name = "maynard" | sql_create_context |
CREATE TABLE table_61065 (
"State" text,
"City" text,
"Population" real,
"Violent Crime" text,
"Murder and Non-Negligent Manslaughter" real,
"Forcible Rape" text,
"Robbery" real,
"Aggravated Assault" real,
"Property Crime" text,
"Burglary" real,
"Larceny-Theft" text,
"Mot... | What is the smallest rate of burglary when forcible rape is 39.1 and motor vehicle theft is less than 568.8? | SELECT MIN("Burglary") FROM table_61065 WHERE "Forcible Rape" = '39.1' AND "Motor Vehicle Theft" < '568.8' | wikisql |
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 bar chart shows the distribution of All_Neutral and School_ID , and rank by the bars in descending please. | SELECT All_Neutral, School_ID FROM basketball_match ORDER BY All_Neutral DESC | nvbench |
CREATE TABLE table_train_270 (
"id" int,
"gender" string,
"allergy_to_omega_3" bool,
"serum_low_density_lipoprotein_cholesterol" int,
"stimulated_c_peptide" float,
"allergy_to_dha" bool,
"allergy_to_vitamin_d" bool,
"serum_triglyceride" int,
"age" float,
"NOUSE" float
) | serum triglyceride greater than 500 mg / dl | SELECT * FROM table_train_270 WHERE serum_triglyceride > 500 | criteria2sql |
CREATE TABLE table_23132 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | When michigan technological university (ncaa) is the college, junior, or club team what is the nationality? | SELECT "Nationality" FROM table_23132 WHERE "College/junior/club team" = 'Michigan Technological University (NCAA)' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospita... | did patient 002-40703 get a prescription for percocet, albuterol 90 mcg, or trazodone since 04/2104? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-40703')) AND medication.drugname IN ('percocet', 'albuterol 90 mcg', '... | eicu |
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
)
... | provide the number of patients whose age is less than 50 and item id is 50903? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "50" AND lab.itemid = "50903" | mimicsql_data |
CREATE TABLE table_train_274 (
"id" int,
"gender" string,
"serum_bicarbonate" int,
"randomization_bg" int,
"positive_serum" bool,
"diabetic_ketoacidosis" bool,
"urinary_ketones" bool,
"diastolic_blood_pressure_dbp" int,
"heart_rate" int,
"body_mass_index_bmi" float,
"age" flo... | bmi range: > 25 kg / m^2 and < 45 kg / m^2 | SELECT * FROM table_train_274 WHERE body_mass_index_bmi > 25 AND body_mass_index_bmi < 45 | criteria2sql |
CREATE TABLE Complaints (
complaint_id INTEGER,
product_id INTEGER,
customer_id INTEGER,
complaint_outcome_code VARCHAR(20),
complaint_status_code VARCHAR(20),
complaint_type_code VARCHAR(20),
date_complaint_raised DATETIME,
date_complaint_closed DATETIME,
staff_id INTEGER
)
CREATE ... | List the name of all products along with the number of complaints that they have received with a bar chart, and I want to rank by the x axis in ascending please. | SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY product_name | nvbench |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_... | i'd like to fly CO between BOSTON and PHILADELPHIA | 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... | atis |
CREATE TABLE table_8421 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | what is the score that has tie number 27 | SELECT "Score" FROM table_8421 WHERE "Tie no" = '27' | wikisql |
CREATE TABLE table_name_35 (
leading_scorer VARCHAR,
visitor VARCHAR
) | Who was the leading scorer that was a visitor of the Trail Blazers? | SELECT leading_scorer FROM table_name_35 WHERE visitor = "trail blazers" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
... | 患者姜依云为疾病Q41.778,门诊诊断的检测指标024672的结果定量及其单位分别是什么? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb 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.JZ... | css |
CREATE TABLE table_74606 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which venue has a crowd over 16,000 and a home team score of 7.7 (49)? | SELECT "Venue" FROM table_74606 WHERE "Crowd" > '16,000' AND "Home team score" = '7.7 (49)' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.