context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE roller_coaster ( Country_ID VARCHAR, Height VARCHAR ) CREATE TABLE country ( Name VARCHAR, population VARCHAR, Country_ID VARCHAR )
Show the name and population of the country that has the highest roller coaster.
SELECT T1.Name, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID ORDER BY T2.Height DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_72 ( date VARCHAR, result VARCHAR )
When did the w 20-19 happen?
SELECT date FROM table_name_72 WHERE result = "w 20-19"
sql_create_context
CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varcha...
How many instructors are in each department? Show me a bar chart, sort by the x axis in asc.
SELECT T1.dept_name, COUNT(DISTINCT T3.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY T1.dept_name
nvbench
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
Is an Scientific Writing lab planned for this year ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE (course.description LIKE '%lab%' OR course.name LIKE '%lab%') AND (course.description LIKE '%Scientific Writing%' OR course.name LIKE '%Scientific Writing%') AND course.course_id = course_offering.course_id AND semester.semester_id = course_offering.semes...
advising
CREATE TABLE table_8902 ( "Consonant final stem" text, "Example: did-" text, "Vowel final stem" text, "Example: ch'aghara-" text, "Noun example: datv-" text )
What example for did- is shown for a Consonant final stem of -i, and a Noun example: datv- of datv-it?
SELECT "Example: did-" FROM table_8902 WHERE "Consonant final stem" = '-i' AND "Noun example: datv-" = 'datv-it'
wikisql
CREATE TABLE table_79972 ( "Rank" real, "Mine" text, "County" text, "Operator" text, "Source of copper" text, "2012 Cu Production (lbs)" real )
What's the lowest ranking source of copper, copper ore, concentrated and leached?
SELECT MIN("Rank") FROM table_79972 WHERE "Source of copper" = 'copper ore, concentrated and leached'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0),...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of last_name and employee_id .
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE t_kc21 ( 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, ...
列出患者55178621医疗记录中的入院诊断疾病编码和名称,主要针对医疗费总额高于9322.98元的
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '55178621' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 9322.98)
css
CREATE TABLE table_65594 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What is the Outcome of the Match played after 2003 with a Score of 6 0, 6 3?
SELECT "Outcome" FROM table_65594 WHERE "Year" > '2003' AND "Score" = '6–0, 6–3'
wikisql
CREATE TABLE table_7249 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
What is the Original artist when the week number is top 9?
SELECT "Original artist" FROM table_7249 WHERE "Week #" = 'top 9'
wikisql
CREATE TABLE table_203_494 ( id number, "party" text, "votes" number, "%" number, "swing" number, "seats" number, "change" number )
the nationals sa and independent party make up what percentage of votes ?
SELECT SUM("%") FROM table_203_494 WHERE "party" IN ('nationals sa', 'independent')
squall
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id...
has patient 77676 ever had any surgery until 1 year ago?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77676) AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-1 year')
mimic_iii
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Projects ( Project_ID...
Show budget type codes and the number of documents in each budget type with a bar chart, could you sort by the the total number from low to high?
SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY COUNT(*)
nvbench
CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) ) CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80...
How many accounts are opened in each year? Show a line chart, and list by the X-axis from low to high.
SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts ORDER BY date_account_opened
nvbench
CREATE TABLE table_25366 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
On what date did the Pistons play @ toronto?
SELECT "Date" FROM table_25366 WHERE "Team" = '@ Toronto'
wikisql
CREATE TABLE table_15439 ( "Riding" text, "Province" text, "Candidate" text, "Votes" real, "Placement" text )
What is the Placement when the Votes are fewer than 208, and when the Candidate is Jordan Turner?
SELECT "Placement" FROM table_15439 WHERE "Votes" < '208' AND "Candidate" = 'jordan turner'
wikisql
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, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
41736838这位患者的妊娠相关性血浆蛋白-A指标在08年4月18日至10月22日期间的情况
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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....
css
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...
Give me a bar chart for how many grape of each grape, and I want to order by the bars in descending.
SELECT Grape, COUNT(Grape) FROM wine GROUP BY Grape ORDER BY Grape DESC
nvbench
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
what is the name of procedure patient 4368 has been given two times in 06/2105?
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 = 436...
mimic_iii
CREATE TABLE table_name_60 ( total_fat VARCHAR, polyunsaturated_fat VARCHAR, monounsaturated_fat VARCHAR )
Name the total fat which has a polyunsaturated fat of 11g and monounsaturated fat of 45g
SELECT total_fat FROM table_name_60 WHERE polyunsaturated_fat = "11g" AND monounsaturated_fat = "45g"
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 )
Display a bar chart for how many products are there for each manufacturer?, and order in asc by the names.
SELECT T2.Name, COUNT(*) 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_name_18 ( score VARCHAR, february VARCHAR )
what score was on february 21
SELECT score FROM table_name_18 WHERE february = 21
sql_create_context
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text )
Compare the total number of each fate with a bar chart, could you show by the the number of fate in desc?
SELECT Fate, COUNT(Fate) FROM mission GROUP BY Fate ORDER BY COUNT(Fate) DESC
nvbench
CREATE TABLE table_55823 ( "Year" real, "Championship" text, "54 holes" text, "Winning score" text, "Margin" text, "Runner(s)-up" text )
What is the margin for the Masters Tournament (2) championship?
SELECT "Margin" FROM table_55823 WHERE "Championship" = 'masters tournament (2)'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
which type of drug has been given to kelly gallardo?
SELECT prescriptions.drug_type FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Kelly Gallardo"
mimicsql_data
CREATE TABLE table_1139835_1 ( crowd INTEGER, scores VARCHAR )
what was the crowd when the scores are 10.12 (72) 8.11 (59)?
SELECT MAX(crowd) FROM table_1139835_1 WHERE scores = "10.12 (72) – 8.11 (59)"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JO...
Plot the average of salary by grouped by hire date as a bar graph
SELECT HIRE_DATE, AVG(SALARY) FROM employees
nvbench
CREATE TABLE table_70933 ( "Team" text, "Manager 1" text, "Captain" text, "Kit manufacturer" text, "Shirt sponsor" text )
Who was the team captain of the Bolton Wanderers?
SELECT "Captain" FROM table_70933 WHERE "Team" = 'bolton wanderers'
wikisql
CREATE TABLE table_17740 ( "Team" text, "Car(s)" text, "#" real, "Driver(s)" text, "Primary Sponsor(s)" text, "Owner(s)" text, "Crew Chief" text )
What is the driver for the team whose primary sponsor is Quicken Loans / Haas Automation?
SELECT "Driver(s)" FROM table_17740 WHERE "Primary Sponsor(s)" = 'Quicken Loans / Haas Automation'
wikisql
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, ...
查一下花志专这个患者之前的门诊诊断证明
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 table_44791 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text )
What kind of report was for the game played on 29 November with Melbourne Tigers being the away team?
SELECT "Report" FROM table_44791 WHERE "Date" = '29 november' AND "Away team" = 'melbourne tigers'
wikisql
CREATE TABLE table_name_97 ( adelaide VARCHAR, gold_coast VARCHAR, auckland VARCHAR, melbourne VARCHAR )
yes or no for the adelaide with no for auckland, yes for melbourne, yes for the gold coast?
SELECT adelaide FROM table_name_97 WHERE auckland = "no" AND melbourne = "yes" AND gold_coast = "yes"
sql_create_context
CREATE TABLE table_14697 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the top rank with a time of 2:19.86?
SELECT MAX("Rank") FROM table_14697 WHERE "Time" = '2:19.86'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many urgent hospital admission patients had open reduction of femur fracture with internal fixation?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Open reduc-int fix femur"
mimicsql_data
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) 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...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of job_id and department_id , could you order by the DEPARTMENT_ID in asc please?
SELECT JOB_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID
nvbench
CREATE TABLE table_56138 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which Venue has an Away team score of 13.12 (90)?
SELECT "Venue" FROM table_56138 WHERE "Away team score" = '13.12 (90)'
wikisql
CREATE TABLE table_name_92 ( driver VARCHAR, laps VARCHAR )
Which driver has 45 laps?
SELECT driver FROM table_name_92 WHERE laps = 45
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, ...
Most common display names.
SELECT DisplayName, COUNT(DisplayName) AS N FROM Users GROUP BY DisplayName ORDER BY N DESC LIMIT 100
sede
CREATE TABLE table_54476 ( "National team" text, "Club" text, "Season" text, "Apps" real, "Goals" real )
In the 2010 season what club has 0 goals and more than 0 Apps?
SELECT "Club" FROM table_54476 WHERE "Goals" = '0' AND "Apps" > '0' AND "Season" = '2010'
wikisql
CREATE TABLE table_11996 ( "Date" text, "Round" text, "Attendance" text, "Opposition" text, "Stadium" text )
Who's the opposition at westpac stadium when the attendance is 31,853?
SELECT "Opposition" FROM table_11996 WHERE "Stadium" = 'westpac stadium' AND "Attendance" = '31,853'
wikisql
CREATE TABLE table_53940 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
Tell me the sum of draws for position less than 15 with played more than 38
SELECT SUM("Draws") FROM table_53940 WHERE "Position" < '15' AND "Played" > '38'
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, ...
provide the number of patients whose discharge location is home health care and procedure long title is percutaneous abdominal drainage?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.long_title = "Percutaneous abdominal drainage"
mimicsql_data
CREATE TABLE table_13952 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
what is the score for the tournament cagnes-sur-mer?
SELECT "Score" FROM table_13952 WHERE "Tournament" = 'cagnes-sur-mer'
wikisql
CREATE TABLE Procedures ( Code INTEGER, Name VARCHAR(30), Cost REAL ) CREATE TABLE Nurse ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), Registered BOOLEAN, SSN INTEGER ) CREATE TABLE Undergoes ( Patient INTEGER, Procedures INTEGER, Stay INTEGER, DateUnder...
List the number of the name of physicians who took some appointment, could you display X-axis in desc order please?
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Physician AS T2 ON T1.Physician = T2.EmployeeID GROUP BY Name ORDER BY Name DESC
nvbench
CREATE TABLE table_name_88 ( to_par INTEGER, player VARCHAR )
What is Robert Allenby's average to par score?
SELECT AVG(to_par) FROM table_name_88 WHERE player = "robert allenby"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, ...
Top 200 Users in Ohio.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%oh%' OR LOWER(Location) LIKE '%ohio%' ORDER BY Reputation DESC LIMIT 200
sede
CREATE TABLE table_name_65 ( date VARCHAR, format VARCHAR, label VARCHAR )
What is Date, when Format is Vinyl, and when Label is Mercury?
SELECT date FROM table_name_65 WHERE format = "vinyl" AND label = "mercury"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
when did patient 021-49082 get a lab test for the first time?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-49082')) ORDER BY lab.labresulttime LIMIT 1
eicu
CREATE TABLE table_60489 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What is the to par of Philip Parkin?
SELECT "To par" FROM table_60489 WHERE "Player" = 'philip parkin'
wikisql
CREATE TABLE table_17145 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text )
Kimball, toby toby kimball is a player; How many times at school/ club team/country was the player present?
SELECT COUNT("School/Club Team/Country") FROM table_17145 WHERE "Player" = 'Kimball, Toby Toby Kimball'
wikisql
CREATE TABLE table_64080 ( "Year" real, "Category" text, "Film" text, "Result" text, "Lost to" text )
which Category has a Result of nominated, and a Lost to of jennifer westfeldt ( kissing jessica stein )?
SELECT "Category" FROM table_64080 WHERE "Result" = 'nominated' AND "Lost to" = 'jennifer westfeldt ( kissing jessica stein )'
wikisql
CREATE TABLE table_name_9 ( rank VARCHAR, athlete VARCHAR )
What rank was Lassi Karonen?
SELECT COUNT(rank) FROM table_name_9 WHERE athlete = "lassi karonen"
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 ) ...
get me the number of urgent hospital admission patients who stayed in hospital for more than 3 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.days_stay > "3"
mimicsql_data
CREATE TABLE table_15708 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
How high did Arnold Palmer score in 1962?
SELECT MAX("Score") FROM table_15708 WHERE "Player" = 'arnold palmer'
wikisql
CREATE TABLE table_name_49 ( gsr_class VARCHAR, type VARCHAR )
What GSR class is associated with a 0-4-2t type?
SELECT gsr_class FROM table_name_49 WHERE type = "0-4-2t"
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...
哪些药品供患有胃炎的患者开出,查一下编号和名称
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.IN_DIAG_DIS_NM = '胃炎' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.IN_DIAG_DIS_N...
css
CREATE TABLE table_25774493_3 ( blocks_per_game VARCHAR, field_goal_percentage VARCHAR )
What were the blocks per game in the selection where the field goal percentage was .594 (2nd)?
SELECT blocks_per_game FROM table_25774493_3 WHERE field_goal_percentage = ".594 (2nd)"
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 ...
Provide the number of patients diagnosed with bowel obstruction whose lab test fluid is blood.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND lab.fluid = "Blood"
mimicsql_data
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年10月2日到06年11月3日期间,张和暖消费多少医保金额?
SELECT SUM(t_kc24.PER_ACC_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '张和暖' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-10-02' AND '2006-11-03' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '张和暖' A...
css
CREATE TABLE table_16560 ( "#" real, "Episode" text, "Air Date" text, "Time slot (EST)" text, "Rating" text, "Share" real, "18-49 (Rating/Share)" text, "Viewers (m)" text, "Rank (Overall)" text )
What time slot is the episode 'the way we weren't' in
SELECT "Time slot (EST)" FROM table_16560 WHERE "Episode" = 'The Way We Weren''t'
wikisql
CREATE TABLE table_name_80 ( group_position VARCHAR, result_f_a VARCHAR )
Result F A of 2 0 had what group position?
SELECT group_position FROM table_name_80 WHERE result_f_a = "2–0"
sql_create_context
CREATE TABLE qtb ( 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...
5148275这个医疗机构在04年5月16日到2018年7月7日这个时间段内处理了几次异地就诊?
SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5148275' AND qtb.IN_HOSP_DATE BETWEEN '2004-05-16' AND '2018-07-07' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5148275' AND gyb.IN_HOSP_DATE BETWEEN '2004-05-16' AND '2018-07-07' AND g...
css
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 marital status is single and primary disease is hypoxia?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "HYPOXIA"
mimicsql_data
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
A scatter chart shows the correlation between Team_ID and School_ID .
SELECT Team_ID, School_ID FROM basketball_match
nvbench
CREATE TABLE table_2762 ( "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 avg finish for position of 70th
SELECT "Avg. Finish" FROM table_2762 WHERE "Position" = '70th'
wikisql
CREATE TABLE table_17085947_32 ( swim__15km_ VARCHAR, athlete VARCHAR )
What was the duration of Daniela Ryf's swimming stage?
SELECT swim__15km_ FROM table_17085947_32 WHERE athlete = "Daniela Ryf"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
count the number of patients whose admission year is less than 2158 and procedure short title is inject ca chemother nec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2158" AND procedures.short_title = "Inject ca chemother NEC"
mimicsql_data
CREATE TABLE table_name_4 ( club VARCHAR, capacity VARCHAR )
Which club has a capacity of 25138?
SELECT club FROM table_name_4 WHERE capacity = "25138"
sql_create_context
CREATE TABLE table_name_23 ( year VARCHAR, pick VARCHAR )
What year was the player pick number 15 picked?
SELECT year FROM table_name_23 WHERE pick = "15"
sql_create_context
CREATE TABLE table_name_74 ( race VARCHAR, date VARCHAR )
What race occurred on the date of 15 June?
SELECT race FROM table_name_74 WHERE date = "15 june"
sql_create_context
CREATE TABLE HOTELS ( Id VARCHAR )
How many available hotels are there in total?
SELECT COUNT(*) FROM HOTELS
sql_create_context
CREATE TABLE table_name_23 ( first_election VARCHAR, name VARCHAR )
What is Kerry J. Donley's First Election date?
SELECT first_election FROM table_name_23 WHERE name = "kerry j. donley"
sql_create_context
CREATE TABLE Course_Authors_and_Tutors ( login_name VARCHAR, author_id VARCHAR ) CREATE TABLE Courses ( author_id VARCHAR, course_name VARCHAR )
Find the login name of the course author that teaches the course with name 'advanced database'.
SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "advanced database"
sql_create_context
CREATE TABLE table_60809 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text )
Who was the first elected for the republican party?
SELECT "First elected" FROM table_60809 WHERE "Party" = 'republican'
wikisql
CREATE TABLE table_44333 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real )
what is the time when the laps is less than 21 and the grid is more than 17?
SELECT "Time" FROM table_44333 WHERE "Laps" < '21' AND "Grid" > '17'
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 jybgb ( BBCJBW text, BBDM tex...
00年6月2号到06年12月18号,患者方欣悦的236211指标是怎样的
SELECT * FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
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...
what is the number of patients whose diagnoses icd9 code is v1083 and lab test fluid is other body fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "V1083" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_name_39 ( laps VARCHAR, grid VARCHAR )
When the grid number is 10, what is the total number of laps?
SELECT COUNT(laps) FROM table_name_39 WHERE grid = 10
sql_create_context
CREATE TABLE table_name_69 ( avg_g VARCHAR, name VARCHAR, loss VARCHAR )
What's cameron dantley's total avg/g for loss less than 35?
SELECT COUNT(avg_g) FROM table_name_69 WHERE name = "cameron dantley" AND loss < 35
sql_create_context
CREATE TABLE table_name_89 ( order INTEGER, built VARCHAR )
with build 5/69-6/69 what's the order?
SELECT SUM(order) FROM table_name_89 WHERE built = "5/69-6/69"
sql_create_context
CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real ) CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of...
Find the component amounts and names of all furnitures that have more than 10 components, order by the Num_of_Component in descending.
SELECT Name, Num_of_Component FROM furniture WHERE Num_of_Component > 10 ORDER BY Num_of_Component DESC
nvbench
CREATE TABLE gwyjzb ( 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, ...
因患疾病G15.489的人在2004年7月3日到2008年9月9日内在预防保健科住院产生的平均费用是多少?
SELECT AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_NM = '预防保健科' AND gwyjzb.IN_HOSP_DATE BETWEEN '2004-07-03' AND '2008-09-09' AND gwyjzb.IN_DIAG_DIS_CD = 'G15.489' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_NM = '预防保健科' AND fgwyjzb.IN_HOSP_D...
css
CREATE TABLE table_name_53 ( bronze INTEGER, nation VARCHAR, total VARCHAR )
What is the average Bronze, when Nation is 'North Korea', and when Total is greater than 5?
SELECT AVG(bronze) FROM table_name_53 WHERE nation = "north korea" AND total > 5
sql_create_context
CREATE TABLE table_25604014_9 ( directed_by VARCHAR, production_code VARCHAR )
Name who directed the production code 1l10
SELECT directed_by FROM table_25604014_9 WHERE production_code = "1L10"
sql_create_context
CREATE TABLE table_name_76 ( website VARCHAR, founded VARCHAR )
Which website has 1921 as the year founded?
SELECT website FROM table_name_76 WHERE founded = 1921
sql_create_context
CREATE TABLE table_203_180 ( id number, "#" number, "weekend end date" text, "film" text, "weekend gross (millions)" text, "notes" text )
what films had their weekend end dates in january ?
SELECT "film" FROM table_203_180 WHERE "weekend end date" = 1
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
what is the maximum hospital cost when it involves acute copd exacerbation since 4 years ago?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'acute copd exacerbation')) AND DATETIME(cost...
eicu
CREATE TABLE table_63411 ( "Year" text, "Matches" real, "Tries" real, "Goals" real, "Points" real )
What are the lowest points with 2013 as the year, and goals less than 0?
SELECT MIN("Points") FROM table_63411 WHERE "Year" = '2013' AND "Goals" < '0'
wikisql
CREATE TABLE table_47062 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
On what date was the catalog scyl-934,623 for Australia?
SELECT "Date" FROM table_47062 WHERE "Catalog" = 'scyl-934,623' AND "Region" = 'australia'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
请提供云秀美这位病患从17.9.12起,截止到20.12.29期间就诊医生数
SELECT COUNT(txmzjzjlb.ZZYSGH) 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 = '云秀美' AND txmzjzjlb.JZKSRQ BETWEEN '2017-09-12' AND '2020-12-29' UNION SELECT COUNT(ft...
css
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar...
During the Fall , what classes are available ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'Fall' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_name_70 ( location VARCHAR, distance VARCHAR )
What's the location for men's speed skating?
SELECT location FROM table_name_70 WHERE distance = "men's speed skating"
sql_create_context
CREATE TABLE table_41765 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which country had more than 2 silvers and less than 4 golds?
SELECT "Nation" FROM table_41765 WHERE "Silver" > '2' AND "Gold" < '4'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
what are the top three medications that were prescribed to mouth and jaw tumor - oral cavity squamous cell ca female patients of the 60 or above during the same month after they have been diagnosed with mouth and jaw tumor - oral cavity squamous cell ca?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'mouth and jaw tumor - oral cavity squamous cell ca...
eicu
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...
统计入院诊断为H46.282的在医院4458801的医疗记录中有什么最低和最高医疗费总额?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4458801' AND gwyjzb.IN_DIAG_DIS_CD = 'H46.282' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '4458801' AND fgwyjzb.IN_DIA...
css
CREATE TABLE table_70726 ( "Artist" text, "Country of origin" text, "Period active" text, "Release-year of first charted record" real, "Genre" text, "Claimed sales" text )
What is the Genre when the Artist is Prince?
SELECT "Genre" FROM table_70726 WHERE "Artist" = 'prince'
wikisql
CREATE TABLE table_18290 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
what's the incumbent with district being massachusetts 2
SELECT "Incumbent" FROM table_18290 WHERE "District" = 'Massachusetts 2'
wikisql
CREATE TABLE table_name_88 ( total INTEGER, player VARCHAR )
What is the total of Mark O'meara?
SELECT MIN(total) FROM table_name_88 WHERE player = "mark o'meara"
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...
Azure threads average Day To Answer by month.
SELECT COUNT(*) AS AnsweredVolume, SUM(CAST((JULIANDAY(CreationDate) - JULIANDAY(P.CreationDate)) * 1440.0 AS INT)) AS TotalTime, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P INNER JOIN Posts AS P1 ON P.AcceptedAnswerId = P1.Id WHERE (P.Tags LIKE '%<azure%' OR ...
sede
CREATE TABLE has_allergy ( StuID VARCHAR, allergy VARCHAR ) CREATE TABLE Student ( StuID VARCHAR, sex VARCHAR )
How many female students have milk or egg allergies?
SELECT COUNT(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = "F" AND T1.allergy = "Milk" OR T1.allergy = "Eggs"
sql_create_context