context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH ...
47260453566这次住院就诊的入院途径是什么?对应的代码是什么
SELECT RYTJDM, RYTJMC FROM zyjzjlb WHERE JZLSH = '47260453566'
css
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostHistory ( Id number, Po...
Top Ranking by Tag and Country.
SELECT ROW_NUMBER() OVER (ORDER BY SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE (CASE WHEN VoteTypeId = 3 THEN -1 ELSE 0 END) END) DESC) AS "#", Users.Id AS "user_link", SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE (CASE WHEN VoteTypeId = 3 THEN -1 ELSE 0 END) END) AS CalcRep FROM Users, Tags INNER JOIN PostTags ON PostTags.Ta...
sede
CREATE TABLE gymnast ( gymnast_id number, floor_exercise_points number, pommel_horse_points number, rings_points number, vault_points number, parallel_bars_points number, horizontal_bar_points number, total_points number ) CREATE TABLE people ( people_id number, name text, a...
What is the total point count of the youngest gymnast?
SELECT T1.total_points FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id ORDER BY T2.age LIMIT 1
spider
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH ...
在03年3月23日到15年11月12日之间病患55566777的洋地黄情况是怎么样的?
(SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = ...
css
CREATE TABLE table_name_49 ( melbourne VARCHAR, gold_coast VARCHAR, adelaide VARCHAR, auckland VARCHAR )
Name the melbourne for adelaide of no with auckland of yes and gold coast of yes
SELECT melbourne FROM table_name_49 WHERE adelaide = "no" AND auckland = "yes" AND gold_coast = "no"
sql_create_context
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, ...
姓名叫郑丹红的那个病人其在01年8月25日到2014年8月3日期间有多少自付比例低于0.85的药品?
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '郑丹红' AND t_kc22.STA_DATE BETWEEN '2001-08-25' AND '2014-08-03' AND t_kc22.SELF_PAY_PRO < 0.85 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.PERS...
css
CREATE TABLE table_6601 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text )
Who was the opponent at the game later than game 22 when the record was 17-10-4?
SELECT "Opponent" FROM table_6601 WHERE "Game" > '22' AND "Record" = '17-10-4'
wikisql
CREATE TABLE table_71123 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Tyres" text, "Points" real )
What is the highest points with g Tyres and Minardi m187?
SELECT MAX("Points") FROM table_71123 WHERE "Tyres" = 'g' AND "Chassis" = 'minardi m187'
wikisql
CREATE TABLE table_20707 ( "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary conference" text )
Name the total number of affiliation for enrollment being 14898
SELECT COUNT("Affiliation") FROM table_20707 WHERE "Enrollment" = '14898'
wikisql
CREATE TABLE table_train_161 ( "id" int, "white_blood_cell_count_wbc" int, "systolic_blood_pressure_sbp" int, "c_peptide_level" float, "diastolic_blood_pressure_dbp" int, "heart_rate" int, "glycosylated_hemoglobin" float, "NOUSE" float )
c _ peptide value less than 1 pmol / ml 90 minutes after oral boost plus administration.
SELECT * FROM table_train_161 WHERE c_peptide_level < 1
criteria2sql
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, ...
出院时,医疗就诊86947036895诊断的疾病编号是什么?名称是什么?
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '86947036895'
css
CREATE TABLE table_name_15 ( mountains_classification VARCHAR, general_classification VARCHAR, winner VARCHAR )
What's the mountains classification of winner Carlos Sastre when the general classification is Denis Menchov?
SELECT mountains_classification FROM table_name_15 WHERE general_classification = "denis menchov" AND winner = "carlos sastre"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
what was the minimum monthly number of patients who were diagnosed with sinusitis - radiographically demonstrated until 2 years ago?
SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'sinusitis - radiographically demonstrated' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) AS t1
eicu
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...
give me the number of patients whose insurance is private and days of hospital stay is greater than 7?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.days_stay > "7"
mimicsql_data
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientuni...
what the first height of patient 012-35195.
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-35195') AND NOT patient.admissionheight IS NULL ORDER BY patient.unitadmittime LIMIT 1
eicu
CREATE TABLE drivers ( driverid number, driverref text, number number, code text, forename text, surname text, dob text, nationality text, url text ) CREATE TABLE circuits ( circuitid number, circuitref text, name text, location text, country text, lat number...
List the names of all distinct races in reversed lexicographic order?
SELECT DISTINCT name FROM races ORDER BY name DESC
spider
CREATE TABLE table_59136 ( "Statistic" text, "Name" text, "Total" text, "School" text, "Opponent" text, "Stage" text )
Calvin Abueva Calvin Abueva had what statistic?
SELECT "Statistic" FROM table_59136 WHERE "Name" = 'calvin abueva calvin abueva'
wikisql
CREATE TABLE table_21536557_2 ( time__cet_ VARCHAR, name VARCHAR )
What is every time(cet) for the name of Lillehammer 2?
SELECT time__cet_ FROM table_21536557_2 WHERE name = "Lillehammer 2"
sql_create_context
CREATE TABLE table_59137 ( "Statistic" text, "Name" text, "Total" text, "School" text, "Opponent" text, "Stage" text )
When the opposing team was SSC-R what was the statistic?
SELECT "Statistic" FROM table_59137 WHERE "Opponent" = 'ssc-r'
wikisql
CREATE TABLE table_203_280 ( id number, "week" number, "date" text, "opponent" text, "result" text, "record" text, "game site" text, "tv time" text, "attendance" number, "bye" text )
when was their first loss of the season ?
SELECT "date" FROM table_203_280 WHERE "result" = 'l' ORDER BY id LIMIT 1
squall
CREATE TABLE pilot ( pilot_id number, pilot_name text, rank number, age number, nationality text, position text, join_year number, team text ) CREATE TABLE pilot_record ( record_id number, pilot_id number, aircraft_id number, date text ) CREATE TABLE aircraft ( airc...
Show the names of pilots and fleet series of the aircrafts they have flied with in ascending order of the rank of the pilot.
SELECT T3.pilot_name, T2.fleet_series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.aircraft_id = T2.aircraft_id JOIN pilot AS T3 ON T1.pilot_id = T3.pilot_id ORDER BY T3.rank
spider
CREATE TABLE table_203_438 ( id number, "year" number, "title" text, "role" text, "notes" text )
what year was beyond the sea released ?
SELECT "year" FROM table_203_438 WHERE "title" = 'beyond the sea'
squall
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, ...
患者15176126为精神分裂症,门诊诊断的补体C4的结果定量及其单位都是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE table_203_349 ( id number, "no. in\nseries" number, "no. in\nseason" number, "title" text, "directed by" text, "written by" text, "original air date" text, "production\ncode" text, "u.s. viewers\n(millions)" number )
how many titles are listed for august ?
SELECT COUNT("title") FROM table_203_349 WHERE "original air date" = 8
squall
CREATE TABLE table_2076522_2 ( accreditation VARCHAR, school VARCHAR )
What is the accrediation for united tribes technical college?
SELECT accreditation FROM table_2076522_2 WHERE school = "United Tribes Technical College"
sql_create_context
CREATE TABLE table_name_18 ( round INTEGER, college VARCHAR, pick VARCHAR )
What is the average round of the player from the college of baylor with a pick less than 28?
SELECT AVG(round) FROM table_name_18 WHERE college = "baylor" AND pick < 28
sql_create_context
CREATE TABLE table_name_21 ( component VARCHAR, integrated VARCHAR )
What component has an integrated of one?
SELECT component FROM table_name_21 WHERE integrated = "one"
sql_create_context
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
What are the dates that have an average sea level pressure between 303 and 31, and count them by a bar chart, and rank by the y-axis in ascending please.
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date)
nvbench
CREATE TABLE table_18946749_4 ( prominence__m_ VARCHAR, rank VARCHAR )
How many values of prominence(m) occur at rank 5?
SELECT COUNT(prominence__m_) FROM table_18946749_4 WHERE rank = 5
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
川石斛颗粒的检查记录在医疗机构1380649有多少?
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '1380649' AND t_kc22.SOC_SRT_DIRE_NM = '川石斛颗粒' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '1380649' AND t_kc22.SOC_SRT_DIRE_NM = '川石斛颗粒' UNIO...
css
CREATE TABLE table_name_84 ( country VARCHAR, to_par VARCHAR )
What country has a To par of e?
SELECT country FROM table_name_84 WHERE to_par = "e"
sql_create_context
CREATE TABLE table_dev_31 ( "id" int, "gender" string, "pre_dm" bool, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "diabetic" string, "fasting_blood_glucose_fbg" float, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "fasting_plasma_glucos...
baseline hb < 10.5 gm / dl in female , or < 13 gm / dl in male
SELECT * FROM table_dev_31 WHERE (baseline_hemoglobin_hgb < 10.5 AND gender = 'female') OR (baseline_hemoglobin_hgb < 13 AND gender = 'male')
criteria2sql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
how many patients whose gender is m and days of hospital stay is greater than 5?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay > "5"
mimicsql_data
CREATE TABLE table_11764007_2 ( week_sent_to_third_island VARCHAR, week_arrived_on_main_island VARCHAR )
What week was the member who arrived on the main island in week 6 sent to the third island?
SELECT week_sent_to_third_island FROM table_11764007_2 WHERE week_arrived_on_main_island = "6"
sql_create_context
CREATE TABLE table_10849 ( "Season" real, "Overall" real, "Slalom" real, "Giant Slalom" text, "Super G" text, "Downhill" text )
Which giant slalom had an Overall number of 25?
SELECT "Giant Slalom" FROM table_10849 WHERE "Overall" = '25'
wikisql
CREATE TABLE table_name_37 ( date VARCHAR, circuit VARCHAR )
On what Date is the Circuit at Sandown Raceway?
SELECT date FROM table_name_37 WHERE circuit = "sandown raceway"
sql_create_context
CREATE TABLE table_204_154 ( id number, "player" text, "matches" number, "innings" number, "runs" number, "average" number, "100s" number, "50s" number )
how many more runs does john have than albert ?
SELECT (SELECT "runs" FROM table_204_154 WHERE "player" = 'john challen') - (SELECT "runs" FROM table_204_154 WHERE "player" = 'albert clapp')
squall
CREATE TABLE table_73000 ( "Round" real, "Date" text, "Grand Prix" text, "Circuit" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text )
What grand prixs did Daijiro Hiura win?
SELECT "Grand Prix" FROM table_73000 WHERE "Race Winner" = 'Daijiro Hiura'
wikisql
CREATE TABLE diagnoses ( 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 ) C...
how many patients hospital stay is more than 4 days with drug code cita20?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "4" AND prescriptions.formulary_drug_cd = "CITA20"
mimicsql_data
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
How many of the patients on urgent admission were born before 2024?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year < "2024"
mimicsql_data
CREATE TABLE table_name_19 ( gold INTEGER, rank VARCHAR, total VARCHAR, bronze VARCHAR )
What is the gold number when total is more than 1, and bronze is 0, and rank is 5?
SELECT SUM(gold) FROM table_name_19 WHERE total > 1 AND bronze = 0 AND rank = "5"
sql_create_context
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 ) ...
count the number of patients whose diagnoses short title is polyp of nasal cavity and drug route is nu?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Polyp of nasal cavity" AND prescriptions.route = "NU"
mimicsql_data
CREATE TABLE table_name_93 ( date VARCHAR, length_of_game VARCHAR )
What was the date of the game that lasted 75:43?
SELECT date FROM table_name_93 WHERE length_of_game = "75:43"
sql_create_context
CREATE TABLE table_33330 ( "Player" text, "Nationality" text, "Position" text, "From" text, "School/Country" text )
What is the school or country for the guard from 2000?
SELECT "School/Country" FROM table_33330 WHERE "Position" = 'guard' AND "From" = '2000'
wikisql
CREATE TABLE table_45147 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the method of resolution for the fight against akihiro gono?
SELECT "Method" FROM table_45147 WHERE "Opponent" = 'akihiro gono'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id numbe...
how many patients have gotten discharged from the hospital since 6 years ago?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime) >= DATETIME(CURRENT_TIME(), '-6 year')
mimic_iii
CREATE TABLE table_name_8 ( tournament VARCHAR, year INTEGER )
What tournament was after 2009?
SELECT tournament FROM table_name_8 WHERE year > 2009
sql_create_context
CREATE TABLE table_name_9 ( attendance VARCHAR, week VARCHAR )
What was the attendance of the game in week 6?
SELECT attendance FROM table_name_9 WHERE week = 6
sql_create_context
CREATE TABLE table_name_36 ( rank INTEGER, time VARCHAR, lane VARCHAR )
What is the Rank of the Swimmer with a Time of 2:25.65 in a Lane larger than 3?
SELECT AVG(rank) FROM table_name_36 WHERE time = "2:25.65" AND lane > 3
sql_create_context
CREATE TABLE table_63605 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What is the Opponent of the game in Week 3?
SELECT "Opponent" FROM table_63605 WHERE "Week" = '3'
wikisql
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
在2015年11月6日到2021年10月2日内列出患者编号02589232所有检验结果指标记录的检验人为昌飞烟的检验指标流水序列号有多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B...
css
CREATE TABLE table_34610 ( "Title" text, "Season" text, "Winner" text, "Score" text, "Runner-up" text, "Venue" text, "Attendance" text )
What season had Kanto Gakuin University as the winner, with an attendance of n/a, and a title of 37th?
SELECT "Season" FROM table_34610 WHERE "Winner" = 'kanto gakuin university' AND "Attendance" = 'n/a' AND "Title" = '37th'
wikisql
CREATE TABLE table_27279050_1 ( poles VARCHAR, points VARCHAR, nation VARCHAR )
How many pole position achieved 0 points from Mexico?
SELECT COUNT(poles) FROM table_27279050_1 WHERE points = "0" AND nation = "Mexico"
sql_create_context
CREATE TABLE table_65435 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
what is the total when the rank is total and the silver is less than 10?
SELECT SUM("Total") FROM table_65435 WHERE "Rank" = 'total' AND "Silver" < '10'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
What is the number of each allergie type that the student with first name Lisa has? Visualize by bar chart, and order x axis from high to low order.
SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" GROUP BY AllergyType ORDER BY AllergyType DESC
nvbench
CREATE TABLE diagnoses ( 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 ) C...
find the age of subject name bruce harris.
SELECT demographic.age FROM demographic WHERE demographic.name = "Bruce Harris"
mimicsql_data
CREATE TABLE table_72255 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
What is the date of the episode written by Michael Poryes?
SELECT "Original air date" FROM table_72255 WHERE "Written by" = 'Michael Poryes'
wikisql
CREATE TABLE table_6478 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real )
which Points has Games smaller than 7?
SELECT MAX("Points") FROM table_6478 WHERE "Games" < '7'
wikisql
CREATE TABLE table_name_88 ( gold INTEGER, nation VARCHAR, silver VARCHAR )
What is the total amount of Gold from guatemala and silver smaller than 0?
SELECT SUM(gold) FROM table_name_88 WHERE nation = "guatemala" AND silver < 0
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the name , and group by attribute name by a bar chart, and could you sort by the mean code in descending please?
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code DESC
nvbench
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAno...
Age off by one error.
SELECT Id AS "user_link", age FROM Users WHERE DisplayName LIKE 'Richard J. Ross III'
sede
CREATE TABLE diagnoses ( 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 ) C...
how many patients whose discharge location is disch-tran to psych hosp and primary disease is t5 fracture?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.diagnosis = "T5 FRACTURE"
mimicsql_data
CREATE TABLE table_name_32 ( lost INTEGER, played INTEGER )
what is the average lost when played is more than 14?
SELECT AVG(lost) FROM table_name_32 WHERE played > 14
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
what is date of death of subject name kelly gallardo?
SELECT demographic.dod FROM demographic WHERE demographic.name = "Kelly Gallardo"
mimicsql_data
CREATE TABLE table_name_36 ( date VARCHAR, venue VARCHAR )
Which date had a venue of the Gold Coast Convention Centre?
SELECT date FROM table_name_36 WHERE venue = "gold coast convention centre"
sql_create_context
CREATE TABLE table_18238 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What was the result of the election in the Virginia 3 district?
SELECT "Result" FROM table_18238 WHERE "District" = 'Virginia 3'
wikisql
CREATE TABLE table_15887683_16 ( country VARCHAR, content VARCHAR )
How many countries have content of arte?
SELECT COUNT(country) FROM table_15887683_16 WHERE content = "arte"
sql_create_context
CREATE TABLE table_name_44 ( market_value__billion_ INTEGER, profits__billion_$_ VARCHAR, assets__billion_$_ VARCHAR, company VARCHAR )
Name the lowest Market Value (billion $) which has Assets (billion $) larger than 276.81, and a Company of toyota, and Profits (billion $) larger than 17.21?
SELECT MIN(market_value__billion_) AS $_ FROM table_name_44 WHERE assets__billion_$_ > 276.81 AND company = "toyota" AND profits__billion_$_ > 17.21
sql_create_context
CREATE TABLE table_30073089_2 ( discipline VARCHAR, fis_points VARCHAR )
Name the discipline for 1561 fis points
SELECT discipline FROM table_30073089_2 WHERE fis_points = 1561
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, star...
On the SOC 400 -level , which ones offer 13 -credit courses ?
SELECT DISTINCT department, name, number FROM course WHERE credits = 13 AND department = 'SOC' AND number < 400 + 100 AND number >= 400
advising
CREATE TABLE table_name_15 ( points INTEGER, team VARCHAR, position VARCHAR )
Which Points has a Team of s o paulo athletic, and a Position larger than 5?
SELECT SUM(points) FROM table_name_15 WHERE team = "são paulo athletic" AND position > 5
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
provide the number of patients whose admission year is less than 2144 and lab test name is heparin, lmw?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2144" AND lab.label = "Heparin, LMW"
mimicsql_data
CREATE TABLE table_name_46 ( score VARCHAR, opponent VARCHAR )
What was the score when the opponent was Detroit Pistons?
SELECT score FROM table_name_46 WHERE opponent = "detroit pistons"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, show me about the distribution of founder and the average of revenue , and group by attribute founder in a bar chart, list in descending by the Founder please.
SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC
nvbench
CREATE TABLE table_name_59 ( opponent VARCHAR, week VARCHAR )
Tell me the opponent of week 14
SELECT opponent FROM table_name_59 WHERE week = 14
sql_create_context
CREATE TABLE instructor ( dept_name VARCHAR, salary INTEGER )
Find the minimum salary for the departments whose average salary is above the average payment of all instructors.
SELECT MIN(salary), dept_name FROM instructor GROUP BY dept_name HAVING AVG(salary) > (SELECT AVG(salary) FROM instructor)
sql_create_context
CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real...
What are the correlation between the height and prominence of mountains which do not belong to the range 'Aberdare Range'? Plot the result by a scatter chart.
SELECT Height, Prominence FROM mountain WHERE Range <> 'Aberdare Range'
nvbench
CREATE TABLE table_25637 ( "No." real, "Place & date" text, "Target" text, "Area damaged" text, "Cause of damage" text, "Intercepted by Patriot" text )
What was the place and date that the Apartments area was damaged?
SELECT "Place & date" FROM table_25637 WHERE "Area damaged" = 'Apartments area'
wikisql
CREATE TABLE table_27572 ( "Player" text, "Games Played" real, "Rebounds" real, "Assists" real, "Steals" real, "Blocks" real, "Points" real )
Which player had 9 blocks?
SELECT "Player" FROM table_27572 WHERE "Blocks" = '9'
wikisql
CREATE TABLE table_name_62 ( time VARCHAR, meet VARCHAR, date VARCHAR )
What is Time, when Meet is 'Duel in the Pool', and when Date is '19 December 2009'?
SELECT time FROM table_name_62 WHERE meet = "duel in the pool" AND date = "19 december 2009"
sql_create_context
CREATE TABLE table_name_82 ( to_par VARCHAR, place VARCHAR )
what is the to par when the place is 8?
SELECT to_par FROM table_name_82 WHERE place = "8"
sql_create_context
CREATE TABLE table_18092 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
In the 2008/2009 season one team had a season total points of 31, for that team how many total points were scored against them?
SELECT "Points against" FROM table_18092 WHERE "Points" = '31'
wikisql
CREATE TABLE table_10260 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text )
Which player plays for Illinois?
SELECT "Player" FROM table_10260 WHERE "School/Club Team/Country" = 'illinois'
wikisql
CREATE TABLE table_name_42 ( home_captain VARCHAR, venue VARCHAR )
Which Home Captain has Venue of Bourda?
SELECT home_captain FROM table_name_42 WHERE venue = "bourda"
sql_create_context
CREATE TABLE table_name_21 ( score VARCHAR, away_team VARCHAR )
What was the score when the away team was brighton & hove albion?
SELECT score FROM table_name_21 WHERE away_team = "brighton & hove albion"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number,...
号码是00808054413的检验报告单中申请科室编码是什么?名称是什么?
SELECT SQKS, SQKSMC FROM jybgb WHERE BGDH = '00808054413'
css
CREATE TABLE table_37699 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text )
What are incumbent William Vandever's results?
SELECT "Result" FROM table_37699 WHERE "Incumbent" = 'william vandever'
wikisql
CREATE TABLE table_50090 ( "Name" text, "Branch" text, "Term began" text, "Term ended" text, "Time in office" text )
What time in office does the U.S. Navy have?
SELECT "Time in office" FROM table_50090 WHERE "Branch" = 'u.s. navy'
wikisql
CREATE TABLE table_name_62 ( bronze INTEGER, gold VARCHAR, silver VARCHAR, rank VARCHAR )
What is the average Bronze when silver is more than 2, and rank is 2, and gold more than 2
SELECT AVG(bronze) FROM table_name_62 WHERE silver > "2" AND rank = "2" AND gold > 2
sql_create_context
CREATE TABLE table_name_89 ( rank INTEGER, time VARCHAR )
With a time of 53.33, who ranked the highest?
SELECT MAX(rank) FROM table_name_89 WHERE time = 53.33
sql_create_context
CREATE TABLE table_5882 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Location" text )
Who was the opponent that led to a record of 23-5?
SELECT "Opponent" FROM table_5882 WHERE "Record" = '23-5'
wikisql
CREATE TABLE table_18424435_3 ( written_by VARCHAR, canadian_viewers__million_ VARCHAR )
Who wrote the episodes watched by 1.575 million people in Canada?
SELECT written_by FROM table_18424435_3 WHERE canadian_viewers__million_ = "1.575"
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence...
what airlines flies out of ATLANTA
SELECT DISTINCT airline.airline_code FROM airline, airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight.airline_code = airline.airline_code AND flight.from_airport = airport_service.airport_code
atis
CREATE TABLE storm ( storm_id number, name text, dates_active text, max_speed number, damage_millions_usd number, number_deaths number ) CREATE TABLE region ( region_id number, region_code text, region_name text ) CREATE TABLE affected_region ( region_id number, storm_id nu...
How many storms occured in each region?
SELECT T1.region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id
spider
CREATE TABLE table_23957 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Orangemen points" real, "Opponents" real, "Record" text )
When did they play against West Virginia?
SELECT "Date" FROM table_23957 WHERE "Opponent" = 'West Virginia'
wikisql
CREATE TABLE table_24713 ( "Rank" real, "Team Name" text, "Basic Elements" text, "Tumbling" text, "Stunts" text, "Tosses/Pyramids" text, "Deductions" text, "Total" text )
Which team names have 44.5 for tumbling?
SELECT "Team Name" FROM table_24713 WHERE "Tumbling" = '44.5'
wikisql
CREATE TABLE table_name_49 ( original_nonequity_tour_cast VARCHAR, original_broadway_cast VARCHAR )
What was the original nonequity tour when the original broadway was Kevin Chamberlin?
SELECT original_nonequity_tour_cast FROM table_name_49 WHERE original_broadway_cast = "kevin chamberlin"
sql_create_context
CREATE TABLE table_name_42 ( constructor VARCHAR, driver VARCHAR, free_practice_driver_s_ VARCHAR, chassis VARCHAR )
who is the constructor when the free practice driver(s) is n/a, the chassis is 005 and the driver is takuma sato?
SELECT constructor FROM table_name_42 WHERE free_practice_driver_s_ = "n/a" AND chassis = "005" AND driver = "takuma sato"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
how many patients with polycythemia were treated with main drug?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Polycythemia vera" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
is the level of arterial bp [diastolic] in patient 28443 last measured on the current intensive care unit visit greater than the value second to last measured on the current intensive care unit 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 = 28443) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i...
mimic_iii