context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
在95524161612号检验结果指标记录中本次检测的项目名称、指标代码以及名称、方法分别是啥?
SELECT jyjgzbb.JCXMMC, jyjgzbb.JCZBDM, jyjgzbb.JCZBMC, jyjgzbb.JCFF FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '95524161612'
css
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone...
please list only UA flights between DENVER and BOSTON
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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER...
atis
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...
号码为13281397团伙成员最经常去的医院排序?
SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '13281397' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '13281397' GROUP BY gyb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT zyb.MED_SER_ORG_NO FROM zyb WHERE zyb.PERSON_ID = '13281397' GR...
css
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 medication (...
how many patients have undergone vasodilator for pulmonary hypertension - treprostinil two or more times until 2104?
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 = 'vasodilator for pulmonary hypertension - treprostinil' AND STRFTIME('%y', treatment.treatmenttime) <= '210...
eicu
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...
把团伙成员魏德水最常开的药品排序出来是啥样?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '魏德水' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLI...
css
CREATE TABLE table_29789_3 ( country VARCHAR, _percentage_change VARCHAR )
Which country saw a 5.7% increase in spending on international tourism between 2011 and 2012?
SELECT country FROM table_29789_3 WHERE _percentage_change = "5.7"
sql_create_context
CREATE TABLE table_72851 ( "Position" text, "Team #1" text, "Agg." text, "Team #2" text, "1st leg" text, "2nd leg" text )
How many positions correspond to a 1-3 1st leg?
SELECT COUNT("Position") FROM table_72851 WHERE "1st leg" = '1-3'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,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 locations ( LOCAT...
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of phone_number and commission_pct , and list total number in descending order.
SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT DESC
nvbench
CREATE TABLE table_14402 ( "City" text, "Province/Region" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
Which city's ICAO is WADD?
SELECT "City" FROM table_14402 WHERE "ICAO" = 'wadd'
wikisql
CREATE TABLE table_204_626 ( id number, "image" number, "name" text, "birth date" text, "death date" text, "brief biography" text )
which child was the first to die ?
SELECT "name" FROM table_204_626 ORDER BY "death date" LIMIT 1
squall
CREATE TABLE table_name_80 ( total VARCHAR, set_3 VARCHAR )
What was the total when the set 3 was 25 14?
SELECT total FROM table_name_80 WHERE set_3 = "25–14"
sql_create_context
CREATE TABLE finrev_fed_key_17 ( state_code number, state text, #_records text ) CREATE TABLE finrev_fed_17 ( state_code number, idcensus number, school_district text, nces_id text, yr_data number, t_fed_rev number, c14 number, c25 number ) CREATE TABLE ndecoreexcel_math_gr...
What is the average match score of CA?
SELECT average_scale_score FROM ndecoreexcel_math_grade8 WHERE state = "California"
studentmathscore
CREATE TABLE Documents ( document_type_code VARCHAR )
List document type codes and the number of documents in each code.
SELECT document_type_code, COUNT(*) FROM Documents GROUP BY document_type_code
sql_create_context
CREATE TABLE table_2668169_2 ( district VARCHAR, incumbent VARCHAR )
Which district does the incumbent Luther Reily represent?
SELECT district FROM table_2668169_2 WHERE incumbent = "Luther Reily"
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE TagSynonyms ( Id number...
Number of questions with just [database].
SELECT COUNT(*) FROM PostTags AS pt JOIN (SELECT PostId, COUNT(*) AS ct FROM PostTags AS p GROUP BY PostId HAVING COUNT(*) = 1) AS db ON pt.PostId = db.PostId WHERE TagId = 30
sede
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...
编号为9146044的医院的出院诊断疾病结果和入院诊断疾病在2005年10月14号到2021年3月6号之间结果不同的医疗就诊记录有哪些呢?
(SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '9146044' AND IN_HOSP_DATE BETWEEN '2005-10-14' AND '2021-03-06') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '9146044' AND IN_HOSP_DATE BETWEEN '2005-10-14' AND '2021-03-06' AND IN_DIAG_DIS_CD = OUT_DIAG_DIS_CD)
css
CREATE TABLE table_31696 ( "Region" text, "Host" text, "Venue" text, "City" text, "State" text )
What is the host in Georgia?
SELECT "Host" FROM table_31696 WHERE "State" = 'georgia'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
count the number of patients whose admission location is trsf within this facility and year of birth is less than 2089?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "2089"
mimicsql_data
CREATE TABLE table_name_43 ( date_of_issue VARCHAR, design VARCHAR )
What date was the John Belisle, Kosta Tsetsekas stamp issued?
SELECT date_of_issue FROM table_name_43 WHERE design = "john belisle, kosta tsetsekas"
sql_create_context
CREATE TABLE table_35474 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Who won the women's doubles when andrey antropov won the men's singles and marina yakusheva won the womens' singles?
SELECT "Women's doubles" FROM table_35474 WHERE "Men's singles" = 'andrey antropov' AND "Women's singles" = 'marina yakusheva'
wikisql
CREATE TABLE table_name_65 ( mark VARCHAR, name VARCHAR )
What is the mark set by Laura Turner?
SELECT mark FROM table_name_65 WHERE name = "laura turner"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
参照不一样的科室编码,以及不一样的入院诊断疾病编码,把医院6293946所有医疗就诊记录中病人的平均年龄列出来
SELECT MED_ORG_DEPT_CD, IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '6293946' GROUP BY MED_ORG_DEPT_CD, IN_DIAG_DIS_CD
css
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, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Can I take EHS 642 as MDE ?
SELECT COUNT(*) > 0 FROM course, program, program_course WHERE course.department = 'EHS' AND course.number = 642 AND program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE table_name_57 ( country VARCHAR, entities VARCHAR )
Which Country has Entities of emsa?
SELECT country FROM table_name_57 WHERE entities = "emsa"
sql_create_context
CREATE TABLE table_80119 ( "Team" text, "Manager" text, "Captain" text, "Kit manufacturer" text, "Shirt sponsor" text )
Which Kit Manufacturer supports team Everton?
SELECT "Kit manufacturer" FROM table_80119 WHERE "Team" = 'everton'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
what is in the current hospital encounter maximum vancomycin value of patient 57050?
SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'vancomycin')
mimic_iii
CREATE TABLE table_name_29 ( laps INTEGER, grid VARCHAR, driver VARCHAR )
what is the sum of laps when grid is less than 20 and johnny herbert is driving?
SELECT SUM(laps) FROM table_name_29 WHERE grid < 20 AND driver = "johnny herbert"
sql_create_context
CREATE TABLE table_32429 ( "Week" real, "Kickoff" text, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game site" text, "Attendance" text )
What was the attendance for Week 1?
SELECT "Attendance" FROM table_32429 WHERE "Week" = '1'
wikisql
CREATE TABLE table_name_90 ( loss VARCHAR, record VARCHAR )
What was the loss of the Brewers game when the record was 46-48?
SELECT loss FROM table_name_90 WHERE record = "46-48"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
give me the number of patients whose religion is greek orthodox and item id is 51419?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "GREEK ORTHODOX" AND lab.itemid = "51419"
mimicsql_data
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), ...
What are the total number of credits offered by each department. Show bar chart.
SELECT DEPT_CODE, SUM(T1.CRS_CREDIT) FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE
nvbench
CREATE TABLE table_10519 ( "Order" real, "Name" text, "Seasons" text, "Games" real, "Goals" real )
What is the low goal for orders more than 939 during Seasons of 1996 2001?
SELECT MIN("Goals") FROM table_10519 WHERE "Seasons" = '1996 – 2001' AND "Order" > '939'
wikisql
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 d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row...
since 2100 how many patients have undergone closed bronchial biopsy within 2 months after the diagnosis of cataract extract status?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cataract extract s...
mimic_iii
CREATE TABLE table_name_27 ( team VARCHAR, make VARCHAR )
What team drove a Dodge vehicle?
SELECT team FROM table_name_27 WHERE make = "dodge"
sql_create_context
CREATE TABLE table_45515 ( "Rank" text, "Team" text, "Athletes" text, "Run 1" text, "Run 2" text, "Run 3" text, "Run 4" text, "Final" text )
Which Run 2 has a Rank of 4?
SELECT "Run 2" FROM table_45515 WHERE "Rank" = '4'
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, ...
给患者杨莹华92252701748这次医疗就诊的检验报告作审核的人有哪些?工号是什么
SELECT zyjybgb.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '92252701748' UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '92252701748'
css
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE treatment ( treat...
tell me the drugs patient 021-80293 was allergic to since 10/2104?
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-80293')) AND STRFTIME('%y-%m', allergy.allergytime) >= '2104-10'
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...
find the number of patients whose diagnosis short title is pseudomonas infect nos and the drug type is main.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Pseudomonas infect NOS" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
give me the number of patients whose lab test name is sodium, urine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Sodium, Urine"
mimicsql_data
CREATE TABLE table_1132568_3 ( rd VARCHAR, grand_prix VARCHAR )
How many on the list are called the Austrian Grand Prix?
SELECT COUNT(rd) FROM table_1132568_3 WHERE grand_prix = "Austrian grand_prix"
sql_create_context
CREATE TABLE table_53646 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the home teams score when the VFL played Princes Park?
SELECT "Home team score" FROM table_53646 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE table_name_5 ( purse__ INTEGER, tournament VARCHAR )
What is the purse total for the royal caribbean golf classic?
SELECT SUM(purse__) AS $__ FROM table_name_5 WHERE tournament = "royal caribbean golf classic"
sql_create_context
CREATE TABLE table_16815824_1 ( round4 INTEGER, team VARCHAR )
What was team Toshiba's round 4 score?
SELECT MIN(round4) FROM table_16815824_1 WHERE team = "team Toshiba"
sql_create_context
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, ...
tell me the name of the first specimen test that patient 031-4987 since 03/2102 received?
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4987')) AND STRFTIME('%y-%m', microlab.culturetakentime) >= '2102-...
eicu
CREATE TABLE table_39057 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponent" text, "Score" text )
With the score of 6 3, 2 6, [10 8] and played on clay who was the opponent?
SELECT "Opponent" FROM table_39057 WHERE "Surface" = 'clay' AND "Score" = '6–3, 2–6, [10–8]'
wikisql
CREATE TABLE Grants ( grant_id INTEGER, organisation_id INTEGER, grant_amount DECIMAL(19,4), grant_start_date DATETIME, grant_end_date DATETIME, other_details VARCHAR(255) ) CREATE TABLE Tasks ( task_id INTEGER, project_id INTEGER, task_details VARCHAR(255), "eg Agree Objectives...
Show me a bar chart for what are the ids and details for all organizations that have grants of more than 6000 dollars?, could you sort y axis in desc order?
SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T1.organisation_id DESC
nvbench
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
Just show employees' salaries by their first name in a bar chart, sort in descending by the bar please.
SELECT FIRST_NAME, SALARY FROM employees ORDER BY FIRST_NAME DESC
nvbench
CREATE TABLE table_name_35 ( lost VARCHAR, try_bonus VARCHAR, losing_bonus VARCHAR )
What is the value for Lost, when the value for Try bonus is 2, and when the value for Losing bonus is 4?
SELECT lost FROM table_name_35 WHERE try_bonus = "2" AND losing_bonus = "4"
sql_create_context
CREATE TABLE table_name_65 ( date VARCHAR, team VARCHAR, venue VARCHAR )
What was the date of the home game against Accrington?
SELECT date FROM table_name_65 WHERE team = "accrington" AND venue = "home"
sql_create_context
CREATE TABLE table_43039 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real )
What is the time of rider Loic Napoleone, who had less than 18 laps and a grid greater than 8?
SELECT "Time" FROM table_43039 WHERE "Laps" < '18' AND "Grid" > '8' AND "Rider" = 'loic napoleone'
wikisql
CREATE TABLE table_15873014_3 ( game INTEGER )
How many games were played in the season?
SELECT MAX(game) FROM table_15873014_3
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Number of posts with bounty start and finish.
WITH opened AS (SELECT PostId FROM Votes WHERE VoteTypeId = 8), closed AS (SELECT PostId FROM Votes WHERE VoteTypeId = 9) SELECT COUNT(*) FROM (SELECT * FROM opened INTERSECT SELECT * FROM closed) AS q
sede
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, give me the comparison about the average of price over the name , and group by attribute name by a bar chart, list by the mean price in ascending please.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Price
nvbench
CREATE TABLE table_57783 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the home team score for kardinia park?
SELECT "Home team score" FROM table_57783 WHERE "Venue" = 'kardinia park'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varc...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the correlation between employee_id and manager_id in a scatter chart.
SELECT EMPLOYEE_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
门诊诊断为病人患疾病J02.597的的促甲状腺激素受体抗体数值的平均值以及最值分别是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) 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.JZZDBM = 'J02.597' AND jyjgzbb.JCZBMC = '促甲状腺激素受体...
css
CREATE TABLE table_name_35 ( school VARCHAR, enrollment VARCHAR, mascot VARCHAR )
What's the school that has an enrollment more than 441 with chargers as their mascot?
SELECT school FROM table_name_35 WHERE enrollment > 441 AND mascot = "chargers"
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Questions with only one tag.
SELECT Id AS "post_link" FROM Posts WHERE Tags LIKE '<##tags##>' OR Tags LIKE ' ##tags## ' LIMIT 5000
sede
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id ...
what is patient 20898's last ward id in this hospital visit?
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20898 AND admissions.dischtime IS NULL) AND NOT transfers.wardid IS NULL ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_80 ( opponent VARCHAR, attendance INTEGER )
Who was the opponent during the game that had more than 31,891 people in attendance?
SELECT opponent FROM table_name_80 WHERE attendance > 31 OFFSET 891
sql_create_context
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 prescription...
give me the number of patients whose ethnicity is black/cape verdean and drug type is main?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_72107 ( "Rd" real, "Name" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text )
What is the highest Rd that Tom Sneva had the pole position in?
SELECT MAX("Rd") FROM table_72107 WHERE "Pole Position" = 'Tom Sneva'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, ...
Drive-by users with one [identification] question.
SELECT Users.Id AS "user_link", Posts.Id AS "post_link" FROM Users INNER JOIN Posts ON Posts.OwnerUserId = Users.Id INNER JOIN PostTags ON Posts.Id = PostTags.PostId INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName LIKE 'identification' AND Posts.ParentId IS NULL AND Users.Id IN (SELECT Users.Id FROM User...
sede
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val...
what was the total amount of lactated ringers that patient 27703 had taken on 11/08/2105?
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27703)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE table_34244 ( "Champs" real, "Games" real, "Draw" real, "Lost" real, "Win/Lose Percentage" text )
Which Draw is the lowest one that has Champs smaller than 0?
SELECT MIN("Draw") FROM table_34244 WHERE "Champs" < '0'
wikisql
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, ...
what are the five most frequently ordered specimen tests for patients that had previously been diagnosed with upper gi bleeding within 2 months since 2105?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'upper gi bleeding' AND STRFTIME('%y', diagno...
eicu
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewT...
Rude answers to Python questions.
SELECT * FROM VoteTypes INNER JOIN Votes ON Votes.VoteTypeId = VoteTypes.Id INNER JOIN Posts ON Votes.PostId = Posts.Id WHERE VoteTypes.Name = 'Offensive'
sede
CREATE TABLE table_name_36 ( date VARCHAR, score VARCHAR )
What is the Date of the game with a Score of 4 6, 4 6?
SELECT date FROM table_name_36 WHERE score = "4–6, 4–6"
sql_create_context
CREATE TABLE table_29633639_1 ( peak VARCHAR, chinese_title VARCHAR )
how many peaks where for the chinese episode named
SELECT COUNT(peak) FROM table_29633639_1 WHERE chinese_title = "萬凰之王"
sql_create_context
CREATE TABLE table_name_65 ( date VARCHAR, tournament VARCHAR )
What is the Date of the Vigo Tournament?
SELECT date FROM table_name_65 WHERE tournament = "vigo"
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE days ( days_code varchar, ...
i would like to book a flight from LOS ANGELES to PITTSBURGH on 6 1
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 1 AND date_day.month_number = 6 AND...
atis
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of headquarter and the amount of headquarter , and group by attribute headquarter, and could you display by the bars in descending?
SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
nvbench
CREATE TABLE table_43482 ( "Volume:Issue" text, "Issue Date(s)" text, "Weeks on Top" real, "Song" text, "Artist" text )
What is the Volume:Issue number of the George McCrae song that spent less than 2 weeks on top of the charts?
SELECT "Volume:Issue" FROM table_43482 WHERE "Weeks on Top" < '2' AND "Artist" = 'george mccrae'
wikisql
CREATE TABLE table_47547 ( "Volume:Issue" text, "Issue Date(s)" text, "Weeks on Top" text, "Song" text, "Artist" text )
What date did the song by jennifer lopez get issued?
SELECT "Issue Date(s)" FROM table_47547 WHERE "Artist" = 'jennifer lopez'
wikisql
CREATE TABLE table_10843 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Which driver had 3 Laps and grids less than 15?
SELECT "Driver" FROM table_10843 WHERE "Laps" = '3' AND "Grid" < '15'
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...
以往患者32467373有哪些门诊诊断还记得吗?
SELECT txmzjzjlb.JZZDBM, txmzjzjlb.JZZDSM FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '32467373' UNION SELECT ftxmzjzjlb.JZZDBM, ftxmzjzjlb.JZZDSM FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AN...
css
CREATE TABLE table_65593 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the highest attendance for December 14, 1958 for after week 12
SELECT MAX("Attendance") FROM table_65593 WHERE "Date" = 'december 14, 1958' AND "Week" > '12'
wikisql
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, ...
what was the three most frequent drugs that were prescribed within 2 months to the transaminase elevation female patients aged 20s after they were diagnosed with transaminase elevation, a year before?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'transaminase elevation' AND DATETIME(diagnosis.dia...
eicu
CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE schedule...
Create a bar chart showing the total number across location
SELECT Location, COUNT(*) FROM cinema GROUP BY Location
nvbench
CREATE TABLE table_204_117 ( id number, "season" number, "level" text, "division" text, "section" text, "position" text, "movements" text )
what year was their top performance ?
SELECT "season" FROM table_204_117 ORDER BY "position" LIMIT 1
squall
CREATE TABLE table_61773 ( "Show" text, "Date" text, "Official ratings (millions)" real, "Weekly rank" text, "Share" text )
Which show aired on 19 april?
SELECT "Show" FROM table_61773 WHERE "Date" = '19 april'
wikisql
CREATE TABLE table_66227 ( "!Event" real, "Round" text, "Surface" text, "Winner" text, "Opponent" text, "Result" text )
Which Surface has a Result of fernando verdasco?
SELECT "Surface" FROM table_66227 WHERE "Result" = 'fernando verdasco'
wikisql
CREATE TABLE table_16864968_7 ( location VARCHAR, game VARCHAR )
Where was game 62 played?
SELECT location FROM table_16864968_7 WHERE game = 62
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...
count the number of patients whose primary disease is congestive heart failure and year of death is less than or equal to 2174?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CONGESTIVE HEART FAILURE" AND demographic.dod_year <= "2174.0"
mimicsql_data
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, ...
病患何嘉悦在02年4月18日到2020年5月25日内所有的检验结果指标记录中检测人是冯婉娜时检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = ...
css
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, ...
已经被门诊诊断为疾病W41.056的这个患者96646392的D2聚体(肝素/EDTA)的结果定量及其单位分别是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 jyb...
css
CREATE TABLE table_11900773_6 ( theme VARCHAR, design VARCHAR )
List all the themes designed by Isabelle Toussaint.
SELECT theme FROM table_11900773_6 WHERE design = "Isabelle Toussaint"
sql_create_context
CREATE TABLE table_174266_6 ( year VARCHAR )
If the year is 2010, what is the minimum amount of years 5-9?
SELECT MIN(5 AS _9_years) FROM table_174266_6 WHERE year = 2010
sql_create_context
CREATE TABLE table_73793 ( "Number" real, "Name" text, "Games Played" real, "Games Started" real, "Goals" real, "Assists" real, "Points" real, "Shots" real )
How many names are listed for the player with 50 points?
SELECT COUNT("Name") FROM table_73793 WHERE "Points" = '50'
wikisql
CREATE TABLE table_25066 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text )
Who was the vacator when Shadrach Bond was the successor?
SELECT "Vacator" FROM table_25066 WHERE "Successor" = 'Shadrach Bond'
wikisql
CREATE TABLE table_name_94 ( away_team VARCHAR, home_team VARCHAR )
What score was conceded by Richmond?
SELECT away_team AS score FROM table_name_94 WHERE home_team = "richmond"
sql_create_context
CREATE TABLE table_70736 ( "Model" text, "Build date" text, "Total produced" real, "Wheel arrangement" text, "Prime mover" text, "Power output" text )
What is the prime mover for a build date in 1975?
SELECT "Prime mover" FROM table_70736 WHERE "Build date" = '1975'
wikisql
CREATE TABLE table_33641 ( "Week" real, "Opponent" text, "Result" text, "Record" text, "Attendance" text )
Which Rams opponent had a record of 2-3?
SELECT "Opponent" FROM table_33641 WHERE "Record" = '2-3'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, cha...
did patient 31482 receive a diagnostic for urinostomy status nec on their current hospital visit?
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'urinostomy status nec') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31482 AND admissions.dischtime ...
mimic_iii
CREATE TABLE table_23696862_6 ( wsop_cashes VARCHAR, wsop_earnings VARCHAR )
The person who had $126,796 WSOP earnings had how many WSOP cashes?
SELECT wsop_cashes FROM table_23696862_6 WHERE wsop_earnings = "$126,796"
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...
give me the number of female patients with medicare health insurance.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.insurance = "Medicare"
mimicsql_data
CREATE TABLE table_14089 ( "Year(s)" real, "Tournament or series" text, "Played in" text, "Games played ( Tests )" text, "Games won ( Tests )" text, "Games lost ( Tests )" text, "Games drawn ( Tests )" text, "Points for ( Tests )" text, "Points against ( Tests )" text )
What tournament or series was played in England, when games played was 4, points for were 121?
SELECT "Tournament or series" FROM table_14089 WHERE "Played in" = 'england' AND "Games played ( Tests )" = '4' AND "Points for ( Tests )" = '121'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
when was the last time patient 006-80884 measured its respiration less than 15.0 since 8 days ago?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884')) AND vitalperiodic.respiration < 15.0 A...
eicu
CREATE TABLE Complaints ( complaint_id INTEGER, product_id INTEGER, customer_id INTEGER, complaint_outcome_code VARCHAR(20), complaint_status_code VARCHAR(20), complaint_type_code VARCHAR(20), date_complaint_raised DATETIME, date_complaint_closed DATETIME, staff_id INTEGER ) CREATE ...
Return the average price of products that have each category code in a bar chart.
SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code
nvbench
CREATE TABLE table_29997112_3 ( flag_name VARCHAR, meaning VARCHAR )
What is the name of the flag that means decimal digit 2?
SELECT flag_name FROM table_29997112_3 WHERE meaning = "Decimal Digit 2"
sql_create_context