context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_44 ( away_team VARCHAR, venue VARCHAR )
What was the away team's score at the game held at MCG?
SELECT away_team AS score FROM table_name_44 WHERE venue = "mcg"
sql_create_context
CREATE TABLE table_8809 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Year made" text, "Quantity made" text, "Quantity preserved" text )
What manufacturer made class b-2?
SELECT "Manufacturer" FROM table_8809 WHERE "Class" = 'b-2'
wikisql
CREATE TABLE table_name_14 ( away VARCHAR, home VARCHAR )
What is Away, when Home is 'marathon'?
SELECT away FROM table_name_14 WHERE home = "marathon"
sql_create_context
CREATE TABLE table_name_35 ( partner VARCHAR, surface VARCHAR, tournament VARCHAR )
Who was Silva's Partner in the Amarante Tournament played on a Hard Surface?
SELECT partner FROM table_name_35 WHERE surface = "hard" AND tournament = "amarante"
sql_create_context
CREATE TABLE table_70142 ( "Member" text, "Party" text, "Electorate" text, "State" text, "First elected" text )
What is the year First elected, when the State is vic, and when the Member is Hon Don Chipp?
SELECT "First elected" FROM table_70142 WHERE "State" = 'vic' AND "Member" = 'hon don chipp'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
get the number of patients with base type drug prescription who have diagnoses icd9 code 6959.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "6959" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients stayed in hospital for more than 34 days and used the drug pancrelipase 5000?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "34" AND prescriptions.drug = "Pancrelipase 5000"
mimicsql_data
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those products with a price between 60 and 120, show me about the correlation between code and manufacturer in a scatter chart.
SELECT Code, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120
nvbench
CREATE TABLE table_name_86 ( college VARCHAR, team VARCHAR, round VARCHAR )
Name the college that has 7 rounds and boston celtics team
SELECT college FROM table_name_86 WHERE team = "boston celtics" AND round = "7"
sql_create_context
CREATE TABLE table_15938 ( "UN Operation name" text, "UN Operation title" text, "Location" text, "Dates of Australian involvement" text, "Number of Australians involved" text, "Australian role" text )
How many Australians were in the UN commission on Korea?
SELECT COUNT("Number of Australians involved") FROM table_15938 WHERE "UN Operation title" = 'UN Commission on Korea'
wikisql
CREATE TABLE table_name_24 ( player VARCHAR, to_par VARCHAR, score VARCHAR )
What Player has a To par of +1 and a Score of 73-71-71=217?
SELECT player FROM table_name_24 WHERE to_par = "+1" AND score = 73 - 71 - 71 = 217
sql_create_context
CREATE TABLE zzmzjzjlb ( 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...
门诊诊断为检测指标976714谵妄的病患的数值的平均值是多少?最值是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '谵妄' AND jyjgzbb.JCZBDM = '97671...
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,...
For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the average of salary , and group by attribute job_id, and sort by the y axis in descending.
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(SALARY) DESC
nvbench
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...
自02.5.16起,至16.6.25至,医疗机构0244651在诊断疾病时,入院结果与出院结果不同的次数总共有多少
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0244651' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-05-16' AND '2016-06-25' AND t_kc21.IN_DIAG_DIS_CD <> t_kc21.OUT_DIAG_DIS_CD
css
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, a bar chart shows the distribution of name and the amount of name , and group by attribute name, and list from low to high by the Name please.
SELECT T1.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_17064 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text )
What player represented Vista Murrieta High School?
SELECT "Player" FROM table_17064 WHERE "School" = 'Vista Murrieta High School'
wikisql
CREATE TABLE table_15274 ( "Championship" text, "Current champion(s)" text, "Reign" text, "Date won" text, "Days held" real, "Location" text )
Name the days for current champions of dean ambrose
SELECT "Days held" FROM table_15274 WHERE "Current champion(s)" = 'dean ambrose'
wikisql
CREATE TABLE table_26826304_1 ( written_by VARCHAR, production_code VARCHAR )
Who was the writer of the episode with a production code of 5aky04?
SELECT written_by FROM table_26826304_1 WHERE production_code = "5AKY04"
sql_create_context
CREATE TABLE table_17641206_8 ( episode VARCHAR, original_airdate VARCHAR )
How many episodes aired on 22january2009
SELECT COUNT(episode) FROM table_17641206_8 WHERE original_airdate = "22January2009"
sql_create_context
CREATE TABLE table_36855 ( "City" text, "State/Territory" text, "IATA" text, "ICAO" text, "Airport" text, "Begin" text )
Which airport has an ICAO of ybcg?
SELECT "Airport" FROM table_36855 WHERE "ICAO" = 'ybcg'
wikisql
CREATE TABLE table_11630008_7 ( title VARCHAR, production_code VARCHAR )
What is the title of production code 514?
SELECT title FROM table_11630008_7 WHERE production_code = 514
sql_create_context
CREATE TABLE table_27392 ( "Language" text, "Padilla Municipality" real, "Tomina Municipality" real, "Sopachuy Municipality" real, "Villa Alcal\u00e1 Municipality" real, "El Villar Municipality" real )
Name the language for sopachuy 10
SELECT "Language" FROM table_27392 WHERE "Sopachuy Municipality" = '10'
wikisql
CREATE TABLE table_name_93 ( qual_1 VARCHAR, name VARCHAR )
What did Alex Tagliani get for Qual 1?
SELECT qual_1 FROM table_name_93 WHERE name = "alex tagliani"
sql_create_context
CREATE TABLE table_39604 ( "Year" real, "Championship" text, "54 Holes" text, "Winning Score" text, "Margin" text, "Runner(s)-up" text )
Which championship has a margin of 8 strokes?
SELECT "Championship" FROM table_39604 WHERE "Margin" = '8 strokes'
wikisql
CREATE TABLE table_name_27 ( method VARCHAR, record VARCHAR )
Which method has a record of 3-0?
SELECT method FROM table_name_27 WHERE record = "3-0"
sql_create_context
CREATE TABLE table_name_68 ( type VARCHAR, etymology VARCHAR, number_of_bearers_2008 VARCHAR, rank VARCHAR )
What is Type, when Number of Bearers 2008 is greater than 12.376, when Rank is greater than 3, and when Etymology is Son of Jens?
SELECT type FROM table_name_68 WHERE number_of_bearers_2008 > 12.376 AND rank > 3 AND etymology = "son of jens"
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...
count the number of patients whose marital status is single and item id is 51144?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.itemid = "51144"
mimicsql_data
CREATE TABLE table_10077 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real )
What is the score of player craig stadler from the United States with a t8 place?
SELECT "Score" FROM table_10077 WHERE "Place" = 't8' AND "Country" = 'united states' AND "Player" = 'craig stadler'
wikisql
CREATE TABLE game ( Date VARCHAR, home_team VARCHAR )
List the dates of games by the home team name in descending order.
SELECT Date FROM game ORDER BY home_team DESC
sql_create_context
CREATE TABLE table_name_17 ( game INTEGER, batting_2nd VARCHAR )
what is the game when batting 2nd is new zealand 6/133 (18)?
SELECT MIN(game) FROM table_name_17 WHERE batting_2nd = "new zealand 6/133 (18)"
sql_create_context
CREATE TABLE table_name_84 ( score VARCHAR, home_team VARCHAR )
What was the score when the home team was goole town?
SELECT score FROM table_name_84 WHERE home_team = "goole town"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is admission type and diagnoses short title of subject id 30011?
SELECT demographic.admission_type, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "30011"
mimicsql_data
CREATE TABLE table_73019 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Time Frame" text, "Starring Actors" text, "Theme Song(s)" text, "Episodes" real, "Average Ratings" text )
What is the theme song for Magarikado no Kanojo?
SELECT "Theme Song(s)" FROM table_73019 WHERE "Romaji Title" = 'Magarikado no Kanojo'
wikisql
CREATE TABLE table_204_631 ( id number, "#" number, "title" text, "english translation" text, "original album" text, "length" text )
how many albums did not have a time length ?
SELECT COUNT("title") FROM table_204_631 WHERE "length" IS NULL
squall
CREATE TABLE table_204_237 ( id number, "season" text, "average" number, "high" number, "low" number, "season tickets" number )
how many seasons had average attendance of at least 15,000 at the stadio ennio tardini ?
SELECT COUNT("season") FROM table_204_237 WHERE "average" >= 15000
squall
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId num...
List of Stack Exchange non-meta sites.
SELECT * FROM sys.databases WHERE (NOT name LIKE '%.Meta' OR name = 'StackExchange.Meta') AND database_id > 5 ORDER BY name
sede
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 ) ...
what was the name of the drug that was prescribed to patient 66015 within 2 days after having received a reopen recent lap site procedure the last month.
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 66015 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ...
mimic_iii
CREATE TABLE table_1993 ( "Rank" real, "London Borough" text, "Black African Population" real, "Black Caribbean Population" real, "Other Black Population" real, "Total Black Population" real )
How much is the other black population when the black African population is 37811?
SELECT MIN("Other Black Population") FROM table_1993 WHERE "Black African Population" = '37811'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDe...
Questions tagged [origins] on SFF.
SELECT Tags, p.Id AS "post_link" FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id WHERE t.TagName = 'origins' ORDER BY CASE WHEN p.Tags LIKE '%history-of%' THEN 1 ELSE 0 END, p.CreationDate
sede
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, ...
Suggested Edits that someone rejected as vandalism, someone approved, and the edit got rejected.
SELECT s.Id AS "suggested_edit_link", v.UserId, v.CreationDate, s.Comment FROM SuggestedEditVotes AS v INNER JOIN SuggestedEdits AS s ON s.Id = v.SuggestedEditId WHERE v.SuggestedEditId IN (SELECT Id FROM SuggestedEdits WHERE Id IN (SELECT SuggestedEditId FROM ReviewTasks WHERE Id IN (SELECT ReviewTaskId FROM ReviewTas...
sede
CREATE TABLE table_name_40 ( application_sharing VARCHAR, web_conferencing VARCHAR )
What is Application Sharing, when Web Conferencing is 'Web Conferencing'?
SELECT application_sharing FROM table_name_40 WHERE web_conferencing = "web conferencing"
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_...
For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and employee_id , and visualize them by a bar chart, order in ascending by the Y.
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
nvbench
CREATE TABLE table_name_70 ( home VARCHAR, competition VARCHAR, round VARCHAR )
Which Home has a Competition of european cup, and a Round of qf?
SELECT home FROM table_name_70 WHERE competition = "european cup" AND round = "qf"
sql_create_context
CREATE TABLE table_59093 ( "Player" text, "Country" text, "Year(s) Won" text, "Total" real, "To par" real )
Can you tell me the Year(s) Won that has the To par larger than 5, and the Total smaller than 155, and the Country of united states?
SELECT "Year(s) Won" FROM table_59093 WHERE "To par" > '5' AND "Total" < '155' AND "Country" = 'united states'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
what was the name of the procedure that was given two or more times to patient 1862 in 09/2100?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 186...
mimic_iii
CREATE TABLE table_63876 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text )
What is the lowest rank of rider darren gilpin?
SELECT MIN("Rank") FROM table_63876 WHERE "Rider" = 'darren gilpin'
wikisql
CREATE TABLE table_2214582_3 ( home_leg VARCHAR, opponents VARCHAR )
What was the home leg score against partizani tirana?
SELECT home_leg FROM table_2214582_3 WHERE opponents = "Partizani Tirana"
sql_create_context
CREATE TABLE table_name_83 ( loss VARCHAR, record VARCHAR )
What loss has 10-16 as the record?
SELECT loss FROM table_name_83 WHERE record = "10-16"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Give me a bar chart for all_games_percent of each team name, and list in descending by the y-axis.
SELECT Team_Name, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC
nvbench
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Na...
Count Questions Freq by Year per Title.
SELECT COUNT(P.Id) AS Posts, YEAR(P.CreationDate) AS Year_Data FROM Posts AS P WHERE P.Title LIKE '%mockito%' AND ((P.Tags LIKE '%android-testing%') OR (P.Tags LIKE '%robotium%') OR (P.Tags LIKE '%androidviewclient%') OR (P.Tags LIKE '%monkeyrunner%') OR (P.Tags LIKE '%robolectric%') OR (P.Tags LIKE '%android-espresso%...
sede
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, ...
calculate the one year survival rate of those who were diagnosed with tracheostomy performed during this admission for ventilatory support.
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
CREATE TABLE table_6655 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text )
On what date was there a friendly game against Wales?
SELECT "Date" FROM table_6655 WHERE "Type of game" = 'friendly' AND "Opponent" = 'wales'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM ...
门诊给韦天心这个病人诊断为躁狂型分裂情感性障碍,看看编号为246107的这个检测指标的结果定量及单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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_MZ...
css
CREATE TABLE table_name_50 ( player VARCHAR, games_played VARCHAR, goals_allowed VARCHAR )
Who played over 46 games and allowed less than 195 goals?
SELECT player FROM table_name_50 WHERE games_played > 46 AND goals_allowed < 195
sql_create_context
CREATE TABLE table_64938 ( "Player" text, "Int'l Debut" text, "Year" text, "Cross Code Debut" text, "Date" text )
What is the Date of RL Test v Wales Int'l Debut?
SELECT "Date" FROM table_64938 WHERE "Int'l Debut" = 'rl test v wales'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
count the number of patients whose primary disease is squamous cell carcinoma oral tongue/sda and year of birth is less than 2170?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" AND demographic.dob_year < "2170"
mimicsql_data
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,...
编码是71680261632和54695034661的两位患者在治疗中使用的名字相同的药品?具体的名称是啥?花了多少钱以及对应的医疗就诊ID是啥啊?
SELECT SOC_SRT_DIRE_NM, AMOUNT, MED_CLINIC_ID FROM t_kc22 WHERE (MED_CLINIC_ID = '71680261632' OR MED_CLINIC_ID = '54695034661') AND SOC_SRT_DIRE_NM IN ((SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '71680261632') INTERSECT (SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '54695034661'))
css
CREATE TABLE table_name_99 ( constructor VARCHAR, time_retired VARCHAR )
What is the constructor for time/retired of handling?
SELECT constructor FROM table_name_99 WHERE time_retired = "handling"
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 whose procedure icd9 code is 4105 and drug type is main?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "4105" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_name_34 ( municipality VARCHAR, party VARCHAR, election VARCHAR )
Which municipality has a party of Lega Friuli-VG that won elections before 2011?
SELECT municipality FROM table_name_34 WHERE party = "lega friuli-vg" AND election < 2011
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients whose diagnoses short title is intestinal abscess and drug type is main?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Intestinal abscess" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_name_94 ( wins INTEGER, points VARCHAR, year VARCHAR )
Name the lowest Wins which has Points of 28, and a Year smaller than 1972?
SELECT MIN(wins) FROM table_name_94 WHERE points = 28 AND year < 1972
sql_create_context
CREATE TABLE table_204_964 ( id number, "team" text, "seasons" number, "games" number, "wins" number, "ties" number, "losses" number, "goals\nfor" number, "goals\nagainst" number, "goal\ndiff" number, "points" number )
who has the least amount of losses ?
SELECT "team" FROM table_204_964 ORDER BY "losses" LIMIT 1
squall
CREATE TABLE table_67844 ( "Rank" real, "Team" text, "Wins" real, "Losses" real, "Runs Allowed" real, "Run Ratio" real )
What is the average number of losses the team with less than 25 runs allowed and 5 wins have?
SELECT AVG("Losses") FROM table_67844 WHERE "Runs Allowed" < '25' AND "Wins" = '5'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
count the number of patients whose admission type is urgent and diagnoses long title is poisoning by penicillins?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Poisoning by penicillins"
mimicsql_data
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, ...
Next semester , is SAC 306 being offered ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'SAC' AND course.number = 306 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_204_770 ( id number, "season" number, "date" text, "jia-a/csl winner" text, "result" text, "fa cup winner" text, "scorers" text, "stadium" text )
how many games have been won by only one point ?
SELECT COUNT(*) FROM table_204_770 WHERE ABS("result" - "result") = 1
squall
CREATE TABLE table_203_496 ( id number, "pos" number, "country" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many gold and bronze medals were achieved overall ?
SELECT SUM("silver" + "bronze") FROM table_203_496
squall
CREATE TABLE table_36006 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
In what Year was the Position 11th?
SELECT COUNT("Year") FROM table_36006 WHERE "Position" = '11th'
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 died in or before the year 2158 and were tested with lab item id 51078?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2158.0" AND lab.itemid = "51078"
mimicsql_data
CREATE TABLE table_191323_2 ( notes VARCHAR, nssdc_id_no VARCHAR )
What are the notes of the satellite whose nssdc id number is 1959-002a?
SELECT notes FROM table_191323_2 WHERE nssdc_id_no = "1959-002A"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Visualize a bar chart about the distribution of ACC_Regular_Season and School_ID , and display Y-axis in desc order please.
SELECT ACC_Regular_Season, School_ID FROM basketball_match ORDER BY School_ID DESC
nvbench
CREATE TABLE table_68802 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
Who was the visiting team at the matchup at the RCA Dome?
SELECT "Visiting Team" FROM table_68802 WHERE "Stadium" = 'rca dome'
wikisql
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
what are the numbers of wines for different grapes?, and show x-axis from high to low order.
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY Grape DESC
nvbench
CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE T...
are there any monte carlo simulation papers since 2011 ?
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'monte carlo simulation' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year > 2011
scholar
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
what is the number of patients whose marital status is single and admission year is less than 2178?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admityear < "2178"
mimicsql_data
CREATE TABLE table_name_78 ( pts_game VARCHAR, games VARCHAR, name VARCHAR )
what is the pts/game for Charlotte barras and the games is 5?
SELECT pts_game FROM table_name_78 WHERE games = 5 AND name = "charlotte barras"
sql_create_context
CREATE TABLE table_728 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What's the year of the first election of the district whose incumbent is Edwin E. Willis?
SELECT "First elected" FROM table_728 WHERE "Incumbent" = 'Edwin E. Willis'
wikisql
CREATE TABLE table_17088705_2 ( swimsuit VARCHAR, preliminary VARCHAR )
Give swimsuit scores of participants 8.847 in preliminary
SELECT swimsuit FROM table_17088705_2 WHERE preliminary = "8.847"
sql_create_context
CREATE TABLE table_72992 ( "Year" real, "Date (Opening)" text, "Date (Closing)" text, "Opening Film" text, "Number of Screening" text, "Award-Winning Film" text )
Which opening film has the opening date of august 23?
SELECT "Opening Film" FROM table_72992 WHERE "Date (Opening)" = 'August 23'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Is butter or bacon better?.
SELECT 'bacon', COUNT(*) FROM Posts WHERE Body LIKE '%bacon%' UNION ALL SELECT 'butter', COUNT(*) FROM Posts WHERE Body LIKE '%butter%'
sede
CREATE TABLE table_66119 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the Score of the 1996 Asian Cup Qualification on June 29, 1996?
SELECT "Score" FROM table_66119 WHERE "Competition" = '1996 asian cup qualification' AND "Date" = 'june 29, 1996'
wikisql
CREATE TABLE table_204_680 ( id number, "released" text, "title" text, "artist" text, "format" text, "language" text )
which artist has released at least 5 albums ?
SELECT "artist" FROM table_204_680 GROUP BY "artist" HAVING COUNT(*) >= 5
squall
CREATE TABLE table_name_51 ( name VARCHAR, points INTEGER )
Who has points larger than 167.5?
SELECT name FROM table_name_51 WHERE points > 167.5
sql_create_context
CREATE TABLE table_15796072_1 ( original_artist VARCHAR, order__number VARCHAR )
Who was the original artist when the order number is 9?
SELECT original_artist FROM table_15796072_1 WHERE order__number = "9"
sql_create_context
CREATE TABLE table_26131768_4 ( district INTEGER, representative VARCHAR )
If the Representative is Barbara sears, what is the district number?
SELECT MAX(district) FROM table_26131768_4 WHERE representative = "Barbara Sears"
sql_create_context
CREATE TABLE table_27150 ( "Rnd." real, "Circuit" text, "LMP1 Winning Team" text, "LMP2 Winning Team" text, "FLM Winning Team" text, "GT1 Winning Team" text, "GT2 Winning Team" text, "Results" text )
Who was the GT2 Winning Team if Greg Mansell Leo Mansell was the LMP1 Winning Team?
SELECT "GT2 Winning Team" FROM table_27150 WHERE "LMP1 Winning Team" = 'Greg Mansell Leo Mansell'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
what is admission type of subject name betty campbell?
SELECT demographic.admission_type FROM demographic WHERE demographic.name = "Betty Campbell"
mimicsql_data
CREATE TABLE table_1289860_2 ( background VARCHAR, hometown VARCHAR )
How many backgrounds are there represented from Memphis, Tennessee?
SELECT COUNT(background) FROM table_1289860_2 WHERE hometown = "Memphis, Tennessee"
sql_create_context
CREATE TABLE table_name_70 ( winner_and_score VARCHAR, finalist VARCHAR )
Which Winner and score has a Finalist of aaron krickstein?
SELECT winner_and_score FROM table_name_70 WHERE finalist = "aaron krickstein"
sql_create_context
CREATE TABLE table_name_78 ( matches INTEGER, drawn VARCHAR, points VARCHAR, place VARCHAR )
What is the highest Matches were the points were smaller than 8, the place was larger than 13, and the drawn is less than 1?
SELECT MAX(matches) FROM table_name_78 WHERE points < 8 AND place > 13 AND drawn < 1
sql_create_context
CREATE TABLE table_32466 ( "Rank" real, "Player" text, "Years" text, "Games" real, "Reb. Avg." real, "Total Rebounds" real )
What was Peter Woolfolk's Total Rebound average?
SELECT SUM("Total Rebounds") FROM table_32466 WHERE "Player" = 'peter woolfolk'
wikisql
CREATE TABLE table_27922 ( "meas. num" real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text )
What was the passing result for the measure with a description of bus and truck operating license bill?
SELECT "passed" FROM table_27922 WHERE "description" = 'Bus and Truck Operating License Bill'
wikisql
CREATE TABLE table_46094 ( "Club" text, "Played" 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 lost has 86 points?
SELECT "Lost" FROM table_46094 WHERE "Points" = '86'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_tit...
how many hours has it been since last time patient 99883 was prescribed clotrimazole during this hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99883 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'clotrimazole' ORDER BY prescriptions.startda...
mimic_iii
CREATE TABLE table_52595 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
Who has a roll value of 422?
SELECT "Name" FROM table_52595 WHERE "Roll" = '422'
wikisql
CREATE TABLE table_11964154_9 ( location_attendance VARCHAR, high_rebounds VARCHAR )
what's the location attendance where high rebounds is nick collison (14)
SELECT location_attendance FROM table_11964154_9 WHERE high_rebounds = "Nick Collison (14)"
sql_create_context
CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance...
Visualize the average experience working length of journalists working on different role type using a bar chart, and could you rank in descending by the total number?
SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type ORDER BY AVG(Years_working) DESC
nvbench
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_DIRE_CD text, MED_DIRE_NM text,...
在2004-06-27到2017-04-29这段时间内,0366537这个医疗机构消耗最多统筹金额的19个科室有哪些
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '0366537' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-06-27' AND '2017-04-29' GROUP BY t_kc21.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 19
css
CREATE TABLE tip ( tip_id int, business_id varchar, text longtext, user_id varchar, likes int, year int, month varchar ) CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE neighborhood ( id int, business_id varchar, neighb...
In which neighborhoods has Michelle reviewed a business ?
SELECT neighborhood.name FROM business, neighborhood, review, user WHERE neighborhood.business_id = business.business_id AND review.business_id = business.business_id AND user.name = 'Michelle' AND user.user_id = review.user_id
yelp