context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_95 ( champions VARCHAR, runner_up VARCHAR, coeff VARCHAR )
Which Champions have a Runner-up of tobol, and a Coeff of 1.125?
SELECT champions FROM table_name_95 WHERE runner_up = "tobol" AND coeff = "1.125"
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 lab ( subject_id text, hadm_id text, ...
count the number of patients whose age is less than 85 and drug route is neb?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "85" AND prescriptions.route = "NEB"
mimicsql_data
CREATE TABLE table_name_27 ( league_cup INTEGER, total VARCHAR, championship VARCHAR, fa_cup VARCHAR )
Championship larger than 3, and a FA Cup smaller than 3, and a Total smaller than 6 involves what highest league cup?
SELECT MAX(league_cup) FROM table_name_27 WHERE championship > 3 AND fa_cup < 3 AND total < 6
sql_create_context
CREATE TABLE table_name_96 ( icao VARCHAR, fleet_size VARCHAR )
Which ICAO has a Fleet size of 2?
SELECT icao FROM table_name_96 WHERE fleet_size = 2
sql_create_context
CREATE TABLE table_name_24 ( score VARCHAR, decision VARCHAR, record VARCHAR )
What was the score of the game that had a record of 26 13 4 2 and a decision of Joseph?
SELECT score FROM table_name_24 WHERE decision = "joseph" AND record = "26–13–4–2"
sql_create_context
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
how many times on 02/10/2105 has patient 56201 produced chest tubes right pleural 1 output.
SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 56201)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tubes right ...
mimic_iii
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NU...
Show the number of courses each instructor taught in a stacked bar chart The x-axis is the instructor's first name and group by course description, could you order total number from low to high order please?
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY CRS_DESCRIPTION, EMP_FNAME ORDER BY COUNT(EMP_FNAME)
nvbench
CREATE TABLE table_204_439 ( id number, "rank" number, "bib" number, "country" text, "athletes" text, "run 1" text, "run 2" text, "run 3" text, "run 4" text, "total" text, "behind" number )
which team was faster : germany or russia ?
SELECT "country" FROM table_204_439 WHERE "country" IN ('germany', 'russia') ORDER BY "total" LIMIT 1
squall
CREATE TABLE table_37011 ( "Year" real, "Location" text, "Gold" text, "Silver" text, "Bronze" text )
What's the Bronze that's also got a Godl of Kim Woo-Jin?
SELECT "Bronze" FROM table_37011 WHERE "Gold" = 'kim woo-jin'
wikisql
CREATE TABLE table_name_84 ( metal VARCHAR, element VARCHAR )
Which Metal has an Element of heavenly stems?
SELECT metal FROM table_name_84 WHERE element = "heavenly stems"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
what was the last systemicsystolic value patient 007-849 had since 12/27/2105?
SELECT vitalperiodic.systemicsystolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849')) AND NOT vitalperiodic.systemicsystolic ...
eicu
CREATE TABLE table_203_507 ( id number, "#" text, "player" text, "\u03c3 points" number, "qual." number, "final" number )
karl behting and giovanni cenni each had final scores of what ?
SELECT "final" FROM table_203_507 WHERE "player" = 'karl behting'
squall
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline...
please give me the flight times the morning on UA for 9 20 from PHILADELPHIA to SAN FRANCISCO
SELECT DISTINCT flight.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 20 AND date_day.month_num...
atis
CREATE TABLE table_29218221_1 ( mon_30_may VARCHAR, fri_3_june VARCHAR )
What is the Mon 30 May time for the rider whose Fri 3 June time was 17' 13.46 131.431mph?
SELECT mon_30_may FROM table_29218221_1 WHERE fri_3_june = "17' 13.46 131.431mph"
sql_create_context
CREATE TABLE table_name_39 ( grid VARCHAR, time_retired VARCHAR, laps VARCHAR )
How many grids have a time of +1:21.239 and more than 25 laps?
SELECT COUNT(grid) FROM table_name_39 WHERE time_retired = "+1:21.239" AND laps > 25
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate tim...
Is the site ready for the Generalist Badge?. Lists the top 40 tags, how many times they're used each, and how many questions are needed with that tag so that the Site is eligible for the Generalist badge
SELECT TagName, COUNT(p.TagId) AS "Uses", 200 - COUNT(p.TagId) AS "Questions Needed WITH this Tag Left" FROM Tags AS t INNER JOIN PostTags AS p ON p.TagId = t.Id GROUP BY t.TagName ORDER BY Uses DESC LIMIT 40
sede
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, draw a bar chart about the distribution of name and the sum of code , and group by attribute name, and sort Y-axis in descending order.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC
nvbench
CREATE TABLE table_78396 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
When is the last week that has a result of a w 34-21?
SELECT MAX("Week") FROM table_78396 WHERE "Result" = 'w 34-21'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid...
how much is the cost of a dvt - related to vascular catheter diagnosis?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'dvt - related to vascular catheter')
eicu
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar...
Who should I expect to be the UP 263 instructor ?
SELECT COUNT(instructor.name), instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'UP' AND course.number = 263 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = cour...
advising
CREATE TABLE table_train_102 ( "id" int, "autoimmune_disease" bool, "stroke" bool, "renal_disease" bool, "hepatic_disease" bool, "liver_disease" bool, "serum_creatinine" float, "seizure_disorder" bool, "NOUSE" float )
serum creatinine >= 1.6 mg / dl
SELECT * FROM table_train_102 WHERE serum_creatinine >= 1.6
criteria2sql
CREATE TABLE table_26261 ( "Party" text, "Result, Parliam. election 2005" text, "Result, County elections 2007" text, "Aug 2008" text, "Sep 2008" text, "Oct 2008" text, "Nov 2008" text, "Dec 2008" text, "Jan 2009" text, "Feb 2009" text, "Mar 2009" text, "Apr 2009" text, ...
What was the polling percentage in Nov 2008 when it was 1.7% in Aug 2008?
SELECT "Nov 2008" FROM table_26261 WHERE "Aug 2008" = '1.7%'
wikisql
CREATE TABLE table_54294 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Attendance" real )
what was the attendance when the away team was boreham wood?
SELECT "Attendance" FROM table_54294 WHERE "Away team" = 'boreham wood'
wikisql
CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Things ( thing_id INTEGER, organization_id INTEGER, Type_of_Thing_Code CHAR(15), service_type_code CHAR(10), service_details VARCHAR(2...
Scatter chart. how many residents does each property have? List property id and resident count.
SELECT T1.property_id, COUNT(*) FROM Properties AS T1 JOIN Residents AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property_id
nvbench
CREATE TABLE table_49660 ( "Year" real, "Class" text, "Team" text, "Points" real, "Wins" real )
Name the lowest Wins which has Points of 28, and a Year smaller than 1972?
SELECT MIN("Wins") FROM table_49660 WHERE "Points" = '28' AND "Year" < '1972'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide the number of patients who have procedure icd9 code 3799 and are on additive type of drug prescription.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "3799" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Top 150 users from nepal.
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Nepal%' ORDER BY Reputation DESC LIMIT 150
sede
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
list the top three most frequent drugs that patients were prescribed with during the same hospital encounter after having been prescribed with levothyroxine sodium 100 mcg po tabs.
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 = 'levothyroxine so...
eicu
CREATE TABLE city ( City_ID int, Official_Name text, Status text, Area_km_2 real, Population real, Census_Ranking text ) CREATE TABLE farm ( Farm_ID int, Year int, Total_Horses real, Working_Horses real, Total_Cattle real, Oxen real, Bulls real, Cows real, Pi...
Give me a histogram for what are the statuses and average populations of each city?, list by the names in desc please.
SELECT Status, AVG(Population) FROM city GROUP BY Status ORDER BY Status DESC
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide the number of patients whose diagnoses long title is drug induced neutropenia and drug route is left eye?
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.long_title = "Drug induced neutropenia" AND prescriptions.route = "LEFT EYE"
mimicsql_data
CREATE TABLE table_74469 ( "Townland" text, "Area( acres )" real, "Barony" text, "Civil parish" text, "Poor law union" text )
What is the poor law union of the Lackenagobidane townland?
SELECT "Poor law union" FROM table_74469 WHERE "Townland" = 'Lackenagobidane'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid num...
when had patient 031-3355 first received a microbiology test during this hospital encounter?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) ORDER BY mi...
eicu
CREATE TABLE table_17861179_1 ( week INTEGER, game_site VARCHAR )
What is the week where the game site is Shea Stadium?
SELECT MIN(week) FROM table_17861179_1 WHERE game_site = "Shea Stadium"
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 ) ...
how many patients whose primary disease is transient ischemic attack and procedure short title is cardiopulm resuscita nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" AND procedures.short_title = "Cardiopulm resuscita NOS"
mimicsql_data
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, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
门诊诊断患者为慢性胃溃疡的抗环瓜氨酸肽抗体数值的平均值是多少?最值是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJ...
css
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE 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 was hired before 2002-06-21, show me the trend about commission_pct over hire_date with a line chart, and order from high to low by the x axis.
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_1314 ( "Team" text, "Titles" real, "Runner-up" real, "Third place" real, "Fourth place" real, "Years participated" real )
When the team is Toronto how many times did they place third?
SELECT COUNT("Third place") FROM table_1314 WHERE "Team" = 'Toronto'
wikisql
CREATE TABLE useracct ( u_id number, name text ) CREATE TABLE review ( a_id number, u_id number, i_id number, rating number, rank number ) CREATE TABLE trust ( source_u_id number, target_u_id number, trust number ) CREATE TABLE item ( i_id number, title text )
How many different users wrote some reviews?
SELECT COUNT(DISTINCT u_id) FROM review
spider
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
药品编号为259362在医疗就诊38637293969中开出的医疗发票项目类别都是啥啊?
SELECT MED_INV_ITEM_TYPE FROM t_kc22 WHERE MED_CLINIC_ID = '38637293969' AND SOC_SRT_DIRE_CD = '259362'
css
CREATE TABLE table_66581 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Score" text, "Record" text )
What was the record at the game with a score of 21-16?
SELECT "Record" FROM table_66581 WHERE "Score" = '21-16'
wikisql
CREATE TABLE table_50406 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
Which Round has a College of appalachian state, and an Overall smaller than 156?
SELECT COUNT("Round") FROM table_50406 WHERE "College" = 'appalachian state' AND "Overall" < '156'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
what difference is there in patient 009-424's weight last measured on the last hospital visit compared to the first value measured on the last hospital visit?
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-424' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS NULL...
eicu
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...
检验申请机构和检验机构在检测通知单35069117494的名称分别叫什么名字?
SELECT jybgb.JYSQJGMC, jybgb.JYJGMC FROM jybgb WHERE jybgb.BGDH = '35069117494'
css
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...
想知道3559148这个医疗机构在两千年一月十三日到零一年六月十五日的这一年多患者对医疗项目自付比例的平均值
SELECT AVG(t_kc22.SELF_PAY_PRO) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3559148' AND t_kc22.STA_DATE BETWEEN '2000-01-13' AND '2001-06-15'
css
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...
从03年11月14日到07年8月9日这个期间里医院2893713购药医疗记录的数量总共是多少呢?
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '2893713' AND IN_HOSP_DATE BETWEEN '2003-11-14' AND '2007-08-09' AND CLINIC_TYPE = '购药'
css
CREATE TABLE table_3011 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text )
What district was the successor seated in March 28, 1878?
SELECT "District" FROM table_3011 WHERE "Date successor seated" = 'March 28, 1878'
wikisql
CREATE TABLE table_name_23 ( index VARCHAR, country VARCHAR, name VARCHAR )
What is the Index number of Chen Bangjun Andie from Singapore?
SELECT index FROM table_name_23 WHERE country = "singapore" AND name = "chen bangjun andie"
sql_create_context
CREATE TABLE table_name_12 ( place VARCHAR, score INTEGER )
WHich Places have a score smaller than 69?
SELECT place FROM table_name_12 WHERE score < 69
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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 te...
count the number of patients who are diagnosed with compression of vein.
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 = 'compression of vein'))
mimic_iii
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
how much different is patient 006-195541's weight last measured on the last hospital visit compared to the value first measured on the last hospital visit?
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195541' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS N...
eicu
CREATE TABLE table_12841 ( "Election" text, "1st Member" text, "1st Party" text, "2nd Member" text, "2nd Party" text )
Which 1st Party has an Election of 1893 by-election?
SELECT "1st Party" FROM table_12841 WHERE "Election" = '1893 by-election'
wikisql
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, d...
What are the ids and names of all start stations that were the beginning of at least 200 trips Show bar chart, and rank from low to high by the X-axis.
SELECT start_station_name, start_station_id FROM trip ORDER BY start_station_name
nvbench
CREATE TABLE table_33749 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What venue does st kilda play at as the away team?
SELECT "Venue" FROM table_33749 WHERE "Away team" = 'st kilda'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
find the number of female patients who were discharged to short term hospital.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "SHORT TERM HOSPITAL"
mimicsql_data
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Questions by a given user with unaccepted answers.
SELECT questions.Id AS "post_link", questions.CreationDate, COUNT(*) AS AnswerCount FROM Posts AS questions JOIN Posts AS answers ON answers.ParentId = questions.Id WHERE questions.OwnerUserId = '##UserId##' AND questions.PostTypeId = 1 AND questions.AcceptedAnswerId IS NULL GROUP BY questions.Id, questions.CreationDat...
sede
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varc...
When is the next time 248 , taught by Ryan Kellogg be offered ?
SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.number = 248 AND course_offering.semester = semester.semester_id AND instructor.name LIKE '%Ryan Kellogg%' AND offering_instructor.instru...
advising
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...
列出病人周锐志医疗记录中的入院诊断疾病名称和编码,主要针对医疗费总额不低于6373.39元的
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '周锐志' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6373.39)
css
CREATE TABLE table_23607 ( "Institution" text, "Team Name" text, "Location (Population)" text, "Team Started" real, "Affiliation" text, "Enrollment" real, "Mascot" text, "Divisional Titles" real, "Big 12 Titles" real, "National Titles" real )
What is the minimum enrollment of the cyclones?
SELECT MIN("Enrollment") FROM table_23607 WHERE "Team Name" = 'Cyclones'
wikisql
CREATE TABLE table_204_414 ( id number, "name" text, "armenian" text, "location" text, "# of prisoners designed for" number, "notes" text )
how many more prisoners is erebuni designed to hold than goris ?
SELECT (SELECT "# of prisoners designed for" FROM table_204_414 WHERE "name" = 'erebuni') - (SELECT "# of prisoners designed for" FROM table_204_414 WHERE "name" = 'goris')
squall
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...
出院时,医疗就诊41356793399诊断的疾病编号及名称分别是什么?
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.MED_CLINIC_ID = '41356793399' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.MED_CLINIC_ID = '41356793399' UNION SELECT zyb.OUT_DIAG_DIS_CD, zyb.OUT_DIAG_DIS_NM FROM zyb WHERE zyb.MED_CLINIC_ID = '41356793399' UNION SELECT mzb....
css
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, Exp...
Reputation > X in % of Total Users.
WITH total_users AS (SELECT tu_count = COUNT(*) FROM Users), users_rep_x AS (SELECT ru_count = COUNT(*) FROM Users AS u WHERE u.Reputation < '##RepMax##') SELECT DISTINCT (SELECT tu_count FROM total_users) AS "total_users", (SELECT ru_count FROM users_rep_x) AS "users_rep_>_x", CAST((CAST((SELECT ru_count FROM users_re...
sede
CREATE TABLE table_7022 ( "Name" text, "Status" text, "Authors" text, "Unit" text, "Location" text )
What is the name of the non-mammal from brazil of the unit of caturrita formation?
SELECT "Name" FROM table_7022 WHERE "Location" = 'brazil' AND "Unit" = 'caturrita formation'
wikisql
CREATE TABLE table_name_62 ( lead VARCHAR, third VARCHAR )
Which Lead has Hans Frauenlob as a Third?
SELECT lead FROM table_name_62 WHERE third = "hans frauenlob"
sql_create_context
CREATE TABLE table_77877 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text )
I want to know the team that was sacked and date of vacancy was 4 december
SELECT "Team" FROM table_77877 WHERE "Manner of departure" = 'sacked' AND "Date of vacancy" = '4 december'
wikisql
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 ) ...
what is the number of patients whose age is less than 43 and diagnoses short title is hypertension nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "43" AND diagnoses.short_title = "Hypertension NOS"
mimicsql_data
CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, latitude varchar, longitude varchar, review_count bigint, is_open tinyint, rating float, state varchar ) CREATE TABLE category ( id int, business_id varchar, c...
Which restaurant in Dallas were reviewed by user Patrick ?
SELECT business.name FROM business, category, review, user WHERE business.city = 'Dallas' AND category.business_id = business.business_id AND category.category_name = 'restaurant' AND review.business_id = business.business_id AND user.name = 'Patrick' AND user.user_id = review.user_id
yelp
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,...
i'd like to arrange a trip to BALTIMORE on 1 1
SELECT DISTINCT flight.flight_id FROM airport_service, city, date_day, days, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'BALTIMORE' AND date_day.day_number = 1 AND date_day.month_number = 1 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.day...
atis
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, ...
Users who cast the most downvotes [save].
SELECT Users.Id AS "user_link", Users.DownVotes, Users.Reputation FROM Users ORDER BY Users.DownVotes DESC LIMIT 128
sede
CREATE TABLE table_10555 ( "Class" text, "Wheel arrangement" text, "Manufacturer" text, "Year made" text, "Quantity made" text, "Quantity preserved" text, "Year(s) withdrawn" text, "Comments" text )
How many have a class of 330?
SELECT "Quantity made" FROM table_10555 WHERE "Class" = '330'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE offering_instructor ( ...
How can I most easily fulfill the PreMajor requirement with a class ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra...
advising
CREATE TABLE table_69020 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
Who is the opponent with attendance greater than 73,984 with a result of w 28 14?
SELECT "Opponent" FROM table_69020 WHERE "Attendance" > '73,984' AND "Result" = 'w 28–14'
wikisql
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, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
白蛋白的参考值范围下限和上限在哪个数值范围内,门诊可诊断患者患有痴呆
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '痴呆' AND jyjgzbb.JCZBMC = '白蛋白'
css
CREATE TABLE table_9990 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College" text )
What is the highest Pick, when Nationality is 'United States', when College is 'New Mexico State', and when Round is greater than 6?
SELECT MAX("Pick") FROM table_9990 WHERE "Nationality" = 'united states' AND "College" = 'new mexico state' AND "Round" > '6'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id...
WHERE filtering with dates and a little bit of time.
SELECT * FROM dbo.Posts WHERE CreationDate >= '2018/12/01'
sede
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId numbe...
Check when there was the last update.
SELECT TOP(500) AS CreationDate FROM Posts ORDER BY CreationDate DESC
sede
CREATE TABLE table_72862 ( "Fin. Pos" real, "Car No." real, "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Laps Led" real, "Points" text )
Name the total number of grid for 30
SELECT COUNT("Grid") FROM table_72862 WHERE "Points" = '30'
wikisql
CREATE TABLE table_name_77 ( week VARCHAR, result VARCHAR )
What is the Week number with a result of l 31 28?
SELECT COUNT(week) FROM table_name_77 WHERE result = "l 31–28"
sql_create_context
CREATE TABLE table_4425 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Tell me the score of misa eguchi eri hozumi
SELECT "Score" FROM table_4425 WHERE "Opponents" = 'misa eguchi eri hozumi'
wikisql
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 prescriptions...
what is minimum age of patients whose marital status is widowed and admission location is trsf within this facility?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.admission_location = "TRSF WITHIN THIS FACILITY"
mimicsql_data
CREATE TABLE table_946 ( "Map Key" real, "Commune" text, "Canton" text, "District" text, "Population" real )
how many canton with commune being waldbillig
SELECT COUNT("Canton") FROM table_946 WHERE "Commune" = 'Waldbillig'
wikisql
CREATE TABLE ftxmzjzjlb ( 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, MZZYZD...
从13年5月29号到19年9月12日,患者17750351的检测指标939792情况如何?
SELECT * FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
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...
Draw a bar chart about the distribution of ACC_Regular_Season and Team_ID , and I want to sort by the X-axis in descending.
SELECT ACC_Regular_Season, Team_ID FROM basketball_match ORDER BY ACC_Regular_Season DESC
nvbench
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...
How many female patients have bladder cancer/sda as the primary disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "BLADDER CANCER/SDA"
mimicsql_data
CREATE TABLE table_19630743_2 ( no VARCHAR, runner_s__up VARCHAR )
What is the total number of John Merrick as a runner up?
SELECT COUNT(no) FROM table_19630743_2 WHERE runner_s__up = "John Merrick"
sql_create_context
CREATE TABLE table_203_61 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which 4 countries were scored last , with only 1 bronze medal each ?
SELECT "nation" FROM table_203_61 ORDER BY "rank" DESC LIMIT 4
squall
CREATE TABLE Marketing_Regions ( Marketing_Region_Code CHAR(15), Marketing_Region_Name VARCHAR(255), Marketing_Region_Descriptrion VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Bookings_Services ( Order_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Bookings ( Booking_ID INTEGER, ...
Show all the planned delivery dates and bin by year in a line chart, and rank from high to low by the X-axis.
SELECT Planned_Delivery_Date, COUNT(Planned_Delivery_Date) FROM Bookings ORDER BY Planned_Delivery_Date DESC
nvbench
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Users ( Id number, Reputation number, CreationD...
Bad questions, based on vote score and closure and the like.
SELECT Score, CASE WHEN ClosedDate IS NULL THEN 'Y' ELSE 'Er' END AS "closed?", Id AS "post_link" FROM Posts WHERE PostTypeId = 1 AND (NOT ClosedDate IS NULL OR Score < -3) ORDER BY Score LIMIT 500
sede
CREATE TABLE table_20065 ( "Name" text, "Year" real, "Landfall" text, "NHC Advisory Number" text, "V(mph)" real, "R(miles)" real, "Saffir-Simpson Category" real, "CHI" text )
What is the maximum number for the Saffir-Simpson category in the Carvill Hurricane Index?
SELECT MAX("Saffir-Simpson Category") FROM table_20065
wikisql
CREATE TABLE table_80207 ( "Name" text, "Period" text, "League" real, "FA Cup" real, "League Cup" real, "Other" real, "Total" real, "Apps" real, "Goal Ratio" real )
What's the lowest Total thats got an FA Cup larger than 10, Name of Arthur Chandler, and a League Cup thats larger than 0?
SELECT MIN("Total") FROM table_80207 WHERE "FA Cup" > '10' AND "Name" = 'arthur chandler' AND "League Cup" > '0'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airli...
what is fare code FN
SELECT DISTINCT fare_basis_code FROM fare_basis WHERE fare_basis_code = 'FN'
atis
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...
Create a bar chart showing all_games_percent across all neutral, and could you order in desc by the X-axis?
SELECT All_Neutral, All_Games_Percent FROM basketball_match ORDER BY All_Neutral DESC
nvbench
CREATE TABLE table_17024 ( "Ships name" text, "Date entered service" text, "Date withdrawn" text, "Tonnage" real, "Type of Ship" text )
what's the date entered service with ships name koningin wilhelmina
SELECT "Date entered service" FROM table_17024 WHERE "Ships name" = 'Koningin Wilhelmina'
wikisql
CREATE TABLE table_59973 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Who is the team that played away team watford?
SELECT "Home team" FROM table_59973 WHERE "Away team" = 'watford'
wikisql
CREATE TABLE table_21501511_1 ( order__number VARCHAR, week__number VARCHAR )
What order did Lambert perform in the top 11?
SELECT order__number FROM table_21501511_1 WHERE week__number = "Top 11"
sql_create_context
CREATE TABLE table_train_51 ( "id" int, "active_infection" bool, "procalcitonin" int, "oliguria" bool, "receiving_vasopressor" bool, "metabolic_acidosis" bool, "colonized_with_a_multi_drug_resistant_organism" bool, "hypoperfusion" bool, "central_venous_oxygen_saturation_scvo2" int, ...
signs of hypoperfusion: serum lactate > 2 mmol / l, low central venous oxygen saturation ( scvo2 ) ( < 70 % ) or high scvo2 ( > 85 % ) , metabolic acidosis, oligo anuria, high venous to arterial co2 gap ( dco2 > 6 mm hg )
SELECT * FROM table_train_51 WHERE hypoperfusion = 1 OR lactate > 2 OR central_venous_oxygen_saturation_scvo2 < 70 OR central_venous_oxygen_saturation_scvo2 > 85 OR metabolic_acidosis = 1 OR oliguria = 1 OR venous_to_arterial_co2_gap_dco2 > 6
criteria2sql
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 scatter chart about the correlation between code and manufacturer .
SELECT T1.Code, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code
nvbench
CREATE TABLE table_70186 ( "Week" real, "Issue Date" text, "Artist" text, "Single" text, "Download" text, "Title" text )
What is the title of the July 2 song that is downloaded as Crazy Frog?
SELECT "Title" FROM table_70186 WHERE "Download" = 'crazy frog' AND "Issue Date" = 'july 2'
wikisql
CREATE TABLE table_18703133_6 ( wins VARCHAR, points VARCHAR )
How many wins have 24 points?
SELECT wins FROM table_18703133_6 WHERE points = 24
sql_create_context
CREATE TABLE table_17274 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Musical guest and song" text, "Original air date" text, "Production code" text )
What is the season # where production code is k1505?
SELECT MIN("Season #") FROM table_17274 WHERE "Production code" = 'K1505'
wikisql
CREATE TABLE table_71906 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Who played in the Mixed Doubles when Zhu Lin played in the Women's Singles?
SELECT "Mixed doubles" FROM table_71906 WHERE "Women's singles" = 'zhu lin'
wikisql