context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_38810 ( "Year" real, "Album" text, "Record label" text, "Info" text, "Music" text )
Which Record label has an Album of tera roop?
SELECT "Record label" FROM table_38810 WHERE "Album" = 'tera roop'
wikisql
CREATE TABLE table_204_991 ( id number, "name" text, "first\nheld" number, "country" text, "earliest attendance figure known" text, "1998 attendance" number, "2000 attendance" number, "2002 attendance" number, "2004 attendance" number, "2006 attendance" number, "2008 attendan...
when was the first otafest held ?
SELECT "first\nheld" FROM table_204_991 WHERE "name" = 'otafest'
squall
CREATE TABLE table_name_96 ( year INTEGER, release_air_date VARCHAR, role VARCHAR, radio_station_production_company VARCHAR )
Role of narrator, and a Radio Station/Production Company of bbc audiobooks, and a Release/Air Date of 13 november 2008 is what sum of the year?
SELECT SUM(year) FROM table_name_96 WHERE role = "narrator" AND radio_station_production_company = "bbc audiobooks" AND release_air_date = "13 november 2008"
sql_create_context
CREATE TABLE wdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
在门诊确诊为脑外伤所致精神障碍的病人方歌韵其直接胆红素二代的检查的结果中具体的定量及其单位都是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_52775 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
Which catalog had a date year of 1984?
SELECT "Catalog" FROM table_52775 WHERE "Date" = '1984'
wikisql
CREATE TABLE table_26178824_1 ( wins VARCHAR, series VARCHAR, position VARCHAR )
how many wins had series formula renault 2.0 nec and the position is 18th?
SELECT wins FROM table_26178824_1 WHERE series = "Formula Renault 2.0 NEC" AND position = "18th"
sql_create_context
CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TAB...
A line chart for showing the number of the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000, and display x-axis from low to high order.
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count > 100 OR amount_of_transaction > 1000 ORDER BY date_of_transaction
nvbench
CREATE TABLE table_175980_2 ( viewers__in_millions_ VARCHAR, season VARCHAR )
What are all values for viewers for 1st season?
SELECT viewers__in_millions_ FROM table_175980_2 WHERE season = "1st"
sql_create_context
CREATE TABLE table_dev_37 ( "id" int, "gender" string, "hemoglobin_a1c_hba1c" float, "diabetes_mellitus" bool, "dysglycemia" bool, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "fasting_plasma_glucose" int, "serum_creatinine" float, "fasting_gl...
patients with dysglycemia are patients with: fasting plasma glucose > 100 mg / dl ( 5.6 mmol / l ) , or hba1c > 5.7 % and < 10 % at screening.
SELECT * FROM table_dev_37 WHERE dysglycemia = 1 OR (fasting_plasma_glucose > 100 OR (hemoglobin_a1c_hba1c > 5.7 AND hemoglobin_a1c_hba1c < 10))
criteria2sql
CREATE TABLE table_name_52 ( visitor VARCHAR, date VARCHAR )
On April 18, which team was the visitor?
SELECT visitor FROM table_name_52 WHERE date = "april 18"
sql_create_context
CREATE TABLE table_2076490_1 ( enrollment__2005_ VARCHAR, school VARCHAR )
How many students enrolled in 2005 at New Hampshire Institute of Art?
SELECT enrollment__2005_ FROM table_2076490_1 WHERE school = "New Hampshire Institute of Art"
sql_create_context
CREATE TABLE table_20903658_1 ( title_subject VARCHAR, medium VARCHAR, public_office VARCHAR )
Who was the subject of the bronze sculpture who was a colonist and soldier in Ville Marie, New France?
SELECT title_subject FROM table_20903658_1 WHERE medium = "Bronze" AND public_office = "colonist and soldier in Ville Marie, New France"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is the minimum age of patients whose admission location is phys referral/normal deli and diagnosed with primary disease congestive heart failure?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.diagnosis = "CONGESTIVE HEART FAILURE"
mimicsql_data
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
What classes will help me be better prepared for taking MODGREEK 202 ?
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'MODGREEK' AND number = 202
advising
CREATE TABLE table_42503 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the highest Top-10, when Top-25 is 4, and when Top-5 is greater than 1?
SELECT MAX("Top-10") FROM table_42503 WHERE "Top-25" = '4' AND "Top-5" > '1'
wikisql
CREATE TABLE table_name_21 ( winning_team VARCHAR, most_laps_led VARCHAR )
What is Winning Team, when Most Laps Led is Alex Tagliani?
SELECT winning_team FROM table_name_21 WHERE most_laps_led = "alex tagliani"
sql_create_context
CREATE TABLE table_45448 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
who is the player when the place is t5 and the score is 69-74=143?
SELECT "Player" FROM table_45448 WHERE "Place" = 't5' AND "Score" = '69-74=143'
wikisql
CREATE TABLE table_41020 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text )
What is the power that belongs to Class A with an Identifier of CBOC-FM?
SELECT "Power" FROM table_41020 WHERE "Class" = 'a' AND "Identifier" = 'cboc-fm'
wikisql
CREATE TABLE table_30347 ( "Character" text, "Game" text, "Platform" text, "Status" text, "Mystic Arte" text, "Character Voice" text )
What is the status of the character keel (keele) zeibel?
SELECT "Status" FROM table_30347 WHERE "Character" = 'Keel (Keele) Zeibel'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
count the number of patients diagnosed with alzheimer's disease who were admitted before 2190.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2190" AND diagnoses.short_title = "Alzheimer's disease"
mimicsql_data
CREATE TABLE table_16672 ( "Rd." real, "Grand Prix" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Constructor" text, "Report" text )
What was the fastest lap at the Mexican Grand Prix?
SELECT "Fastest Lap" FROM table_16672 WHERE "Grand Prix" = 'Mexican Grand Prix'
wikisql
CREATE TABLE table_70507 ( "Team" text, "Country" text, "Value ($M)" real, "Debt as %of value" text, "% change on year" text, "Revenue ($M)" real, "Operating income($m)" real )
What is the highest operating income that change by 2% and is less than $1,036m?
SELECT MAX("Operating income($m)") FROM table_70507 WHERE "% change on year" = '2' AND "Value ($M)" < '1,036'
wikisql
CREATE TABLE table_66433 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the average rank of Elise Matthysen in lanes under 8?
SELECT AVG("Rank") FROM table_66433 WHERE "Name" = 'elise matthysen' AND "Lane" < '8'
wikisql
CREATE TABLE table_name_79 ( interview INTEGER, swimsuit VARCHAR, country VARCHAR, preliminaries VARCHAR, evening_gown VARCHAR )
What is the least score for interview with a preliminaries score less than 9.4, evening gown score less than 9.55, and swimsuit score more than 9.18 in New York?
SELECT MIN(interview) FROM table_name_79 WHERE preliminaries < 9.4 AND evening_gown < 9.55 AND country = "new york" AND swimsuit > 9.18
sql_create_context
CREATE TABLE table_38112 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponent in the Final" text, "Score" text )
What was the Score on February 18, 2008?
SELECT "Score" FROM table_38112 WHERE "Date" = 'february 18, 2008'
wikisql
CREATE TABLE table_name_93 ( representative VARCHAR, presentation_of_credentials VARCHAR )
Which Representative has a Presentation of Credentials on september 8, 2005?
SELECT representative FROM table_name_93 WHERE presentation_of_credentials = "september 8, 2005"
sql_create_context
CREATE TABLE table_55362 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
What's the authority when the roll is less than 234 for the massey east area?
SELECT "Authority" FROM table_55362 WHERE "Roll" < '234' AND "Area" = 'massey east'
wikisql
CREATE TABLE table_49946 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the score of the 2006 Fifa World Cup Qualification?
SELECT "Score" FROM table_49946 WHERE "Competition" = '2006 fifa world cup qualification'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodici...
how many patients were treated with hormonal therapy (for varices) - octreotide in the same hospital visit after they were diagnosed with hyperglycemia - suspected in this year?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperglycemia - suspected' AND DATETIME(diagnosis.diagnosistime, 'start o...
eicu
CREATE TABLE table_name_20 ( longitude VARCHAR, geo_id VARCHAR, ansi_code VARCHAR, water__sqmi_ VARCHAR )
What is the longitude for the Township that has a ANSI code less than 1036534, a water (sqmi) of 0, and a GEO ID greater than 3809959540?
SELECT COUNT(longitude) FROM table_name_20 WHERE ansi_code < 1036534 AND water__sqmi_ = 0 AND geo_id > 3809959540
sql_create_context
CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) ) CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester v...
Find the number of courses offered by Psychology department in each building with a bar chart, could you list in ascending by the total number?
SELECT building, COUNT(building) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' GROUP BY building ORDER BY COUNT(building)
nvbench
CREATE TABLE table_name_41 ( method VARCHAR, time VARCHAR )
How did he win with a time of 0:38?
SELECT method FROM table_name_41 WHERE time = "0:38"
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, Vote...
Duplicate target of the given post.
SELECT RelatedPostId AS "post_link" FROM PostLinks WHERE (PostId = '##id?1331325##') AND (LinkTypeId = 3)
sede
CREATE TABLE table_67811 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
Name the average yeara for engine of renault v10 with points more than 4
SELECT AVG("Year") FROM table_67811 WHERE "Engine" = 'renault v10' AND "Points" > '4'
wikisql
CREATE TABLE table_76000 ( "Rank" real, "College" text, "First Season" real, "Seasons" real, "Wins" real, "Losses" real )
How many wins were there for Washington State College with losses greater than 980 and a first season before 1906 and rank greater than 42?
SELECT COUNT("Wins") FROM table_76000 WHERE "Losses" > '980' AND "First Season" < '1906' AND "College" = 'washington state' AND "Rank" > '42'
wikisql
CREATE TABLE table_63795 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real )
Which Drawn has a Position smaller than 8, and a Played smaller than 14?
SELECT MAX("Drawn") FROM table_63795 WHERE "Position" < '8' AND "Played" < '14'
wikisql
CREATE TABLE table_name_38 ( title VARCHAR, english_translation VARCHAR )
What is the title of the song that has a translation of Without Me?
SELECT title FROM table_name_38 WHERE english_translation = "without me"
sql_create_context
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 treatment ( treat...
how many days has it been since patient 010-16572 first hydromorphone was prescribed on this hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-165...
eicu
CREATE TABLE table_name_36 ( college VARCHAR, player VARCHAR )
Which college has a Player of shabazz muhammad?
SELECT college FROM table_name_36 WHERE player = "shabazz muhammad"
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 ...
what is the number of patients whose primary disease is st-segment elevation myocardial infarction\cardiac cath and year of birth is less than 2107?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.dob_year < "2107"
mimicsql_data
CREATE TABLE table_56622 ( "Season" text, "Games" real, "Lost" real, "Tied" real, "Points" real, "Pct %" real, "Goals for" real, "Goals against" real, "Standing" text )
When the percent is larger than 0.685, what is the average number of points scored?
SELECT AVG("Points") FROM table_56622 WHERE "Pct %" > '0.685'
wikisql
CREATE TABLE table_68959 ( "Episode" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
What result did Janis Ian have in the episode of top 3?
SELECT "Result" FROM table_68959 WHERE "Episode" = 'top 3' AND "Original artist" = 'janis ian'
wikisql
CREATE TABLE table_name_7 ( name__year_commissioned_ VARCHAR, licence_number VARCHAR )
What is the name where the license number is PL 22?
SELECT name__year_commissioned_ FROM table_name_7 WHERE licence_number = "pl 22"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
列出在2003年10月24日到2017年4月14日内患者曹诗蕾被开出多少检验报告单的检验报告单号?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjl...
css
CREATE TABLE Timed_Locations_of_Things ( thing_id INTEGER, Date_and_Time DATETIME, Location_Code CHAR(15) ) CREATE TABLE Customer_Events ( Customer_Event_ID INTEGER, customer_id INTEGER, date_moved_in DATETIME, property_id INTEGER, resident_id INTEGER, thing_id INTEGER ) CREATE TAB...
Please use a bar chart to compare the number of customers of each customer's move in date, and could you display X-axis in desc order?
SELECT date_moved_in, COUNT(date_moved_in) FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY date_moved_in ORDER BY date_moved_in DESC
nvbench
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
编号为43832017的病人在其医疗记录中花费的医疗费8811.34元都有啥,入院时患的病的编码和名称都是啥?
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '43832017' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 8811.34)
css
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), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of phone_number and salary , I want to list by the Y-axis in descending please.
SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY DESC
nvbench
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday, list by the Y-axis in asc please.
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(EMPLOYEE_ID)
nvbench
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 ...
患者的门诊诊断为躁狂型精神病的检测指标758740的参考值范围下限和上限是什么?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '躁狂型精神病' AND jyjgzbb.JCZBDM = '758740'
css
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_...
when was the last time that patient 43735 was diagnosed with a status-post ptca until 1 year ago?
SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'status-post ptca') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 43735) AND DATETIME(diagn...
mimic_iii
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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 TABL...
how many times is this other skeletal traction procedure done in 2105?
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'other skeletal traction') AND STRFTIME('%y', procedures_icd.charttime) = '2105'
mimic_iii
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, ...
Which Badges are the most dificult to get?.
SELECT Badges.Name AS Name, Badges.Class AS Class, COUNT(Users.Id) AS NumberUsers FROM Badges INNER JOIN Users ON Badges.UserId = Users.Id WHERE Badges.TagBased = 0 GROUP BY Name, Class ORDER BY NumberUsers
sede
CREATE TABLE table_12236 ( "Rank" real, "Athlete" text, "Nanquan" real, "Nangun" real, "Total" real )
WHAT IS THE AVERAGE NANGUN WITH A RANK LARGER THAN 2, TOTAL OF 17.85?
SELECT AVG("Nangun") FROM table_12236 WHERE "Rank" > '2' AND "Total" = '17.85'
wikisql
CREATE TABLE table_20462111_1 ( location VARCHAR, date VARCHAR )
Where was the cup on 07.02.2009 held?
SELECT location FROM table_20462111_1 WHERE date = "07.02.2009"
sql_create_context
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as ...
Which CSP classes are PreMajor ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department LIKE '%CSP%' AND program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE table_74337 ( "Team" text, "Stadium" text, "Home Games" real, "Average Attendance" real, "Total Attendance" real, "Capacity Percentage" text )
What team had a capacity of 102.3%?
SELECT "Team" FROM table_74337 WHERE "Capacity Percentage" = '102.3%'
wikisql
CREATE TABLE table_75446 ( "Celebrity" text, "Famous for" text, "Entered" text, "Exited" text, "Finished" text )
What was Dom Joly famous for?
SELECT "Famous for" FROM table_75446 WHERE "Celebrity" = 'dom joly'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
How many patients are admitted from hosp/extram and before the year 2168?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.admityear < "2168"
mimicsql_data
CREATE TABLE gymnast ( Total_Points VARCHAR )
List the total points of gymnasts in descending order.
SELECT Total_Points FROM gymnast ORDER BY Total_Points DESC
sql_create_context
CREATE TABLE table_name_65 ( date VARCHAR, site VARCHAR )
What is Date, when Site is 'Louisiana Superdome New Orleans, LA'?
SELECT date FROM table_name_65 WHERE site = "louisiana superdome • new orleans, la"
sql_create_context
CREATE TABLE table_23093 ( "Districts of Bihar" text, "Total Population 2001" real, "Male Population 2001" real, "Female Population 2001" real, "Growth Rate 1981-91" text, "Growth Rate 1991-01" text, "Sex Ratio \u2021 1991" real, "Sex Ratio \u2021 2001" real, "Population density \u20...
What are all values for the male population in 2001 with a growth rate in 1991-01 of 36.16?
SELECT "Male Population 2001" FROM table_23093 WHERE "Growth Rate 1991-01" = '36.16'
wikisql
CREATE TABLE table_204_163 ( id number, "airline" text, "icao" text, "iata" text, "callsign" text, "commenced\noperations" number )
how many airlines commenced operation after 2006 ?
SELECT COUNT("airline") FROM table_204_163 WHERE "commenced\noperations" > 2006
squall
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, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the hire_date bin hire_date by weekday by a bar chart.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_name_44 ( against INTEGER, opposing_team VARCHAR )
What largest against has the opposing team of fiji?
SELECT MAX(against) FROM table_name_44 WHERE opposing_team = "fiji"
sql_create_context
CREATE TABLE table_name_85 ( points INTEGER, game VARCHAR, score VARCHAR )
Which Points have a Game smaller than 70, and a Score of 4 8?
SELECT MIN(points) FROM table_name_85 WHERE game < 70 AND score = "4–8"
sql_create_context
CREATE TABLE table_28398 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Founding Religious Affiliation" text, "Enrollment" real, "Joined" real )
Which institution's nickname is the Bobcats?
SELECT "Institution" FROM table_28398 WHERE "Nickname" = 'Bobcats'
wikisql
CREATE TABLE table_24290 ( "Day" text, "Stage" text, "Time (GMT)" text, "Name" text, "Length" text, "Winner" text, "Time" text, "Avg. spd." text, "Rally leader" text )
Which ralliers won the stages that were at 18:54 GMT?
SELECT "Winner" FROM table_24290 WHERE "Time (GMT)" = '18:54'
wikisql
CREATE TABLE table_17018 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
How many US viewers (millions) were there for 'cold reveal
SELECT "U.S. viewers (millions)" FROM table_17018 WHERE "Title" = 'Cold Reveal'
wikisql
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) 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, ...
70688038255这次门诊就诊的诊断如何?列出诊断的名称和编码
SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM mzjzjlb WHERE mzjzjlb.JZLSH = '70688038255'
css
CREATE TABLE table_27732 ( "Number" real, "Name" text, "Vertices" text, "Hypotenuse 0 c" text, "Vertical 0 b" text, "Horizontal 0 a" text )
Name the horizontal number for number 10
SELECT COUNT("Horizontal 0 a") FROM table_27732 WHERE "Number" = '10'
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 ...
90549392这个病人在二一年十一月一日之前有哪些住院就诊的检验报告单?查一下这些住院就诊流水号
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers...
css
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...
Calculate the patients diagnosed with icd9 code 5770 who were discharged to home.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "HOME" AND diagnoses.icd9_code = "5770"
mimicsql_data
CREATE TABLE table_75990 ( "Source" text, "Date" text, "Goberman" text, "Loera" text, "Merkley" text, "Neville" text, "Novick" text, "Obrist" text, "Other/ Undecided" text )
Which Goberman has a Date of april 28 april 30, 2008?
SELECT "Goberman" FROM table_75990 WHERE "Date" = 'april 28–april 30, 2008'
wikisql
CREATE TABLE table_name_49 ( byes INTEGER, wins VARCHAR )
What is the smallest byes when the wins are 3?
SELECT MIN(byes) FROM table_name_49 WHERE wins = 3
sql_create_context
CREATE TABLE table_name_46 ( away_team VARCHAR, venue VARCHAR )
What was the away team score at western oval?
SELECT away_team AS score FROM table_name_46 WHERE venue = "western oval"
sql_create_context
CREATE TABLE table_63577 ( "Name" text, "Height" text, "Weight" text, "Spike" text, "2008 club" text )
What Name has a 2008 Club of Sisley Treviso?
SELECT "Name" FROM table_63577 WHERE "2008 club" = 'sisley treviso'
wikisql
CREATE TABLE table_58309 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the time/retired for grid 9?
SELECT "Time/Retired" FROM table_58309 WHERE "Grid" = '9'
wikisql
CREATE TABLE table_45890 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
What is the average attendance for all events held at Palmerston Park venue?
SELECT AVG("Attendance") FROM table_45890 WHERE "Venue" = 'palmerston park'
wikisql
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
Give me the comparison about the sum of Height over the Sex , and group by attribute Sex by a bar chart, rank by the Y in ascending please.
SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY SUM(Height)
nvbench
CREATE TABLE table_37764 ( "Year" real, "Class" text, "Team" text, "Points" real, "Rank" text, "Wins" real )
How many wins occurred for 6th rank?
SELECT COUNT("Wins") FROM table_37764 WHERE "Rank" = '6th'
wikisql
CREATE TABLE table_203_446 ( id number, "name" text, "gender" text, "age" number, "from" text, "occupation" text, "prize money (usd)" text, "status" text )
how many of the contestants were students ?
SELECT COUNT("name") FROM table_203_446 WHERE "occupation" = 'student'
squall
CREATE TABLE table_28760804_1 ( title VARCHAR, directed_by VARCHAR )
What is the title of the episode Alex Reid directed?
SELECT title FROM table_28760804_1 WHERE directed_by = "Alex Reid"
sql_create_context
CREATE TABLE table_34030 ( "Year" real, "Title" text, "Label" text, "Format" text, "Album" text )
What title has a Label of warp records / paper bag records?
SELECT "Title" FROM table_34030 WHERE "Label" = 'warp records / paper bag records'
wikisql
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE comment_instructor ( instructor_id int...
What are the class hours next semester for the DENT 551 lecture ?
SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'DENT' AND course.nu...
advising
CREATE TABLE railway ( LOCATION VARCHAR )
Show different locations of railways along with the corresponding number of railways at each location.
SELECT LOCATION, COUNT(*) FROM railway GROUP BY LOCATION
sql_create_context
CREATE TABLE table_71979 ( "Location" text, "Year" real, "Champion" text, "Runner-up" text, "Score" text )
When is the earliest year in milan that guillermo vilas was champion?
SELECT MIN("Year") FROM table_71979 WHERE "Location" = 'milan' AND "Champion" = 'guillermo vilas'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
give me the number of patients whose insurance is self pay and days of hospital stay is greater than 23?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.days_stay > "23"
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...
患者77127973在医院6027111入院诊断时的医疗就诊记录里疾病名称不包含瘙痒症的编号有什么?
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '77127973' AND gwyjzb.MED_SER_ORG_NO = '6027111' AND NOT gwyjzb.IN_DIAG_DIS_NM LIKE '%瘙痒症%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '77127973' AND fgwyjzb.MED_SER_ORG_NO = '6027111' AND NOT fgwyjzb.IN_DIAG_DIS_NM LIKE '%瘙...
css
CREATE TABLE table_11235334_2 ( episode VARCHAR, air_date VARCHAR )
How many episodes aired on october 27, 2008
SELECT COUNT(episode) FROM table_11235334_2 WHERE air_date = "October 27, 2008"
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ...
Most recent post from given set of users.
WITH recent_cte AS (SELECT u.Id AS UserId, MAX(p.Id) AS MaxId FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE u.Id IN ('##list##') GROUP BY u.Id) SELECT UserId AS "user_link", MaxId AS "post_link", p.CreationDate, p.Score FROM recent_cte INNER JOIN Posts AS p ON MaxId = p.Id ORDER BY p.CreationDate ...
sede
CREATE TABLE table_name_86 ( score_final VARCHAR, apparatus VARCHAR )
What was her final score on the ribbon apparatus?
SELECT score_final FROM table_name_86 WHERE apparatus = "ribbon"
sql_create_context
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...
is the value of urea nitrogen of a patient last measured on the current hospital visit greater than the value of patient 49176 first measured on the current hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49176 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'urea nitrogen') ORDER BY labevents.char...
mimic_iii
CREATE TABLE table_name_32 ( yards VARCHAR, player VARCHAR )
How many Yards did Player Rob Turner collect?
SELECT yards FROM table_name_32 WHERE player = "rob turner"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
名叫花心宜的团伙成员最常开的药品排序是怎么样的呢?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '花心宜' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_204_914 ( id number, "year" number, "team" text, "games" number, "attempts" number, "yards" number, "ypc" number, "long" number, "tds" number )
who did this player play for after he was on the los angeles rams ?
SELECT "team" FROM table_204_914 WHERE "year" > (SELECT MAX("year") FROM table_204_914 WHERE "team" = 'los angeles rams') ORDER BY "year" LIMIT 1
squall
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 time of admission and gender of patient with patient id 26285.
SELECT demographic.gender, demographic.admittime FROM demographic WHERE demographic.subject_id = "26285"
mimicsql_data
CREATE TABLE table_name_35 ( athlete VARCHAR, country VARCHAR )
Which athlete represented the country of egypt?
SELECT athlete FROM table_name_35 WHERE country = "egypt"
sql_create_context
CREATE TABLE table_46693 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the highest grid that tetsuya harada rode in?
SELECT MAX("Grid") FROM table_46693 WHERE "Rider" = 'tetsuya harada'
wikisql
CREATE TABLE table_14975415_1 ( director VARCHAR, english_title VARCHAR )
Who is the director for the witman boys?
SELECT director FROM table_14975415_1 WHERE english_title = "The Witman Boys"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
what is the respiration change of patient 027-61708 from the value measured at 2105-12-23 00:00:00 compared to the value measured at 2105-12-22 23:55:00?
SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-61708')) AND NOT vitalperiodic.respiration ...
eicu