context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_60 ( number_range VARCHAR, quantity VARCHAR )
What is the number range for the 56 quantity?
SELECT number_range FROM table_name_60 WHERE quantity = "56"
sql_create_context
CREATE TABLE table_14954150_1 ( result VARCHAR, date VARCHAR )
What was the result of the game on October 6, 1974?
SELECT result FROM table_14954150_1 WHERE date = "October 6, 1974"
sql_create_context
CREATE TABLE table_62252 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What is Tom Kite's Place?
SELECT "Place" FROM table_62252 WHERE "Player" = 'tom kite'
wikisql
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE flight_fare ...
what are the flights from ATLANTA to BALTIMORE
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIM...
atis
CREATE TABLE table_39280 ( "Dance" text, "Best dancer(s)" text, "Best score" text, "Worst dancer(s)" text, "Worst score" text )
What is the best score of the dance freestyle?
SELECT "Best score" FROM table_39280 WHERE "Dance" = 'freestyle'
wikisql
CREATE TABLE table_name_96 ( official_itv1_rating VARCHAR, episode VARCHAR )
What is the Official ITV1 rating for auditions 4?
SELECT official_itv1_rating FROM table_name_96 WHERE episode = "auditions 4"
sql_create_context
CREATE TABLE table_name_73 ( Id VARCHAR )
What is the 2004 value if the 1998 value is 35?
SELECT 2004 FROM table_name_73 WHERE 1998 = "35"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents...
count the number of patients who had undergone loc exc bone lesion nec two times until 2103.
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'loc exc bone lesion n...
mimic_iii
CREATE TABLE table_59 ( "Crop (kilotonnes)" text, "New South Wales" real, "Victoria" real, "Queensland" real, "Western Australia" real, "South Australia" real, "Tasmania" real, "Total" real )
what's the minimum total with crop (kilotonnes) being s lupin
SELECT MIN("Total") FROM table_59 WHERE "Crop (kilotonnes)" = 's Lupin'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergy...
had patient 006-195316 visited the emergency room on their current hospital visit?
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '006-195316' AND patient.hospitaladmitsource = 'emergency department' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE fare ( fare_id int, from_airport va...
show me flights from PITTSBURGH to ATLANTA on monday afternoon
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 (((flight.departure_time BETWEEN 1200 AND 1800) AND date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_...
atis
CREATE TABLE table_name_27 ( margin VARCHAR, date VARCHAR )
What is the Margin, when Date is 19 July 2008 (Round 19)?
SELECT margin FROM table_name_27 WHERE date = "19 july 2008 (round 19)"
sql_create_context
CREATE TABLE table_14480 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real )
What years won when the To par is more than 13?
SELECT "Year(s) won" FROM table_14480 WHERE "To par" > '13'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients less than age 89 years are widowed?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.age < "89"
mimicsql_data
CREATE TABLE table_203_121 ( id number, "name" text, "pos." text, "caps" number, "goals" number, "club" text )
how many people have no goals ?
SELECT COUNT("name") FROM table_203_121 WHERE "goals" = 0
squall
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
编号是91530632的患者医疗费总额大于4446.07元的其医疗记录入院诊断疾病编码和名称,列出其都是什么?
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '91530632' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 4446.07)
css
CREATE TABLE table_8912 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
Which College has a Round of 11, and a Position of wr?
SELECT "College" FROM table_8912 WHERE "Round" = '11' AND "Position" = 'wr'
wikisql
CREATE TABLE table_15693 ( "Date" text, "Score" text, "Location" text, "Competition" text, "Serial No." text )
The competition located in Northampton had a resulting score of what?
SELECT "Score" FROM table_15693 WHERE "Location" = 'northampton'
wikisql
CREATE TABLE table_name_96 ( tamil_name VARCHAR, english_name VARCHAR )
What is the Tamil Name of the Thaipusam holiday?
SELECT tamil_name FROM table_name_96 WHERE english_name = "thaipusam"
sql_create_context
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...
how much is hypertonic saline administration?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'hypertonic saline administration')
eicu
CREATE TABLE table_1015521_2 ( us_air_force_equivalent VARCHAR, commonwealth_equivalent VARCHAR )
If you are a pilot officer in the commonwealth then what will you called as in the US air force?
SELECT us_air_force_equivalent FROM table_1015521_2 WHERE commonwealth_equivalent = "Pilot Officer"
sql_create_context
CREATE TABLE table_name_17 ( gold INTEGER, silver VARCHAR, bronze VARCHAR )
What is the highest Gold that has a Silver less than 7 and Bronze less than 0
SELECT MAX(gold) FROM table_name_17 WHERE silver < 7 AND bronze < 0
sql_create_context
CREATE TABLE table_name_76 ( venue VARCHAR, home_team VARCHAR )
What was the venue when the home team was Fitzroy?
SELECT venue FROM table_name_76 WHERE home_team = "fitzroy"
sql_create_context
CREATE TABLE table_2923917_4 ( melbourne VARCHAR, distance VARCHAR )
How many listings under Melbourne has a distance at 15km?
SELECT COUNT(melbourne) FROM table_2923917_4 WHERE distance = "15km"
sql_create_context
CREATE TABLE table_name_32 ( winning_song VARCHAR, debut_album VARCHAR )
Which winning song had a debut album in progress?
SELECT winning_song FROM table_name_32 WHERE debut_album = "in progress"
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 patient ( uniquep...
has patient 027-3046 received a vasodilator - minoxidil in other hospitals?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '027-3046' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '027-3046' AND patient.hospitaldischargetime IS NULL)) AND trea...
eicu
CREATE TABLE table_43636 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What is the Week number with a Result of W 30-28?
SELECT AVG("Week") FROM table_43636 WHERE "Result" = 'w 30-28'
wikisql
CREATE TABLE table_name_13 ( candidate VARCHAR, riding VARCHAR )
Who is the Candidate when the Riding is Hochelaga?
SELECT candidate FROM table_name_13 WHERE riding = "hochelaga"
sql_create_context
CREATE TABLE table_26565936_2 ( no_in_series VARCHAR, written_by VARCHAR )
What number(s) in the series was written by bo crese?
SELECT no_in_series FROM table_26565936_2 WHERE written_by = "Bo Crese"
sql_create_context
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varch...
AA from PHOENIX to MILWAUKEE
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 = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHO...
atis
CREATE TABLE table_name_37 ( nationality VARCHAR, games VARCHAR )
What is the nationality of the player who played 505 games?
SELECT nationality FROM table_name_37 WHERE games = "505"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number,...
top users in el salvador.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%##country##%') ORDER BY Reputation DESC
sede
CREATE TABLE table_name_87 ( label VARCHAR, catalog VARCHAR )
What is the Label of the release with Catalog number LPM-2899?
SELECT label FROM table_name_87 WHERE catalog = "lpm-2899"
sql_create_context
CREATE TABLE table_13643154_2 ( rnd INTEGER, circuit VARCHAR )
What is the most rnd for watkins glen?
SELECT MIN(rnd) FROM table_13643154_2 WHERE circuit = "Watkins Glen"
sql_create_context
CREATE TABLE table_73839 ( "No. in season" real, "No. in series" real, "Title" text, "Canadian airdate" text, "US airdate" text, "Production code" real )
How many titles had production code 1040?
SELECT COUNT("Title") FROM table_73839 WHERE "Production code" = '1040'
wikisql
CREATE TABLE table_50991 ( "Heat" real, "Lane" real, "Name" text, "Country" text, "Mark" text )
What is the highest lane value for a mark of 2:02.27 NR, with heats under 2?
SELECT MAX("Lane") FROM table_50991 WHERE "Mark" = '2:02.27 nr' AND "Heat" < '2'
wikisql
CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text )
What are the names of climbers and the corresponding heights of the mountains that they climb Show bar chart, display from low to high by the bars please.
SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Name
nvbench
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime t...
what is patient 22648's minimum value of urea nitrogen, urine in this month?
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22648) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'urea nitrogen, urine') AND DATETIME(labevents.charttime, 'start of month') ...
mimic_iii
CREATE TABLE table_28190363_1 ( network VARCHAR, judges VARCHAR )
How many networks are there that include the judges pete goffe-wood andrew atkinson benny masekwameng?
SELECT COUNT(network) FROM table_28190363_1 WHERE judges = "Pete Goffe-Wood Andrew Atkinson Benny Masekwameng"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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 numbe...
when did it last happen on the current icu visit that the heart rate of patient 18866 was less than 97.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 = 18866) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WH...
mimic_iii
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 primary disease is sdh and hospital stay is above 10 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SDH" AND demographic.days_stay > "10"
mimicsql_data
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
DB2 tag - monthly totals.
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
sede
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 patient ( uniquep...
what are three most frequent medications prescribed during the same hospital visit to the syringomyelia female patients of age 60 or above after they have been diagnosed with syringomyelia?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'syringomyelia')...
eicu
CREATE TABLE table_23289 ( "Draw" real, "Artist" text, "Song" text, "Jury votes" real, "Televotes" real, "Total votes" real, "Result" text )
How many televotes are there where there is 4 jury votes?
SELECT "Televotes" FROM table_23289 WHERE "Jury votes" = '4'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id nu...
Answer score as a function of question score. Plots average answer score, +/- 1 standard deviation, as a function of binned question score.. Plots average answer score, +/- 1 standard deviation, as a function of binned question score. Increase the Q.Score cutoff to see more exaggerated but noisier trends.
SELECT AVG(Q.Score) AS QuestionScore, AVG(A.Score) AS AnswerScore, AVG(A.Score) + STDEV(A.Score) AS PlusOneSigma, AVG(A.Score) - STDEV(A.Score) AS MinusOneSigma FROM Posts AS A INNER JOIN Posts AS Q ON A.ParentId = Q.Id WHERE A.PostTypeId = 2 AND Q.Score <= 100 GROUP BY SIGN(Q.Score) * ROUND(SQRT(ABS(Q.Score) * 10), 0)...
sede
CREATE TABLE table_73493 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
Name the total number of opponent in the final for 6 2, 6 1, 6 3
SELECT COUNT("Opponent in the final") FROM table_73493 WHERE "Score in the final" = '6–2, 6–1, 6–3'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what were the differences in arterial bp [systolic] of patient 28443 last measured on the current intensive care unit visit compared to the value second to last measured on the current 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 = 28443) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i...
mimic_iii
CREATE TABLE table_name_58 ( location VARCHAR, date VARCHAR )
what is the location on november 23?
SELECT location FROM table_name_58 WHERE date = "november 23"
sql_create_context
CREATE TABLE table_56668 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
Which finish has a 99.550 Qual?
SELECT "Finish" FROM table_56668 WHERE "Qual" = '99.550'
wikisql
CREATE TABLE table_12574 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
What is the date when France is the opposing team?
SELECT "Date" FROM table_12574 WHERE "Opposing Teams" = 'france'
wikisql
CREATE TABLE table_name_70 ( rating VARCHAR, share VARCHAR, viewers__millions_ VARCHAR )
WHAT IS THE RATING THAT HAD A SHARE SMALLER THAN 4, AND 2.47 MILLION VIEWERS?
SELECT COUNT(rating) FROM table_name_70 WHERE share < 4 AND viewers__millions_ > 2.47
sql_create_context
CREATE TABLE table_204_123 ( id number, "week" number, "date" text, "kickoff" text, "opponent" text, "results\nfinal score" text, "results\nteam record" text, "game site" text, "attendance" number )
which week has the same kickoff time as week 6 ?
SELECT "week" FROM table_204_123 WHERE "week" <> 6 AND "kickoff" = (SELECT "kickoff" FROM table_204_123 WHERE "week" = 6)
squall
CREATE TABLE table_28400 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Founding Religious Affiliation" text, "Enrollment" real, "Joined" real )
When did the institution located in Lewiston, Maine join the conference?
SELECT "Joined" FROM table_28400 WHERE "Location" = 'Lewiston, Maine'
wikisql
CREATE TABLE table_7326 ( "Country or region" text, "Number of mobile phones" text, "Population" text, "# of phones as % of population" real, "Last updated date" text )
How many people live where there are 118% of people have phones?
SELECT "Population" FROM table_7326 WHERE "# of phones as % of population" = '118'
wikisql
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
get last flight from OAKLAND to SALT LAKE CITY on wednesday
SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias1.days_code FROM days AS DAYSalias1 WHERE DAYSalias1.day_name IN (SELECT DATE_DAYalias1.day_name FROM date_day AS DATE_DAYalias1 WHERE DATE_DAYalias1.day_number = 23 AND DATE_DAYalias1.month_number = 4 AND DATE_DAYalias1.year = 1991)) AND to...
atis
CREATE TABLE table_54949 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Year made" text, "Quantity made" text, "Quantity preserved" text, "Year(s) withdrawn" text )
What is the class of the locomotive with an Eastleigh Works manufacturer, made in 1914, and withdrawn in 1959?
SELECT "Class" FROM table_54949 WHERE "Manufacturer" = 'eastleigh works' AND "Year made" = '1914' AND "Year(s) withdrawn" = '1959'
wikisql
CREATE TABLE table_65623 ( "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text )
What date was the circuit, snetterton, when riki christodoulou had the fastest lap?
SELECT "Date" FROM table_65623 WHERE "Circuit" = 'snetterton' AND "Fastest Lap" = 'riki christodoulou'
wikisql
CREATE TABLE table_name_5 ( laps VARCHAR, driver VARCHAR )
what is the number of laps when the driver is ron flockhart?
SELECT COUNT(laps) FROM table_name_5 WHERE driver = "ron flockhart"
sql_create_context
CREATE TABLE table_12962773_2 ( no VARCHAR, current_club VARCHAR )
What are the numbers of the players currently playing for Ironi Nahariya?
SELECT no FROM table_12962773_2 WHERE current_club = "Ironi Nahariya"
sql_create_context
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...
what is the number of patients whose year of birth is less than 2117 and item id is 51176?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2117" AND lab.itemid = "51176"
mimicsql_data
CREATE TABLE table_1965650_11 ( nhl_team VARCHAR, college_junior_club_team VARCHAR )
What NHL team was the player from Calgary Centennials (WCHL) drafted for?
SELECT nhl_team FROM table_1965650_11 WHERE college_junior_club_team = "Calgary Centennials (WCHL)"
sql_create_context
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, ...
门诊就诊15752379757的患者体征在几号记录的?
SELECT wdmzjzjlb.JLSJ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '15752379757' UNION SELECT bdmzjzjlb.JLSJ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '15752379757'
css
CREATE TABLE table_43300 ( "Name" text, "Years" text, "League a" text, "FA Cup" text, "League Cup" text, "Other b" text, "Total" text )
What shows for the League when the FA Cup is 6 (20)?
SELECT "League a" FROM table_43300 WHERE "FA Cup" = '6 (20)'
wikisql
CREATE TABLE table_20335 ( "Season #" real, "Series #" real, "Title" text, "Director(s)" text, "Writer(s)" text, "Original airdate" text )
Name the most series number for giula sandler
SELECT MAX("Series #") FROM table_20335 WHERE "Writer(s)" = 'Giula Sandler'
wikisql
CREATE TABLE table_73842 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Which episode had 2.75 million viewers in the U.S.?
SELECT "Title" FROM table_73842 WHERE "U.S. viewers (million)" = '2.75'
wikisql
CREATE TABLE table_2417330_3 ( date_of_successors_formal_installation VARCHAR, successor VARCHAR )
When did Orville H. Browning (r) succeed?
SELECT date_of_successors_formal_installation FROM table_2417330_3 WHERE successor = "Orville H. Browning (R)"
sql_create_context
CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code ...
Show me a bar chart that bin all date of transactions into the weekday interval and the y-axis is their total number, and order by the y-axis in desc.
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions ORDER BY COUNT(date_of_transaction) DESC
nvbench
CREATE TABLE table_80432 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
How many tries against did the club with 1 drawn and 41 points have?
SELECT "Tries against" FROM table_80432 WHERE "Drawn" = '1' AND "Points" = '41'
wikisql
CREATE TABLE table_44336 ( "Edition" text, "Round" text, "Date" text, "Partnering" text, "Against" text, "Surface" text, "Opponents" text, "Result" text )
Who were the opponents during the 2006 fed cup europe/africa group ii against greece?
SELECT "Opponents" FROM table_44336 WHERE "Edition" = '2006 fed cup europe/africa group ii' AND "Against" = 'greece'
wikisql
CREATE TABLE table_79567 ( "Rank" real, "Athletes" text, "Country" text, "Time" text, "Notes" text )
What are the notes for the athlete from Spain?
SELECT "Notes" FROM table_79567 WHERE "Country" = 'spain'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, a...
patient 15794 had any e24 with bp ng during this month?
SELECT COUNT(*) > 0 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 = 15794)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'e24 with...
mimic_iii
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
what was the last time that patient 027-153669 received a lab test in the last hospital encounter?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-153669' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospital...
eicu
CREATE TABLE table_name_16 ( position INTEGER, bike_no VARCHAR, points VARCHAR )
What is the average Position, when Bike No is greater than 8, and when Points is less than 240?
SELECT AVG(position) FROM table_name_16 WHERE bike_no > 8 AND points < 240
sql_create_context
CREATE TABLE table_15977768_1 ( centennial VARCHAR, information VARCHAR )
Name the centennial for location
SELECT centennial FROM table_15977768_1 WHERE information = "Location"
sql_create_context
CREATE TABLE table_17235 ( "Disc" real, "Track" real, "English title" text, "Japanese title" text, "R\u014dmaji title" text, "Artist" text, "Track time" text )
How long is track number 8?
SELECT "Track time" FROM table_17235 WHERE "Track" = '8'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, ...
when this month patient 016-9636 received the sodium test for the last time?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636')) AND lab.labname = 'sodium' AND DATETIME(lab.labresulttime, 'start of mo...
eicu
CREATE TABLE table_name_39 ( rank VARCHAR, notes VARCHAR, name VARCHAR )
What's the rank for Daewoo Business Center when the notes are cancelled?
SELECT rank FROM table_name_39 WHERE notes = "cancelled" AND name = "daewoo business center"
sql_create_context
CREATE TABLE table_name_18 ( year VARCHAR, rank INTEGER )
What year ranked larger than 5?
SELECT year FROM table_name_18 WHERE rank > 5
sql_create_context
CREATE TABLE documents ( document_id number, document_type_code text, project_id number, document_date time, document_name text, document_description text, other_details text ) CREATE TABLE documents_with_expenses ( document_id number, budget_type_code text, document_details tex...
How many documents correspond with each project id?
SELECT project_id, COUNT(*) FROM documents GROUP BY project_id
spider
CREATE TABLE table_7096 ( "million CZK" text, "2005" text, "2006" real, "2007" real, "2008" real, "2009" real )
What is the sum of 2007 when the 2009 is less than 7,006, and a 2008 larger than 2,226?
SELECT SUM("2007") FROM table_7096 WHERE "2009" < '7,006' AND "2008" > '2,226'
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 had the diagnosis icd9 code e8859 and drug type addictive?
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 = "E8859" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewRejectionReasons ( Id number, N...
Which Tags are most popular in Posts.
SELECT t.TagName, t.Count FROM Tags AS t ORDER BY t.Count DESC
sede
CREATE TABLE table_37731 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the record after the game in which Rosales (1-1) took the loss?
SELECT "Record" FROM table_37731 WHERE "Loss" = 'rosales (1-1)'
wikisql
CREATE TABLE table_37595 ( "Rank" real, "Club" text, "Wins" real, "Last win" real, "Runner-up" real, "Last losing final" text )
How many Last wins have a Club of mansfield town, and Wins smaller than 1?
SELECT COUNT("Last win") FROM table_37595 WHERE "Club" = 'mansfield town' AND "Wins" < '1'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate ti...
for patients who were diagnosed until 2 years ago with hx-ven thrombosis/embols, what were the top five most common procedures that followed within 2 months?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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 = admissi...
mimic_iii
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total...
Is GREEK 441 section 825 provided in the Winter 2007 semester ?
SELECT COUNT(*) > 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.section_number = 825 AND course.department = 'GREEK' AND course.number = 441 AND semester.semester = 'Winter' AND semest...
advising
CREATE TABLE PersonFriend ( name VARCHAR, friend VARCHAR ) CREATE TABLE Person ( name VARCHAR, age INTEGER )
Find the name of the person who has friends with age above 40 and under age 30?
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)
sql_create_context
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...
查一下患者53607326踝部检验的各项指标结果
SELECT * FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE table_name_29 ( goals INTEGER, games VARCHAR, debut_year VARCHAR, player VARCHAR )
What are the most goals listed when Jack Trehey was the player, with the listed debut year of 1902, games less than 1?
SELECT MAX(goals) FROM table_name_29 WHERE debut_year = 1902 AND player = "jack trehey" AND games < 1
sql_create_context
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id num...
Questions counted by time to first answer (w/o 24 hr restriction).
SELECT LOG(10, CAST((JULIANDAY(CreationDate) - JULIANDAY(q.CreationDate)) * 1440.0 AS INT)) AS "Log Time (m)", LOG(10, COUNT(*)) FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id LEFT OUTER JOIN Posts AS a2 ON a.ParentId = a2.ParentId AND a.CreationDate > a2.CreationDate WHERE a2.Id IS NULL AND a.CreationDate ...
sede
CREATE TABLE table_25946 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real )
How many opponents were there with the record of 3-2-2?
SELECT COUNT("Opponent") FROM table_25946 WHERE "Record" = '3-2-2'
wikisql
CREATE TABLE table_name_51 ( record VARCHAR, attendance VARCHAR )
Which record has 64,053 as the attendance?
SELECT record FROM table_name_51 WHERE attendance = "64,053"
sql_create_context
CREATE TABLE table_name_75 ( venue VARCHAR, rank VARCHAR )
What venue has 2 as the rank?
SELECT venue FROM table_name_75 WHERE rank = "2"
sql_create_context
CREATE TABLE table_64326 ( "Season" text, "Date" text, "Venue" text, "Competition" text, "Score" text, "Attendance" real, "Report" text )
How many people attended the Scottish Cup on 29.02.2000?
SELECT "Attendance" FROM table_64326 WHERE "Competition" = 'scottish cup' AND "Date" = '29.02.2000'
wikisql
CREATE TABLE table_26060884_2 ( burglary INTEGER, property_crimes VARCHAR )
What was the maximum burglary statistics if the property crimes is 168630?
SELECT MAX(burglary) FROM table_26060884_2 WHERE property_crimes = 168630
sql_create_context
CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) ) CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) ) CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), su...
Give the proportion of what is the average price for each type of product?
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code
nvbench
CREATE TABLE table_train_186 ( "id" int, "language" string, "diabetic" string, "regular_alcohol_intake" int, "allergy_to_drug" bool, "alcohol_abuse" bool, "age" float, "NOUSE" float )
current drug or alcohol abuse ( regular alcohol intake > 14 units / week )
SELECT * FROM table_train_186 WHERE alcohol_abuse = 1 OR regular_alcohol_intake > 14
criteria2sql
CREATE TABLE journal_committee ( editor_id number, journal_id number, work_type text ) CREATE TABLE journal ( journal_id number, date text, theme text, sales number ) CREATE TABLE editor ( editor_id number, name text, age number )
List the names of editors that are not on any journal committee.
SELECT name FROM editor WHERE NOT editor_id IN (SELECT editor_id FROM journal_committee)
spider
CREATE TABLE musical ( Name VARCHAR, Musical_ID VARCHAR ) CREATE TABLE actor ( Musical_ID VARCHAR )
Show names of musicals which have at least three actors.
SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*) >= 3
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
give me the number of patients whose drug type is main and lab test name is glucose, body fluid?
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.drug_type = "MAIN" AND lab.label = "Glucose, Body Fluid"
mimicsql_data