context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 ) ...
what is the minimum monthly number of patients who had abn react-procedure nec in 2104?
SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'abn react-procedure nec') AND STRFTIME('%y', diagnoses_icd.charttime) = '2104' GROUP BY STRFTIME('%y-%...
mimic_iii
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_jybgb ( YLJGDM_MZJZJLB te...
在医院0960685门诊就诊的就诊记录里面,找出叫姜慧丽的这个患者被诊断的病名不包括紧张的就诊记录
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '姜慧丽' AND hz_info.YLJGDM = '0960685' AND NOT mzjzjlb.JZZDSM LIKE '%紧张%'
css
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minu...
does CO fly from DENVER to PITTSBURGH
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.airline_code = 'CO') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND flight.to_airport = AIRPORT...
atis
CREATE TABLE table_1499774_5 ( english_gloss VARCHAR, northern_lakota VARCHAR )
Name the number of english gloss for wak ye a
SELECT COUNT(english_gloss) FROM table_1499774_5 WHERE northern_lakota = "wakȟáŋyeža"
sql_create_context
CREATE TABLE table_1132568_3 ( rd VARCHAR, grand_prix VARCHAR )
What number is the Canadian Grand Prix on the list?
SELECT rd FROM table_1132568_3 WHERE grand_prix = "Canadian grand_prix"
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 )
Tell me the proportion of the total number of different classes using a bar graph.
SELECT Class, COUNT(Class) FROM captain GROUP BY Class
nvbench
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
看看零五年一月十六日到二零年六月二十二日医疗机构2725836外地住院有多少就诊记录
SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '27...
css
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
For all employees who have the letters D or S in their first name, draw a line chart about the change of employee_id over hire_date .
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, Owner...
Top users in New Zealand.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%new zealand%' OR UPPER(Location) LIKE '%NZ' ORDER BY Reputation DESC
sede
CREATE TABLE table_30048 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the location attendance for 3 game
SELECT "Location Attendance" FROM table_30048 WHERE "Game" = '3'
wikisql
CREATE TABLE table_72340 ( "Phase" text, "Round" text, "Clubs remaining" real, "Clubs involved" real, "Winners from previous round" text, "New entries this round" text, "Leagues entering at this round" text )
When looking at new entries this round and seeing 8; what number in total is there for clubs remaining?
SELECT COUNT("Clubs remaining") FROM table_72340 WHERE "New entries this round" = '8'
wikisql
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, ...
请把患者陶浩阔在二零零八年十二月十一日到二零一七年十月十日内所有检验结果指标记录中的仪器编号以及名称都找出来
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE table_name_45 ( gold INTEGER, bronze VARCHAR, silver VARCHAR, rank VARCHAR )
What is the low gold total for nations with under 23 silvers, ranked beloe 5, and 6 bronzes?
SELECT MIN(gold) FROM table_name_45 WHERE silver < 23 AND rank > 5 AND bronze = 6
sql_create_context
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 hz_info ( KH text, KLX number...
号码为66471271031的病人其中医诊断在住院期间的编号以及名称各是什么?
SELECT wdmzjzjlb.ZYZYZDZZBM, wdmzjzjlb.ZYZYZDZZMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '66471271031' UNION SELECT bdmzjzjlb.ZYZYZDZZBM, bdmzjzjlb.ZYZYZDZZMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '66471271031'
css
CREATE TABLE table_name_97 ( driver VARCHAR, winnings VARCHAR )
Who has won $98,860?
SELECT driver FROM table_name_97 WHERE winnings = "$98,860"
sql_create_context
CREATE TABLE table_12204 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Who Player has a Finish of 74?
SELECT "Player" FROM table_12204 WHERE "Finish" = '74'
wikisql
CREATE TABLE table_name_77 ( circuit VARCHAR, date VARCHAR )
Which circuit is on July 24?
SELECT circuit FROM table_name_77 WHERE date = "july 24"
sql_create_context
CREATE TABLE table_2668243_8 ( district VARCHAR, incumbent VARCHAR )
What district is Joseph Lecompte in office in?
SELECT district FROM table_2668243_8 WHERE incumbent = "Joseph Lecompte"
sql_create_context
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 medication ( medi...
when was the last time patient 030-52395 had a drug intake of gastric tube on the first icu visit?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52395') AND NOT patient.unitdischargetime IS NULL...
eicu
CREATE TABLE gyb ( 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...
在34412645856的医疗就诊中,患者出院时诊断的是哪种疾病,把疾病的编号也找出来
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.MED_CLINIC_ID = '34412645856' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.MED_CLINIC_ID = '34412645856' UNION SELECT zyb.OUT_DIAG_DIS_CD, zyb.OUT_DIAG_DIS_NM FROM zyb WHERE zyb.MED_CLINIC_ID = '34412645856' UNION SELECT mzb....
css
CREATE TABLE table_28044 ( "Series no." real, "No. in season" real, "Title" text, "Written by" text, "Directed by" text, "Original air date" text, "U.S. viewers (millions)" text )
Who wrote the episode where the original air date is july20,2007?
SELECT "Written by" FROM table_28044 WHERE "Original air date" = 'July20,2007'
wikisql
CREATE TABLE table_name_74 ( player VARCHAR, school_club_team VARCHAR )
Which player attended school at Georgia Tech?
SELECT player FROM table_name_74 WHERE school_club_team = "georgia tech"
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,...
how many female patients died?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.expire_flag = "1"
mimicsql_data
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, Creati...
Users with a silver badge but not a bronze badge.
SELECT DISTINCT (u.Id) AS "user_link" FROM Users AS u INNER JOIN Badges AS sb ON sb.UserId = u.Id AND sb.Class = 2 LEFT JOIN Badges AS bb ON bb.UserId = u.Id AND bb.Class = 3 WHERE bb.Id IS NULL
sede
CREATE TABLE table_25399 ( "Player" text, "Games Played" real, "Field Goals" real, "Three Pointers" real, "Free Throws" real, "Rebounds" real, "Assists" real, "Blocks" real, "Steals" real, "Points" real )
What is the lowest number of three pointers in games that kendall gill played?
SELECT MIN("Three Pointers") FROM table_25399 WHERE "Player" = 'Kendall Gill'
wikisql
CREATE TABLE table_name_83 ( team_1 VARCHAR, team_2 VARCHAR )
Which Team 1 faced Dynamos FC?
SELECT team_1 FROM table_name_83 WHERE team_2 = "dynamos fc"
sql_create_context
CREATE TABLE table_201_5 ( id number, "year" number, "title" text, "chart positions\nnor" number, "chart positions\naus" number, "chart positions\naut" number, "chart positions\nbel" number, "chart positions\nger" number, "chart positions\nnl" number, "chart positions\nnz" number...
when did the album hallelujah - live volume 2 come out ?
SELECT "year" FROM table_201_5 WHERE "year" = 'hallelujah - live volume 2'
squall
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
count the number of patients still living who have diagnoses icd9 code 5589.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "5589"
mimicsql_data
CREATE TABLE table_47241 ( "product" text, "dimensions (mm)" text, "pages per minute (color)" real, "max page size" text, "interface" text )
What is the interface of the product xerox travel scanner 100?
SELECT "interface" FROM table_47241 WHERE "product" = 'xerox travel scanner 100'
wikisql
CREATE TABLE table_58345 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text )
Which Object type has an NGC number of 2171?
SELECT "Object type" FROM table_58345 WHERE "NGC number" = '2171'
wikisql
CREATE TABLE table_43160 ( "Year" text, "Champion" text, "Country" text, "To par" text, "Margin of victory" text, "Winner's share ( $ )" text )
what is the victory margin with a 45,000 Winner's share
SELECT "Margin of victory" FROM table_43160 WHERE "Winner's share ( $ )" = '45,000'
wikisql
CREATE TABLE table_12251936_1 ( live_births_2006 VARCHAR, county VARCHAR )
How many live births were there in 2006 in South Yorkshire (met county)?
SELECT live_births_2006 FROM table_12251936_1 WHERE county = "South Yorkshire (Met county)"
sql_create_context
CREATE TABLE table_75947 ( "Round" text, "Date" text, "Home team" text, "Score" text, "Away team" text )
Who played as the home team when Vit ria was the away team?
SELECT "Home team" FROM table_75947 WHERE "Away team" = 'vitória'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
is the arterial bp [diastolic] of patient 24971's body last measured on the first intensive care unit visit greater than the value second to last measured on the first intensive care unit visit?
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24971) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item...
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
患者王飞燕有哪些门诊就诊的检验报告日期在2020-10-11以后?查询这些门诊就诊的流水号
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '王飞燕' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2020-10-11')
css
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TAB...
also show me the first flight from ATLANTA to DENVER on a THURSDAY
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, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND days.day_name = 'THURSDAY' AND flight.flight_days = days.days_code AND...
atis
CREATE TABLE fires ( fire_year number, discovery_date number, discovery_doy number, discovery_time text, stat_cause_code number, stat_cause_descr text, cont_date text, cont_doy text, cont_time text, fire_size number, fire_size_class text, latitude number, longitude nu...
How many years of data are recorded in this database?
SELECT COUNT(DISTINCT fire_year) FROM fires
uswildfires
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 ( ...
how many patients whose procedure icd9 code is 8968 have been prescribed main drug type?
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 = "8968" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE Player ( HS INTEGER )
What is the average training hours of all players?
SELECT AVG(HS) FROM Player
sql_create_context
CREATE TABLE table_64913 ( "Actor" text, "Character" text, "Soap Opera" text, "Years" text, "Duration" text )
What's the duration of the Archers with Norman Painting as an actor?
SELECT "Duration" FROM table_64913 WHERE "Soap Opera" = 'the archers' AND "Actor" = 'norman painting'
wikisql
CREATE TABLE table_name_36 ( release_date VARCHAR, writer VARCHAR, company VARCHAR )
What is the release date of the album written by Goss, James James Goss under Audiogo?
SELECT release_date FROM table_name_36 WHERE writer = "goss, james james goss" AND company = "audiogo"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
What are the total enrollments of universities of each affiliation type. Plot them as bar chart.
SELECT Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation
nvbench
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, ...
患有白细胞异常的人数总量是多少
SELECT COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.IN_DIAG_DIS_NM = '白细胞异常'
css
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) 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...
on CO any class service from SAN FRANCISCO to PITTSBURGH
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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SA...
atis
CREATE TABLE table_204_704 ( id number, "province" text, "map #" number, "iso 3166-2:af" text, "centers" text, "population" number, "area (km2)" number, "language" text, "notes" text, "u.n. region" text )
how many provinces have the same number of districts as kabul ?
SELECT COUNT("province") FROM table_204_704 WHERE "province" <> 'kabul' AND "notes" = (SELECT "notes" FROM table_204_704 WHERE "province" = 'kabul')
squall
CREATE TABLE table_8597 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Points" text )
When there were 554 points, what was the point difference?
SELECT "Points difference" FROM table_8597 WHERE "Points for" = '554'
wikisql
CREATE TABLE table_name_85 ( fa_cup_goals INTEGER, total_apps__sub_ VARCHAR, total_goals VARCHAR )
What division has the highest FA Cup Goals, but a Total Goal score less than 5, and a Total Apps of 52?
SELECT MAX(fa_cup_goals) FROM table_name_85 WHERE total_apps__sub_ = "52" AND total_goals < 5
sql_create_context
CREATE TABLE table_name_55 ( region VARCHAR, date VARCHAR )
What was the region of the release from May 27, 2009?
SELECT region FROM table_name_55 WHERE date = "may 27, 2009"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalp...
on the last hospital encounter when was the last time that patient 033-12085 was prescribed medication via the zpyxvend route?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-12085' AND NOT patient.hospitaldischargetime IS NULL ORDER...
eicu
CREATE TABLE table_name_21 ( distance VARCHAR, winner_or_2nd VARCHAR )
What was the distance for the winner or 2nd Waterline?
SELECT distance FROM table_name_21 WHERE winner_or_2nd = "waterline"
sql_create_context
CREATE TABLE table_name_22 ( high_points VARCHAR, opponent VARCHAR, date VARCHAR )
What was the high points for opponent Mid-Michigan destroyers on January 3?
SELECT high_points FROM table_name_22 WHERE opponent = "mid-michigan destroyers" AND date = "january 3"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
柳娟秀这个病人的检验报告单结果指标均异常的有哪些?看看检验报告的单号
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '柳娟秀' AND NOT ...
css
CREATE TABLE table_16119656_1 ( attendance INTEGER )
What was the lowest no. of attendance on record?
SELECT MIN(attendance) FROM table_16119656_1
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
has patient 005-8370 received treatment of hyponatremia at other hospitals during this year?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '005-8370' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '005-8370' AND patient.hospitaldischargetime IS NULL)) AND trea...
eicu
CREATE TABLE table_20632 ( "#" real, "Date" text, "at/vs." text, "Opponent" text, "Score" text, "Attendance" real, "Record" text )
Name the most attendance for number 4
SELECT MAX("Attendance") FROM table_20632 WHERE "#" = '4'
wikisql
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 Posts ( Id number, PostTypeId number, AcceptedAnswer...
Answer tag stats per month and year.
SELECT Tags.TagName, YEAR(Answers.CreationDate) AS Year, MONTH(Answers.CreationDate) AS Month, COUNT(*) AS Total FROM Posts AS Answers INNER JOIN Posts AS Questions ON (Answers.ParentId = Questions.Id) INNER JOIN PostTags ON (Questions.Id = PostTags.PostId) INNER JOIN Tags ON (PostTags.TagId = Tags.Id) WHERE Answers.Ow...
sede
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...
19242256这个病人在哪几次医疗记录中被开出过的药品不少于3101.15元,医疗就诊编号是啥
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '19242256' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 3101.15) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '19242256' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLI...
css
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...
provide the number of patients whose admission type is elective and procedure icd9 code is 3615?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "3615"
mimicsql_data
CREATE TABLE table_14981555_3 ( venue VARCHAR, date VARCHAR )
How many venues were used on 10 Mar 2007?
SELECT venue FROM table_14981555_3 WHERE date = "10 Mar 2007"
sql_create_context
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 jyjgzbb ( BGDH text, BGRQ tim...
为病人陶宏伯检测降钙素原的在06年5月31日到21年10月31日内的医务人员工号及姓名都是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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 jy...
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLO...
For those employees who was hired before 2002-06-21, for employee_id, hire_date, visualize the trend, and I want to order X in asc order.
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_29338 ( "Year" real, "Winner" text, "Location" text, "Entrants" real, "Winners Prize" text, "Total Prize Pool" text )
What was the prize pool in New Orleans?
SELECT "Total Prize Pool" FROM table_29338 WHERE "Location" = 'New Orleans'
wikisql
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...
阿戈美拉汀片的检查记录,在医疗机构8564108有多少?
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '8564108' AND t_kc22.SOC_SRT_DIRE_NM = '阿戈美拉汀片' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '8564108' AND t_kc22.SOC_SRT_DIRE_NM = '阿戈美拉汀片' UN...
css
CREATE TABLE table_24837750_1 ( installed_capacity__mw_ VARCHAR, county VARCHAR )
How much capacity was installed in Wheatland?
SELECT installed_capacity__mw_ FROM table_24837750_1 WHERE county = "Wheatland"
sql_create_context
CREATE TABLE table_27501 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
Who wrote episode number 149 in the series?
SELECT "Written by" FROM table_27501 WHERE "No. in series" = '149'
wikisql
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...
Sum R@ndom Commints in Editz.
SELECT DISTINCT Comment FROM SuggestedEdits WHERE OwnerUserId = 410 AND Comment != '' AND NOT Comment LIKE '%characters in body%' UNION ALL SELECT DISTINCT Comment FROM PostHistory WHERE UserId = 410 AND PostHistoryTypeId IN (4, 5, 6) AND Comment != '' AND NOT Comment LIKE '%characters in body%'
sede
CREATE TABLE table_name_74 ( imperfect_stem VARCHAR, meaning VARCHAR )
What is the imperfect stem of the word that means 'take away, remove'?
SELECT imperfect_stem FROM table_name_74 WHERE meaning = "'take away, remove'"
sql_create_context
CREATE TABLE table_name_73 ( home_team VARCHAR, away_team VARCHAR )
What was the home team with the away team of rushden & diamonds?
SELECT home_team FROM table_name_73 WHERE away_team = "rushden & diamonds"
sql_create_context
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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CR...
what changes have been made to the calculated total co2 levels of patient 9566 second measured on the current hospital visit compared to the value first measured on the current hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9566 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') ORDER BY labevent...
mimic_iii
CREATE TABLE table_37382 ( "Train Number" text, "Train Name" text, "Origin" text, "Destination" text, "Frequency (inbound/outbound)" text )
What is the destination of the Garib nwaz exp train?
SELECT "Destination" FROM table_37382 WHERE "Train Name" = 'garib nwaz exp'
wikisql
CREATE TABLE table_name_3 ( date VARCHAR, home_team VARCHAR )
When did South Melbourne play at home?
SELECT date FROM table_name_3 WHERE home_team = "south melbourne"
sql_create_context
CREATE TABLE table_name_89 ( outcome VARCHAR, date VARCHAR )
What is the outcome on March 20, 1994?
SELECT outcome FROM table_name_89 WHERE date = "march 20, 1994"
sql_create_context
CREATE TABLE table_20849830_1 ( game VARCHAR, record VARCHAR )
What game number had a record of 3-1?
SELECT game FROM table_20849830_1 WHERE record = "3-1"
sql_create_context
CREATE TABLE table_29163303_2 ( score VARCHAR, championship VARCHAR )
What are the results of those matches where the championship is French Open?
SELECT score FROM table_29163303_2 WHERE championship = "French Open"
sql_create_context
CREATE TABLE table_name_51 ( hydroelectricity INTEGER, total VARCHAR, solar VARCHAR )
What is the minimum hydroelectricity with a less than 116.4 total, and a greater than 18.637 solar?
SELECT MIN(hydroelectricity) FROM table_name_51 WHERE total < 116.4 AND solar > 18.637
sql_create_context
CREATE TABLE gyb ( 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...
在入院诊断疾病结果和出院诊断疾病结果的检测中医院3472324在2005年3月11号到2006年10月26号这段时间的医疗记录中有哪些不一样?
SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '3472324' AND qtb.IN_HOSP_DATE BETWEEN '2005-03-11' AND '2006-10-26' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '3472324' AND gyb.IN_HOSP_DATE BETWEEN '2005-03-11' AND '2006-10-26' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '3472324' AND zyb.IN_HOSP_DATE BETW...
css
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE...
when was the last time the respiratory rate of patient 4401 was measured on this month/29 at greater than 23.0?
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4401)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirato...
mimic_iii
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREAT...
how many flights does DL have with a class of service code F
SELECT COUNT(DISTINCT flight.flight_id) FROM fare, flight, flight_fare WHERE fare.fare_basis_code = 'F' AND flight_fare.fare_id = fare.fare_id AND flight.airline_code = 'DL' AND flight.flight_id = flight_fare.flight_id
atis
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 demographic ( subject_id text, hadm_id t...
give the minimum age of patients whose insurance is private and year of death is before 2122.
SELECT MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.dod_year < "2122.0"
mimicsql_data
CREATE TABLE table_name_20 ( syracuse VARCHAR, utica VARCHAR, rochester VARCHAR )
What is Syracuse, when Utica is Union Springs Shale And Limestone, and when Rochester is Union Springs Shale And Limestone?
SELECT syracuse FROM table_name_20 WHERE utica = "union springs shale and limestone" AND rochester = "union springs shale and limestone"
sql_create_context
CREATE TABLE table_name_98 ( paul_mccartney VARCHAR, linda_mccartney VARCHAR )
Which Paul McCartney has a Linda McCartney of keyboards?
SELECT paul_mccartney FROM table_name_98 WHERE linda_mccartney = "keyboards"
sql_create_context
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 code over the name , and group by attribute headquarter by a bar chart, and list total number in ascending order.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Code
nvbench
CREATE TABLE table_9876 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" text )
On what date was the Opponent Chicago Bears?
SELECT "Date" FROM table_9876 WHERE "Opponent" = 'chicago bears'
wikisql
CREATE TABLE table_name_79 ( year INTEGER, competition VARCHAR, result VARCHAR )
What was the highest year that Europe/Africa Zone Group I Group B lost?
SELECT MAX(year) FROM table_name_79 WHERE competition = "europe/africa zone group i group b" AND result = "lost"
sql_create_context
CREATE TABLE table_2897457_7 ( nhl_team VARCHAR, pick__number VARCHAR )
How many NHL teams have a pick number of 128?
SELECT COUNT(nhl_team) FROM table_2897457_7 WHERE pick__number = 128
sql_create_context
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
Find Nationality and the sum of meter_100 , and group by attribute Nationality, and visualize them by a bar chart, and could you sort in descending by the total number of meter 100?
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY SUM(meter_100) DESC
nvbench
CREATE TABLE table_79048 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real )
What is the total for 1986 with a to par higher than 6?
SELECT COUNT("Total") FROM table_79048 WHERE "Year(s) won" = '1986' AND "To par" > '6'
wikisql
CREATE TABLE table_41698 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
Which Cuts made has a Top-25 smaller than 3?
SELECT MAX("Cuts made") FROM table_41698 WHERE "Top-25" < '3'
wikisql
CREATE TABLE table_203_731 ( id number, "pos." text, "city" text, "population\n(ab)" number, "surface\n(km2)" number, "density\n(ab/km2)" number, "altitude\n(mslm)" number )
does albino have more or less people than stezzano ?
SELECT (SELECT "population\n(ab)" FROM table_203_731 WHERE "city" = 'albino') > (SELECT "population\n(ab)" FROM table_203_731 WHERE "city" = 'stezzano')
squall
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
i need the flights from WASHINGTON to MONTREAL on a SATURDAY
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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MONTREAL' AND days.day_name = 'SATURDAY' AND flight.flight_days = days.days_code AN...
atis
CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Students_in_Detention ( student_id INTEGER, detention_id INTEGER, incident_id INTEGER ) CREATE TABLE Addresses ( address_id INTEGER, line_1 VARCHAR(120), line_2 VARCHAR(1...
Show me about the distribution of date_address_from and the sum of monthly_rental , and group by attribute other_details and bin date_address_from by time in a bar chart.
SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_52504 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
On what date was a match played at Lake Oval?
SELECT "Date" FROM table_52504 WHERE "Venue" = 'lake oval'
wikisql
CREATE TABLE table_70369 ( "Category" text, "Film" text, "Director(s)" text, "Country" text, "Nominating Festival" text )
What country did Jonas Geirnaert direct a film in?
SELECT "Country" FROM table_70369 WHERE "Director(s)" = 'jonas geirnaert'
wikisql
CREATE TABLE table_36637 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" real, "Points" real, "Overall WC points (Rank)" text )
Which Rank is the lowest one that has a 1st (m) larger than 133.5, and an Overall WC points (Rank) of 459 (7)?
SELECT MIN("Rank") FROM table_36637 WHERE "1st (m)" > '133.5' AND "Overall WC points (Rank)" = '459 (7)'
wikisql
CREATE TABLE table_204_814 ( id number, "date" text, "opposition" text, "result" text, "score" text, "brazil scorers" text, "competition" text )
was the total goals scored on june 14 , 1982 more than 6 ?
SELECT (SELECT "score" + "score" FROM table_204_814 WHERE "date" = 'june 14, 1982') > 6
squall
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 ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
count the number of patients whose primary disease is transient ischemic attack and who died in or before year 2183.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" AND demographic.dod_year <= "2183.0"
mimicsql_data
CREATE TABLE table_4663 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What venue featured fitzroy as the home squad?
SELECT "Venue" FROM table_4663 WHERE "Home team" = 'fitzroy'
wikisql
CREATE TABLE table_1129 ( "Administrative county" text, "Area 1891 (Statute acres)" real, "Population 1891" real, "Area 1961 (Statute acres)" real, "Population 1961" real )
Name the administrative county being area of 422372
SELECT "Administrative county" FROM table_1129 WHERE "Area 1961 (Statute acres)" = '422372'
wikisql
CREATE TABLE table_name_89 ( manufacturer VARCHAR, rider VARCHAR, laps VARCHAR, grid VARCHAR )
Which Manufacturer has a Laps of 21, a Grid larger than 16, and a Rider of akira ry ?
SELECT manufacturer FROM table_name_89 WHERE laps = 21 AND grid > 16 AND rider = "akira ryō"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
投保人号码为43928583的患者的年门诊费一共有多少钱?
SELECT SUM(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.PERSON_ID = '43928583' AND t_kc21.CLINIC_TYPE = '门诊'
css