context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE city ( White VARCHAR, County_ID VARCHAR ) CREATE TABLE county_public_safety ( Crime_rate VARCHAR, County_ID VARCHAR )
Show white percentages of cities and the crime rates of counties they are in.
SELECT T1.White, T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID
sql_create_context
CREATE TABLE table_203_125 ( id number, "club" text, "winners" number, "runner-ups" number, "winning years" text, "runner-up years" text )
how many clubs were runner ups after the year 2000 ?
SELECT COUNT("club") FROM table_203_125 WHERE "runner-up years" > 2000
squall
CREATE TABLE table_26811 ( "Episode no." real, "Airdate" text, "Viewers" real, "BBC Three weekly ranking" real, "Cable rank" real )
When did episode number 6 air?
SELECT "Airdate" FROM table_26811 WHERE "Episode no." = '6'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, g...
how many patients underwent a packed cell transfusion two times since 2104?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'packed cell transfusi...
mimic_iii
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 prescription...
count the number of patients who are below the age of 76 and their drug code is imdu30.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "76" AND prescriptions.formulary_drug_cd = "IMDU30"
mimicsql_data
CREATE TABLE table_33393 ( "Round" real, "Overall" real, "Player" text, "Position" text, "College" text )
What is the total of overall values with a safety position in a round greater than 1?
SELECT COUNT("Overall") FROM table_33393 WHERE "Position" = 'safety' AND "Round" > '1'
wikisql
CREATE TABLE table_name_23 ( years VARCHAR, area VARCHAR )
What years does the school have that's in Makikihi?
SELECT years FROM table_name_23 WHERE area = "makikihi"
sql_create_context
CREATE TABLE table_77818 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Where was the friendly competition on 7 June 1999 played?
SELECT "Venue" FROM table_77818 WHERE "Competition" = 'friendly' AND "Date" = '7 june 1999'
wikisql
CREATE TABLE table_1083 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
Which players college is Tennessee?
SELECT "Player" FROM table_1083 WHERE "College" = 'Tennessee'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number...
what was the medication that patient 50286 was prescribed for the last time through the im route in 11/last year?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 50286) AND prescriptions.route = 'im' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', pres...
mimic_iii
CREATE TABLE table_10577579_3 ( men’s_nickname VARCHAR, women’s_nickname VARCHAR )
What is the men's nickname at the school that has the lady wildcats women's nickname?
SELECT men’s_nickname FROM table_10577579_3 WHERE women’s_nickname = "Lady Wildcats"
sql_create_context
CREATE TABLE table_name_51 ( pos VARCHAR, driver VARCHAR, race_1 VARCHAR, points VARCHAR, qualifying VARCHAR )
What is the total number of positions with less than 10 points, more than 7 qualifying, ret value in Race 1, and Jonathan Grant driving?
SELECT COUNT(pos) FROM table_name_51 WHERE points < 10 AND qualifying > 7 AND race_1 = "ret" AND driver = "jonathan grant"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
05426415号病患在7025827号医院中就诊过的科室名称包括了喉的所有医疗就诊记录都有什么?
SELECT * FROM gwyjzb WHERE gwyjzb.PERSON_ID = '05426415' AND gwyjzb.MED_SER_ORG_NO = '7025827' AND gwyjzb.MED_ORG_DEPT_NM LIKE '%喉%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '05426415' AND fgwyjzb.MED_SER_ORG_NO = '7025827' AND fgwyjzb.MED_ORG_DEPT_NM LIKE '%喉%'
css
CREATE TABLE table_28194 ( "Metropolitan ring" text, "Localities" real, "Total" real, "Jews and others 1" real, "Thereof: Jews" real, "Arabs" real, "Population density (per km\u00b2)" text, "Annual Population growth rate" text )
What is the lowest total when arabs is 4000?
SELECT MIN("Total") FROM table_28194 WHERE "Arabs" = '4000'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) C...
calculate the minimum age of patients admitted on or after 2156 who stayed in hospital for 29 days.
SELECT MIN(demographic.age) FROM demographic WHERE demographic.days_stay = "29" AND demographic.admityear >= "2156"
mimicsql_data
CREATE TABLE table_69244 ( "Date" text, "Time" text, "Round" text, "Opponent" text, "Ground" text, "Score" text )
Where was the game played that had a score of 3-2 and a time of 15:00 cet?
SELECT "Ground" FROM table_69244 WHERE "Score" = '3-2' AND "Time" = '15:00 cet'
wikisql
CREATE TABLE table_204_862 ( id number, "rank" number, "bib" number, "athlete" text, "country" text, "run 1" text, "run 2" text, "total" text, "behind" number )
how many competitors were from the same country as david moller ?
SELECT COUNT("athlete") FROM table_204_862 WHERE "athlete" <> 'david moller' AND "country" = (SELECT "country" FROM table_204_862 WHERE "athlete" = 'david moller')
squall
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,...
医疗就诊67013595973中审核超过11份检验报告单的有哪些人?列出这些审核人工号是什么?姓名是什么?
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '67013595973' GROUP BY jybgb.SHRGH HAVING COUNT(*) > 11
css
CREATE TABLE table_name_48 ( position INTEGER, played INTEGER )
What is the highest position for less than 42 played?
SELECT MAX(position) FROM table_name_48 WHERE played < 42
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id num...
what are the three most frequent prescribed drugs for patients that were prescribed with imipenem-cilastatin at the same time the previous year?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'imipenem-cilastatin' AND DATETIME(prescriptions.startdate, 'start...
mimic_iii
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
get me the number of elective hospital admission patients who have drug code abac300.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.formulary_drug_cd = "ABAC300"
mimicsql_data
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, ...
how many papers has jeff dean published ?
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'jeff dean' AND writes.authorid = author.authorid
scholar
CREATE TABLE table_name_26 ( number VARCHAR, percentage___percentage_ VARCHAR )
Which number has a 0.35 percentage?
SELECT number FROM table_name_26 WHERE percentage___percentage_ = "0.35"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
what were the hospital hospital admission times of patient 006-157753 this year?
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '006-157753' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number IN...
Show the number of date account opened from each date account opened, and rank by the y-axis in asc.
SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts ORDER BY COUNT(date_account_opened)
nvbench
CREATE TABLE table_10601 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text, "Record" text )
Name the week when the result was l 38-17
SELECT "Week" FROM table_10601 WHERE "Result" = 'l 38-17'
wikisql
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...
门诊给患者韩奇正诊断为疾病Z28.586,那检测指标609254的结果定量及其单位是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE prescriptions ( row_id number, subject...
what were the three most frequent drugs prescribed for patients who were also prescribed with chlorhexidine gluconate at the same time in 2105?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'chlorhexidine gluconate' AND STRFTIME('%y', prescriptions.startda...
mimic_iii
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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit...
during the current hospital visit what was the first ward id of patient 94229?
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94229 AND admissions.dischtime IS NULL) AND NOT transfers.wardid IS NULL ORDER BY transfers.intime LIMIT 1
mimic_iii
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, ...
均在2016年1月24日之后患者袁幼怡的住院就诊记录对应的检验报告单的报告日期有哪些?列出住院就诊流水号都是多少?
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers...
css
CREATE TABLE table_18962 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
What are the won games with losing bonus of 0?
SELECT "Won" FROM table_18962 WHERE "Losing bonus" = '0'
wikisql
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 whose admission type is newborn and item id is 51274?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab.itemid = "51274"
mimicsql_data
CREATE TABLE table_15187735_3 ( segment_d VARCHAR, segment_c VARCHAR )
Name the segment d for chicken
SELECT segment_d FROM table_15187735_3 WHERE segment_c = "Chicken"
sql_create_context
CREATE TABLE table_71076 ( "DATE" text, "SCORE" text, "H.T." text, "VENUE" text, "COMPETITION" text )
What was the HT for the game at Stadio Luigi Ferraris?
SELECT "H.T." FROM table_71076 WHERE "VENUE" = 'stadio luigi ferraris'
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 me about the distribution of All_Home and the sum of Team_ID , and group by attribute All_Home in a bar chart, order by the y axis in asc.
SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(Team_ID)
nvbench
CREATE TABLE table_name_21 ( time VARCHAR, round VARCHAR, event VARCHAR )
Which Time has a Round larger than 1, and an Event of total fighting alliance 2?
SELECT time FROM table_name_21 WHERE round > 1 AND event = "total fighting alliance 2"
sql_create_context
CREATE TABLE table_203_509 ( id number, "year" number, "laetare medalist" text, "position" text )
who was the previous winner before john henry phelan in 1951 ?
SELECT "laetare medalist" FROM table_203_509 WHERE "year" < 1951 ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_24772 ( "Season" text, "Champion" text, "Runner-Up" text, "Result" text, "League MVP" text, "Finals MVP" text, "Winning Coach" text )
What was the final score when River Plate was the runner-up?
SELECT "Result" FROM table_24772 WHERE "Runner-Up" = 'River Plate'
wikisql
CREATE TABLE table_28212888_2 ( directed_by VARCHAR, no_in_series VARCHAR )
Who was the director of the episode with series number 116?
SELECT directed_by FROM table_28212888_2 WHERE no_in_series = 116
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number...
Users with at least X total badges.
SELECT UserId AS "user_link", COUNT(*) AS badgeCount FROM Badges GROUP BY UserId HAVING COUNT(*) > 100 ORDER BY badgeCount DESC
sede
CREATE TABLE table_name_80 ( field_goals INTEGER, extra_points VARCHAR, touchdowns VARCHAR )
What is the average field goal someone has when they have 0 extra points but more than 5 touch downs?
SELECT AVG(field_goals) FROM table_name_80 WHERE extra_points > 0 AND touchdowns > 5
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, ...
Most answers in a tag.
SELECT u.Id AS "user_link", COUNT(p.Id) AS Answers FROM Users AS u, Posts AS p INNER JOIN Posts AS q ON p.ParentId = q.Id WHERE p.PostTypeId = 2 AND u.Id = p.OwnerUserId AND q.Tags LIKE '%##tag##%' GROUP BY u.Id ORDER BY COUNT(p.Id) DESC LIMIT 100
sede
CREATE TABLE table_63071 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text )
What is the branding for the radio with a frequency of 1150 am?
SELECT "Branding" FROM table_63071 WHERE "Frequency" = '1150 am'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
患者彭金鑫出院诊断疾病名称不包含精神的在医院2214743的医疗就诊记录是什么编号?
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '彭金鑫' AND qtb.MED_SER_ORG_NO = '2214743' AND NOT qtb.OUT_DIAG_DIS_NM LIKE '%精神%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '彭金鑫' AND gyb.MED_SER_ORG_NO = '2214743' AND NOT gyb.OUT_DIAG_DIS_NM LIKE '%精神%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb ...
css
CREATE TABLE table_23038 ( "Application" text, "Latest release date and version" text, "Developed by" text, "Platforms" text, "Mainly Used For" text, "License" text )
Name the application for caligari corporation
SELECT "Application" FROM table_23038 WHERE "Developed by" = 'Caligari Corporation'
wikisql
CREATE TABLE table_15081939_4 ( average VARCHAR, evening_gown VARCHAR )
How many averages for the province with evening gown score of 8.00
SELECT COUNT(average) FROM table_15081939_4 WHERE evening_gown = "8.00"
sql_create_context
CREATE TABLE table_name_69 ( year_s__won VARCHAR, total VARCHAR )
In which year(s) did the person who has a total of 291 win?
SELECT year_s__won FROM table_name_69 WHERE total = 291
sql_create_context
CREATE TABLE table_24935743_2 ( location VARCHAR, school VARCHAR )
What school is in Jeromesville?
SELECT location FROM table_24935743_2 WHERE school = "Jeromesville"
sql_create_context
CREATE TABLE table_16729930_18 ( release_price___usd__ VARCHAR, part_number_s_ VARCHAR )
What is the release price for a processor with part number cy80632007227ab?
SELECT release_price___usd__ FROM table_16729930_18 WHERE part_number_s_ = "CY80632007227AB"
sql_create_context
CREATE TABLE table_36873 ( "Club" text, "Sport" text, "League" text, "Venue" text, "Established" real, "Championships" real )
What sport happened at Wildcat Stadium?
SELECT "Sport" FROM table_36873 WHERE "Venue" = 'wildcat stadium'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Na...
SELECT * FROM (SELECT * FROM Users WHERE Views = 10).
SELECT * FROM Users WHERE Views = 10 AND Reputation > 1000 LIMIT 1
sede
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
provide the number of patients whose days of hospital stay is greater than 8 and drug route is id?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "8" AND prescriptions.route = "ID"
mimicsql_data
CREATE TABLE table_5143 ( "County" text, "Per capita income" text, "Median household income" text, "Median family income" text, "Population" real, "Number of households" real )
Which country has a $46,426 median family income?
SELECT "County" FROM table_5143 WHERE "Median family income" = '$46,426'
wikisql
CREATE TABLE table_name_95 ( general_classification VARCHAR, stage VARCHAR )
Which General classification has a Stage of 7?
SELECT general_classification FROM table_name_95 WHERE stage = "7"
sql_create_context
CREATE TABLE table_name_7 ( date VARCHAR, opponent VARCHAR )
What was the date of the game against the New York Jets?
SELECT date FROM table_name_7 WHERE opponent = "new york jets"
sql_create_context
CREATE TABLE table_204_441 ( id number, "date" text, "opponent" text, "venue" text, "result" text, "attendance" number, "scorers" text )
on which date was the game played with the most number of people in attendance ?
SELECT "date" FROM table_204_441 ORDER BY "attendance" DESC LIMIT 1
squall
CREATE TABLE table_28523_2 ( location VARCHAR, school VARCHAR )
Where is the cunningham hill infant school located?
SELECT location FROM table_28523_2 WHERE school = "Cunningham Hill Infant school"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
Out of total number of patients having aortic valve insuffiency.aortic valve replacement /sda as their primary disease, how many of them had a closed bronchial biopsy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND procedures.short_title = "Closed bronchial biopsy"
mimicsql_data
CREATE TABLE table_12441 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What is the total for the player with a Finish of T39?
SELECT "Total" FROM table_12441 WHERE "Finish" = 't39'
wikisql
CREATE TABLE table_1600 ( "Official Name" text, "Status" text, "Area km 2" text, "Population" real, "Census Ranking" text )
How many areas are named West Isles?
SELECT COUNT("Area km 2") FROM table_1600 WHERE "Official Name" = 'West Isles'
wikisql
CREATE TABLE table_name_65 ( score VARCHAR, date VARCHAR )
What is Score, when Date is 10 July 2011?
SELECT score FROM table_name_65 WHERE date = "10 july 2011"
sql_create_context
CREATE TABLE table_67506 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What engine with more than 2 points has Brabham bt58 as Chassis?
SELECT "Engine" FROM table_67506 WHERE "Chassis" = 'brabham bt58' AND "Points" > '2'
wikisql
CREATE TABLE table_name_59 ( interview INTEGER, evening_gown VARCHAR, average VARCHAR )
What is the total number of interview scores that have an evening gown score of 9.543 and an average that is bigger than 9.521?
SELECT SUM(interview) FROM table_name_59 WHERE evening_gown = 9.543 AND average > 9.521
sql_create_context
CREATE TABLE table_26259391_1 ( production_code VARCHAR, original_air_date VARCHAR )
Which production code had original air dated february20,2011
SELECT production_code FROM table_26259391_1 WHERE original_air_date = "February20,2011"
sql_create_context
CREATE TABLE table_48233 ( "Date" text, "Series" text, "Circuit" text, "City / State" text, "Winner" text, "Team" text )
WHAT IS THE WINNER WITH ATCC ROUND 6?
SELECT "Winner" FROM table_48233 WHERE "Series" = 'atcc round 6'
wikisql
CREATE TABLE table_name_79 ( transfer_window VARCHAR, country VARCHAR, transfer_fee VARCHAR )
What transfer window has bra as the country, with 3.4m as the transfer fee?
SELECT transfer_window FROM table_name_79 WHERE country = "bra" AND transfer_fee = "£3.4m"
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...
Average length of answer bodies..
SELECT SUM(LENGTH(Body)) AS "total_chars" FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = '##userId##'
sede
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId n...
Best Users from Sri Lanka.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%lanka%' OR UPPER(Location) LIKE '%SRI' ORDER BY Reputation DESC LIMIT 200
sede
CREATE TABLE table_17272 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Musical guest and song" text, "Original air date" text, "Production code" text )
What is theoriginal air date of the episode directed by timothy van patten?
SELECT "Original air date" FROM table_17272 WHERE "Directed by" = 'Timothy Van Patten'
wikisql
CREATE TABLE table_name_94 ( top_25 INTEGER, events VARCHAR, wins VARCHAR )
What is the lowest Top-25 that has 3 Events and Wins greater than 0?
SELECT MIN(top_25) FROM table_name_94 WHERE events = 3 AND wins > 0
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
这个医疗就诊17047326007的总医疗费一共花了多少?
SELECT MED_AMOUT FROM t_kc21 WHERE MED_CLINIC_ID = '17047326007'
css
CREATE TABLE table_name_69 ( total INTEGER, routine_score VARCHAR )
What is the sum of the total for a routine score of 26.6?
SELECT SUM(total) FROM table_name_69 WHERE routine_score = 26.6
sql_create_context
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
通过门诊诊断出疾病A48.710的病员的促甲状腺激素受体抗体数值的平均值和他们的最值分别是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'A48.710' AND jyjgzbb.JCZBMC =...
css
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real )
Give me a bar chart for the total number of each class
SELECT Class, COUNT(*) FROM race GROUP BY Class
nvbench
CREATE TABLE table_11190 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text )
Which driver retired from a collision after 41 laps?
SELECT "Driver" FROM table_11190 WHERE "Time/Retired" = 'collision' AND "Laps" = '41'
wikisql
CREATE TABLE table_30419 ( "Series" text, "Seasons" real, "Races" real, "Poles" real, "Wins" real, "Podiums (Non-win)" real, "Point Finishes (Non-podium)" real, "Teams" real, "Total Points" real, "Championships" real, "Best Finish (Championship)" text )
How many seasons are there with Formula Holden?
SELECT COUNT("Seasons") FROM table_30419 WHERE "Series" = 'Formula Holden'
wikisql
CREATE TABLE table_name_69 ( opponent VARCHAR, championship VARCHAR )
What is Opponent, when Championship is P tange?
SELECT opponent FROM table_name_69 WHERE championship = "pétange"
sql_create_context
CREATE TABLE table_1585 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
Name the total number when avg start is 2000
SELECT COUNT("Avg. Start") FROM table_1585 WHERE "Year" = '2000'
wikisql
CREATE TABLE table_35953 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What is the surface of eckental tournament with a w/o score?
SELECT "Surface" FROM table_35953 WHERE "Tournament" = 'eckental' AND "Score" = 'w/o'
wikisql
CREATE TABLE table_38930 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
How many Touchdowns have Field goals larger than 0?
SELECT COUNT("Touchdowns") FROM table_38930 WHERE "Field goals" > '0'
wikisql
CREATE TABLE table_36800 ( "Player" text, "Attempts" real, "Yards" real, "Average" real, "Long" real, "Touchdowns" real )
What is the least amount of yards when the average is less than 2.6?
SELECT MIN("Yards") FROM table_36800 WHERE "Average" < '2.6'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownV...
Top users from Morgantown, WV.
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Morgantown%' ORDER BY Reputation DESC LIMIT 100
sede
CREATE TABLE table_33466 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is richmond's score as the home team?
SELECT "Home team score" FROM table_33466 WHERE "Home team" = 'richmond'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, H...
病人杨文彬的治疗历史
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '杨文彬' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费'
css
CREATE TABLE table_68730 ( "Event" text, "Time" text, "Venue" text, "Date" text, "Notes" text )
For a venue of Rome on July 30, 2009, what are the notes?
SELECT "Notes" FROM table_68730 WHERE "Venue" = 'rome' AND "Date" = 'july 30, 2009'
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...
查询入院诊断为J45.129的最低和最高医疗费总额,主要针对医院7271121的医疗记录
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '7271121' AND qtb.IN_DIAG_DIS_CD = 'J45.129' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '7271121' AND gyb.IN_DIAG_DIS_CD = 'J45.129' UNION S...
css
CREATE TABLE table_65064 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text )
What is Ateneo de Manila's PBA Team?
SELECT "PBA team" FROM table_65064 WHERE "College" = 'ateneo de manila'
wikisql
CREATE TABLE table_name_73 ( population VARCHAR, official_name VARCHAR )
What's the population of durham parish?
SELECT COUNT(population) FROM table_name_73 WHERE official_name = "durham"
sql_create_context
CREATE TABLE table_name_63 ( nationality VARCHAR, appearances VARCHAR )
What nationality has 116 appearances?
SELECT nationality FROM table_name_63 WHERE appearances = 116
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
患者号码是的那个人86565852其医疗费总额高于2978.48元的时候的治病记录中显示其出院诊断疾病编码和名称为啥?
SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '86565852' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2978.48) UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '86565852' AND...
css
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 zyjzjlb ( CYBQDM text, CYBQMC...
门诊诊断为疾病W44.704的病患的游离前列腺特异性抗原数值的平均值是多少最值是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'W44.704' AND jyjgzbb.JCZBMC =...
css
CREATE TABLE table_61797 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What is team 1 when team 2 is Manchester United?
SELECT "Team 1" FROM table_61797 WHERE "Team 2" = 'manchester united'
wikisql
CREATE TABLE table_1833 ( "Country" text, "Mens Open" real, "Womens Open" real, "Mens Wheelchair" real, "Womens Wheelchair" real, "Total" real )
How many are the total winners from South Korea?
SELECT "Total" FROM table_1833 WHERE "Country" = 'South Korea'
wikisql
CREATE TABLE table_71938 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" real )
What is the highest Rank of Karen Pickering when she had a time of less than 55.71?
SELECT MAX("Rank") FROM table_71938 WHERE "Name" = 'karen pickering' AND "Time" < '55.71'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, I want to display in descending by the y-axis.
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(SALARY) DESC
nvbench
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number...
what is the name of the drug that patient 27242 has been prescribed two or more times in 05/last year?
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 = 27242) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 ye...
mimic_iii
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
在2004年6月24日到2014年6月10日这段时间里,编码为6291859的医院所有非异地结算的医疗就诊记录都是哪些?
(SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '6291859' AND IN_HOSP_DATE BETWEEN '2004-06-24' AND '2014-06-10') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '6291859' AND IN_HOSP_DATE BETWEEN '2004-06-24' AND '2014-06-10' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2'))
css
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8...
How many courses for each teacher? Show me a bar chart, and show y-axis in descending order.
SELECT EMP_FNAME, COUNT(EMP_FNAME) 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 EMP_FNAME ORDER BY COUNT(EMP_FNAME) DESC
nvbench
CREATE TABLE table_203_157 ( id number, "year" number, "film" text, "role" text, "language" text, "notes" text )
what was the next movie after kurradu ?
SELECT "film" FROM table_203_157 WHERE id = (SELECT id FROM table_203_157 WHERE "film" = 'kurradu') + 1
squall
CREATE TABLE table_name_43 ( investing_dragon_s_ VARCHAR, money_requested__£_ VARCHAR, entrepreneur_s_ VARCHAR )
Which Investing Dragon has requested 100,000 and is supported by Entrepreneur Kay Russell?
SELECT investing_dragon_s_ FROM table_name_43 WHERE money_requested__£_ = "100,000" AND entrepreneur_s_ = "kay russell"
sql_create_context