context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_17 ( silver INTEGER, total VARCHAR, gold VARCHAR )
What is the least amount of silvers for a team with less than 4 golds and less than 5 total medals?
SELECT MIN(silver) FROM table_name_17 WHERE total < 5 AND gold < 4
sql_create_context
CREATE TABLE table_203_754 ( id number, "no." number, "player" text, "position" text, "career" text, "date no. retired" text )
who 's a top player in the rw position ?
SELECT "player" FROM table_203_754 WHERE "position" = 'rw'
squall
CREATE TABLE table_76932 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real )
What is the total of laps run by the driver with a grid under 17 and a time of +5.088?
SELECT SUM("Laps") FROM table_76932 WHERE "Time" = '+5.088' AND "Grid" < '17'
wikisql
CREATE TABLE table_42919 ( "m\u00e5cha" text, "indicative" text, "imperative" text, "subjunctive" text, "inverse subjunctive" text )
What subjunctive has the indicative of se m chan(t)?
SELECT "subjunctive" FROM table_42919 WHERE "indicative" = 'se måchan(t)'
wikisql
CREATE TABLE table_1301373_7 ( australian_marquee VARCHAR, international_marquee VARCHAR )
Name the australian marquee for alessandro del piero
SELECT australian_marquee FROM table_1301373_7 WHERE international_marquee = "Alessandro Del Piero"
sql_create_context
CREATE TABLE table_name_68 ( wins VARCHAR, points VARCHAR, finishes VARCHAR, starts VARCHAR )
What is the number of wins associated with 1 point, more than 1 start, and under 7 finishes?
SELECT wins FROM table_name_68 WHERE finishes < 7 AND starts > 1 AND points = 1
sql_create_context
CREATE TABLE table_name_25 ( pick INTEGER, position VARCHAR )
What is the sum of the pick of the lw position player?
SELECT SUM(pick) FROM table_name_25 WHERE position = "lw"
sql_create_context
CREATE TABLE table_203_587 ( id number, "country" text, "weapon designation" text, "weapon description" text, "year(s) delivered" text, "quantity delivered" number )
what is the total number of tanks sold by china to iraq ?
SELECT SUM("quantity delivered") FROM table_203_587 WHERE "weapon description" = 'tank' AND "country" = 'china'
squall
CREATE TABLE table_41367 ( "Name" text, "Space Agency" text, "Launch Date" text, "Terminated" text, "Location" text )
What is the Name of the Space Telescope Terminated on March 1993?
SELECT "Name" FROM table_41367 WHERE "Terminated" = 'march 1993'
wikisql
CREATE TABLE table_54814 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Which constructor had a laps number bigger than 3 when the driver was Jarno Trulli?
SELECT "Constructor" FROM table_54814 WHERE "Laps" > '3' AND "Driver" = 'jarno trulli'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
TOP 100 users from Bangladesh.
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Bangladesh%' ORDER BY Reputation DESC LIMIT 1000
sede
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
how many times has patient 033-24126 had a vancomycin - random lab test until 1 year ago?
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-24126')) AND lab.labname = 'vancomycin - random' AND DATETIME(lab.labresulttime) <= DATE...
eicu
CREATE TABLE table_204_969 ( id number, "composer" text, "title" text, "genre" text, "date" number, "notes" text )
how many works were made in the incidental music genre ?
SELECT COUNT("title") FROM table_204_969 WHERE "genre" = 'incidental music'
squall
CREATE TABLE table_58321 ( "Mid Gippsland FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the lowest amount of wins of someone who has 2 losses?
SELECT MIN("Wins") FROM table_58321 WHERE "Losses" = '2'
wikisql
CREATE TABLE table_name_13 ( losses INTEGER, draws VARCHAR, season VARCHAR )
What is the least amount of losses for the team that had more than 0 draws during the seasons earlier than 1926?
SELECT MIN(losses) FROM table_name_13 WHERE draws > 0 AND season < 1926
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
日期均在2021-05-03之后的患者王向卉的哪些门诊就诊记录对应的检验报告单的报告?列出门诊就诊流水号是什么?
SELECT mzjzjlb.JZLSH 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 NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2021-05-03')
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
count the number of patients taking drug via tp route who have diagnoses icd9 code v667.
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.icd9_code = "V667" AND prescriptions.route = "TP"
mimicsql_data
CREATE TABLE table_21034801_1 ( opponent VARCHAR, record VARCHAR )
How many opponents led to an exactly 7-0 record?
SELECT COUNT(opponent) FROM table_21034801_1 WHERE record = "7-0"
sql_create_context
CREATE TABLE gwyjzb ( 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, ...
列出病人48858661医疗记录中医疗费总额大于759.51元的入院诊断疾病编码和名称
SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '48858661' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 759.51) UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '48858661' AND ...
css
CREATE TABLE table_49041 ( "Name (English)" text, "Name (German)" text, "Abbr." text, "Ideology" text, "Position" text, "Votes (2011)" text, "Seats in Hamburgische B\u00fcrgerschaft" real )
WHAT IS THE TOTAL NUMBER OF SEATS IN Hamburgische B rgerschaft WITH AN ABBR OF b ndnis 90 / die gr nen (gal)?
SELECT COUNT("Seats in Hamburgische B\u00fcrgerschaft") FROM table_49041 WHERE "Abbr." = 'bündnis 90 / die grünen (gal)'
wikisql
CREATE TABLE table_35347 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
Which Overall is the highest one that has a Name of gregory spann, and a Pick # larger than 19?
SELECT MAX("Overall") FROM table_35347 WHERE "Name" = 'gregory spann' AND "Pick #" > '19'
wikisql
CREATE TABLE table_73777 ( "Driver Unit Model No." text, "Release Year" real, "Output Voltage (RMS)" text, "Inputs" text, "Outputs" text, "Notes" text )
What year were outputs is 2x pro bias, rca loop out and notes is vacuum tube released?
SELECT "Release Year" FROM table_73777 WHERE "Outputs" = '2x Pro Bias, RCA Loop Out' AND "Notes" = 'Vacuum tube'
wikisql
CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Sales ( sales_transa...
What are the number of the purchase details of transactions with amount bigger than 10000?, I want to list by the y-axis in asc.
SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY COUNT(purchase_details)
nvbench
CREATE TABLE table_78983 ( "Perpetrator" text, "Date" text, "Year" real, "Location" text, "Country" text, "Killed" real, "Injured" text )
What is the average Year, when Date is '04.01 April 1'?
SELECT AVG("Year") FROM table_78983 WHERE "Date" = '04.01 april 1'
wikisql
CREATE TABLE customer_addresses ( customer_id number, address_id number, date_from time, date_to time ) CREATE TABLE product_suppliers ( product_id number, supplier_id number, date_supplied_from time, date_supplied_to time, total_amount_purchased text, total_value_purchased numb...
What are the names and addressed of customers who have both New and Pending orders?
SELECT T1.customer_name, T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "New" INTERSECT SELECT T1.customer_name, T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_stat...
spider
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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, ...
what is the average hospital cost that involves a procedure known as a int or repl lead epicar?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'int or repl lead epicar')) GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_name_83 ( high_assists VARCHAR, team VARCHAR )
What is High Assists, when Team is '@ Milwaukee'?
SELECT high_assists FROM table_name_83 WHERE team = "@ milwaukee"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
Give me the number of patients with coronary artery disease or coronary artery bypass graft with mvi maze as their primary disease who have a pr route of drug administration.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" AND prescriptions.route = "PR"
mimicsql_data
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airport_service (...
show me all the TW flights from INDIANAPOLIS to HOUSTON that arrive around 11am
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 (((flight.arrival_time <= 1130 AND flight.arrival_time >= 1030) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTON' AND flight.to...
atis
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text )
Return me a scatter chart to show the smallest rating of the movie for each reviewer.
SELECT rID, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY rID
nvbench
CREATE TABLE table_70308 ( "Overall place" text, "Yacht name" text, "Skipper" text, "Points" text, "Combined elapsed time" text )
Which skipper has barclays adventurer as the name of the yacht?
SELECT "Skipper" FROM table_70308 WHERE "Yacht name" = 'barclays adventurer'
wikisql
CREATE TABLE table_name_99 ( visiting_team VARCHAR, date VARCHAR )
Who is the Visiting team on december 20?
SELECT visiting_team FROM table_name_99 WHERE date = "december 20"
sql_create_context
CREATE TABLE medication ( code number, name text, brand text, description text ) CREATE TABLE prescribes ( physician number, patient number, medication number, date time, appointment number, dose text ) CREATE TABLE undergoes ( patient number, procedures number, sta...
Find the name of physicians whose position title contains the word 'senior'.
SELECT name FROM physician WHERE position LIKE '%senior%'
spider
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepi...
calculate how many drugs patient 015-94586 is prescribed in 06/2101.
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-94586')) AND STRFTIME('%y-%m', medication.drugstarttime) = '2101-06'
eicu
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 diagnoses ( ...
how many patients whose drug code is atro1i and lab test category is hematology?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "ATRO1I" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_14752049_1 ( international_tourist_arrivals__2011_ VARCHAR, country VARCHAR )
How many tourist arrivals occurred in 2011 in the country of Italy?
SELECT international_tourist_arrivals__2011_ FROM table_14752049_1 WHERE country = "Italy"
sql_create_context
CREATE TABLE table_name_82 ( mountains_classification VARCHAR, stage VARCHAR, young_rider_classification VARCHAR, intergiro_classification VARCHAR )
Name the mountains classification which has a young rider classification of francesco casagrande and integiro classification of not awarded with stage of 2
SELECT mountains_classification FROM table_name_82 WHERE young_rider_classification = "francesco casagrande" AND intergiro_classification = "not awarded" AND stage = "2"
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,...
what is the number of patients whose drug name is send 500mg vial?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Send 500mg Vial"
mimicsql_data
CREATE TABLE table_57999 ( "Rank" text, "Name" text, "Height ft / m" text, "Floors" real, "Year" real )
What is the Height of rank 11?
SELECT "Height ft / m" FROM table_57999 WHERE "Rank" = '11'
wikisql
CREATE TABLE table_56085 ( "Character" text, "Position" text, "Actor" text, "First Episode" text, "Final Episode" text, "Episodes Credited" real )
What was the final episode credited of 187?
SELECT "Final Episode" FROM table_56085 WHERE "Episodes Credited" = '187'
wikisql
CREATE TABLE table_2740 ( "Rank" real, "Census-designated place" text, "Metropolitan area" text, "State" text, "Population (2000 census)" real, "Land area (mi 2 )" text, "Population density (people per mi 2 )" text )
what is the total number of population where census designated place is westmont?
SELECT COUNT("Population (2000 census)") FROM table_2740 WHERE "Census-designated place" = 'Westmont'
wikisql
CREATE TABLE bdmzjzjlb ( 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, MZZYZDZ...
二零零八年七月二十七日到二零一二年七月十三日,编号为2152272的医院有多少科室在门诊就诊中开出了2张以内的检验报告单
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM wdmzjzjlb JOIN jybgb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE wdmzjzjlb.YLJGDM = '2152272' AND jybgb.BGRQ BETWEEN '2008-07-27' AND '2012-07-13' GROUP BY jybgb.KSBM HAVING COUNT(*) < 2 UNION SELECT jybgb.KSBM FROM bdmzjzjlb JO...
css
CREATE TABLE table_54679 ( "Player" text, "Tries" text, "Conv" text, "Venue" text, "Date" text )
Where did Brian Hightower play when he has the Conv of 0?
SELECT "Venue" FROM table_54679 WHERE "Conv" = '0' AND "Player" = 'brian hightower'
wikisql
CREATE TABLE table_1805919_1 ( traditional_chinese VARCHAR, english_translation VARCHAR )
How many traditional Chinese for the translation of 'Crossing the River'?
SELECT COUNT(traditional_chinese) FROM table_1805919_1 WHERE english_translation = "Crossing the River"
sql_create_context
CREATE TABLE table_57875 ( "Class" text, "Type" text, "Operator" text, "No. Built" real, "Year Built" text, "Cars per Set" real, "Unit nos." text )
How many number Builts had unit numbers of 375301-310?
SELECT SUM("No. Built") FROM table_57875 WHERE "Unit nos." = '375301-310'
wikisql
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
What are the dates in which the mean sea level pressure was between 303 and 31, and count them by a bar chart, could you sort in desc by the y axis?
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date) DESC
nvbench
CREATE TABLE table_76487 ( "Rank" real, "Club" text, "Winners" real, "Runners-up" real, "Third" real )
How many Winners have a Third of 1, and Runners-up smaller than 0?
SELECT COUNT("Winners") FROM table_76487 WHERE "Third" = '1' AND "Runners-up" < '0'
wikisql
CREATE TABLE table_name_68 ( released VARCHAR, series_sorted VARCHAR )
what is the released when the series is sorted 6y/ai?
SELECT released FROM table_name_68 WHERE series_sorted = "6y/ai"
sql_create_context
CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num...
Show me the number of born state by born state in a histogram, order by the born_state from low to high.
SELECT born_state, COUNT(born_state) FROM head GROUP BY born_state ORDER BY born_state
nvbench
CREATE TABLE table_2252745_1 ( pop__km² VARCHAR, administrative_centre VARCHAR )
when administrative centre is egilssta ir, what is the pop./ km ?
SELECT COUNT(pop__km²) FROM table_2252745_1 WHERE administrative_centre = "Egilsstaðir"
sql_create_context
CREATE TABLE table_name_66 ( game VARCHAR, year VARCHAR )
What game was in 2001?
SELECT game FROM table_name_66 WHERE year = 2001
sql_create_context
CREATE TABLE table_15187735_3 ( segment_c VARCHAR, segment_b VARCHAR )
Name the segment c for couscous
SELECT segment_c FROM table_15187735_3 WHERE segment_b = "Couscous"
sql_create_context
CREATE TABLE table_29435 ( "Year" real, "Title" text, "Format" text, "Studio" text, "Release Date" text, "Copyright Information" text, "Catalog Number" text )
how many times was the catalog number cal01 / 0091037137319?
SELECT COUNT("Copyright Information") FROM table_29435 WHERE "Catalog Number" = 'CAL01 / 0091037137319'
wikisql
CREATE TABLE table_name_69 ( top_10 VARCHAR, starts VARCHAR, avg_finish VARCHAR )
How many top 10s belong to the team with a start of 7 and an average finish less than 16.7?
SELECT COUNT(top_10) FROM table_name_69 WHERE starts = 7 AND avg_finish < 16.7
sql_create_context
CREATE TABLE table_72777 ( "Season" text, "Air date" real, "Winner" text, "Runner-up" text, "Third place" text, "Host(s)" text, "Judges" text, "Winning mentor" text )
Who was the winning mentor in season two?
SELECT "Winning mentor" FROM table_72777 WHERE "Season" = 'Two'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, ...
what flights are there from MEMPHIS to LAS VEGAS
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 = 'MEMPHIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VE...
atis
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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 n...
从13年3月31日到20年9月29日,小儿青光眼科有多少门诊数
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.JZKSMC = '小儿青光眼科' AND mzjzjlb.JZKSRQ BETWEEN '2013-03-31' AND '2020-09-29'
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid ...
what would be the maximum monthly number of patients diagnosed with meningitis - acute since 2 years ago?
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'meningitis - acute' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE pitStops ( raceId INTEGER, driverId INTEGER, stop INTEGER, lap INTEGER, time TEXT, duration TEXT, milliseconds INTEGER ) CREATE TABLE seasons ( year INTEGER, url TEXT ) CREATE TABLE driverStandings ( driverStandingsId INTEGER, raceId INTEGER, driverId INTEG...
Display a bar chart for what are the ids and locations of all circuits in France or Belgium?, could you sort names in descending order?
SELECT location, circuitId FROM circuits WHERE country = "France" OR country = "Belgium" ORDER BY location DESC
nvbench
CREATE TABLE table_name_61 ( surface VARCHAR, opponent VARCHAR, score VARCHAR )
What is the Surface of the court against Ivo Klec with a Score of 6 3, 6 3?
SELECT surface FROM table_name_61 WHERE opponent = "ivo klec" AND score = "6–3, 6–3"
sql_create_context
CREATE TABLE table_3905 ( "Standard" text, "Date" text, "CO (g/kWh)" text, "NO x (g/kWh)" text, "HC (g/kWh)" text, "PM (g/kWh)" text )
What's the NO of the standard with HC of 1.23 g/kWh?
SELECT "NO x (g/kWh)" FROM table_3905 WHERE "HC (g/kWh)" = '1.23'
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...
韦浩岚这个病人被门诊诊断为混合性焦虑障碍,他做的三碘甲状腺原氨酸的结果定量及其单位分别是啥
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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.JZ...
css
CREATE TABLE table_name_68 ( third_place VARCHAR, winner VARCHAR )
Who earned third place when the winner was Paul Haarhuis?
SELECT third_place FROM table_name_68 WHERE winner = "paul haarhuis"
sql_create_context
CREATE TABLE table_name_10 ( set_4 VARCHAR, set_5 VARCHAR, set_3 VARCHAR )
What is Set 4, when Set 5 is NA, and when Set 3 is 19-25?
SELECT set_4 FROM table_name_10 WHERE set_5 = "na" AND set_3 = "19-25"
sql_create_context
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
For SURVMETH 641 , is SURVMETH 697 more difficult ?
SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, program_course AS PROGRAM_COURSE_0, program_course AS PROGRAM_COURSE_1 WHERE COURSE_0.department = 'SURVMETH' AND COURSE_0.number = 697 AND COURSE_1.department = 'SURVMETH' AND COURSE_1.number = 641 AND PROGRAM_COURSE_0.course_id = COURSE_0.course_id AND ...
advising
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE View_Unit_Status ...
Return the number of the date of birth for all the guests with gender code 'Male', sort Y in ascending order please.
SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" ORDER BY COUNT(date_of_birth)
nvbench
CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Transactions_Lots ( ...
Show the ids and details of the investors who have at least two transactions with type code 'SALE' by a bar chart, list from high to low by the Y.
SELECT T1.Investor_details, T1.investor_id FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = "SALE" ORDER BY T1.investor_id DESC
nvbench
CREATE TABLE table_name_83 ( crowd INTEGER, venue VARCHAR )
What was the smallest crowd of vfl park?
SELECT MIN(crowd) FROM table_name_83 WHERE venue = "vfl park"
sql_create_context
CREATE TABLE table_name_15 ( mintage VARCHAR, year VARCHAR, butterfly VARCHAR )
What mintage earlier than the year 2006 has the butterfly great spangled fritillary.
SELECT mintage FROM table_name_15 WHERE year < 2006 AND butterfly = "great spangled fritillary"
sql_create_context
CREATE TABLE table_204_805 ( id number, "name" text, "club" text, "date of departure" text, "replacement" text, "date of appointment" text )
other new replacement chosen in april 2009 besides kij meesrisuk
SELECT "replacement" FROM table_204_805 WHERE "date of appointment" = 'april 2009' AND "replacement" <> 'kij meesrisuk'
squall
CREATE TABLE table_204_352 ( id number, "pos" text, "no" number, "rider" text, "manufacturer" text, "laps" number, "time" text, "grid" number, "points" number )
how many riders manufacturer is honda ?
SELECT COUNT("rider") FROM table_204_352 WHERE "manufacturer" = 'honda'
squall
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
名叫彭书萱的病人在被门诊诊断为疾病U20.085的时候茶碱的结果定量及其单位都是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = j...
css
CREATE TABLE table_17118006_2 ( bid_pronar_investment__us$_ VARCHAR, farmers VARCHAR )
What was the BID/PRONAR investment (in $) in the department that included 1326 farmers in its projects?
SELECT bid_pronar_investment__us$_ FROM table_17118006_2 WHERE farmers = 1326
sql_create_context
CREATE TABLE table_26214389_3 ( grand_total INTEGER, qatari_male VARCHAR )
If the qatari male is 1104, what is the grand total?
SELECT MAX(grand_total) FROM table_26214389_3 WHERE qatari_male = 1104
sql_create_context
CREATE TABLE table_68189 ( "Season" text, "Games" real, "Lost" real, "Tied" text, "Points" real, "Goals for" real, "Goals against" real, "Standing" text )
What is the highest number of points scored when Acadie-Bathurst had 4 tied games, less than 257 goals, and over 72 games played?
SELECT MAX("Points") FROM table_68189 WHERE "Tied" = '4' AND "Goals for" < '257' AND "Games" > '72'
wikisql
CREATE TABLE table_44730 ( "Internet Plan" text, "Downstream" text, "Upstream" text, "Bandwidth Included" text, "Price" text )
What is the upstream for the 100 mbps downstream?
SELECT "Upstream" FROM table_44730 WHERE "Downstream" = '100 mbps'
wikisql
CREATE TABLE table_16426 ( "Location" text, "Monday" text, "Tuesday" text, "Wednesday" text, "Thursday" text, "Friday" text, "Saturday" text, "Sunday" text )
what's the thursday time with sunday being 1:00-5:00 and tuesday being 1:00-7:00
SELECT "Thursday" FROM table_16426 WHERE "Sunday" = '1:00-5:00' AND "Tuesday" = '1:00-7:00'
wikisql
CREATE TABLE table_7760 ( "Province of Silla" text, "Administrative district" text, "Pre-1009 province" text, "Post-1009 province" text, "Modern equivalent" text )
WHat kind of Province of Silla has a Modern equivalent of pyeongan?
SELECT "Province of Silla" FROM table_7760 WHERE "Modern equivalent" = 'pyeongan'
wikisql
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,...
what is the number of patients admitted before the year 2203 who had left femur fracture primary disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT FEMUR FRACTURE" AND demographic.admityear < "2203"
mimicsql_data
CREATE TABLE table_name_5 ( country VARCHAR, city VARCHAR )
Which country's city is Sendai?
SELECT country FROM table_name_5 WHERE city = "sendai"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
tell me the three year survival rate of patients who have been prescribed famotidine 20 mg po tabs after having been diagnosed with vaginal delivery?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_23528 ( "Pos" real, "Driver" text, "Vehicle" text, "Top 13 Time" text, "Shoot-Out Time" text, "Best Time of Day" text )
how many drivers driving toyota corolla
SELECT COUNT("Driver") FROM table_23528 WHERE "Vehicle" = 'Toyota Corolla'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
provide the number of patients whose diagnosis long title is malignant neoplasm of other sites of tongue and lab test fluid is urine.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Malignant neoplasm of other sites of tongue" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_74280 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What daft pick number is the player coming from Regina Pats (WHL)?
SELECT "Pick #" FROM table_74280 WHERE "College/junior/club team" = 'Regina Pats (WHL)'
wikisql
CREATE TABLE table_55336 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
For boozer (13) what is the high assists and high rebounds?
SELECT "High assists" FROM table_55336 WHERE "High rebounds" = 'boozer (13)'
wikisql
CREATE TABLE table_49813 ( "Date From" text, "Date To" text, "Pos." text, "Name" text, "Moving To" text )
What is Pos., when Date To is '30 June 2009', and when Name is 'Eddie Johnson'?
SELECT "Pos." FROM table_49813 WHERE "Date To" = '30 june 2009' AND "Name" = 'eddie johnson'
wikisql
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admissions ( ...
what is the monthly average protein/creatinine ratio level of patient 88401 last year?
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88401) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'protein/creatinine ratio') AND DATETIME(labevents.charttime, 'start of year...
mimic_iii
CREATE TABLE table_name_84 ( Id VARCHAR )
what is 1977 when 1978 is 4.1?
SELECT 1977 FROM table_name_84 WHERE 1978 = "4.1"
sql_create_context
CREATE TABLE table_name_97 ( away VARCHAR, round VARCHAR, club VARCHAR )
What is NK Rijeka's away score in Round 2?
SELECT away FROM table_name_97 WHERE round < 2 AND club = "nk rijeka"
sql_create_context
CREATE TABLE table_80018 ( "Sport" text, "League" text, "Tier" text, "Club" text, "Stadium" text )
Which stadium is for football with the China League One?
SELECT "Stadium" FROM table_80018 WHERE "Sport" = 'football' AND "League" = 'china league one'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
how many patients of american indian/alaska native ethnicity are diagnosed with icd9 code 20973?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND diagnoses.icd9_code = "20973"
mimicsql_data
CREATE TABLE table_66145 ( "Model number" text, "sSpec number" text, "Cores" text, "Frequency" text, "Turbo" text, "L2 cache" text, "L3 cache" text, "GPU model" text, "GPU frequency" text, "Socket" text, "I/O bus" text, "Release date" text, "Part number(s)" text, ...
What is the GPU frequency for the processor released in June 2013, with a sSpec number of sr17l(c0)?
SELECT "GPU frequency" FROM table_66145 WHERE "Release date" = 'june 2013' AND "sSpec number" = 'sr17l(c0)'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom te...
what are the five most frequent drugs that were prescribed to male patients 60 or above in the same month after they were diagnosed with ventltr assoc pneumonia in the previous year?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ...
mimic_iii
CREATE TABLE table_72615 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
When it is week 2 what is the record?
SELECT "Record" FROM table_72615 WHERE "Week" = '2'
wikisql
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) ...
Give me the comparison about meter_100 over the meter_300 , I want to show by the X from low to high.
SELECT meter_300, meter_100 FROM swimmer ORDER BY meter_300
nvbench
CREATE TABLE table_21234 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Where was the game that took place in November 21 located and how many attended?
SELECT "Location Attendance" FROM table_21234 WHERE "Date" = 'November 21'
wikisql
CREATE TABLE table_74021 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Who is the candidates for district maryland 1?
SELECT "Candidates" FROM table_74021 WHERE "District" = 'Maryland 1'
wikisql
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,...
医院6703357的8237科室在一零年九月十一日到一八年七月二十五日的这段时间里涉及到多少医疗费
SELECT SUM(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '6703357' AND MED_ORG_DEPT_CD = '8237') AND CLINIC_SLT_DATE BETWEEN '2010-09-11' AND '2018-07-25'
css
CREATE TABLE table_name_33 ( date VARCHAR, venue VARCHAR )
What date was the game played at vfl park?
SELECT date FROM table_name_33 WHERE venue = "vfl park"
sql_create_context
CREATE TABLE table_name_7 ( country VARCHAR, speed VARCHAR )
What County scored with a speed of 98.09mph?
SELECT country FROM table_name_7 WHERE speed = "98.09mph"
sql_create_context