context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_22510 ( "Province, Community" text, "Contestant" text, "Age" real, "Height" text, "Hometown" text, "Geographical Regions" text )
When toronto is the hometown how many height measurements are there?
SELECT COUNT("Height") FROM table_22510 WHERE "Hometown" = 'Toronto'
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
since 3 years ago, patient 88659 has been tested for rbc, pleural?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rbc, pleural') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88659) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-3 year'...
mimic_iii
CREATE TABLE table_80058 ( "Year" text, "English title" text, "Original title" text, "Country" text, "Director" text )
What's the English title listed that has an Original title of The Crying Game?
SELECT "English title" FROM table_80058 WHERE "Original title" = 'the crying game'
wikisql
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_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATIO...
For those employees who did not have any job in the past, give me the comparison about the sum of employee_id over the job_id , and group by attribute job_id, and display total number from low to high order.
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID)
nvbench
CREATE TABLE table_203_497 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
what country has won no silver medals ?
SELECT "nation" FROM table_203_497 WHERE "silver" = 0
squall
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, ...
in 2105, what are the top three most frequent treatments that patients were given in the same month after the diagnosis of post spinal surgery - thoracic?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'post spinal surgery - thoracic' AND STRF...
eicu
CREATE TABLE table_45079 ( "Number notation" real, "Power notation" text, "Short scale" text, "Long scale" text, "Indian (or South Asian) English" text )
For a short scale of one quadrillion a thousand trillion, what is the Long scale?
SELECT "Long scale" FROM table_45079 WHERE "Short scale" = 'one quadrillion a thousand trillion'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
在两千年七月三十日至两千零四年二月二十九日期间医院4897749有几科室在门诊就诊中开出了超过30张检验报告单?
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '4897749' AND jybgb.BGRQ BETWEEN '2000-07-30' AND '2004-02-29' GROUP BY jybgb.KSBM HAVING COUNT(*) > 30 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb ...
css
CREATE TABLE table_25365 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the total number of rebounds on november 27?
SELECT COUNT("High rebounds") FROM table_25365 WHERE "Date" = 'November 27'
wikisql
CREATE TABLE table_14779 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What is the region for Catalog amlh 66078 in stereo lp format?
SELECT "Region" FROM table_14779 WHERE "Format" = 'stereo lp' AND "Catalog" = 'amlh 66078'
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...
give the average age of married patients who were admitted in or after the year 2187.
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear >= "2187"
mimicsql_data
CREATE TABLE table_20194 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
Name the number of players for louisiana state
SELECT COUNT("Player") FROM table_20194 WHERE "School/Club Team" = 'Louisiana State'
wikisql
CREATE TABLE table_name_27 ( number_of_seasons_in_liga_mx INTEGER, club VARCHAR )
What is the highest Number of seasons in Liga MX for Club cruz azul?
SELECT MAX(number_of_seasons_in_liga_mx) FROM table_name_27 WHERE club = "cruz azul"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
列出8322376这个医院内有多少科室在2003年5月20日到2018年4月7日期间涉及的医疗费总额高于7725.47元
SELECT COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '8322376' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-05-20' AND '2018-04-07' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 7725.47) AS T
css
CREATE TABLE table_name_40 ( total VARCHAR, player VARCHAR )
Which Total has a Player of matt ruth?
SELECT total FROM table_name_40 WHERE player = "matt ruth"
sql_create_context
CREATE TABLE table_train_24 ( "id" int, "systolic_blood_pressure_sbp" int, "do_not_resuscitate_dnr" bool, "temperature" float, "hypotension" bool, "cardiac_arrest" bool, "age" float, "NOUSE" float )
age >= 18 years
SELECT * FROM table_train_24 WHERE age >= 18
criteria2sql
CREATE TABLE table_17210 ( "Round" real, "Overall" text, "Player" text, "Position" text, "Nationality" text, "Club team" text )
How many rounds is the player Matthew Puempel associated with?
SELECT COUNT("Round") FROM table_17210 WHERE "Player" = 'Matthew Puempel'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
what was the name of the drug that's been prescribed to patient 73713 two times during their first hospital visit?
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) GROUP BY prescriptions.drug) A...
mimic_iii
CREATE TABLE table_204_532 ( id number, "season" text, "tier" number, "division" text, "place" text )
how many times did they place at least 12th ?
SELECT COUNT(*) FROM table_204_532 WHERE "place" <= 12
squall
CREATE TABLE table_14794 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What was the most points for Coloni Spa?
SELECT MAX("Points") FROM table_14794 WHERE "Entrant" = 'coloni spa'
wikisql
CREATE TABLE table_60873 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
Can you tell me the highest Against that has the Status of six nations, and the Date of 02/03/2002?
SELECT MAX("Against") FROM table_60873 WHERE "Status" = 'six nations' AND "Date" = '02/03/2002'
wikisql
CREATE TABLE table_32779 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
Which Driver has less than 84 laps, more than 9 points and is on Rocketsports Racing Team?
SELECT "Driver" FROM table_32779 WHERE "Laps" < '84' AND "Points" > '9' AND "Team" = 'rocketsports racing'
wikisql
CREATE TABLE table_name_18 ( rank VARCHAR, total VARCHAR, bronze VARCHAR )
What is the total rank where the total is less than 5, and bronze is less than 0?
SELECT COUNT(rank) FROM table_name_18 WHERE total < 5 AND bronze < 0
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE fare ( fare_id int, from_...
find the flights leaving DALLAS and going to SAN FRANCISCO that leave after 1700
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 1700 AND flight.to_airport = AIRPORT_SERVICE_1...
atis
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Highest voted vote different comment.
SELECT PostId AS "post_link", Score, Text FROM Comments WHERE Text LIKE '%faq#vote-differences%' ORDER BY Score DESC LIMIT 10
sede
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate ti...
what is patient 13806's weight difference from the last value measured on the last hospital visit compared to the first value measured on the last hospital visit?
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13806 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND ch...
mimic_iii
CREATE TABLE table_13812785_8 ( high_points VARCHAR, date VARCHAR )
Who had the high points dated march 13?
SELECT high_points FROM table_13812785_8 WHERE date = "March 13"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, ...
give me the three top diagnoses that had the highest four year mortality rate?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt...
mimic_iii
CREATE TABLE table_204_52 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
what is the name of the last venue on this chart ?
SELECT "venue" FROM table_204_52 ORDER BY id DESC LIMIT 1
squall
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, ...
How many patients aged below 77 years old had other psoriasis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "77" AND diagnoses.long_title = "Other psoriasis"
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...
count the number of patients on po/ng route of drug administration who are less than 72 years.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "72" AND prescriptions.route = "PO/NG"
mimicsql_data
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, even...
what are the three most common diagnostics for people who were diagnosed with hypertension nos earlier in the same month, until 2 years ago?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions...
mimic_iii
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 demographic (...
calculate the number of patients admitted on phys referral/normal deli who remained admitted in hospital for 26 days.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.days_stay = "26"
mimicsql_data
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( ...
what number of days have passed since the last time patient 60136 stayed in careunit tsicu during the current hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE table_17304621_14 ( upstream VARCHAR, price_tl VARCHAR )
What is the upstream speed of the network that costs 39 tl?
SELECT upstream FROM table_17304621_14 WHERE price_tl = "39 TL"
sql_create_context
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, return a bar chart about the distribution of name and code , and group by attribute founder, could you show by the x axis from low to high?
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name
nvbench
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...
tell me the diagnosis icd9 code and short title of diagnosis for patient with patient id 21796.
SELECT diagnoses.icd9_code, diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "21796"
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...
count the number of patients less than 80 years who have been discharged to skilled nursing facility.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.age < "80"
mimicsql_data
CREATE TABLE table_name_41 ( april VARCHAR, june VARCHAR )
Name the april for candice cassidy
SELECT april FROM table_name_41 WHERE june = "candice cassidy"
sql_create_context
CREATE TABLE table_23849 ( "Parish" text, "Obama%" text, "Obama#" real, "McCain%" text, "McCain#" real )
What parish did McCain have 45.37% of the votes?
SELECT "Parish" FROM table_23849 WHERE "McCain%" = '45.37%'
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...
provide the number of patients whose admission location is emergency room admit?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT"
mimicsql_data
CREATE TABLE station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE status ( station_id number, bikes_available number, docks_available number, time text ) CREATE TABLE weather ( date text, max_te...
How many different cities have these stations?
SELECT COUNT(DISTINCT city) FROM station
spider
CREATE TABLE table_name_12 ( date VARCHAR, grand_prix VARCHAR )
Name the date for the australian grand prix.
SELECT date FROM table_name_12 WHERE grand_prix = "australian grand prix"
sql_create_context
CREATE TABLE table_25375 ( "Player" text, "Games Played" real, "Minutes" real, "Field Goals" real, "Three Pointers" real, "Free Throws" real, "Rebounds" real, "Assists" real, "Blocks" real, "Steals" real, "Points" real )
Of the players who scored 5 three pointers, what is the highest number of games played?
SELECT MAX("Games Played") FROM table_25375 WHERE "Three Pointers" = '5'
wikisql
CREATE TABLE table_203_815 ( id number, "pick #" number, "nfl team" text, "player" text, "position" text, "college" text )
which position had the least number of players in round nine ?
SELECT "position" FROM table_203_815 GROUP BY "position" HAVING COUNT("player") = (SELECT COUNT("player") FROM table_203_815 GROUP BY "position" ORDER BY COUNT("player") LIMIT 1)
squall
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHA...
How many documents are created in each day? Bin the document date by year interval and group by document type with a group line chart, I want to show Document_Date in ascending order please.
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name ORDER BY Document_Date
nvbench
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE transfers ( row_id number, subject_id number, had...
what was the last ultrafiltrate ultrafiltrate output time for patient 29741 on the last icu visit?
SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29741) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND outputevents.it...
mimic_iii
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
count the number of patients whose diagnosis icd9 code is 481 and lab test fluid is blood.
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 = "481" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_197638_6 ( age INTEGER, player VARCHAR )
At what age did Roy Emerson complete the Grand Slam?
SELECT MAX(age) FROM table_197638_6 WHERE player = "Roy Emerson"
sql_create_context
CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_regular_season text, acc_percent text, acc_home text, acc_road text, all_games text, all_games_percent number, all_home text, all_road text, all_neutral text ) CREATE TABLE university (...
What is the primary conference of the school that has the lowest acc percent score in the competition?
SELECT t1.primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent LIMIT 1
spider
CREATE TABLE table_67976 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text, "10:30" text )
What 10:00 has a 7:30 of da kink in my hair?
SELECT "10:00" FROM table_67976 WHERE "7:30" = 'da kink in my hair'
wikisql
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) 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_gradu...
Which courses are required before I can take ANTHRARC 492 ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_15168 ( "Representative" text, "Title" text, "Presentation of Credentials" text, "Termination of Mission" text, "Appointed by" text )
Which Representative has a Termination of Mission as May 24, 1905?
SELECT "Representative" FROM table_15168 WHERE "Termination of Mission" = 'may 24, 1905'
wikisql
CREATE TABLE table_1341604_10 ( candidates VARCHAR, result VARCHAR )
how many candidates with result being new seat democratic gain
SELECT COUNT(candidates) FROM table_1341604_10 WHERE result = "New seat Democratic gain"
sql_create_context
CREATE TABLE table_21623 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
What was the number of seasons that was directed by Joanna Kerns?
SELECT COUNT("Season #") FROM table_21623 WHERE "Directed by" = 'Joanna Kerns'
wikisql
CREATE TABLE table_46220 ( "Date" text, "Opponent" text, "Location" text, "Time" text, "Result" text )
When was a game played at 7:00 pm?
SELECT "Date" FROM table_46220 WHERE "Time" = '7:00 pm'
wikisql
CREATE TABLE table_142573_1 ( clock_rate__mhz_ INTEGER, designation VARCHAR )
Name the least clock rate mhz when designation is rimm 4200
SELECT MIN(clock_rate__mhz_) FROM table_142573_1 WHERE designation = "RIMM 4200"
sql_create_context
CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE editor ( Editor_ID int, Name text, Age real )
Show the number of the names of editors that are on the committee of journals with sales bigger than 3000, and display in descending by the total number.
SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name ORDER BY COUNT(Name) DESC
nvbench
CREATE TABLE table_7113 ( "Year" real, "Conventional plans" text, "HMOs" text, "PPOs" text, "POS plans" text )
Which conventional plan has a POS plan of 21%?
SELECT "Conventional plans" FROM table_7113 WHERE "POS plans" = '21%'
wikisql
CREATE TABLE table_4028 ( "Province" text, "First LLCR" real, "Appearances" real, "Championships" real, "Runner Up" real )
What year was Ontario's first LLCR?
SELECT "First LLCR" FROM table_4028 WHERE "Province" = 'Ontario'
wikisql
CREATE TABLE table_62022 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" text )
What is the Opponent on Week 11?
SELECT "Opponent" FROM table_62022 WHERE "Week" = '11'
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...
How many patients with hypoxia are younger than 54 year of age?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPOXIA" AND demographic.age < "54"
mimicsql_data
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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, insuranc...
what are the four most frequent microbiological tests that patients took in the same month after receiving ot cerv fusion post/post until 3 years ago?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE table_37391 ( "Surname" text, "First" text, "D.O.B." text, "Bats" text, "Throws" text, "Position" text )
When is mr. ryan's DOB?
SELECT "D.O.B." FROM table_37391 WHERE "Surname" = 'ryan'
wikisql
CREATE TABLE table_name_86 ( opponent VARCHAR, attendance VARCHAR )
What team was the opponent when there were 27,321 in attendance?
SELECT opponent FROM table_name_86 WHERE attendance = "27,321"
sql_create_context
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, ...
从2004年10月30日至2012年3月27日期间名字叫沈文乐参保人在门诊的检查费用是多少?
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '沈文乐' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2004-10-30' AND '2012-03-27' AND t_kc22.MED_INV_IT...
css
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 diagnoses_icd ( row_id numbe...
how many prescriptions for papain-urea ointment during this year?
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'papain-urea ointment' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) 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 TAB...
what flights land at MKE
SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'MKE' AND city.city_code = airport_service.city_code AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code
atis
CREATE TABLE allergy_type ( allergy text, allergytype text ) CREATE TABLE has_allergy ( stuid number, allergy text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text )
Who is the advisor of student with ID 1004?
SELECT advisor FROM student WHERE stuid = 1004
spider
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 of asian ethnicity are under 48 years of age?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.age < "48"
mimicsql_data
CREATE TABLE table_60568 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Who had a finish of t20?
SELECT "Player" FROM table_60568 WHERE "Finish" = 't20'
wikisql
CREATE TABLE table_22555 ( "Nation" text, "Rider" text, "Horse" text, "Cross Country Penalties" text, "Total Penalties" text, "Total Team Penalties" text, "Team Rank" real )
How many penalties are there when Eric Vigeanel is the rider?
SELECT COUNT("Total Penalties") FROM table_22555 WHERE "Rider" = 'Eric Vigeanel'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NA...
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, display by the bars in asc please.
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_name_51 ( record VARCHAR, finish VARCHAR, year VARCHAR, manager VARCHAR )
what is the record when the year is after 1992, manager is tom kotchman and finish is 2nd?
SELECT record FROM table_name_51 WHERE year > 1992 AND manager = "tom kotchman" AND finish = "2nd"
sql_create_context
CREATE TABLE table_28985631_1 ( month_name VARCHAR, numbered_month VARCHAR )
How many month names are there for the tenth numbered month?
SELECT COUNT(month_name) FROM table_28985631_1 WHERE numbered_month = "Tenth"
sql_create_context
CREATE TABLE table_59420 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What is the score for Nick Faldo?
SELECT "Score" FROM table_59420 WHERE "Player" = 'nick faldo'
wikisql
CREATE TABLE table_33458 ( "Year" real, "Drivers" text, "Wins" real, "Points" text, "D.C." text )
In 2011, how many wins did Michael Meadows have?
SELECT SUM("Wins") FROM table_33458 WHERE "Year" = '2011' AND "Drivers" = 'michael meadows'
wikisql
CREATE TABLE Parts ( part_id INTEGER, part_name VARCHAR(255), chargeable_yn VARCHAR(1), chargeable_amount VARCHAR(20), other_part_details VARCHAR(255) ) CREATE TABLE Engineer_Skills ( engineer_id INTEGER, skill_id INTEGER ) CREATE TABLE Maintenance_Engineers ( engineer_id INTEGER, ...
Show me the proportion on how many assets can each parts be used in? List the part name and the number.
SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name
nvbench
CREATE TABLE table_name_5 ( run_3 INTEGER, run_1 VARCHAR, run_2 VARCHAR )
What is the run 3 of the athlete with a run 1 more than 53.75 and a run 2 less than 52.91?
SELECT SUM(run_3) FROM table_name_5 WHERE run_1 > 53.75 AND run_2 < 52.91
sql_create_context
CREATE TABLE table_1566852_8 ( pictorials VARCHAR, cover_model VARCHAR )
List the pictorals from issues when lindsey roeper was the cover model.
SELECT pictorials FROM table_1566852_8 WHERE cover_model = "Lindsey Roeper"
sql_create_context
CREATE TABLE table_74220 ( "Episode Number" text, "Episode Name" text, "Airdate" text, "Viewers (millions)" text, "Rank(Timeslot)" text, "Rank 18\u201349 (Night)" text )
what is the total rank on airdate march 30, 2011?
SELECT COUNT("Rank(Timeslot)") FROM table_74220 WHERE "Airdate" = 'March 30, 2011'
wikisql
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date )
For directors who had more than one movie, bin the year into Year interval and them compute the total number of movies in each year bucket, and group by title The result can be drawn as a trend line, and show x-axis in ascending order.
SELECT year, COUNT(year) FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title GROUP BY title ORDER BY year
nvbench
CREATE TABLE table_name_48 ( second VARCHAR, alternate VARCHAR )
Who is the second for the curling team which has alternate Margarita Fomina?
SELECT second FROM table_name_48 WHERE alternate = "margarita fomina"
sql_create_context
CREATE TABLE table_40801 ( "Free" text, "Free polite" text, "Genitive 1" text, "Genitive 2" text, "Genitive 3" text )
Which Genitive 1 has a Genitive 3 of *n(i)-ia?
SELECT "Genitive 1" FROM table_40801 WHERE "Genitive 3" = '*n(i)-ia'
wikisql
CREATE TABLE table_1360 ( "N\u00b0" real, "Television service" text, "Country" text, "Language" text, "Content" text, "DAR" text, "HDTV" text, "PPV" text, "Package/Option" text )
Do the Sky Calcio 5 channels have PPV?
SELECT "PPV" FROM table_1360 WHERE "Television service" = 'Sky Calcio 5'
wikisql
CREATE TABLE table_2226817_9 ( directed_by VARCHAR, production_code VARCHAR )
How many episodes have the production code 8.04
SELECT COUNT(directed_by) FROM table_2226817_9 WHERE production_code = "8.04"
sql_create_context
CREATE TABLE table_204_718 ( id number, "date" text, "opponent" text, "time" text, "score" text, "record" text )
what school is scheduled to play first ?
SELECT "opponent" FROM table_204_718 ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_1457 ( "Institution" text, "Location" text, "Nickname" text, "Enrollment" real, "Established" real )
What school location had an enrollment of 12400?
SELECT "Location" FROM table_1457 WHERE "Enrollment" = '12400'
wikisql
CREATE TABLE table_80098 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" text )
Who was the opponent when the Seattle Seahawks had a record of 0-1?
SELECT "Opponent" FROM table_80098 WHERE "Record" = '0-1'
wikisql
CREATE TABLE table_train_246 ( "id" int, "allergy_to_dapagliflozin" bool, "allergy_to_exenatide" bool, "estimated_glomerular_filtration_rate_egfr" int, "fasting_c_peptide" float, "urine_albumin_to_creatinine_ratio_uacr" int, "fasting_triglyceride" int, "NOUSE" float )
urine albumin _ to _ creatinine ratio greater or equal to 300 mg / g
SELECT * FROM table_train_246 WHERE urine_albumin_to_creatinine_ratio_uacr >= 300
criteria2sql
CREATE TABLE table_38717 ( "Date" text, "Opponent" text, "Result" text, "Score" text, "Record" text, "Streak" text )
What was the score when the opponent was Detroit Pistons?
SELECT "Score" FROM table_38717 WHERE "Opponent" = 'detroit pistons'
wikisql
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_las...
How many apartment bookings in each year? Show me a bar chart binning booking end date by year.
SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings
nvbench
CREATE TABLE table_name_42 ( player VARCHAR, year_s__won VARCHAR, to_par VARCHAR )
What is Player, when Year(s) Won is before 1961, and when To Par is 6?
SELECT player FROM table_name_42 WHERE year_s__won < 1961 AND to_par = 6
sql_create_context
CREATE TABLE table_name_69 ( time VARCHAR, ground VARCHAR, away_team VARCHAR )
What is Time, when Ground is Waverley Park, and when Away Team is Footscray?
SELECT time FROM table_name_69 WHERE ground = "waverley park" AND away_team = "footscray"
sql_create_context
CREATE TABLE table_75023 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
Opponent of @ braves, and a Loss of pelfrey (2 5) had what score?
SELECT "Score" FROM table_75023 WHERE "Opponent" = '@ braves' AND "Loss" = 'pelfrey (2–5)'
wikisql
CREATE TABLE station ( LOCATION VARCHAR, number_of_platforms INTEGER, total_passengers INTEGER )
Show all locations and the total number of platforms and passengers for all train stations in each location.
SELECT LOCATION, SUM(number_of_platforms), SUM(total_passengers) FROM station GROUP BY LOCATION
sql_create_context
CREATE TABLE table_36736 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the low silver total associated with under 1 total?
SELECT MIN("Silver") FROM table_36736 WHERE "Total" < '1'
wikisql
CREATE TABLE table_31421 ( "Official name" text, "INE code" real, "Name in Spanish" text, "Name in Basque" text, "Population (2007)" real )
What is the INE code of the municipality whose official name is Berantevilla?
SELECT MAX("INE code") FROM table_31421 WHERE "Official name" = 'Berantevilla'
wikisql
CREATE TABLE table_42183 ( "Round" real, "Pick" real, "Name" text, "Position" text, "College" text )
What's the average round the position of RB was drafted?
SELECT AVG("Round") FROM table_42183 WHERE "Position" = 'rb'
wikisql
CREATE TABLE table_name_8 ( july VARCHAR, february VARCHAR )
Who is in July where February is linda forsythe?
SELECT july FROM table_name_8 WHERE february = "linda forsythe"
sql_create_context