context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_43 ( comparative VARCHAR, link VARCHAR )
Which Comparative has a Link of sourcecode webserver?
SELECT comparative FROM table_name_43 WHERE link = "sourcecode webserver"
sql_create_context
CREATE TABLE table_740 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
what's the candidates with party being democratic and dbeingtrict being north carolina 1
SELECT "Candidates" FROM table_740 WHERE "Party" = 'Democratic' AND "District" = 'North Carolina 1'
wikisql
CREATE TABLE table_3251 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
If the writer is Mark Fink, who is the director?
SELECT "Directed by" FROM table_3251 WHERE "Written by" = 'Mark Fink'
wikisql
CREATE TABLE table_25243 ( "Year" text, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text )
How many laps have a 3:34:26 race time?
SELECT COUNT("Laps") FROM table_25243 WHERE "Race Time" = '3:34:26'
wikisql
CREATE TABLE table_12565 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Attendance" real )
What is the score when the attendance is greater than 134 and Workington is the home team?
SELECT "Score" FROM table_12565 WHERE "Attendance" > '134' AND "Home team" = 'workington'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
how much does it cost for a procedure called neuromuscular blocking agent?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'neuromuscular blocking agent')
eicu
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( ...
count the number of patients who had undergone a cooling the patient procedure two times since 2105.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'cooling the patient' AND STRFTIME('%y', treatment.treatmenttime) >= '2105') GROUP BY patient.uniquepid) AS...
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
count the number of patients who have died in or before year 2164 with a s/p fall as their primary disease.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dod_year <= "2164.0"
mimicsql_data
CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE technician ( technician_id real, Na...
What are the names of technicians with the machine series that they repair? Show me how many machines for each technician's name, list Name in descending order please.
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 GROUP BY Name ORDER BY Name DESC
nvbench
CREATE TABLE useracct ( name VARCHAR, u_id VARCHAR ) CREATE TABLE review ( u_id VARCHAR, rating VARCHAR )
Find the name of the user who gave the highest rating.
SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id ORDER BY T2.rating DESC LIMIT 1
sql_create_context
CREATE TABLE table_28773 ( "Portuguese name" text, "English name" text, "Subdivides in" text, "Equivalence in Varas" text, "Metrical equivalence" text )
Name the equivalence for varas for geometrical pace
SELECT "Equivalence in Varas" FROM table_28773 WHERE "English name" = 'Geometrical pace'
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 ...
名叫孔红艳的病人在2002年11月10日至2007年9月10日内测验人为13231895的所有检验结果指标记录的检验指数的流水号是啥?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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_...
css
CREATE TABLE table_21928 ( "Episode #" text, "Season #" real, "Title" text, "Writer(s)" text, "Director" text, "Originalairdate" text )
what was the title of the episode 21a?
SELECT "Title" FROM table_21928 WHERE "Episode #" = '21a'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Show me about the distribution of All_Road and Team_ID in a bar chart, rank by the x axis from low to high.
SELECT All_Road, Team_ID FROM basketball_match ORDER BY All_Road
nvbench
CREATE TABLE table_name_59 ( surface VARCHAR, outcome VARCHAR, opponent VARCHAR )
What is the surface of the tournament with a runner-up outcome and dudi sela as the opponent?
SELECT surface FROM table_name_59 WHERE outcome = "runner-up" AND opponent = "dudi sela"
sql_create_context
CREATE TABLE table_19042 ( "Episode" text, "Original Air Date" text, "Viewers (millions)" text, "Presenter" text, "Location" text )
What episode of the Pride of Britain Awards had an audience of 6.06 million viewers?
SELECT "Episode" FROM table_19042 WHERE "Viewers (millions)" = '6.06'
wikisql
CREATE TABLE table_21035326_1 ( opponent VARCHAR, golden_bears_points VARCHAR )
What opponent was playing against the Golden Bears when they scored 3 points?
SELECT opponent FROM table_21035326_1 WHERE golden_bears_points = 3
sql_create_context
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 diagnosis ( diagnosisid number, ...
what were the top three most frequently prescribed drugs that patients were prescribed within the same hospital visit after being prescribed ciprofloxacin in d5w 400 mg/200ml iv soln until 2104?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'ciprofloxacin in...
eicu
CREATE TABLE table_79062 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Streak" text )
What was the record for less than 78 games and a score of 114 109 (ot)?
SELECT "Record" FROM table_79062 WHERE "Game" < '78' AND "Score" = '114–109 (ot)'
wikisql
CREATE TABLE table_204_53 ( id number, "date" text, "result" text, "opponent" text, "event" text, "location" text, "method" text, "round" number, "time" text )
how many times did grigorian have a match in belgium ?
SELECT COUNT(*) FROM table_204_53 WHERE "location" = 'belgium'
squall
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Graph of answer quality and number - with minimum reputation threshold.
SELECT *, COUNT(*) FROM (SELECT p.OwnerUserId AS "user_link", u.Reputation, ROUND(AVG(CAST(p.Score AS FLOAT)), 2) AS "avg_score", COUNT(*) AS "#_questions" FROM Posts AS p JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.PostTypeId = 2 AND p.CommunityOwnedDate IS NULL AND p.ClosedDate IS NULL AND u.Reputation > '##Minim...
sede
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagn...
how much is lidocaine 2% costing?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'lidocaine 2%')
mimic_iii
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
how many times since 3 years ago does patient 22753 visit the hospital?
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 22753 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-3 year')
mimic_iii
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, ...
how many days was it since patient 65582's last urin tract infection nos diagnosis during the current hospital encounter.
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = 'urin tract infection nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM adm...
mimic_iii
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
病人在医疗机构6778599就诊,异地来的有多少
SELECT COUNT(DISTINCT PERSON_ID) FROM t_kc21 WHERE MED_SER_ORG_NO = '6778599' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2')
css
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 admission location and admission time of subject id 45962?
SELECT demographic.admission_location, demographic.admittime FROM demographic WHERE demographic.subject_id = "45962"
mimicsql_data
CREATE TABLE labevents ( row_id number, subject_id number, hadm_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 text, careunit text, ...
what did patient 3267 pay for their hospital stay until 2104?
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3267) AND STRFTIME('%y', cost.chargetime) <= '2104'
mimic_iii
CREATE TABLE table_20107762_1 ( assists VARCHAR, mins VARCHAR )
What is the amount of assists when mins is 744:27?
SELECT assists FROM table_20107762_1 WHERE mins = "744:27"
sql_create_context
CREATE TABLE diagnoses ( 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 procedures ( ...
count the number of patients with procedure icd9 code 8949 who are less than 80 years of age.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "80" AND procedures.icd9_code = "8949"
mimicsql_data
CREATE TABLE table_name_43 ( points INTEGER, team VARCHAR, chassis VARCHAR )
What are the highest points for the team of marlboro brm with brm p180 as the chassis?
SELECT MAX(points) FROM table_name_43 WHERE team = "marlboro brm" AND chassis = "brm p180"
sql_create_context
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
Return the average age of captains in each class, and rank Y-axis from low to high order please.
SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY AVG(age)
nvbench
CREATE TABLE table_name_48 ( gold VARCHAR, silver VARCHAR )
Who won the gold when Bertil Ahlin Sweden won the silver?
SELECT gold FROM table_name_48 WHERE silver = "bertil ahlin sweden"
sql_create_context
CREATE TABLE table_23124 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
Name the college/junior club team for john campbell
SELECT "College/junior/club team" FROM table_23124 WHERE "Player" = 'John Campbell'
wikisql
CREATE TABLE table_name_50 ( director VARCHAR, title VARCHAR )
Who directed Tequila?
SELECT director FROM table_name_50 WHERE title = "tequila"
sql_create_context
CREATE TABLE table_40000 ( "Round" real, "Overall" real, "Player" text, "Position" text, "College" text )
What is the lowest Overall for the wide receiver in a round less than 2?
SELECT MIN("Overall") FROM table_40000 WHERE "Position" = 'wide receiver' AND "Round" < '2'
wikisql
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 mzjzjlb ( HXPLC number, HZXM ...
在医疗就诊37475427497中,为病患96815436的检验报告做审核的人员姓名及工号
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '37475427497'
css
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-11-13到2018-05-18内,2024496这个医疗机构的医疗费总额如何
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '2024496' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-11-13' AND '2018-05-18'
css
CREATE TABLE table_train_98 ( "id" int, "mini_mental_state_examination_mmse" int, "stroke" bool, "lyperlipidemia_ldl" int, "allergy_to_milk" bool, "allergy_to_soy" bool, "body_mass_index_bmi" float, "NOUSE" float )
mmse range: 10 to 28
SELECT * FROM table_train_98 WHERE mini_mental_state_examination_mmse >= 10 AND mini_mental_state_examination_mmse <= 28
criteria2sql
CREATE TABLE table_30120761_1 ( area__acres__ VARCHAR, poor_law_union VARCHAR, civil_parish VARCHAR )
What are all the acreages of the townlands in the Macroom poor law union and Macroom civil parish?
SELECT area__acres__ FROM table_30120761_1 WHERE poor_law_union = "Macroom" AND civil_parish = "Macroom"
sql_create_context
CREATE TABLE table_60062 ( "Position" real, "Club" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Points" real, "Goal Difference" real )
What is the number played by the team in place greater than 16?
SELECT AVG("Played") FROM table_60062 WHERE "Position" > '16'
wikisql
CREATE TABLE table_name_39 ( laps INTEGER, time VARCHAR, grid VARCHAR )
What is the lowest number of Laps that have a Time of +24.440, and a Grid higher than 18?
SELECT MIN(laps) FROM table_name_39 WHERE time = "+24.440" AND grid > 18
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
医院9461389所有的就诊记载里,依科室编号的不同与入院诊断编码的不同列出医保大病支付的花费与医疗费的总额度相比比值最小是多少
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '9461389' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD
css
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...
这个被门诊诊断为疾病F42.715的患者的检测指标677145参考值范围的下限与上限是什么?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'F42.715' AND jyjgzbb.JCZBDM = '677145' UNION SELECT jyjgzbb.CKZFWX...
css
CREATE TABLE table_67089 ( "Pick #" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
Which team picked the player from the Toronto Marlboros (OHA) as Pick #32?
SELECT "NHL team" FROM table_67089 WHERE "College/junior/club team" = 'toronto marlboros (oha)' AND "Pick #" = '32'
wikisql
CREATE TABLE table_204_902 ( id number, "rank" number, "name" text, "nationality" text, "time" text, "notes" text )
who is the only person to rank from jamaica ?
SELECT "name" FROM table_204_902 WHERE "nationality" = 'jamaica'
squall
CREATE TABLE table_name_40 ( city VARCHAR, iata VARCHAR )
Which city has the IATA SSG?
SELECT city FROM table_name_40 WHERE iata = "ssg"
sql_create_context
CREATE TABLE table_name_19 ( opponents_in_final VARCHAR, score_in_final VARCHAR )
Which Opponents in Final has a Score in Final of 7 5, 1 6 4 6?
SELECT opponents_in_final FROM table_name_19 WHERE score_in_final = "7–5, 1–6 4–6"
sql_create_context
CREATE TABLE table_15621965_14 ( player VARCHAR, school_club_team VARCHAR )
Name the player for seattle
SELECT player FROM table_15621965_14 WHERE school_club_team = "Seattle"
sql_create_context
CREATE TABLE table_name_45 ( discipline VARCHAR, championship VARCHAR )
In which discipline was non-championship under Championship?
SELECT discipline FROM table_name_45 WHERE championship = "non-championship"
sql_create_context
CREATE TABLE table_204_621 ( id number, "no." number, "date" text, "tournament" text, "winning score" text, "margin\nof victory" text, "runner(s)-up" text )
which margin of victory was the largest ?
SELECT "margin\nof victory" FROM table_204_621 ORDER BY "margin\nof victory" DESC LIMIT 1
squall
CREATE TABLE table_name_49 ( date VARCHAR, record VARCHAR )
What was the date of the Mariners game when they had a record of 53 17?
SELECT date FROM table_name_49 WHERE record = "53–17"
sql_create_context
CREATE TABLE table_name_55 ( thai_name VARCHAR, transcription VARCHAR )
WHich Thai name has a Transcription of wan phruehatsabodi?
SELECT thai_name FROM table_name_55 WHERE transcription = "wan phruehatsabodi"
sql_create_context
CREATE TABLE table_name_50 ( goals_scored VARCHAR, pos VARCHAR, years_active VARCHAR )
How many goals were scored with a pos larger than 4 and active in 2001-?
SELECT goals_scored FROM table_name_50 WHERE pos > 4 AND years_active = "2001-"
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
医疗就诊33312894581与医疗就诊31529825688中开出的名称相同的药品有哪些?请把这些药品名称列给我
SELECT t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21_t_kc22.MED_CLINIC_ID = '33312894581' INTERSECT SELECT t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON ...
css
CREATE TABLE table_name_35 ( percentage___percentage_ VARCHAR, males VARCHAR )
What is the percentage where males equal 99?
SELECT percentage___percentage_ FROM table_name_35 WHERE males = "99"
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, visualize a bar chart about the distribution of name and the sum of manufacturer , and group by attribute name, and I want to order Y in ascending order.
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer
nvbench
CREATE TABLE table_27213 ( "Player" text, "Minutes" real, "Field Goals" real, "Rebounds" real, "Assists" real, "Steals" real, "Blocks" real, "Points" real )
How many points does the player with 2 steals have?
SELECT "Points" FROM table_27213 WHERE "Steals" = '2'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUser...
Past bounties with no answers between two dates.
SELECT p.Id AS "post_link", p.Score, p.OwnerUserId AS "user_link", p.Tags FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId WHERE v.VoteTypeId = 8 AND p.AnswerCount = 0 AND (v.CreationDate >= '##Date1?2016-01-01##') AND (v.CreationDate <= '##Date2?2016-06-01##') ORDER BY p.CreationDate
sede
CREATE TABLE table_name_51 ( rank INTEGER, peak_name VARCHAR )
What is the total number of ranks when the Peak Name is Red Shirt Table?
SELECT SUM(rank) FROM table_name_51 WHERE peak_name = "red shirt table"
sql_create_context
CREATE TABLE table_name_50 ( gold VARCHAR, total VARCHAR, bronze VARCHAR )
Can you tell me the Gold that has the Total larger than 2, and the Bronze smaller than 1?
SELECT gold FROM table_name_50 WHERE total > 2 AND bronze < 1
sql_create_context
CREATE TABLE table_17810099_3 ( writer_s_ VARCHAR, episode__number VARCHAR )
who wrote episode 14?
SELECT writer_s_ FROM table_17810099_3 WHERE episode__number = "14"
sql_create_context
CREATE TABLE table_204_207 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number, "bye" text )
last home opponent of the season
SELECT "opponent" FROM table_204_207 WHERE "opponent" = 'home' ORDER BY "week" DESC LIMIT 1
squall
CREATE TABLE county ( Id VARCHAR )
How many counties are there in total?
SELECT COUNT(*) FROM county
sql_create_context
CREATE TABLE table_name_54 ( spartak INTEGER, played VARCHAR, draw VARCHAR )
what is the sum of spartak when played is 102 and draw is less than 19?
SELECT SUM(spartak) FROM table_name_54 WHERE played = 102 AND draw < 19
sql_create_context
CREATE TABLE table_204_843 ( id number, "volume" number, "year" text, "names" text, "articles" number, "pages" number, "images" number, "maps" number, "number of copies" number )
in what year were there the least number of images ?
SELECT "year" FROM table_204_843 ORDER BY "images" LIMIT 1
squall
CREATE TABLE table_77197 ( "Entered office" text, "Left office" text, "Party" text, "Election" text, "Coalition" text )
When did the party elected in jun. 1959 enter office?
SELECT "Entered office" FROM table_77197 WHERE "Election" = 'jun. 1959'
wikisql
CREATE TABLE table_name_7 ( series VARCHAR, date VARCHAR )
Which Series has a Date of may 2?
SELECT series FROM table_name_7 WHERE date = "may 2"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
患者65424109之前看病的医院是哪个
SELECT zzmzjzjlb.YLJGDM FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '65424109' UNION SELECT fzzmzjzjlb.YLJGDM FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AND hz_info.KH = fzzmzjzjlb.KH AND hz_i...
css
CREATE TABLE table_name_67 ( opponent_in_the_final VARCHAR, tournament VARCHAR, outcome VARCHAR, surface VARCHAR )
What is Opponent In The Final, when Outcome is 'Winner', when Surface is 'Carpet (I)', and when Tournament is 'Lyon, France'?
SELECT opponent_in_the_final FROM table_name_67 WHERE outcome = "winner" AND surface = "carpet (i)" AND tournament = "lyon, france"
sql_create_context
CREATE TABLE table_203_562 ( id number, "state" text, "no. of candidates" number, "no. of elected" number, "total no. of seats in assembly" number, "year of election" number )
what state had only 30 seats in their assembly ?
SELECT "state" FROM table_203_562 WHERE "total no. of seats in assembly" = 30
squall
CREATE TABLE table_name_38 ( try_bonus VARCHAR, points_for VARCHAR )
What's the try bonus that had 423 points?
SELECT try_bonus FROM table_name_38 WHERE points_for = "423"
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_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, XM...
患者43179204有哪些检验报告的结果指标全部正常?看看这些检验报告的单号
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '43179204' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
what is admission type and death status of subject id 1121?
SELECT demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "1121"
mimicsql_data
CREATE TABLE table_name_36 ( total INTEGER, to_par VARCHAR )
Can you tell me the average Total that has the To par of 15?
SELECT AVG(total) FROM table_name_36 WHERE to_par = 15
sql_create_context
CREATE TABLE table_name_9 ( player VARCHAR, position VARCHAR, year VARCHAR )
What player played center in 2010?
SELECT player FROM table_name_9 WHERE position = "center" AND year = 2010
sql_create_context
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...
what is the number of patients whose diagnoses long title is unspecified essential hypertension?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Unspecified essential hypertension"
mimicsql_data
CREATE TABLE table_name_7 ( attendance VARCHAR, date VARCHAR )
What is the Attendance of the game on November 6, 1966?
SELECT attendance FROM table_name_7 WHERE date = "november 6, 1966"
sql_create_context
CREATE TABLE table_2448 ( "Round" real, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Team" text )
What is the winning team at Oulton Park when Max Chilton held the pole position?
SELECT "Winning Team" FROM table_2448 WHERE "Pole Position" = 'Max Chilton' AND "Circuit" = 'Oulton Park'
wikisql
CREATE TABLE table_204_311 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
what was the total number of medals won by all the teams combined ?
SELECT SUM("total") FROM table_204_311
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, ...
列举出从06年3月16日至17年7月23日之间病人赵光远所有检验结果指标记录中的检测方法?
SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info...
css
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
show me flights from DENVER to PHILADELPHIA arriving after 2100
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.arrival_time > 2100 AND flight.to_airport = AIRPORT_SERVICE_1.ai...
atis
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
provide me the number of patients with chest pain primary disease who have procedure icd9 code 3521.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "CHEST PAIN" AND procedures.icd9_code = "3521"
mimicsql_data
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, t...
Which courses for Arrian satisfy the MDE specifications ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Arrian%' OR course.description LIKE '%Arrian%' OR course.name LIKE '%Arrian%') AND program_cours...
advising
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
根据号码是7425569的医院入院诊断结果中的疾病名称,不同疾病的平均患者年龄都是多少岁啊?
SELECT qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '7425569' GROUP BY qtb.IN_DIAG_DIS_NM UNION SELECT gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '7425569' GROUP BY gyb.IN_DIAG_DIS_NM UNION SELECT zyb.IN_DIAG_DIS_NM, AVG(zyb.PERSON_AGE) FROM zyb WHERE zyb....
css
CREATE TABLE table_7083 ( "Team" text, "Match" real, "Points" real, "Draw" real, "Lost" real )
What is the average number of draws for teams with more than 10 matches?
SELECT AVG("Draw") FROM table_7083 WHERE "Match" > '10'
wikisql
CREATE TABLE table_47498 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text )
What is T8 Place Player Scott Hoch's Score?
SELECT "Score" FROM table_47498 WHERE "Place" = 't8' AND "Player" = 'scott hoch'
wikisql
CREATE TABLE table_60372 ( "Nation" text, "Distance" text, "Athlete" text, "Venue" text, "Date" text )
What is Athlete, when Nation is 'Nigeria'?
SELECT "Athlete" FROM table_60372 WHERE "Nation" = 'nigeria'
wikisql
CREATE TABLE table_64857 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "IHSAA Football Class" text, "# / County" text )
Which IHSAA Football Class has a School of whitko?
SELECT "IHSAA Football Class" FROM table_64857 WHERE "School" = 'whitko'
wikisql
CREATE TABLE table_52424 ( "School" text, "Location" text, "Enrolment" real, "Founded" real, "Denomination" text, "Day/Boarding" text, "School Colors" text )
Is mt lawley day or boarding?
SELECT "Day/Boarding" FROM table_52424 WHERE "Location" = 'mt lawley'
wikisql
CREATE TABLE table_name_76 ( silver INTEGER, nation VARCHAR )
What is the most silver won by Norway?
SELECT MAX(silver) FROM table_name_76 WHERE nation = "norway"
sql_create_context
CREATE TABLE table_14604 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Name the score for 26 may 1997
SELECT "Score" FROM table_14604 WHERE "Date" = '26 may 1997'
wikisql
CREATE TABLE table_204_980 ( id number, "name" text, "type" text, "elevation\n(ground station)" number, "elevation\n(mountain station)" number, "slope length" number, "capacity\n(persons/hour)" number, "construction year" number )
what is the only cable car with a 2937 slope length ?
SELECT "name" FROM table_204_980 WHERE "type" = 'cable car' AND "slope length" = 2937
squall
CREATE TABLE table_27539535_7 ( record VARCHAR, opponent VARCHAR )
What was the teams record when they played the ottawa senators?
SELECT record FROM table_27539535_7 WHERE opponent = "Ottawa Senators"
sql_create_context
CREATE TABLE table_27458 ( "Rank" real, "Rider" text, "Sat 29 May" text, "Mon 31 May" text, "Tues 1 June" text, "Wed 2 June" text, "Thurs 3 June" text, "Fri 4 June" text )
If Tuesday 1 June is 21' 05.27 107.351mph, what is the rider total number?
SELECT COUNT("Rider") FROM table_27458 WHERE "Tues 1 June" = '21'' 05.27 107.351mph'
wikisql
CREATE TABLE table_name_53 ( nba_draft VARCHAR, player VARCHAR )
What was the nba draft for al-farouq aminu?
SELECT nba_draft FROM table_name_53 WHERE player = "al-farouq aminu"
sql_create_context
CREATE TABLE table_name_91 ( avg_finish INTEGER, year VARCHAR, starts VARCHAR )
in 2007, what is the avg finish that had a start less than 1?
SELECT SUM(avg_finish) FROM table_name_91 WHERE year = 2007 AND starts < 1
sql_create_context
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Documents ( Document_...
How many document type for different document type description? Visualize with a bar chart, show Y-axis from high to low order.
SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types GROUP BY Document_Type_Description ORDER BY COUNT(Document_Type_Description) DESC
nvbench
CREATE TABLE table_65538 ( "Match" text, "Date" text, "Location" text, "Lineup" text, "Result" text, "Competition" text )
What was her place in the lineup on match 2?
SELECT "Lineup" FROM table_65538 WHERE "Match" = '2'
wikisql
CREATE TABLE table_40945 ( "Season" text, "Round" text, "Opponents" text, "Home leg" text, "Away leg" text, "Aggregate" text )
What is the round with ajax opponents
SELECT "Round" FROM table_40945 WHERE "Opponents" = 'ajax'
wikisql
CREATE TABLE table_204_284 ( id number, "jurisdiction" text, "adherents" number, "bishops" number, "priests" number, "monastics" number, "monasteries" number, "parishes" number )
how many jurisdictions are listed in the chart ?
SELECT COUNT("jurisdiction") FROM table_204_284
squall