context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE sta...
Plot season by how many season as a line chart, and could you rank by the X from high to low please?
SELECT Season, COUNT(Season) FROM game ORDER BY Season 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...
医院1943196的医疗记录中,入院诊断为慢性支气管炎的最低医疗费总额是多少?最高的金额又是多少
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '1943196' AND t_kc24.t_kc21_IN_DIAG_DIS_NM = '慢性支气管炎')
css
CREATE TABLE table_name_70 ( player VARCHAR, place VARCHAR )
Which player is T3?
SELECT player FROM table_name_70 WHERE place = "t3"
sql_create_context
CREATE TABLE table_55981 ( "Name" text, "Current version" text, "System" text, "Platform" text, "License" text )
What is the System when the Licence is gpl and the Current Version is 1.72?
SELECT "System" FROM table_55981 WHERE "License" = 'gpl' AND "Current version" = '1.72'
wikisql
CREATE TABLE table_name_99 ( name VARCHAR, authors VARCHAR )
What is the name of gao chiappe meng o'connor wang cheng liu?
SELECT name FROM table_name_99 WHERE authors = "gao chiappe meng o'connor wang cheng liu"
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...
从2006年2月17日到2006年6月28日内号码为19494267参保人的门诊检查费一共花费多少元?
SELECT SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '19494267' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2006-02-17' AND '2006-06-28' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fg...
css
CREATE TABLE table_name_12 ( points INTEGER, engine VARCHAR )
What is the average points earned for entrants with ATS V8 engines?
SELECT AVG(points) FROM table_name_12 WHERE engine = "ats v8"
sql_create_context
CREATE TABLE table_27782699_3 ( position_in_table VARCHAR, team VARCHAR )
What was the AB team's position in table?
SELECT position_in_table FROM table_27782699_3 WHERE team = "AB"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
清脑复神液在医疗就诊31300599205中开出的医疗发票项目是什么类型的?
SELECT MED_INV_ITEM_TYPE FROM t_kc22 WHERE MED_CLINIC_ID = '31300599205' AND SOC_SRT_DIRE_NM = '清脑复神液'
css
CREATE TABLE table_9675 ( "Poll Source" text, "Dates administered" text, "Democrat: John Lynch" text, "Republican: Joe Kenney" text, "Lead Margin" real )
What was the poll source that showed Democrat: John Lynch at 62% and had a lead margin of less than 33?
SELECT "Poll Source" FROM table_9675 WHERE "Lead Margin" < '33' AND "Democrat: John Lynch" = '62%'
wikisql
CREATE TABLE table_5443 ( "Driver" text, "Seasons" text, "Entries" real, "3rd places" real, "Percentage" text )
Which seasons have fernando alonso as the driver?
SELECT "Seasons" FROM table_5443 WHERE "Driver" = 'fernando alonso'
wikisql
CREATE TABLE table_10240125_1 ( total_goals INTEGER )
What is the smallest number of Total Goals?
SELECT MIN(total_goals) FROM table_10240125_1
sql_create_context
CREATE TABLE table_71642 ( "Year" real, "English title" text, "Original title" text, "Country" text, "Director(s)" text )
What is the English title of the film from 2001?
SELECT "English title" FROM table_71642 WHERE "Year" = '2001'
wikisql
CREATE TABLE table_37491 ( "Rank" real, "Name" text, "Nation" text, "Points" real, "Places" real )
What is the fewest number of places for a skater from Norway with fewer than 1524.9 points?
SELECT MIN("Places") FROM table_37491 WHERE "Nation" = 'norway' AND "Points" < '1524.9'
wikisql
CREATE TABLE table_30968 ( "Episode" real, "Broadcast date" text, "Guest(s)" text, "Singer(s)" text, "Ratings" text )
when was the episode guest starring michael mcintyre and alex james broadcasted
SELECT "Broadcast date" FROM table_30968 WHERE "Guest(s)" = 'Michael McIntyre and Alex James'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Descri...
select * from Posts where tags like '%android%' and tags like '%material-design%.
SELECT * FROM Posts AS p JOIN Posts AS a ON a.Id = p.ParentId WHERE a.Tags LIKE '%material-design%' AND a.Tags LIKE '%android%' AND a.AnswerCount > 0
sede
CREATE TABLE table_11111 ( "Jurisdiction" text, "Voted Yes" real, "Percent Yes" real, "Voted No" real, "Percent No" real )
What is the percent yes of Nova Scotia, which had more than 2,410,119 vote yes and less than 51.3 vote no?
SELECT COUNT("Percent Yes") FROM table_11111 WHERE "Voted Yes" > '2,410,119' AND "Jurisdiction" = 'nova scotia' AND "Percent No" < '51.3'
wikisql
CREATE TABLE table_name_48 ( overall VARCHAR, college VARCHAR, pick VARCHAR )
What is the total number of overall picks that were after pick 9 and went to Auburn College?
SELECT COUNT(overall) FROM table_name_48 WHERE college = "auburn" AND pick > 9
sql_create_context
CREATE TABLE table_39173 ( "Team" text, "Copa Libertadores 1999" text, "Copa Mercosur 1999" text, "Copa CONMEBOL 1999" text, "Intercontinental Cup 1999" text )
What is the copa mercosur 1999 result for team gr mio, who did not qualify for the Copa Libertadores 1999 and Copa Conmebol 1999?
SELECT "Copa Mercosur 1999" FROM table_39173 WHERE "Copa Libertadores 1999" = 'did not qualify' AND "Copa CONMEBOL 1999" = 'did not qualify' AND "Team" = 'grêmio'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
二零零三年二月七号到二零零八年三月二十四号这期间,曹俊郎的降钙素原指标记录
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzb...
css
CREATE TABLE table_name_21 ( name VARCHAR, length__ft_ VARCHAR )
Who has a length of 71 ft?
SELECT name FROM table_name_21 WHERE length__ft_ = 71
sql_create_context
CREATE TABLE Faculty ( rank VARCHAR, sex VARCHAR )
Show all the ranks and the number of male and female faculty for each rank.
SELECT rank, sex, COUNT(*) FROM Faculty GROUP BY rank, sex
sql_create_context
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
检验报告单19815716663的检验科室编码是什么?名称是什么?
SELECT zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.BGDH = '19815716663' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.BGDH = '19815716663'
css
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 )
wbc count < 3
SELECT * FROM table_train_161 WHERE white_blood_cell_count_wbc < 3
criteria2sql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
find out how many patients were discharged from the hospital during the previous year.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
eicu
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 TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_de...
Can you draw a bar chart to show the number of items in each customer details category?, I want to order in asc by the total number.
SELECT customer_details, COUNT(customer_details) FROM Customers GROUP BY customer_details ORDER BY COUNT(customer_details)
nvbench
CREATE TABLE table_60179 ( "Week" text, "Theme" text, "Song Sung" text, "Artist" text, "Status" text )
Which song was sung by Artist Luther Vandross in the Week Top 20?
SELECT "Song Sung" FROM table_60179 WHERE "Artist" = 'luther vandross' AND "Week" = 'top 20'
wikisql
CREATE TABLE table_204_869 ( id number, "species" text, "country of origin" text, "total released" number, "first release" text, "last release" text, "areas of release" text, "areas established" text, "pasture type" text )
what is the difference between the number of onthophagus obliquus species released and the number of sisyphus rubrus paschalidis released ?
SELECT ABS((SELECT "total released" FROM table_204_869 WHERE "species" = 'onthophagus obliquus') - (SELECT "total released" FROM table_204_869 WHERE "species" = 'sisyphus rubrus paschalidis'))
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...
give me the number of patients whose lab test name is prolactin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Prolactin"
mimicsql_data
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
赵婉仪这个病人现在的身高和体重分别是多少?
SELECT zzmzjzjlb.SG, zzmzjzjlb.TZ FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '赵婉仪' UNION SELECT fzzmzjzjlb.SG, fzzmzjzjlb.TZ FROM person_info JOIN hz_info JOIN ...
css
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
what is the intake method of the ecotrin ec?
SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'ecotrin ec'
eicu
CREATE TABLE table_name_60 ( more_than_$80 VARCHAR, percent_of_total VARCHAR )
Which have more than $80k and a total percent of 2.2%?
SELECT more_than_$80, 000 FROM table_name_60 WHERE percent_of_total = "2.2%"
sql_create_context
CREATE TABLE table_20745706_1 ( date VARCHAR, _number VARCHAR )
What is the date of game 5?
SELECT date FROM table_20745706_1 WHERE _number = "5"
sql_create_context
CREATE TABLE table_203_539 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" number )
what distance hurdles was run the most ?
SELECT "event" FROM table_203_539 GROUP BY "event" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_name_34 ( attendance INTEGER, date VARCHAR )
What's the average attendance on january 6, 2008?
SELECT AVG(attendance) FROM table_name_34 WHERE date = "january 6, 2008"
sql_create_context
CREATE TABLE table_34677 ( "Administrative Panel" real, "Agricultural Panel" real, "Cultural and Educational Panel" real, "Industrial and Commercial Panel" real, "Labour Panel" real, "National University of Ireland" real, "University of Dublin" real, "Nominated by the Taoiseach" real, ...
What is the lowest number for the University of Dublin, having and administrative panel of 3, and a Cultural and Educational panel less than 2?
SELECT MIN("University of Dublin") FROM table_34677 WHERE "Administrative Panel" = '3' AND "Cultural and Educational Panel" < '2'
wikisql
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text 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 varchar...
What will the special topics classes be next Winter ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E...
advising
CREATE TABLE table_65405 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text )
What did Denmark time at?
SELECT "Time" FROM table_65405 WHERE "Country" = 'denmark'
wikisql
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, ...
How many 300 -level classes are being offered in Spring and Summer term ?
SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = course_offering.semester ...
advising
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
how many places for chinese are there in the bay area ?
SELECT COUNT(*) FROM geographic, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'chinese'
restaurants
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 ...
在00年1月17日直到11年5月4日这一段时间,病患云天干内所有检验结果指标记录中的仪器编号以及名称分别叫什么?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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.BG...
css
CREATE TABLE table_44004 ( "Draft" real, "Round" real, "Pick" real, "Player" text, "College/High School/Club" text )
What is the total pick number of the player from a round greater than 1, a draft before 2002, and with the college/high school/club of western kentucky?
SELECT COUNT("Pick") FROM table_44004 WHERE "Round" > '1' AND "Draft" < '2002' AND "College/High School/Club" = 'western kentucky'
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...
Find the number of patients with coronary artery as their primary disease who were born before 2110.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND demographic.dob_year < "2110"
mimicsql_data
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) 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 re...
Return a bar chart about the distribution of Sex and the amount of Sex , and group by attribute Sex, and rank in desc by the names.
SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE table_name_77 ( time_retired VARCHAR, grid VARCHAR )
what is the time/retired when the grid is 9?
SELECT time_retired FROM table_name_77 WHERE grid = 9
sql_create_context
CREATE TABLE table_9560 ( "Name" text, "Mi from Kingston" real, "Km from Kingston" real, "Parish" text, "Length feet" real, "Length meters" real )
What is Name, when Length Meters is greater than 66.4, and when Km From Kingston is 138.8?
SELECT "Name" FROM table_9560 WHERE "Length meters" > '66.4' AND "Km from Kingston" = '138.8'
wikisql
CREATE TABLE payment ( amount VARCHAR )
What is the largest payment amount?
SELECT amount FROM payment ORDER BY amount DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_25 ( date VARCHAR, home VARCHAR )
On what date did Detroit play at home?
SELECT date FROM table_name_25 WHERE home = "detroit"
sql_create_context
CREATE TABLE table_3721 ( "Model Number" text, "Frequency" text, "L2 Cache" text, "HT" text, "Mult. 1" text, "Voltage" text, "TDP" text, "Socket" text, "Release date" text, "Order Part Number" text )
What are the L2 cache specifications of part number amql64dam22gg?
SELECT "L2 Cache" FROM table_3721 WHERE "Order Part Number" = 'AMQL64DAM22GG'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
give me the number of patients whose ethnicity is white - russian and drug route is id?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.route = "ID"
mimicsql_data
CREATE TABLE table_name_51 ( year INTEGER, silver VARCHAR )
What's listed for the lowest Year that a Silver of Kim Kyung-Ho?
SELECT MIN(year) FROM table_name_51 WHERE silver = "kim kyung-ho"
sql_create_context
CREATE TABLE table_26244 ( "No" real, "Player" text, "Height (m)" text, "Height (f)" text, "Position" text, "Year born" real, "Current Club" text )
Which clubs have players with height 2.14m?
SELECT "Current Club" FROM table_26244 WHERE "Height (m)" = '2.14'
wikisql
CREATE TABLE table_49530 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Year made" text, "Quantity made" text, "Quantity preserved" text )
Which wheel arrangement made in year 1900?
SELECT "Wheel arrangement" FROM table_49530 WHERE "Year made" = '1900'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
Percent of users who added this [tag]?.
SELECT FIRST_USER AS "user_link", COUNT(PostId) AS "COUNT", COUNT(PostId) * 100 / SUM(COUNT(PostId)) OVER () AS "%" FROM (SELECT MAX(CreationDate) AS CDATE, PostId, FIRST_USER FROM (SELECT FIRST_VALUE(PH.UserId) OVER (PARTITION BY PH.PostId ORDER BY PH.CreationDate) AS FIRST_USER, * FROM PostHistory AS PH WHERE PH.Text...
sede
CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machi...
What are the number of the names of the technicians that are assigned to repair machines with more point values than 70?, and order from high to low by the total number.
SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70 GROUP BY Name ORDER BY COUNT(Name) DESC
nvbench
CREATE TABLE table_71141 ( "Rank" real, "Country/Region" text, "Population" real, "Area (km 2 )" real, "Density (Pop. per km 2 )" real )
Can you tell me the total number of Rank that has the Area (km 2) smaller than 2,040, and the Population smaller than 1,234,596?
SELECT COUNT("Rank") FROM table_71141 WHERE "Area (km 2 )" < '2,040' AND "Population" < '1,234,596'
wikisql
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 transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype tex...
count the number of patients that are diagnosed with int inf clstrdium dfcile until 3 years ago.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'int inf clstrdium dfcile') AND DATETIME(diagnoses_icd.char...
mimic_iii
CREATE TABLE table_test_14 ( "id" int, "bleeding" int, "intra_aortic_balloon_pump_iabp" bool, "systolic_blood_pressure_sbp" int, "haemoglobin" float, "severe_hypertension" bool, "platelets" int, "neutrophil_count" int, "renal_disease" bool, "severe_thrombocytopenia" bool, "fa...
cardiogenic shock ( sbp < 80 mmhg for > 30 minutes, or requiring iv pressors or intra _ aortic balloon bump ( iabp ) or other hemodynamic support device for hypotension )
SELECT * FROM table_test_14 WHERE cardiogenic_shock = 1 OR (systolic_blood_pressure_sbp < 80 OR iv_pressors = 1 OR intra_aortic_balloon_pump_iabp = 1 OR hemodynamic_instability = 1)
criteria2sql
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...
金额top18的项目是医疗机构3979463哪个项目?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '3979463' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 18
css
CREATE TABLE table_name_39 ( attendance INTEGER, opponent VARCHAR )
What is the sum of attendance for the games played at Los Angeles Rams?
SELECT SUM(attendance) FROM table_name_39 WHERE opponent = "at los angeles rams"
sql_create_context
CREATE TABLE table_name_90 ( floors INTEGER, built VARCHAR, name VARCHAR )
What is the lowest Floors, when Built is greater than 1970, and when Name is NV Building 3?
SELECT MIN(floors) FROM table_name_90 WHERE built > 1970 AND name = "nv building 3"
sql_create_context
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, ...
编号41791564165的检验报告单与编号24394363437的检验报告单中是否有检测指标的名称是一样的?一一列出这些检测指标名称、检测指标结果定量及其单位、对应的检验报告单号
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW, jyjgzbb.BGDH FROM jyjgzbb WHERE jyjgzbb.BGDH = '41791564165' OR jyjgzbb.BGDH = '24394363437' AND jyjgzbb.JCZBMC IN (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.BGDH = '41791564165' INTERSECT SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.BGDH = '24394363...
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
Count the number of elective hospital admission patients who had a creatine kinase lab test.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Creatine Kinase (CK)"
mimicsql_data
CREATE TABLE table_30862 ( "Episode #" real, "Series #" real, "Episode Title" text, "Original air date" text, "Production Code" real )
What is the title of the episode with series number 14?
SELECT "Episode Title" FROM table_30862 WHERE "Series #" = '14'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
during the previous year, what is the top four most frequent microbiology tests given to patients within the same hospital visit within the same patient after receiving ventilator weaning?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'ventilato...
eicu
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...
what is the number of patients whose admission type is elective and admission year is less than 2184?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2184"
mimicsql_data
CREATE TABLE table_2562572_53 ( largest_ethnic_group__2002_ VARCHAR, cyrillic_name VARCHAR )
What ethnic group had the largest population in in 2002?
SELECT largest_ethnic_group__2002_ FROM table_2562572_53 WHERE cyrillic_name = "Сурдук"
sql_create_context
CREATE TABLE table_name_37 ( assets__usd__millions INTEGER, bank VARCHAR, number_of_branches VARCHAR )
What is the highest Assets (USD) Millions from Equity Bank and less than 44 branches?
SELECT MAX(assets__usd__millions) FROM table_name_37 WHERE bank = "equity bank" AND number_of_branches < 44
sql_create_context
CREATE TABLE table_204_761 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
other than switzerland , which other nation won a total of three bronze awards ?
SELECT "nation" FROM table_204_761 WHERE "nation" <> 'switzerland' AND "bronze" = 3
squall
CREATE TABLE table_24709 ( "Pos" real, "Team" text, "07 Pts" real, "08 Pts" real, "09 Pts" real, "Total Pts" real, "Total Pld" real, "Avg" text )
If the team is Rubio , what is the 08 points?
SELECT "08 Pts" FROM table_24709 WHERE "Team" = 'Rubio Ñú'
wikisql
CREATE TABLE table_24910733_1 ( title VARCHAR, written_by VARCHAR )
What is the title when the writer is Emily Halpern?
SELECT title FROM table_24910733_1 WHERE written_by = "Emily Halpern"
sql_create_context
CREATE TABLE table_72734 ( "N\u00b0" real, "Television service" text, "Country" text, "Language" text, "Content" text, "DAR" text, "HDTV" text, "Package/Option" text )
How many dar are in germany?
SELECT "DAR" FROM table_72734 WHERE "Country" = 'Germany'
wikisql
CREATE TABLE table_45715 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
On April 15 who is the Home team?
SELECT "Home" FROM table_45715 WHERE "Date" = 'april 15'
wikisql
CREATE TABLE table_name_64 ( scored INTEGER, competition VARCHAR, date VARCHAR )
Name the averag scored for 2011 long teng cup and 2 october 2011
SELECT AVG(scored) FROM table_name_64 WHERE competition = "2011 long teng cup" AND date = "2 october 2011"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is admission location and icu stay id of subject id 74032?
SELECT demographic.admission_location, prescriptions.icustay_id FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "74032"
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...
what is the number of patients categorized under chemistry lab test who have a diagnoses of acute myocardial infarction of inferolataeral wall, inital episode of care?
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.short_title = "AMI inferolateral, init" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
for patients who have received endotracheal tube removal since 2 years ago, what are the top four most common medications that have followed during the same hospital visit?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'endotracheal tu...
eicu
CREATE TABLE table_name_39 ( name VARCHAR, current_age VARCHAR, years_on_death_row VARCHAR )
Who is the prisoner that is older than 45 and has served less than 22 years on death row?
SELECT name FROM table_name_39 WHERE current_age > 45 AND years_on_death_row < 22
sql_create_context
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...
Show the average age for all female students and group them by last name with a bar chart, could you list by the total number in asc please?
SELECT LName, AVG(Age) FROM Student WHERE Sex = 'F' GROUP BY LName ORDER BY AVG(Age)
nvbench
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 fzzmzjzjlb ( HXPLC number, HZ...
在两千年七月三十日至两千零四年二月二十九日期间医院4897749有几科室在门诊就诊中开出了超过30张检验报告单?
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.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 fzzmzjzjlb ...
css
CREATE TABLE table_dev_25 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "diastolic_blood_pressure_dbp" int, "alcohol_abuse" bool, "hypertension" bool, "NOUSE" float )
female of non _ childbearing potential.
SELECT * FROM table_dev_25 WHERE gender = 'female' AND pregnancy_or_lactation = 0
criteria2sql
CREATE TABLE table_28297 ( "Shortscale comparison" text, "Chuquet" text, "Peletier" text, "Systematics" text, "Base 10" text, "SI Prefix" text )
Name the peletier for systematics being million 1
SELECT "Peletier" FROM table_28297 WHERE "Systematics" = 'Million 1'
wikisql
CREATE TABLE table_31722 ( "Name" text, "Location" text, "District" text, "Altitude (metres)" real, "Region" text )
Tell me the location for altitude being less thaan 6102
SELECT "Location" FROM table_31722 WHERE "Altitude (metres)" < '6102'
wikisql
CREATE TABLE table_name_9 ( cubic_inches__exact_ VARCHAR, metric_value VARCHAR )
What are the exact Cubic inches of the Metric value of 104.955 L?
SELECT cubic_inches__exact_ FROM table_name_9 WHERE metric_value = "104.955 l"
sql_create_context
CREATE TABLE table_55694 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
what is the time/retired for driver richard attwood?
SELECT "Time/Retired" FROM table_55694 WHERE "Driver" = 'richard attwood'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
列出郑波涛在8549699的就诊记录里,患者出院科室的名字有关节病字样的住院就诊记录
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND 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_i...
css
CREATE TABLE table_38275 ( "Team" text, "Driver" text, "Laps" real, "Time" text, "Grid" real )
What is the average grid number that had Team China with less than 10 laps?
SELECT AVG("Grid") FROM table_38275 WHERE "Laps" < '10' AND "Team" = 'china'
wikisql
CREATE TABLE table_name_84 ( silver VARCHAR, bronze INTEGER )
What is the total number of Silver medals for the Nation with less than 1 Bronze?
SELECT COUNT(silver) FROM table_name_84 WHERE bronze < 1
sql_create_context
CREATE TABLE table_51590 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text )
I want the condition that has a partial thromboplastin time of prolonged and unaffected bleeding time
SELECT "Condition" FROM table_51590 WHERE "Partial thromboplastin time" = 'prolonged' AND "Bleeding time" = 'unaffected'
wikisql
CREATE TABLE table_name_14 ( position VARCHAR, school_club_team VARCHAR )
What is the position of the player from Tampa?
SELECT position FROM table_name_14 WHERE school_club_team = "tampa"
sql_create_context
CREATE TABLE tracks ( id INTEGER, name VARCHAR(200), album_id INTEGER, media_type_id INTEGER, genre_id INTEGER, composer VARCHAR(220), milliseconds INTEGER, bytes INTEGER, unit_price NUMERIC(10,2) ) CREATE TABLE genres ( id INTEGER, name VARCHAR(120) ) CREATE TABLE invoice_...
List the number of invoices from the US, grouped by state Visualize by bar chart, I want to rank in ascending by the X please.
SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY billing_state
nvbench
CREATE TABLE table_69269 ( "Race" text, "Dist (f)" real, "Course" text, "Prize (\u00a3K)" real, "Runners" real, "Placing" real, "Margin" text, "Jockey" text, "Trainer" text )
What is the average prize for the Buttercross Limited Stakes?
SELECT AVG("Prize (\u00a3K)") FROM table_69269 WHERE "Race" = 'buttercross limited stakes'
wikisql
CREATE TABLE table_66814 ( "Position" text, "Player" text, "County team" text, "Club team(s)" text, "Team Number" real )
How many club teams had more than 14 people?
SELECT "Club team(s)" FROM table_66814 WHERE "Team Number" > '14'
wikisql
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...
从01年1月31日一直到09年8月12日内患者80476579被开出盐酸多奈哌齐片(薄膜)的总次数一共有多少?
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '80476579' AND t_kc22.STA_DATE BETWEEN '2001-01-31' AND '2009-08-12' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸多奈哌齐片(薄膜)' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID W...
css
CREATE TABLE employee ( emp_jobcode VARCHAR )
Find the count and code of the job has most employees.
SELECT emp_jobcode, COUNT(*) FROM employee GROUP BY emp_jobcode ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_49 ( score VARCHAR, date VARCHAR )
what was the score on the game that happened on May 15?
SELECT score FROM table_name_49 WHERE date = "may 15"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
For those employees who did not have any job in the past, a bar chart shows the distribution of hire_date and the sum of manager_id bin hire_date by time, list in descending by the y-axis.
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID) DESC
nvbench
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...
列出患者何丽姿的医疗记录中每一次药品消费金额不低于8447.75元的医疗就诊编号
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '何丽姿' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 8447.75)
css
CREATE TABLE table_17265535_7 ( equation VARCHAR )
If the equation is 6 9 + 6 9 + 6, what is the 3rd throw?
SELECT MAX(3 AS rd_throw) FROM table_17265535_7 WHERE equation = "6 × 9² + 6 × 9 + 6"
sql_create_context
CREATE TABLE table_name_67 ( open_source_movie VARCHAR, planned_release VARCHAR )
What are the open source movies with planned releases in 2013?
SELECT open_source_movie FROM table_name_67 WHERE planned_release = "2013"
sql_create_context