context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_15652027_1 (
sexual_abuse_1 INTEGER,
conflict VARCHAR
) | What is the sexual abuse rate where the conflict is the Burundi Civil War? | SELECT MIN(sexual_abuse_1) FROM table_15652027_1 WHERE conflict = "Burundi Civil War" | sql_create_context |
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETI... | What is the code of each role and the number of employees in each role Show bar chart, and order by the y axis in desc please. | SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_76366 (
"Poll source" text,
"Dates administered" text,
"Arlen Specter*" text,
"Pat Toomey" text,
"Tom Ridge*" text,
"Peg Luksik" text
) | Which Tom Ridge* has a Pat Toomey of 60%, and a Poll source of suffolk? | SELECT "Tom Ridge*" FROM table_76366 WHERE "Pat Toomey" = '60%' AND "Poll source" = 'suffolk' | wikisql |
CREATE TABLE table_26615633_1 (
species VARCHAR,
jewel VARCHAR
) | What is the species when jewel is coal? | SELECT species FROM table_26615633_1 WHERE jewel = "Coal" | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | count the number of patients whose admission type is elective and ethnicity is hispanic/latino - puerto rican | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" | mimicsql_data |
CREATE TABLE table_18558 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What year was first-elected for the row of Texas 2? | SELECT "First elected" FROM table_18558 WHERE "District" = 'Texas 2' | wikisql |
CREATE TABLE table_2493389_1 (
fat__g_ VARCHAR,
protein__g_ VARCHAR,
calories__1_tbsp__ VARCHAR
) | Name the fat for protein being 4 and calories 80 | SELECT fat__g_ FROM table_2493389_1 WHERE protein__g_ = "4" AND calories__1_tbsp__ = 80 | sql_create_context |
CREATE TABLE table_8094 (
"Poll Source" text,
"Dates administered" text,
"Democrat: Dick Durbin" text,
"Republican: Steve Sauerberg" text,
"Lead Margin" real
) | What is Dick Durbin lead margin in the poll with 59%? | SELECT "Lead Margin" FROM table_8094 WHERE "Democrat: Dick Durbin" = '59%' | wikisql |
CREATE TABLE table_name_10 (
_2007 VARCHAR,
visitors INTEGER,
type VARCHAR
) | How many visitors in 2007 were there for ski jumping hill? | SELECT SUM(visitors), _2007 FROM table_name_10 WHERE type = "ski jumping hill" | sql_create_context |
CREATE TABLE table_name_58 (
series VARCHAR,
game VARCHAR
) | Name the series with game of game 6 | SELECT series FROM table_name_58 WHERE game = "game 6" | sql_create_context |
CREATE TABLE table_64025 (
"Opposing Team" text,
"Against" real,
"Date" text,
"Venue" text,
"Round" text
) | What was the venue on 17/02/2008? | SELECT "Venue" FROM table_64025 WHERE "Date" = '17/02/2008' | wikisql |
CREATE TABLE table_name_27 (
crowd INTEGER,
away_team VARCHAR
) | How many people were in the crowd when the away team was north melbourne? | SELECT SUM(crowd) FROM table_name_27 WHERE away_team = "north melbourne" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | Out of total number of patients admitted before the year 2162, how many had percutaneous (endoscopic) gastrojejunostomy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2162" AND procedures.long_title = "Percutaneous [endoscopic] gastrojejunostomy" | mimicsql_data |
CREATE TABLE table_2178 (
"Pitcher" text,
"Starts" real,
"Wins" real,
"Losses" real,
"No decisions" real,
"Winning %" text,
"Seasons" text
) | stae the least number of wins in 1986 | SELECT MIN("Wins") FROM table_2178 WHERE "Seasons" = '1986' | wikisql |
CREATE TABLE table_name_57 (
away_team VARCHAR,
venue VARCHAR
) | How much did the away team score at victoria park? | SELECT away_team AS score FROM table_name_57 WHERE venue = "victoria park" | sql_create_context |
CREATE TABLE table_204_987 (
id number,
"city/municipality" text,
"no. of\nbarangays" number,
"area\n(km2)" number,
"population\n(2010 census)" number,
"pop. density\n(per km2)" number
) | which other city has the same number of barangays as jalajala | SELECT "city/municipality" FROM table_204_987 WHERE "city/municipality" <> 'jalajala' AND "no. of\nbarangays" = (SELECT "no. of\nbarangays" FROM table_204_987 WHERE "city/municipality" = 'jalajala') | squall |
CREATE TABLE table_35662 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"Career W/L" text
) | Name the 1999 with 2011 of 2r | SELECT "1999" FROM table_35662 WHERE "2011" = '2r' | 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... | when did patient 96842 first have a diagnosis of pleural effusion nos during the last hospital visit? | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'pleural effusion nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96842 AND NOT admissi... | mimic_iii |
CREATE TABLE table_56931 (
"District" real,
"Place of Birth" text,
"Delegate" text,
"Party" text,
"Took Office" real,
"Committee" text
) | How many districts in Baltimore City does Cheryl Glenn dictate? | SELECT COUNT("District") FROM table_56931 WHERE "Place of Birth" = 'baltimore city' AND "Delegate" = 'cheryl glenn' | wikisql |
CREATE TABLE table_62629 (
"Perpetrator" text,
"Date" text,
"Year" real,
"Location" text,
"Country" text,
"Killed" real,
"Injured" text
) | What is the average Year, when Country is 'U.S.', and when Location is 'Edmond , OK'? | SELECT AVG("Year") FROM table_62629 WHERE "Country" = 'u.s.' AND "Location" = 'edmond , ok' | wikisql |
CREATE TABLE table_1376890_2 (
chroma_format VARCHAR,
name VARCHAR
) | how many chroma format with name being high profile | SELECT COUNT(chroma_format) FROM table_1376890_2 WHERE name = "High profile" | sql_create_context |
CREATE TABLE minor_in (
stuid number,
dno number
)
CREATE TABLE course (
cid text,
cname text,
credits number,
instructor number,
days text,
hours text,
dno number
)
CREATE TABLE enrolled_in (
stuid number,
cid text,
grade text
)
CREATE TABLE faculty (
facid number... | What are the first names for all faculty professors, ordered by first name? | SELECT fname FROM faculty WHERE rank = "Professor" ORDER BY fname | spider |
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, return a bar chart about the distribution of name and the sum of manufacturer , and group by attribute name, and list X-axis in ascending order. | SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name | nvbench |
CREATE TABLE table_203_762 (
id number,
"#" number,
"date" text,
"film" text,
"gross" text,
"notes" text
) | what was the last title in 2002 to gross the most money ? | SELECT "film" FROM table_203_762 ORDER BY "gross" DESC LIMIT 1 | squall |
CREATE TABLE table_26249 (
"No" real,
"Player" text,
"Height (m)" text,
"Height (f)" text,
"Position" text,
"Year born" real,
"Current Club" text
) | How many current clubs have the player Aigars Vitols? | SELECT COUNT("Current Club") FROM table_26249 WHERE "Player" = 'Aigars Vitols' | wikisql |
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,
... | 看看之前患者97868786有哪些异常反应 | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG... | css |
CREATE TABLE table_34907 (
"Season" text,
"Team" text,
"Country" text,
"Division" real,
"Apps" real,
"Goals" real
) | What is the lowest value for apps in 2009 season in a division less than 1? | SELECT MIN("Apps") FROM table_34907 WHERE "Season" = '2009' AND "Division" < '1' | wikisql |
CREATE TABLE table_name_87 (
coaster_name VARCHAR,
location VARCHAR
) | Which coaster is located in sandusky, Ohio? | SELECT coaster_name FROM table_name_87 WHERE location = "sandusky, ohio" | sql_create_context |
CREATE TABLE table_204_397 (
id number,
"rank" text,
"team" text,
"athletes" text,
"run 1" text,
"run 2" text,
"run 3" text,
"run 4" text,
"final" text
) | what team comes after italy -lrb- ita -rrb- italy i ? | SELECT "team" FROM table_204_397 WHERE id = (SELECT id FROM table_204_397 WHERE "team" = 'italy (ita) italy i') + 1 | squall |
CREATE TABLE Order_Items (
product_id VARCHAR,
total_amount_purchased INTEGER
)
CREATE TABLE Product_Suppliers (
product_id VARCHAR,
total_amount_purchased INTEGER
) | Return the ids of all products that were ordered more than three times or supplied more than 80000. | SELECT product_id FROM Order_Items GROUP BY product_id HAVING COUNT(*) > 3 UNION SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING SUM(total_amount_purchased) > 80000 | sql_create_context |
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,... | 医疗就诊76156541293中,支出的统筹基金占医疗费总额的比例是多少 | SELECT (SELECT OVE_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '76156541293') / (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '76156541293') | css |
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... | Give me the comparison about the amount of All_Home over the All_Home , and group by attribute All_Home by a bar chart, and sort in asc by the total number. | SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY COUNT(All_Home) | nvbench |
CREATE TABLE table_12976038_1 (
episode__number VARCHAR,
viewers__in_millions_ VARCHAR
) | What number episode had 5.74 million viewers? | SELECT episode__number FROM table_12976038_1 WHERE viewers__in_millions_ = "5.74" | sql_create_context |
CREATE TABLE table_33095 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | When did the 1966 Cleveland Browns play the Green Bay Packers? | SELECT "Date" FROM table_33095 WHERE "Opponent" = 'green bay packers' | wikisql |
CREATE TABLE table_29515 (
"Year" text,
"Summits" text,
"Country" text,
"Continent" text,
"Elevation ft" real,
"Elevation m" real
) | what was the lowest elevation in april 2006? | SELECT MIN("Elevation ft") FROM table_29515 WHERE "Year" = 'April 2006' | wikisql |
CREATE TABLE table_33790 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the home team's score when they played Richmond? | SELECT "Home team score" FROM table_33790 WHERE "Away team" = 'richmond' | wikisql |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | A bar chart shows the distribution of meter_500 and meter_100 . | SELECT meter_500, meter_100 FROM swimmer | nvbench |
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,
... | has any organism been observed in the last microbiological examination of patient 031-9128's other since 92 months ago? | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-9128')) AND microlab.culturesite = 'other' AND DATETIME(microlab.cultureta... | eicu |
CREATE TABLE table_name_78 (
nation_of_citizenship VARCHAR,
type_of_vehicle VARCHAR,
year VARCHAR
) | What Nation of citizenship has a stock car vehicle with a year of 1999? | SELECT nation_of_citizenship FROM table_name_78 WHERE type_of_vehicle = "stock car" AND year = 1999 | sql_create_context |
CREATE TABLE table_69765 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What is the lowest number of losses for the club c diz cf? | SELECT MIN("Losses") FROM table_69765 WHERE "Club" = 'cádiz cf' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | when had patient 004-28929 had urine output for the first time since 1249 days ago? | 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 = '004-28929')) AND intakeoutput.cellpath LIKE '%output%... | eicu |
CREATE TABLE business (
bid int,
business_id varchar,
name varchar,
full_address varchar,
city varchar,
latitude varchar,
longitude varchar,
review_count bigint,
is_open tinyint,
rating float,
state varchar
)
CREATE TABLE checkin (
cid int,
business_id varchar,
c... | How many reviews has Michelle written in March 2014 ? | SELECT COUNT(DISTINCT (review.text)) FROM review, user WHERE review.month = 'March' AND review.year = 2014 AND user.name = 'Michelle' AND user.user_id = review.user_id | yelp |
CREATE TABLE table_65170 (
"Eliminated" text,
"Tag Team" text,
"Entered" real,
"Eliminated by" text,
"Time" text
) | Which Eliminated has a Tag Team of jindrak and cade? | SELECT "Eliminated by" FROM table_65170 WHERE "Tag Team" = 'jindrak and cade' | wikisql |
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 the relation between team id and acc_percent for each All_Home using a scatter chart | SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Home | nvbench |
CREATE TABLE table_name_62 (
rank VARCHAR,
player VARCHAR,
wins VARCHAR
) | What is the rank for bob murphy with under 4 wins? | SELECT COUNT(rank) FROM table_name_62 WHERE player = "bob murphy" AND wins < 4 | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Rank users by number of questions and give average vote N>10. | SELECT * FROM (SELECT u.DisplayName AS UserName, COUNT(*) AS Nquestions, SUM(q.Score) AS TotalVotes, ROUND(SUM(q.Score) / (1.0 * COUNT(*)), 2) AS AverageVotes FROM Posts AS q INNER JOIN Users AS u ON q.OwnerUserId = u.Id WHERE q.PostTypeId = 1 GROUP BY u.DisplayName) AS a WHERE a.Nquestions > 10 ORDER BY a.AverageVotes... | sede |
CREATE TABLE table_name_53 (
match INTEGER,
opponent_team VARCHAR,
home_away VARCHAR
) | What was the highest match when the away opponent was Dalian Shide Siwu? | SELECT MAX(match) FROM table_name_53 WHERE opponent_team = "dalian shide siwu" AND home_away = "away" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_... | had patient 62298 been diagnosed as hpt b chrn wo cm wo dlta in this year? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hpt b chrn wo cm wo dlta') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 62298) AND DATETIME(diagnose... | mimic_iii |
CREATE TABLE table_name_28 (
decision VARCHAR,
home VARCHAR
) | What is the Decision listed when the Home was Colorado? | SELECT decision FROM table_name_28 WHERE home = "colorado" | sql_create_context |
CREATE TABLE table_63070 (
"Frequency" text,
"Call sign" text,
"Branding" text,
"Format" text,
"Owner" text
) | What is the frequency for the radio owned by bell media with a call sign of chsu-fm? | SELECT "Frequency" FROM table_63070 WHERE "Owner" = 'bell media' AND "Call sign" = 'chsu-fm' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,... | Easiest Challenges (most answers) with no Answer Containing.... | SELECT p.Id AS "post_link", MAX(p.AnswerCount) AS "Answer Count", COUNT(p.Id) FROM Posts AS p JOIN Posts AS q ON p.Id = q.ParentId WHERE p.PostTypeId = 1 AND NOT q.Body COLLATE SQL_Latin1_General_CP1_CI_AI LIKE '%Brain-Flak%' AND p.ClosedDate IS NULL GROUP BY p.Id ORDER BY 'Answer Count' DESC | sede |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | Draw a bar chart about the distribution of Name and Weight . | SELECT Name, Weight FROM people | nvbench |
CREATE TABLE table_name_7 (
nominee VARCHAR,
outcome VARCHAR,
category VARCHAR
) | Which nominee won the award for Fourth Best Indian Film? | SELECT nominee FROM table_name_7 WHERE outcome = "won" AND category = "fourth best indian film" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | what is maximum age of patients whose insurance is medicaid and ethnicity is hispanic or latino? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.ethnicity = "HISPANIC OR LATINO" | mimicsql_data |
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 lab (
subject_id text,
hadm_id text,
... | how many patients whose primary disease is acidosis and drug route is pr? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "ACIDOSIS" AND prescriptions.route = "PR" | mimicsql_data |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
... | patient 81461 had been diagnosed with a mitral/aortic val insuff since 1 year ago? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'mitral/aortic val insuff') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81461) AND DATETIME(diagnose... | mimic_iii |
CREATE TABLE mailshot_campaigns (
mailshot_id number,
product_category text,
mailshot_name text,
mailshot_start_date time,
mailshot_end_date time
)
CREATE TABLE products (
product_id number,
product_category text,
product_name text
)
CREATE TABLE premises (
premise_id number,
p... | Find the types and details for all premises and order by the premise type. | SELECT premises_type, premise_details FROM premises ORDER BY premises_type | spider |
CREATE TABLE table_75599 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
) | Which Wins is the highest one that has a Class of 500cc, and Points smaller than 6? | SELECT MAX("Wins") FROM table_75599 WHERE "Class" = '500cc' AND "Points" < '6' | wikisql |
CREATE TABLE table_19662262_6 (
strike_rate VARCHAR,
wickets VARCHAR
) | What is the strike rate when there are 17 wickets? | SELECT strike_rate FROM table_19662262_6 WHERE wickets = 17 | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Weaksauce Rep Per Character. This is dirty because it doesn't strip HTML tags | SELECT PostID = p.Id, u.DisplayName, AnswerRep = p.Score * 10, AnswerLength = (LENGTH(p.Body)), RepPerChar = CAST((p.Score * 10) AS FLOAT(23, 13)) / CAST((LENGTH(p.Body)) AS FLOAT(23, 13)) FROM Users AS u JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE p.PostTypeId = 2 ORDER BY u.DisplayName DESC | sede |
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
) | What are the names of climbers and the corresponding heights of the mountains that they climb Show bar chart, display by the Y-axis from high to low please. | SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T2.Height DESC | nvbench |
CREATE TABLE table_203_406 (
id number,
"entrant" text,
"constructor" text,
"chassis" text,
"engine" text,
"tyre" text,
"driver" text,
"rounds" text
) | what brand has been constructor the most ? | SELECT "constructor" FROM table_203_406 GROUP BY "constructor" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_name_69 (
city VARCHAR,
iata VARCHAR
) | Where has an IATA of BVA? | SELECT city FROM table_name_69 WHERE iata = "bva" | sql_create_context |
CREATE TABLE table_train_8 (
"id" int,
"white_blood_cell_count_wbc" int,
"systolic_blood_pressure_sbp" int,
"active_infection" bool,
"intention_to_arterial_catheter" bool,
"temperature" float,
"intention_to_central_venous_catheter" bool,
"sepsis" bool,
"heart_rate" int,
"paco2" f... | intention to place a central venous catheter. | SELECT * FROM table_train_8 WHERE intention_to_central_venous_catheter = 1 | criteria2sql |
CREATE TABLE table_1952057_5 (
super_bowl_championships INTEGER,
team VARCHAR
) | If the team in the New England Patriots, what is the super bowl championship minimum number? | SELECT MIN(super_bowl_championships) FROM table_1952057_5 WHERE team = "New England Patriots" | sql_create_context |
CREATE TABLE table_64051 (
"Rank" real,
"Lane" real,
"Athlete" text,
"Nationality" text,
"Time" real,
"React" real
) | What is the highest rank of an athlete from Belgium with react greater than 0.162? | SELECT MAX("Rank") FROM table_64051 WHERE "Nationality" = 'belgium' AND "React" > '0.162' | wikisql |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
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 ... | i want a flight from LOS ANGELES to PITTSBURGH that arrives before 1500 on tuesday | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 22 AND da... | atis |
CREATE TABLE table_name_93 (
total INTEGER,
gold VARCHAR,
silver VARCHAR
) | What is the average total medals of the team with 2 gold and less than 1 silver? | SELECT AVG(total) FROM table_name_93 WHERE gold = 2 AND silver < 1 | sql_create_context |
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE game (
... | Show me how many home team by home team in a histogram, and I want to show by the bar in ascending. | SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team ORDER BY Home_team | nvbench |
CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
... | Show the number of cities in each country with a bar chart, and order y axis from high to low order. | SELECT T2.Name, COUNT(T2.Name) FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID GROUP BY T2.Name ORDER BY COUNT(T2.Name) DESC | nvbench |
CREATE TABLE table_name_24 (
place_of_birth VARCHAR,
committee VARCHAR,
district VARCHAR
) | Where was the delegate belonging to the Judiciary committee of district 43 born? | SELECT place_of_birth FROM table_name_24 WHERE committee = "judiciary" AND district = 43 | 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, give me the comparison about the average of price over the name , and group by attribute name by a bar chart, and order X-axis in asc order. | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE tweets (
id number,
uid number,
text text,
createdate time
)
CREATE TABLE follows (
f1 number,
f2 number
)
CREATE TABLE user_profiles (
uid number,
name text,
email text,
partitionid number,
followers number
) | Find the name of each user and number of tweets tweeted by each of them. | SELECT T1.name, COUNT(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid | spider |
CREATE TABLE table_1341598_44 (
district VARCHAR,
incumbent VARCHAR
) | What district is incumbent jack hightower from? | SELECT district FROM table_1341598_44 WHERE incumbent = "Jack Hightower" | sql_create_context |
CREATE TABLE table_47723 (
"Dates" text,
"Tournament" text,
"Prize fund ( \uffe5 )" real,
"Winner" text,
"OWGR pts" real
) | Which OWGR pts has Dates of may 10-13? | SELECT SUM("OWGR pts") FROM table_47723 WHERE "Dates" = 'may 10-13' | wikisql |
CREATE TABLE table_name_89 (
d_43_√ VARCHAR,
d_46_√ VARCHAR
) | Name the D 43 when it has D 46 of d 26 | SELECT d_43_√ FROM table_name_89 WHERE d_46_√ = "d 26" | sql_create_context |
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,
... | 编号为06771484381的检验报告单相对应的就诊流水号是多少号? | SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGDH = '06771484381' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb.BGDH = '06771484381' | css |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 患者43539557患有牙本质过敏症,门诊诊断的检测指标945661的结果定量及其单位都均为? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb... | css |
CREATE TABLE table_name_65 (
played INTEGER,
position INTEGER
) | What is the total number of played for the entry with a position of less than 1? | SELECT SUM(played) FROM table_name_65 WHERE position < 1 | sql_create_context |
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,
... | 医疗记录中对于潘莹玉患者医疗费总额高于2220.31元的所以出院诊断疾病编码和名称都分别是什么呢? | SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '潘莹玉' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2220.31) UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '潘莹玉' AND fgwyjzb.M... | css |
CREATE TABLE table_204_282 (
id number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text,
"#" number
) | what is the number of times friendly appears as a competition ? | SELECT COUNT(*) FROM table_204_282 WHERE "competition" = 'friendly' | squall |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Questions with no answers and no comments. | SELECT p.Id AS "post_link", p.ViewCount FROM Posts AS p WHERE p.PostTypeId = 2 AND p.Score <= -1 AND p.ClosedDate IS NULL AND COALESCE(p.CommentCount, 0) = 0 ORDER BY p.CreationDate DESC, p.ViewCount DESC LIMIT 10 | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | how many patients whose ethnicity is hispanic/latino - puerto rican and diagnoses icd9 code is 69514? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND diagnoses.icd9_code = "69514" | mimicsql_data |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
... | Consicutive week from the current date. | WITH weeks(week) AS (SELECT DISTINCT DATEPART(year, CreationDate) * 100 + DATEPART(week, CreationDate) FROM Posts WHERE OwnerUserId = 2332443), groups AS (SELECT ROW_NUMBER() OVER (ORDER BY week) AS rn, DATEADD(day, -ROW_NUMBER() OVER (ORDER BY week), week) AS grp, week FROM weeks) SELECT COUNT(*) AS consecutiveWeeks, ... | sede |
CREATE TABLE table_name_25 (
home_or_away VARCHAR,
shirt_number INTEGER
) | Can you tell me the Home or the Away that has the Shirt Number larger than 18? | SELECT home_or_away FROM table_name_25 WHERE shirt_number > 18 | sql_create_context |
CREATE TABLE table_31624 (
"Year" text,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text
) | What year did huang nanyan yang wei play women's doubles and Men's doubles was played by lee dong-soo yoo yong-sung? | SELECT "Year" FROM table_31624 WHERE "Women's doubles" = 'huang nanyan yang wei' AND "Men's doubles" = 'lee dong-soo yoo yong-sung' | wikisql |
CREATE TABLE table_42693 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | How many points have a difference of 23, with a drawn less than 5? | SELECT COUNT("Points") FROM table_42693 WHERE "Difference" = '23' AND "Drawn" < '5' | wikisql |
CREATE TABLE table_61398 (
"Military deaths" real,
"Civilian deaths (including foreigners)" real,
"Total deaths" real,
"Military and/or Civilian wounded" text,
"Total casualties" text
) | What is the total number of military deaths when there are 78 military and/or civilian wounded and more than 27 total deaths? | SELECT COUNT("Military deaths") FROM table_61398 WHERE "Military and/or Civilian wounded" = '78' AND "Total deaths" > '27' | wikisql |
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
premise_id INTEGER,
date_address_from DATETIME,
address_type_code VARCHAR(15),
date_address_to DATETIME
)
CREATE TABLE Products (
product_id INTEGER,
product_category VARCHAR(15),
product_name VARCHAR(80)
)
CREATE TABLE Mailshot_Cu... | Show the outcome code of mailshots along with the number of mailshots in each outcome code in a bar chart, list Y in descending order. | SELECT outcome_code, COUNT(*) FROM Mailshot_Customers GROUP BY outcome_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_22822559_8 (
high_rebounds VARCHAR,
record VARCHAR
) | Who had the highest rebounds during the game with a record of 23-47? | SELECT high_rebounds FROM table_22822559_8 WHERE record = "23-47" | sql_create_context |
CREATE TABLE table_30244 (
"Entrant" text,
"Constructor" text,
"Car" text,
"Driver" text,
"Co-driver" text,
"Rounds" text
) | who is the other person where the assistant is paulo babo | SELECT "Driver" FROM table_30244 WHERE "Co-driver" = 'Paulo Babo' | wikisql |
CREATE TABLE table_70717 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
) | What was Olin Dutra's score? | SELECT "Score" FROM table_70717 WHERE "Player" = 'olin dutra' | wikisql |
CREATE TABLE txmzjzjlb (
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... | 以前患者褚学义有哪些门诊诊断记录啊? | SELECT txmzjzjlb.JZZDBM, txmzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN txmzjzjlb 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 WHERE person_info.XM = '褚学义' UNION SELECT ftxmzjzjlb.JZZDBM, ftxmzjzjlb.JZZDSM FROM person_info JO... | css |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE PR... | How many courses for each office? Show me a bar chart. | SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE | nvbench |
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_co... | Show me the number of booking start date by booking start date in a histogram, and order by the total number from low to high. | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings ORDER BY COUNT(booking_start_date) | nvbench |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | what was the medication patient 22897 had been prescribed two times on their first hospital visit? | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22897 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) GROUP BY prescriptions.drug) A... | mimic_iii |
CREATE TABLE table_name_7 (
score VARCHAR,
team_1 VARCHAR
) | What was the score for Team 1 of Stade Lavallois (d1)? | SELECT score FROM table_name_7 WHERE team_1 = "stade lavallois (d1)" | sql_create_context |
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 demographic (
subject_id text,
hadm_id t... | which type of admission did patient jane dillard have? | SELECT demographic.admission_type FROM demographic WHERE demographic.name = "Jane Dillard" | mimicsql_data |
CREATE TABLE table_name_84 (
long INTEGER,
yards VARCHAR,
car VARCHAR
) | Who has a highest Long with 26 Yards and less than 9 Car? | SELECT MAX(long) FROM table_name_84 WHERE yards = "26" AND car < 9 | sql_create_context |
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... | tell me the sex of patient 017-41154. | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '017-41154' | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.