context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_14 (
founded INTEGER,
league VARCHAR,
club VARCHAR
) | Which Founded has a League of women's flat track derby association, and a Club of omaha rollergirls? | SELECT AVG(founded) FROM table_name_14 WHERE league = "women's flat track derby association" AND club = "omaha rollergirls" | sql_create_context |
CREATE TABLE table_58465 (
"Number & Name" text,
"Description" text,
"Livery" text,
"Owner(s)" text,
"Date" text
) | What is the number & name with an Undergoing overhaul, restoration or repairs date? | SELECT "Number & Name" FROM table_58465 WHERE "Date" = 'undergoing overhaul, restoration or repairs' | wikisql |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE SuggestedEdits (
Id number,
Pos... | Questions and answers per month for a specific tag ID. How many questions per month does each tag in the top 10 tags get | SELECT Month, PostTypeId, COUNT(*) AS count FROM (SELECT Id, PostTypeId, DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) AS "month" FROM Posts) AS tmp GROUP BY PostTypeId, Month ORDER BY PostTypeId, Month | sede |
CREATE TABLE table_10298 (
"Name" text,
"Type" text,
"Local board" text,
"Suburb" text,
"Authority" text,
"Decile" real
) | What is the sum for every value of Decile in Clendon? | SELECT SUM("Decile") FROM table_10298 WHERE "Suburb" = 'clendon' | wikisql |
CREATE TABLE table_37043 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What's the stadium on November 8? | SELECT "Home" FROM table_37043 WHERE "Date" = 'november 8' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
... | no of entries in badge. | SELECT COUNT(*) FROM Badges | sede |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
... | what was patient 11823's arterial bp mean average on 11/27/last year? | SELECT AVG(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 = 11823)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... | mimic_iii |
CREATE TABLE table_name_62 (
tracking_method VARCHAR,
supported_databases VARCHAR,
name VARCHAR
) | Which tracking method supports MySQL databases and is named Open Web Analytics? | SELECT tracking_method FROM table_name_62 WHERE supported_databases = "mysql" AND name = "open web analytics" | sql_create_context |
CREATE TABLE customers (
customer_id number,
customer_details text
)
CREATE TABLE payments (
payment_id number,
settlement_id number,
payment_method_code text,
date_payment_made time,
amount_payment number
)
CREATE TABLE customer_policies (
policy_id number,
customer_id number,
... | Find the settlement amount of the claim with the largest claim amount. Show both the settlement amount and claim amount. | SELECT amount_settled, amount_claimed FROM claims ORDER BY amount_claimed DESC LIMIT 1 | spider |
CREATE TABLE table_25030512_12 (
party VARCHAR,
incumbent VARCHAR
) | When bill young redistricted from the 10th district is the incumbent what is the party? | SELECT party FROM table_25030512_12 WHERE incumbent = "Bill Young Redistricted from the 10th district" | sql_create_context |
CREATE TABLE table_35209 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | How many people attended the game that had the Clippers as visiting team? | SELECT "Attendance" FROM table_35209 WHERE "Visitor" = 'clippers' | wikisql |
CREATE TABLE table_1342233_24 (
incumbent VARCHAR,
first_elected VARCHAR
) | What is the incumbent from 1941? | SELECT incumbent FROM table_1342233_24 WHERE first_elected = 1941 | sql_create_context |
CREATE TABLE table_64396 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | What is the away team at the game with a Tie no of 2? | SELECT "Away team" FROM table_64396 WHERE "Tie no" = '2' | wikisql |
CREATE TABLE table_75721 (
"1890s" text,
"1890\u201391" text,
"1891\u201392" text,
"1892\u201393" text,
"1893\u201394" text
) | What is the year from 1891-92 from the years 1890s to the 1960s? | SELECT "1891\u201392" FROM table_75721 WHERE "1890s" = '1960s' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
... | what percentile is the calculated total co2 value of 32.0 in the same age group as patient 25847 during the first hospital encounter? | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE adm... | mimic_iii |
CREATE TABLE table_43929 (
"Sport" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the smallest number of silvers associated with bronzes under 20, totals of 1, golds of 0, and in Water Polo? | SELECT MIN("Silver") FROM table_43929 WHERE "Bronze" < '20' AND "Total" = '1' AND "Sport" = 'water polo' AND "Gold" < '0' | wikisql |
CREATE TABLE table_name_15 (
year VARCHAR,
qual VARCHAR
) | The 147.481 Qual, happened in what year? | SELECT year FROM table_name_15 WHERE qual = "147.481" | sql_create_context |
CREATE TABLE table_64781 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
) | What is the district of Paraswada with none reserved? | SELECT "District" FROM table_64781 WHERE "Reserved for ( SC / ST /None)" = 'none' AND "Name" = 'paraswada' | wikisql |
CREATE TABLE table_79125 (
"Date" text,
"Opponents" text,
"H / A" text,
"Result F \u2013 A" text,
"Attendance" real
) | Which Result F-A has Opponents of rosenborg? | SELECT "Result F \u2013 A" FROM table_79125 WHERE "Opponents" = 'rosenborg' | wikisql |
CREATE TABLE table_49858 (
"Player" text,
"Team" text,
"Matches" real,
"Innings" real,
"Runs" real,
"Average" real,
"Highest Score" text,
"100s" real
) | What was Donald Bradman's average runs? | SELECT AVG("Runs") FROM table_49858 WHERE "Player" = 'donald bradman' | wikisql |
CREATE TABLE table_name_28 (
driver VARCHAR,
q1_order VARCHAR,
q1_pos VARCHAR
) | Driver at larger than 10 with a Q1 of 18. | SELECT driver FROM table_name_28 WHERE q1_order > 10 AND q1_pos = 18 | sql_create_context |
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 demographic (... | how many patients on medicare insurance had retention urine nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.short_title = "Retention urine NOS" | mimicsql_data |
CREATE TABLE table_3475 (
"District" real,
"Representative" text,
"Party" text,
"Residence" text,
"First Elected" text,
"Term Limited" real
) | If the residence is Chagrin falls, who is the representative? | SELECT "Representative" FROM table_3475 WHERE "Residence" = 'Chagrin Falls' | wikisql |
CREATE TABLE table_78584 (
"Season" text,
"Division North" text,
"Division South" text,
"Division East" text,
"Division West" text,
"Division Southwest" text
) | Who won Division North when Division Southwest was won by Novaci and Division West by Vrap i te? | SELECT "Division North" FROM table_78584 WHERE "Division Southwest" = 'novaci' AND "Division West" = 'vrapčište' | 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... | Show me about the distribution of All_Road and ACC_Percent in a bar chart. | SELECT All_Road, ACC_Percent FROM basketball_match | nvbench |
CREATE TABLE table_56201 (
"Driver" text,
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyre" text
) | What entrant has a P tyre and was constructed by Alfa Romeo? | SELECT "Entrant" FROM table_56201 WHERE "Tyre" = 'p' AND "Constructor" = 'alfa romeo' | wikisql |
CREATE TABLE table_name_40 (
label VARCHAR,
region VARCHAR
) | What is Label, when Region is Japan? | SELECT label FROM table_name_40 WHERE region = "japan" | sql_create_context |
CREATE TABLE table_68473 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | Who played as Team 2 against Team 1 SC Gagnoa? | SELECT "Team 2" FROM table_68473 WHERE "Team 1" = 'sc gagnoa' | wikisql |
CREATE TABLE table_60523 (
"Pick #" real,
"Player" text,
"Nationality" text,
"Position" text,
"NHL team" text,
"Team from" text,
"League from" text
) | What is the nationality of player Jani Hakanpaa? | SELECT "Nationality" FROM table_60523 WHERE "Player" = 'jani hakanpaa' | wikisql |
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE competition (
Competition_ID int,
Year real,
... | For all players, show the proportion of the club name they come from. | SELECT T1.name, COUNT(T1.name) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID GROUP BY T1.name | nvbench |
CREATE TABLE table_name_85 (
production_num INTEGER,
series VARCHAR,
title VARCHAR
) | What is the smallest production number for the LT series with the Dumb Patrol title? | SELECT MIN(production_num) FROM table_name_85 WHERE series = "lt" AND title = "dumb patrol" | sql_create_context |
CREATE TABLE table_name_55 (
rank VARCHAR,
location VARCHAR
) | What is the rank when the game was at dnipro stadium , kremenchuk? | SELECT rank FROM table_name_55 WHERE location = "dnipro stadium , kremenchuk" | sql_create_context |
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,... | 患者27615170在13年4月2日到21年3月6日内被开出的所有检验报告单的科室编码以及名称都是什么? | SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb... | css |
CREATE TABLE table_46448 (
"Tournament" text,
"1984" text,
"1985" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text... | What is the 1986 value with A in 1991 and A in 1987? | SELECT "1986" FROM table_46448 WHERE "1991" = 'a' AND "1987" = 'a' | wikisql |
CREATE TABLE table_203_447 (
id number,
"constituency" number,
"region" text,
"name" text,
"party" text,
"last elected" number
) | what is the last region listed on the table ? | SELECT "region" FROM table_203_447 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_name_77 (
loci VARCHAR,
software VARCHAR
) | Is there Loci in the Cinderella software? | SELECT loci FROM table_name_77 WHERE software = "cinderella" | sql_create_context |
CREATE TABLE table_204_743 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | how many laps in total is the race ? | SELECT MAX("laps") FROM table_204_743 | squall |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | what are the three most frequently ordered laboratory tests until 2103 for patients with age 20s? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) AND STRFTIME('%y', labevents.c... | mimic_iii |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABL... | Query that selects unicorns with high legs but small cornsibutions.. | SELECT p.Id AS "post_link", u.Id AS "user_link", u.Reputation, LENGTH(p.Body) AS "length" FROM Posts AS p JOIN Users AS u ON p.OwnerUserId = u.Id ORDER BY u.Reputation / (LENGTH(p.Body) + 1) DESC LIMIT 1000 | sede |
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 patients whose primary disease is hyperglycemia;hyponatremia and procedure short title is insert 2 vascular stents? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA" AND procedures.short_title = "Insert 2 vascular stents" | mimicsql_data |
CREATE TABLE table_76053 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What are the highest wins with cuts smaller than 6, events of 4 and a top-5 smaller than 0? | SELECT MAX("Wins") FROM table_76053 WHERE "Cuts made" < '6' AND "Events" = '4' AND "Top-5" < '0' | wikisql |
CREATE TABLE Attribute_Definitions (
attribute_id INTEGER,
attribute_name VARCHAR(30),
attribute_data_type VARCHAR(10)
)
CREATE TABLE Catalog_Contents_Additional_Attributes (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
attribute_id INTEGER,
attribute_value VARCHAR(255)
)
CREATE... | Which catalog contents has price above 700 dollars? Show their catalog entry names and capacities with a pie chart. | SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700 | nvbench |
CREATE TABLE table_48415 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | What is the highest ERP W with a w216bo call sign? | SELECT MAX("ERP W") FROM table_48415 WHERE "Call sign" = 'w216bo' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | how many times patient 004-11043 until 2 years ago undergoes neuromuscular blocking agent - rocuronium? | SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-11043')) AND treatment.treatmentname = 'neuromuscular blocking agent - rocur... | eicu |
CREATE TABLE table_12606 (
"Engine" text,
"Capacity (l)" real,
"Power (hp)" real,
"Torque" text,
"Used" text
) | When was power (hp) less than 93 for the OM324 engine used? | SELECT "Used" FROM table_12606 WHERE "Power (hp)" < '93' AND "Engine" = 'om324' | wikisql |
CREATE TABLE zyb (
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... | 参照不同科室的名字和不一样的入院诊断算一算医院8435928所有的记录里患者平均有多少岁,保存里面平均年纪不大于29岁的记录 | SELECT qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '8435928' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_NM HAVING AVG(qtb.PERSON_AGE) < 29 UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '8435928' GROUP... | css |
CREATE TABLE table_name_85 (
rank INTEGER,
country VARCHAR
) | Which highest rank belongs to the palestinian territories? | SELECT MAX(rank) FROM table_name_85 WHERE country = "palestinian territories" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE o... | what was the name of the lab test, which patient 5828 first received in this month? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month'... | mimic_iii |
CREATE TABLE table_name_20 (
school_club_team VARCHAR,
player VARCHAR
) | Which team was Roy de Walt a player on? | SELECT school_club_team FROM table_name_20 WHERE player = "roy de walt" | sql_create_context |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
e... | List the name and the number of stations for all the cities that have at least 15 stations with a bar chart, and show by the y-axis from low to high please. | SELECT city, COUNT(*) FROM station GROUP BY city ORDER BY COUNT(*) | nvbench |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE compartment_cla... | what does EWR stand for | SELECT DISTINCT airport_code FROM airport WHERE airport_code = 'EWR' | atis |
CREATE TABLE table_11365 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text
) | Name the object type with an NGC number more than 6638 and right ascensions being 18h25m37.8s | SELECT "Object type" FROM table_11365 WHERE "NGC number" > '6638' AND "Right ascension ( J2000 )" = '18h25m37.8s' | wikisql |
CREATE TABLE table_16009 (
"Nomination" text,
"Actors Name" text,
"Film Name" text,
"Director" text,
"Country" text
) | What was the film that vadim ilyenko directed? | SELECT "Film Name" FROM table_16009 WHERE "Director" = 'Vadim Ilyenko' | 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... | Compute the total team_id across all games as a pie chart. | SELECT All_Games, Team_ID FROM basketball_match | nvbench |
CREATE TABLE table_5587 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
) | Who is the opponent of the game that had a record of 24-26-4? | SELECT "Opponent" FROM table_5587 WHERE "Record" = '24-26-4' | wikisql |
CREATE TABLE table_name_55 (
driver VARCHAR,
chassis VARCHAR,
rounds VARCHAR
) | What driver went 14 rounds with a 193 Chassis? | SELECT driver FROM table_name_55 WHERE chassis = "193" AND rounds = "14" | sql_create_context |
CREATE TABLE table_33160 (
"Province" text,
"Inhabitants" real,
"President" text,
"Party" text,
"Election" real
) | What is the average election for vicenza province with the liga veneta party? | SELECT AVG("Election") FROM table_33160 WHERE "Party" = 'liga veneta' AND "Province" = 'vicenza' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | what is the minimum total cost of the hospital that includes the laboratory -polys test until 2104? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = '-polys')) AND STRFTIME('%y', cost.chargetime) <= '2104' GROUP BY cos... | eicu |
CREATE TABLE table_name_45 (
death VARCHAR,
birth VARCHAR
) | when was the death when the birth was 8 december 1542? | SELECT death FROM table_name_45 WHERE birth = "8 december 1542" | sql_create_context |
CREATE TABLE table_56740 (
"Player" text,
"Overs" text,
"Runs" text,
"Wkts" text,
"Mdns" text,
"Econ" text
) | Tell me the wkts for econ of 4.23 | SELECT "Wkts" FROM table_56740 WHERE "Econ" = '4.23' | wikisql |
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE writes (
paperid int,
aut... | what datasets were used by oren etzioni ? | SELECT DISTINCT paperdataset.datasetid FROM author, paper, paperdataset, writes WHERE author.authorname = 'oren etzioni' AND paper.paperid = paperdataset.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
... | is patient 96404 ever prescribed senna during the previous year? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96404) AND prescriptions.drug = 'senna' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE table_6515 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
) | What earliest year with points larger than 68 and a rank of 7th? | SELECT MIN("Year") FROM table_6515 WHERE "Points" > '68' AND "Rank" = '7th' | wikisql |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | How are AOSS 574 and AOSS 321 different ? | SELECT DISTINCT department, description, number FROM course WHERE (department = 'AOSS' AND number = 574) OR (department = 'AOSS' AND number = 321) | advising |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text... | 在医疗就诊25637819176中报告超出6份检验报告单得这些报告人都叫啥名?他们的工号是几号? | SELECT BGRGH, BGRXM FROM jybgb WHERE JZLSH = '25637819176' GROUP BY BGRGH HAVING COUNT(*) > 6 | css |
CREATE TABLE table_name_54 (
départment__or_collectivity_ VARCHAR,
since VARCHAR,
président VARCHAR
) | Which department has Guy-Dominique Kennel as president since 2008? | SELECT départment__or_collectivity_ FROM table_name_54 WHERE since = 2008 AND président = "guy-dominique kennel" | sql_create_context |
CREATE TABLE table_59007 (
"Engine" text,
"Power" text,
"Torque" text,
"0\u2013100km/h (62mph)" text,
"Top speed" text
) | What is the torque of the 6.3l v12 engine? | SELECT "Torque" FROM table_59007 WHERE "Engine" = '6.3l v12' | wikisql |
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 month (
month_number int,
month_name text
)
CREATE TABLE time_zone (
time_zone_code t... | what are the lowest one way fares from ATLANTA to PITTSBURGH | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city... | atis |
CREATE TABLE fgwyjzb (
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,
... | 根据不同的入院诊断疾病名称和科室编码,编码为9224891的医院所有医疗就诊记录中患者的平均年龄列出来都是多少? | SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9224891' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '92248... | css |
CREATE TABLE table_13336122_3 (
title VARCHAR,
directed_by VARCHAR
) | How many episodes have been directed by David Duchovny? | SELECT COUNT(title) FROM table_13336122_3 WHERE directed_by = "David Duchovny" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients had umbilical vein catheterization and csf lab test? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Umbilical vein catheterization" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_name_90 (
venue VARCHAR,
date VARCHAR
) | Which venue had a match played on August 16, 2006? | SELECT venue FROM table_name_90 WHERE date = "august 16, 2006" | 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... | Show me about the distribution of All_Neutral and ACC_Percent in a bar chart, rank by the total number in desc. | SELECT All_Neutral, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC | nvbench |
CREATE TABLE table_33802 (
"Medal" text,
"Name" text,
"Games" text,
"Sport" text,
"Event" text
) | What is the game named derartu tulu category:articles with hcards? | SELECT "Games" FROM table_33802 WHERE "Name" = 'derartu tulu category:articles with hcards' | wikisql |
CREATE TABLE table_name_90 (
tournament VARCHAR
) | What is Tournament, when 2003 is 'A'? | SELECT tournament FROM table_name_90 WHERE 2003 = "a" | 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 diagnosis (
diagn... | tell me the top five most frequent specimens tested? | SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE admissions (
... | when patient 65467 received a procedure for the last time? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65467) ORDER BY procedures_icd.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_70285 (
"Date" text,
"Venue" text,
"Score [A ]" text,
"Competition" text,
"Att." text
) | Which venue was used on 12 September 1998? | SELECT "Venue" FROM table_70285 WHERE "Date" = '12 september 1998' | wikisql |
CREATE TABLE table_train_182 (
"id" int,
"allergy_to_sulfa" bool,
"creatinine_clearance_cl" float,
"liver_disease" bool,
"allergy_to_glyburide" bool,
"allergy_to_metformin" bool,
"NOUSE" float
) | abnormal liver function | SELECT * FROM table_train_182 WHERE liver_disease = 1 | criteria2sql |
CREATE TABLE table_43860 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"Record" text,
"Streak" text
) | Who was the Team that was played against on February 24 and a game after game 55? | SELECT "Team" FROM table_43860 WHERE "Game" > '55' AND "Date" = 'february 24' | wikisql |
CREATE TABLE table_36760 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Which Tournament has an Outcome of winner, and a Surface of hard (i)? | SELECT "Tournament" FROM table_36760 WHERE "Outcome" = 'winner' AND "Surface" = 'hard (i)' | wikisql |
CREATE TABLE table_15869204_5 (
high_assists VARCHAR,
location_attendance VARCHAR
) | Name the high assists for delta center 19,639 | SELECT high_assists FROM table_15869204_5 WHERE location_attendance = "Delta Center 19,639" | sql_create_context |
CREATE TABLE ref_colors (
color_code text,
color_description text
)
CREATE TABLE ref_characteristic_types (
characteristic_type_code text,
characteristic_type_description text
)
CREATE TABLE products (
product_id number,
color_code text,
product_category_code text,
product_name text,
... | What are the names of products that are not 'white' in color and are not measured by the unit 'Handful'? | SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = "white" AND t2.unit_of_measure <> "Handful" | spider |
CREATE TABLE table_15838081_3 (
season__number VARCHAR,
writer_s_ VARCHAR
) | Name the number of season number for jeff truman | SELECT COUNT(season__number) FROM table_15838081_3 WHERE writer_s_ = "Jeff Truman" | sql_create_context |
CREATE TABLE table_12936521_2 (
nickname VARCHAR,
institution VARCHAR
) | What's the nickname of the University of Massachusetts Lowell (UMass Lowell)? | SELECT nickname FROM table_12936521_2 WHERE institution = "University of Massachusetts Lowell (UMass Lowell)" | sql_create_context |
CREATE TABLE table_name_34 (
attendance INTEGER,
opponent VARCHAR,
record VARCHAR
) | How much Attendance has an Opponent of rockies, and a Record of 32-30? | SELECT SUM(attendance) FROM table_name_34 WHERE opponent = "rockies" AND record = "32-30" | sql_create_context |
CREATE TABLE table_24466191_1 (
poles VARCHAR,
position VARCHAR
) | Name the number of poles for 15th position | SELECT COUNT(poles) FROM table_24466191_1 WHERE position = "15th" | sql_create_context |
CREATE TABLE table_name_54 (
goals_for INTEGER,
drawn VARCHAR,
played VARCHAR
) | What is the highest goals for that has a drawn less than 11, with a played less than 42? | SELECT MAX(goals_for) FROM table_name_54 WHERE drawn < 11 AND played < 42 | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
... | users with no questions or answers. Users with no questions | SELECT u.Id AS "user_link", COUNT(p.OwnerUserId) AS "total posts", u.UpVotes, u.DownVotes FROM Users AS u LEFT JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE u.UpVotes + u.DownVotes > 0 GROUP BY u.Id, u.UpVotes, u.DownVotes ORDER BY COUNT(p.OwnerUserId), u.UpVotes DESC | sede |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | when was the first time until 328 days ago that patient 003-54278 had the minimum sao2 for? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-54278')) AND NOT vitalperiodic.sao2 IS NULL AND... | eicu |
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 名叫袁秀筠的患者检测指标634250从09年10月15日到14年10月24日的情况如何? | SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy... | css |
CREATE TABLE table_16185956_1 (
elected VARCHAR,
district VARCHAR
) | How many times was the incumbent elected in Washington 4 district? | SELECT COUNT(elected) FROM table_16185956_1 WHERE district = "Washington 4" | sql_create_context |
CREATE TABLE Companies (
Industry VARCHAR
) | Find the number of companies whose industry is 'Banking' or 'Conglomerate', | SELECT COUNT(*) FROM Companies WHERE Industry = "Banking" OR Industry = "Conglomerate" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, show me about the distribution of headquarter and the sum of manufacturer , and group by attribute headquarter in a bar chart, and show by the Y from high to low. | SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Manufacturer) DESC | nvbench |
CREATE TABLE table_name_61 (
team VARCHAR,
score VARCHAR
) | Which team scored l 87 115 (ot)? | SELECT team FROM table_name_61 WHERE score = "l 87–115 (ot)" | 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... | among patients who took rt heart angiocardiogram this year, what are the top four most frequent lab tests that followed in the same month? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i... | mimic_iii |
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge... | Show the total number of the first year of parties with the theme 'Spring' or 'Teqnology' with a bar chart, and show by the the number of first year in ascending. | SELECT First_year, COUNT(First_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" GROUP BY First_year ORDER BY COUNT(First_year) | nvbench |
CREATE TABLE table_20031 (
"State" text,
"Date of Polls" text,
"Seats (ACs)" real,
"Date of Counting" text,
"Incumbent" text,
"Election Winner" text
) | How many dates of polls occur in the Madhya Pradesh state? | SELECT COUNT("Date of Polls") FROM table_20031 WHERE "State" = 'Madhya Pradesh' | wikisql |
CREATE TABLE table_27973624_1 (
number_of_fixtures INTEGER
) | What is the lowest number of fixtures? | SELECT MIN(number_of_fixtures) FROM table_27973624_1 | sql_create_context |
CREATE TABLE table_name_76 (
home_team VARCHAR,
venue VARCHAR
) | Who was the home team at the game held at Princes Park? | SELECT home_team FROM table_name_76 WHERE venue = "princes park" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.