context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what were the five most frequent diagnoses among the patients 30s?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE table_name_75 ( pole VARCHAR, class VARCHAR )
How many poles had a moto2 class?
SELECT pole FROM table_name_75 WHERE class = "moto2"
sql_create_context
CREATE TABLE gyb ( 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...
8773150这家医院在二零零五年的六月九号到二零零六年二月二十四这期间里全部的医疗记录中个人账户的花费和总医疗费花费之间的平均比值
SELECT AVG(t_kc24.PER_ACC_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '8773150' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-06-09' AND '2006-02-24' UNION SELECT AVG(t_kc24.PER_ACC_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_OR...
css
CREATE TABLE table_name_54 ( rank INTEGER, time___sec__ VARCHAR )
What is the rank for the person with time 11.14?
SELECT AVG(rank) FROM table_name_54 WHERE time___sec__ = 11.14
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
let me know the number of patients with diagnoses icd9 code 29634 who were admitted in hospital before 2124.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2124" AND diagnoses.icd9_code = "29634"
mimicsql_data
CREATE TABLE table_name_22 ( player VARCHAR, position VARCHAR, nhl_team VARCHAR )
Who plays goaltender for the Vancouver Canucks?
SELECT player FROM table_name_22 WHERE position = "goaltender" AND nhl_team = "vancouver canucks"
sql_create_context
CREATE TABLE district ( District_name VARCHAR, city_area VARCHAR )
Find all the distinct district names ordered by city area in descending.
SELECT DISTINCT District_name FROM district ORDER BY city_area DESC
sql_create_context
CREATE TABLE table_68181 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Distance (Miles)" text, "Time" text )
What jockey rode for Michael House before 2012
SELECT "Jockey" FROM table_68181 WHERE "Year" < '2012' AND "Owner" = 'michael house'
wikisql
CREATE TABLE table_69463 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the highest attendance when the opponent was the Indians and the record was 13-4?
SELECT MAX("Attendance") FROM table_69463 WHERE "Opponent" = 'indians' AND "Record" = '13-4'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id num...
tell me the costs of a drug named emtricitabine?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'emtricitabine')
mimic_iii
CREATE TABLE table_10236830_6 ( film_name VARCHAR, actors_name VARCHAR )
Which films does the actor Alla Sergiyko star in?
SELECT film_name FROM table_10236830_6 WHERE actors_name = "Alla Sergiyko"
sql_create_context
CREATE TABLE table_test_19 ( "id" int, "gender" string, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "acute_infectious" bool, "hypertensive_retinopathy" bool, "leukocyte_count" int, "severe_uncontrolled_hypertension" bool, "chronic_infectious" boo...
severe uncontrolled hypertension ( >= 180 / 110 ) or hypertensive retinopathy
SELECT * FROM table_test_19 WHERE severe_uncontrolled_hypertension = 1 OR systolic_blood_pressure_sbp >= 180 OR diastolic_blood_pressure_dbp >= 110 OR hypertensive_retinopathy = 1
criteria2sql
CREATE TABLE table_name_34 ( rank VARCHAR, qual VARCHAR )
What is the rank of the 150.163 qual?
SELECT rank FROM table_name_34 WHERE qual = "150.163"
sql_create_context
CREATE TABLE table_75878 ( "Rank" real, "Main span metres" text, "Main span feet" text, "Year opened" real, "Country" text )
What is the oldest year with a main span feet of 1,640 in South Korea?
SELECT MIN("Year opened") FROM table_75878 WHERE "Main span feet" = '1,640' AND "Country" = 'south korea'
wikisql
CREATE TABLE table_20538157_2 ( written_by VARCHAR, no_in_season VARCHAR )
Who were the writers of episode 20?
SELECT written_by FROM table_20538157_2 WHERE no_in_season = 20
sql_create_context
CREATE TABLE table_10953197_4 ( title VARCHAR, production_code VARCHAR )
What's the total number of episodes with the production code 2395113A?
SELECT COUNT(title) FROM table_10953197_4 WHERE production_code = "2395113A"
sql_create_context
CREATE TABLE table_1342359_5 ( district VARCHAR, incumbent VARCHAR )
what's the district with incumbent being richard j. welch
SELECT district FROM table_1342359_5 WHERE incumbent = "Richard J. Welch"
sql_create_context
CREATE TABLE table_28846752_4 ( player VARCHAR, highest_score VARCHAR )
Who is the player when the highest score is 84?
SELECT player FROM table_28846752_4 WHERE highest_score = "84"
sql_create_context
CREATE TABLE sales ( sales_transaction_id number, sales_details text ) CREATE TABLE investors ( investor_id number, investor_details text ) CREATE TABLE purchases ( purchase_transaction_id number, purchase_details text ) CREATE TABLE transactions ( transaction_id number, investor_id n...
What are the details of the lots which are not used in any transactions?
SELECT lot_details FROM lots EXCEPT SELECT T1.lot_details FROM lots AS T1 JOIN transactions_lots AS T2 ON T1.lot_id = T2.lot_id
spider
CREATE TABLE table_name_28 ( icelandic_title VARCHAR, norwegian_title VARCHAR )
What is the Icelandic title for the Norweigan titled galgeblomsten?
SELECT icelandic_title FROM table_name_28 WHERE norwegian_title = "galgeblomsten"
sql_create_context
CREATE TABLE table_name_11 ( home_ground_s_ VARCHAR, name VARCHAR )
What's the Home ground(s) listed for the Name Melville Cricket Club?
SELECT home_ground_s_ FROM table_name_11 WHERE name = "melville cricket club"
sql_create_context
CREATE TABLE table_name_29 ( goals VARCHAR, games VARCHAR )
How many goals were there in game 47?
SELECT goals FROM table_name_29 WHERE games = "47"
sql_create_context
CREATE TABLE table_name_9 ( score VARCHAR, location_attendance VARCHAR, high_rebounds VARCHAR )
What is Score, when Location Attendance is 'Madison Square Garden Unknown', and when High Rebounds is 'Sidney Green (10)'?
SELECT score FROM table_name_9 WHERE location_attendance = "madison square garden unknown" AND high_rebounds = "sidney green (10)"
sql_create_context
CREATE TABLE table_204_785 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many bronze medals did el salvador win ?
SELECT "bronze" FROM table_204_785 WHERE "nation" = 'el salvador'
squall
CREATE TABLE table_name_47 ( area__km_2__ INTEGER, type VARCHAR )
What Area (km 2) is lowest with a type being Apostolic Administration?
SELECT MIN(area__km_2__) FROM table_name_47 WHERE type = "apostolic administration"
sql_create_context
CREATE TABLE table_12280396_1 ( county VARCHAR, peak VARCHAR )
Name the county with the peak being indre russetind?
SELECT county FROM table_12280396_1 WHERE peak = "Indre Russetind"
sql_create_context
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE...
give me a list of flights between PITTSBURGH and BALTIMORE
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BAL...
atis
CREATE TABLE table_26401 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" real )
Name the original air date for harry hannigan directed by adam weissman
SELECT "Original air date" FROM table_26401 WHERE "Written by" = 'Harry Hannigan' AND "Directed by" = 'Adam Weissman'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_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, ...
在号码是8450909的医院里按照不同的科室编码还有出院诊断疾病名称进行排列的医疗就诊记录中所有的患者们的平均年龄是多些啊?
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8450909' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_NM
css
CREATE TABLE table_name_38 ( byes INTEGER, south_west_dfl VARCHAR, wins VARCHAR )
When the team Heathmere of the South West DFL won more than 11 games, what is the maximum byes?
SELECT MAX(byes) FROM table_name_38 WHERE south_west_dfl = "heathmere" AND wins > 11
sql_create_context
CREATE TABLE table_name_30 ( name VARCHAR, law_school_attended VARCHAR, appointed VARCHAR )
Who attended Columbia law school and was appointed in 2004?
SELECT name FROM table_name_30 WHERE law_school_attended = "columbia law school" AND appointed = 2004
sql_create_context
CREATE TABLE table_50756 ( "Year" text, "Total matches" real, "Total W-L-H" text, "Singles W-L-H" text, "Points won" real, "Points %" text )
WHAT YEAR HAD 5 TOTAL MATCHES?
SELECT "Year" FROM table_50756 WHERE "Total matches" = '5'
wikisql
CREATE TABLE table_53708 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
For Venue vfl park, what was the home team score?
SELECT "Home team score" FROM table_53708 WHERE "Venue" = 'vfl park'
wikisql
CREATE TABLE table_1319 ( "Episode" real, "Title" text, "Story" text, "Adapted by" text, "Director" text, "Airdate" text, "Exists?" text )
Name the number of episodes for alan nourse
SELECT COUNT("Episode") FROM table_1319 WHERE "Story" = 'Alan Nourse'
wikisql
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 records from the products and each product's manufacturer, show me about the distribution of name and the average of manufacturer , and group by attribute name in a bar chart, and I want to order in desc by the y axis please.
SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer DESC
nvbench
CREATE TABLE table_30878 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Name the parter for w/o
SELECT "Partner" FROM table_30878 WHERE "Score" = 'w/o'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
在11-12-13到19-01-19期间内,患者凤飞尘被开出的所有检验报告单中的标本采集部位需要列出来
SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '凤飞尘' AND jy...
css
CREATE TABLE drivers ( driverid VARCHAR, forename VARCHAR, surname VARCHAR ) CREATE TABLE laptimes ( driverid VARCHAR )
What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice?
SELECT T1.driverid, T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING COUNT(*) >= 2
sql_create_context
CREATE TABLE table_10972 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
At the match in windy hill, how much did the home team score?
SELECT "Home team score" FROM table_10972 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE table_34466 ( "Outcome" text, "Date" text, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
What was the outcome on 25 october 2004?
SELECT "Outcome" FROM table_34466 WHERE "Date" = '25 october 2004'
wikisql
CREATE TABLE table_32754 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the name of the away team whose venue is Kardinia Park?
SELECT "Away team" FROM table_32754 WHERE "Venue" = 'kardinia park'
wikisql
CREATE TABLE table_68304 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What are Tiger Woods' average earnings?
SELECT AVG("Money ( $ )") FROM table_68304 WHERE "Player" = 'tiger woods'
wikisql
CREATE TABLE table_26375386_23 ( rank INTEGER, vote_percentage VARCHAR )
What was the maximum rank for the vote percentage of 5.6%
SELECT MIN(rank) FROM table_26375386_23 WHERE vote_percentage = "5.6%"
sql_create_context
CREATE TABLE table_37412 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is the score of the game on January 18?
SELECT "Score" FROM table_37412 WHERE "Date" = 'january 18'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( ...
what are the five most frequent drugs that were prescribed in the same hospital encounter to the atrial fibrillation male patients 30s after they have been diagnosed with atrial fibrillation in 2104?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'atrial fibrilla...
eicu
CREATE TABLE table_66223 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location" text, "Record" text )
Which High assists has a Score of w 71-56?
SELECT "High assists" FROM table_66223 WHERE "Score" = 'w 71-56'
wikisql
CREATE TABLE table_1825751_14 ( pageant VARCHAR, hometown VARCHAR )
How many pageants were in san fernando, pampanga?
SELECT COUNT(pageant) FROM table_1825751_14 WHERE hometown = "San Fernando, Pampanga"
sql_create_context
CREATE TABLE table_32079 ( "Model" text, "Release date" text, "Sensor res., size" text, "Lens(35mmequiv.) zoom, aperture" text, "Screen size,pixels" text, "Dimensions W\u00d7H\u00d7D (mm)" text, "Weight" text )
What is the screen size and pixel value when the dimensions are 115.5 83.7 102.5?
SELECT "Screen size,pixels" FROM table_32079 WHERE "Dimensions W\u00d7H\u00d7D (mm)" = '115.5×83.7×102.5'
wikisql
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREA...
Among the least difficult MDE courses , which has the largest class size ?
SELECT DISTINCT department, name, number FROM course WHERE course_id IN (SELECT PROGRAM_COURSE_ID FROM program_course AS PROGRAM_COURSE WHERE PROGRAM_WORKLOAD = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%MDE%')) AND num_enrolled = (S...
advising
CREATE TABLE table_44647 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
how many times is the name Derek Smith when the round is higher than 3?
SELECT COUNT("Overall") FROM table_44647 WHERE "Name" = 'derek smith' AND "Round" > '3'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefin...
Find all users answering question 3368246.
SELECT Id, Id AS "post_link", ParentId, Title, OwnerUserId FROM Posts WHERE ParentId = 3368246 AND PostTypeId = 2
sede
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 jobs ( JOB_ID varchar(10), JOB_TI...
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the sum of employee_id bin hire_date by time, and rank y axis from high to low order.
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(EMPLOYEE_ID) DESC
nvbench
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
calculate the number of dead patients who are less than 70 years of age.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.age < "70"
mimicsql_data
CREATE TABLE table_44101 ( "Nat." text, "Name" text, "Moving from" text, "Type" text, "Transfer window" text, "Ends" real, "Transfer fee" text, "Source" text )
Where is the moving from location with a transfer window of summer and the source kerkida.net?
SELECT "Moving from" FROM table_44101 WHERE "Transfer window" = 'summer' AND "Source" = 'kerkida.net'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date...
For employees with first names that end with the letter 'm', groups and counts the first name to visualize a pie graph.
SELECT FIRST_NAME, COUNT(FIRST_NAME) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME
nvbench
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, ...
知不知道开出检验报告单41571015009的科室名称是啥?编码呢
SELECT zyjybgb.KSBM, zyjybgb.KSMC FROM zyjybgb WHERE zyjybgb.BGDH = '41571015009' UNION SELECT mzjybgb.KSBM, mzjybgb.KSMC FROM mzjybgb WHERE mzjybgb.BGDH = '41571015009'
css
CREATE TABLE table_name_80 ( wins INTEGER, against INTEGER )
How many wins has more than 165 against?
SELECT MAX(wins) FROM table_name_80 WHERE against > 165
sql_create_context
CREATE TABLE People ( person_id INTEGER, first_name VARCHAR(255), middle_name VARCHAR(255), last_name VARCHAR(255), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), login_name VARCHAR(40), password VARCHAR(40) ) CREATE TABLE Courses ( course_id VARCHAR(100), course_nam...
For all course_name from courses table, group by the course name and count them with a bar chart, and list by the the number of course name from low to high.
SELECT course_name, COUNT(course_name) FROM Courses GROUP BY course_name ORDER BY COUNT(course_name)
nvbench
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...
能知道医疗就诊46607257909入院时诊断的疾病编号以及疾病的名称吗
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE MED_CLINIC_ID = '46607257909'
css
CREATE TABLE table_2911 ( "Episode" text, "First broadcast" text, "Davids team" text, "Lees team" text, "Scores" text )
If the lees team is Clare Balding and Miranda Hart, what is the first broadcast total number?
SELECT COUNT("First broadcast") FROM table_2911 WHERE "Lees team" = 'Clare Balding and Miranda Hart'
wikisql
CREATE TABLE table_name_38 ( score VARCHAR, outcome VARCHAR )
What was the score when she was a runner-up?
SELECT score FROM table_name_38 WHERE outcome = "runner-up"
sql_create_context
CREATE TABLE teachers ( lastname text, firstname text, classroom number ) CREATE TABLE list ( lastname text, firstname text, grade number, classroom number )
Find the last names of the students in third grade that are not taught by COVIN JEROME.
SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname <> "COVIN" AND T2.lastname <> "JEROME"
spider
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id ...
Check Strunk und White process. Return how far I have to go to get S&W
SELECT 100 - COUNT(*) AS "Edits To Strunk & White" FROM Posts WHERE PostTypeId = 1 AND LastEditorUserId = @UserId AND OwnerUserId != @UserId
sede
CREATE TABLE table_40324 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the most top-10 of the team with 8 cuts made and less than 11 events?
SELECT MAX("Top-10") FROM table_40324 WHERE "Cuts made" = '8' AND "Events" < '11'
wikisql
CREATE TABLE table_68845 ( "Round" real, "Name" text, "Position" text, "School" text, "Signed" text )
what is the school when signed is no and round is 50?
SELECT "School" FROM table_68845 WHERE "Signed" = 'no' AND "Round" = '50'
wikisql
CREATE TABLE table_name_40 ( run_1 INTEGER, run_2 VARCHAR, athlete VARCHAR )
What is the sum of the run 1 of athlete matthias guggenberger, who has a run 2 greater than 55.24?
SELECT SUM(run_1) FROM table_name_40 WHERE run_2 > 55.24 AND athlete = "matthias guggenberger"
sql_create_context
CREATE TABLE table_name_16 ( date_of_release VARCHAR, title VARCHAR )
When was twenty released?
SELECT date_of_release FROM table_name_16 WHERE title = "twenty"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients whose diagnoses icd9 code is 6824 and lab test category is blood gas?
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 = "6824" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_14914 ( "Season" text, "Series" text, "Races" text, "Wins" text, "Podiums" text, "Points" text, "Final Placing" text )
Which Podium has 1 Race and a Final Place of 5th?
SELECT "Podiums" FROM table_14914 WHERE "Races" = '1' AND "Final Placing" = '5th'
wikisql
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE weather ( date TEXT, ...
In zip code 94107, on which day neither Fog nor Rain was not observed, and count them by a bar chart, order total number in ascending order please.
SELECT date, COUNT(date) FROM weather WHERE zip_code = 94107 AND events <> "Fog" AND events <> "Rain" ORDER BY COUNT(date)
nvbench
CREATE TABLE table_204_155 ( id number, "rank" number, "heat" number, "athlete" text, "nationality" text, "time" number, "notes" text )
did adrienne power or kim wall have a faster time ?
SELECT "athlete" FROM table_204_155 WHERE "athlete" IN ('adrienne power', 'kim wall') ORDER BY "time" LIMIT 1
squall
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
患者许天蓝入院诊断疾病名称包含阻塞性的医疗就诊记录在医院0791593编号是什么?
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '许天蓝' AND gwyjzb.MED_SER_ORG_NO = '0791593' AND gwyjzb.IN_DIAG_DIS_NM LIKE '%阻塞性%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '许天蓝' AND fgwyjzb.MED_SER_ORG_NO = '0791593' AND fgwyjzb.IN_DIAG_DIS_NM LIKE '%阻塞性%'
css
CREATE TABLE table_35098 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text )
What incumbent was re-elected in the district in california 3?
SELECT "Incumbent" FROM table_35098 WHERE "Result" = 're-elected' AND "District" = 'california 3'
wikisql
CREATE TABLE table_3958 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
What episode number of the series had a production code of bdf409?
SELECT MIN("Series #") FROM table_3958 WHERE "Production code" = 'BDF409'
wikisql
CREATE TABLE table_19514 ( "DVD name" text, "Ep No." real, "DVD No." real, "Release date" real, "Additional information" text )
How many release dates does volume 4 DVD have?
SELECT COUNT("Release date") FROM table_19514 WHERE "DVD name" = 'Volume 4'
wikisql
CREATE TABLE table_204_28 ( id number, "election" text, "name of the party/alliance" text, "number of votes" number, "percentage" text, "seats in the parliament" number )
compared to 1998 , what is the difference in seats won in the 2001 election cycle ?
SELECT ABS((SELECT "seats in the parliament" FROM table_204_28 WHERE "election" = 2001) - (SELECT "seats in the parliament" FROM table_204_28 WHERE "election" = 1998))
squall
CREATE TABLE table_53718 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What is the lowest attendance on November 18?
SELECT MIN("Attendance") FROM table_53718 WHERE "Date" = 'november 18'
wikisql
CREATE TABLE table_70177 ( "Pick #" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What is the position of the player on the Los Angeles Kings?
SELECT "Position" FROM table_70177 WHERE "NHL team" = 'los angeles kings'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microb...
since 3 years ago what was the three most frequently given procedure for patients 40s?
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, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
mimic_iii
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( in...
what was the name of the drug that patient 015-91239 had been prescribed two times in the current hospital encounter.
SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015...
eicu
CREATE TABLE table_28073 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
Name the player for 1 touchdowns
SELECT "Player" FROM table_28073 WHERE "Touchdowns" = '1'
wikisql
CREATE TABLE table_398 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many games was Damien Wilkins (27) the high scorer?
SELECT MIN("Game") FROM table_398 WHERE "High points" = 'Damien Wilkins (27)'
wikisql
CREATE TABLE table_50188 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Nickname" text )
Who is affiliated with the nickname Ramblers?
SELECT "Affiliation" FROM table_50188 WHERE "Nickname" = 'ramblers'
wikisql
CREATE TABLE table_name_28 ( to_par VARCHAR, player VARCHAR )
What is Gene Sauers' to par?
SELECT to_par FROM table_name_28 WHERE player = "gene sauers"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE T...
How many of my edits have been rolled back?. Lists all of your posts where someone else performed a rollback after your edit. There could be some false positives here, where someone edited after you and the rollback just reverted their changes (and not yours).
SELECT DISTINCT edits.PostId AS "post_link", edits.Comment AS "edit_comment", edits.CreationDate AS "edit_date", rollbacks.Comment AS "rollback_comment", rollbacks.CreationDate AS "rollback_date" FROM PostHistory AS edits INNER JOIN PostHistory AS rollbacks ON edits.PostId = rollbacks.PostId AND rollbacks.CreationDate ...
sede
CREATE TABLE table_55982 ( "Name" text, "Current version" text, "System" text, "Platform" text, "License" text )
What is the System with a freeware License?
SELECT "System" FROM table_55982 WHERE "License" = 'freeware'
wikisql
CREATE TABLE table_54623 ( "Pitcher" text, "Date" text, "Team" text, "Result" text, "Site" text )
I want the date for rockies
SELECT "Date" FROM table_54623 WHERE "Team" = 'rockies'
wikisql
CREATE TABLE table_69313 ( "Nat." text, "Name" text, "Since" text, "Goals" real, "Ends" real, "Transfer fee" text )
Add up all the Ends columns that have goals smaller than 0.
SELECT SUM("Ends") FROM table_69313 WHERE "Goals" < '0'
wikisql
CREATE TABLE table_62967 ( "play" text, "author" text, "company" text, "base" text, "country" text )
Which Country's Author is based on Sophocles and Euripides?
SELECT "country" FROM table_62967 WHERE "author" = 'based on sophocles and euripides'
wikisql
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...
how many patients whose ethnicity is american indian/alaska native and procedure short title is adm inhal nitric oxide?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND procedures.short_title = "Adm inhal nitric oxide"
mimicsql_data
CREATE TABLE table_8749 ( "Name/Designation" text, "Class" text, "Range (varies with payload weight)" text, "Payload" text, "Status" text )
What is the payload for Class MRBM, and a range of 1,930km?
SELECT "Payload" FROM table_8749 WHERE "Class" = 'mrbm' AND "Range (varies with payload weight)" = '1,930km'
wikisql
CREATE TABLE table_name_76 ( fastest_time__s_ INTEGER, location VARCHAR, rank VARCHAR )
What is the top fastest time, larger than 2, in Enugu?
SELECT MAX(fastest_time__s_) FROM table_name_76 WHERE location = "enugu" AND rank > 2
sql_create_context
CREATE TABLE table_23180638_1 ( peak_position VARCHAR, oricon_albums_chart VARCHAR )
How many peak positions were there on the daily charts?
SELECT peak_position FROM table_23180638_1 WHERE oricon_albums_chart = "Daily Charts"
sql_create_context
CREATE TABLE table_name_24 ( score_in_the_final VARCHAR, date VARCHAR )
What was the final score on March 22, 1993?
SELECT score_in_the_final FROM table_name_24 WHERE date = "march 22, 1993"
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 diagnoses ( ...
Find the insurance of subject id 3284.
SELECT demographic.insurance FROM demographic WHERE demographic.subject_id = "3284"
mimicsql_data
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...
看看病人朱泰和在10.8.21到16.12.05内所有检验报告单中的标本采集部位,把这些采集部位都列出来
SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb 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 AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = ...
css
CREATE TABLE table_43033 ( "Season" text, "Team" text, "Country" text, "League" text, "Level" real, "Apps" real, "Goals" real )
What is the average Goals for team Kairat, in the 2002 season with more than 29 apps?
SELECT AVG("Goals") FROM table_43033 WHERE "Team" = 'kairat' AND "Season" = '2002' AND "Apps" > '29'
wikisql
CREATE TABLE table_32382 ( "Stage" text, "Date" text, "Route" text, "Terrain" text, "Length" text, "Winner" text )
Which date has a Terrain of plain stage, and a Stage of 4?
SELECT "Date" FROM table_32382 WHERE "Terrain" = 'plain stage' AND "Stage" = '4'
wikisql
CREATE TABLE table_name_14 ( rider VARCHAR, time VARCHAR )
What Rider had a Time of +1:08.291?
SELECT rider FROM table_name_14 WHERE time = "+1:08.291"
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...
let me know the short title of procedure and death date of patient with patient id 15898.
SELECT demographic.dod, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "15898"
mimicsql_data