context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 insurance is private and procedure short title is remov biliary/liver tube?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Remov biliary/liver tube"
mimicsql_data
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id num...
Comments moved to chat in the last 90 days.
SELECT COUNT(*) AS threads FROM Comments WHERE Text LIKE 'Comments are not for extended discussion%' AND CreationDate > CURRENT_TIMESTAMP() - '##days?90##'
sede
CREATE TABLE player_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first text ) CREATE TABLE player ( player_id text, birth_year text, birth_month text, birth_day text, birth_country text, birth_st...
How much points were received by the NL league's most valuable player winner in 1990?
SELECT T2.points_won FROM player_award AS T1 JOIN player_award_vote AS T2 ON T1.player_id = T2.player_id WHERE T1.league_id = "NL" AND T1.award_id = "Most Valuable Player" AND T1.year = "1990" AND T2.league_id = "NL" AND T2.year = "1990"
thehistoryofbaseball
CREATE TABLE table_9154 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the Place of the Player with a To par of +4 and Score of 70-76-71=217?
SELECT "Place" FROM table_9154 WHERE "To par" = '+4' AND "Score" = '70-76-71=217'
wikisql
CREATE TABLE table_name_75 ( position VARCHAR, nationality VARCHAR, player VARCHAR )
What position did Jimmy Oliver of the United States play?
SELECT position FROM table_name_75 WHERE nationality = "united states" AND player = "jimmy oliver"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) 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, ...
what was the first time that patient 95986 had the maximum value of metamyelocytes in 05/2105?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95986) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'metamyelocytes') AND STRFTIME('%y-%m', labevents.charttime) = '2105-05' ORDER B...
mimic_iii
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...
参保人水建茗10元以内小金额结算次数有多少,时间是在13年3月5日到16年1月7日内
SELECT COUNT(*) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '水建茗' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2013-03-05' AND '2016-01-07' AND t_kc24.MED_AMOUT <= 10
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
have patient 012-40970's been normal until 56 months ago in respiration?
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-40970')) AND vitalperiodic.respiration BETWEEN respiration_lower...
eicu
CREATE TABLE table_name_93 ( winning_score VARCHAR, margin_of_victory VARCHAR, tournament VARCHAR )
What is the winning score with a margin of victory of 4 strokes for the NEC Invitational tournament?
SELECT winning_score FROM table_name_93 WHERE margin_of_victory = "4 strokes" AND tournament = "nec invitational"
sql_create_context
CREATE TABLE table_10308 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What date was the game played at Princes Park?
SELECT "Date" FROM table_10308 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE table_23963781_3 ( position VARCHAR, nationality VARCHAR, minutes VARCHAR )
What is the position of the player who is from the United States and has 30 minutes?
SELECT position FROM table_23963781_3 WHERE nationality = "United States" AND minutes = 30
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Po...
Closed Questions with -2 score or less..
SELECT q.Score AS Score, q.Id AS "post_link", CASE h.Comment WHEN '1' THEN 'Exact Duplicate' WHEN '2' THEN 'Off-topic' WHEN '3' THEN 'Subjective and argumentative' WHEN '4' THEN 'Not a real question' WHEN '7' THEN 'Too localized' WHEN '10' THEN 'General reference' WHEN '20' THEN 'Noise or pointless (Meta sites only)' W...
sede
CREATE TABLE table_204_823 ( id number, "dates" text, "location" text, "attendance" text, "official guests" text, "notes" text )
what was the first year the event was held at the pick congress hotel in chicago ?
SELECT MIN("dates") FROM table_204_823 WHERE "location" = 'chicago'
squall
CREATE TABLE table_name_72 ( theme VARCHAR, issue_price VARCHAR )
What was the theme when the issue price was $508.95?
SELECT theme FROM table_name_72 WHERE issue_price = "$508.95"
sql_create_context
CREATE TABLE table_16893837_4 ( date VARCHAR, opponents VARCHAR )
Name the date for margalita chakhnashvili salome devidze
SELECT date FROM table_16893837_4 WHERE opponents = "Margalita Chakhnashvili Salome Devidze"
sql_create_context
CREATE TABLE table_71410 ( "Week" real, "Date" text, "Opponent" text, "Score" text, "Result" text, "Attendance" text, "Record" text )
What is the record of the opponent that has a bye?
SELECT "Record" FROM table_71410 WHERE "Opponent" = 'bye'
wikisql
CREATE TABLE table_name_37 ( laps VARCHAR, time_retired VARCHAR )
How many laps are associated with a time of + 1:39.591?
SELECT laps FROM table_name_37 WHERE time_retired = "+ 1:39.591"
sql_create_context
CREATE TABLE table_36610 ( "Weight Division" text, "Winner" text, "Loser" text, "Method" text, "Round" real, "Time" text )
Who was the loser of the heavyweight division fight that lasted a time of 2:24?
SELECT "Loser" FROM table_36610 WHERE "Weight Division" = 'heavyweight' AND "Time" = '2:24'
wikisql
CREATE TABLE table_48606 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real )
What score did Ed Furgol get to come in at T6?
SELECT "Score" FROM table_48606 WHERE "Place" = 't6' AND "Player" = 'ed furgol'
wikisql
CREATE TABLE table_name_61 ( season VARCHAR, team VARCHAR, wins VARCHAR, losses VARCHAR )
Which season had 0 wins and 5 losses for the Surrey team?
SELECT season FROM table_name_61 WHERE wins = "0" AND losses = "5" AND team = "surrey"
sql_create_context
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 demographic ( subject_id text, hadm_id t...
get me the number of patients diagnosed with diverticulosis of colon with hemorrhage who had blood fluid lab test.
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 = "Diverticulosis of colon with hemorrhage" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_58261 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the home team score at VFL Park?
SELECT "Home team score" FROM table_58261 WHERE "Venue" = 'vfl park'
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 patient ( uniquep...
what was the first value of the sao2 of patient 030-8973 on 12/28/2104?
SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-8973')) AND NOT vitalperiodic.sao2 IS NULL AND STRFTIME('%...
eicu
CREATE TABLE table_2012187_1 ( wins VARCHAR, top_10 VARCHAR )
state the wins of the team with 2 top 10
SELECT COUNT(wins) FROM table_2012187_1 WHERE top_10 = 2
sql_create_context
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, ...
what is the number of patients whose primary disease is hypertension;rule out coronary artery disease\cardiac cath and procedure icd9 code is 7761?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" AND procedures.icd9_code = "7761"
mimicsql_data
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
count the number of times that since 961 days ago patient 015-56556 had taken total.
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-56556')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce...
eicu
CREATE TABLE shop ( shop_id number, shop_name text, location text, open_date text, open_year number ) CREATE TABLE device ( device_id number, device text, carrier text, package_version text, applications text, software_platform text ) CREATE TABLE stock ( shop_id number...
Return the names and locations of shops, ordered by name in alphabetical order.
SELECT shop_name, location FROM shop ORDER BY shop_name
spider
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 dual_carrier...
i need a flight from NEW YORK to MONTREAL THURSDAY 5 24 arriving before 1200
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 AS DAYS_0, days AS DAYS_1, flight WHERE (((DAYS_1.day_name = 'THURSDAY' AND flight.arrival_time <= 1200 AND flight.flight_days = DAYS_1.days_code) AND date_day...
atis
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city v...
For CS majors what are the upper level electives offered ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_52025 ( "Stadium" text, "Capacity" real, "City" text, "Club" text, "Opening" real )
What is the average opening at Stadyum Samsun with a capacity smaller than 34,658?
SELECT AVG("Opening") FROM table_52025 WHERE "Stadium" = 'stadyum samsun' AND "Capacity" < '34,658'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(2...
For all employees who have the letters D or S in their first name, a line chart shows the trend of department_id over hire_date .
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what is the total 1/2ns ivf consumption amount that patient 015-96048 has received on 10/01/last year?
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-96048')) AND intakeoutput.celllabel = '1/2ns...
eicu
CREATE TABLE table_50331 ( "Year ended" text, "Revenue (\u00a3million)" real, "Profit/(loss) before tax (\u00a3m)" real, "Net profit (\u00a3m)" real, "Earnings per share (p)" real )
What is the total net profit when earnings per share is 27.4, and profit/loss befor tax was smaller than 194.6 million?
SELECT SUM("Net profit (\u00a3m)") FROM table_50331 WHERE "Earnings per share (p)" = '27.4' AND "Profit/(loss) before tax (\u00a3m)" < '194.6'
wikisql
CREATE TABLE table_name_37 ( bodyweight INTEGER, total__kg_ VARCHAR, clean_ VARCHAR, _jerk VARCHAR )
What is the highest Bodyweight associated with a Clean & jerk larger than 120, and a Total (kg) of 245?
SELECT MAX(bodyweight) FROM table_name_37 WHERE clean_ & _jerk > 120 AND total__kg_ = 245
sql_create_context
CREATE TABLE table_name_10 ( week INTEGER, game_site VARCHAR )
What is the earliest week that the Texans played at the Cleveland Browns Stadium?
SELECT MIN(week) FROM table_name_10 WHERE game_site = "cleveland browns stadium"
sql_create_context
CREATE TABLE table_name_8 ( fa_trophy INTEGER, club VARCHAR, play_offs VARCHAR )
Which of the lowest FA Trophys involved the Forest Green Rovers club when the play-offs number was bigger than 0?
SELECT MIN(fa_trophy) FROM table_name_8 WHERE club = "forest green rovers" AND play_offs > 0
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
how many patients in 2103 were staying at careunit tsicu?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'tsicu' AND STRFTIME('%y', transfers.intime) = '2103')
mimic_iii
CREATE TABLE seasons ( year INTEGER, url TEXT ) CREATE TABLE driverStandings ( driverStandingsId INTEGER, raceId INTEGER, driverId INTEGER, points REAL, position INTEGER, positionText TEXT, wins INTEGER ) CREATE TABLE constructorStandings ( constructorStandingsId INTEGER, r...
What are the names of all the Japanese constructors that have earned more than 5 points, and count them by a bar chart
SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name
nvbench
CREATE TABLE table_24575253_4 ( division_three VARCHAR, division_two VARCHAR )
When westcott 1935 is in division two how many leagues are in division three?
SELECT COUNT(division_three) FROM table_24575253_4 WHERE division_two = "Westcott 1935"
sql_create_context
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
Draw a bar chart about the distribution of name and ID , and I want to display x-axis in ascending order please.
SELECT name, ID FROM swimmer ORDER BY name
nvbench
CREATE TABLE table_12170 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Partner Aurelija Misevi i t had an outcome of runner-up in what tournament?
SELECT "Tournament" FROM table_12170 WHERE "Outcome" = 'runner-up' AND "Partner" = 'aurelija misevičiūtė'
wikisql
CREATE TABLE table_name_11 ( crowd INTEGER, venue VARCHAR )
What was the attendance when VFL played MCG?
SELECT MAX(crowd) FROM table_name_11 WHERE venue = "mcg"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TAB...
what was the 'output' patient 013-38992 got on the current intensive care unit visit for the first time?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-38992') AND patient.unitdischargetime IS NULL) AND intak...
eicu
CREATE TABLE table_name_58 ( city VARCHAR, country VARCHAR, airport VARCHAR )
What is the city in India with an airport named Sardar Vallabhbhai Patel International Airport?
SELECT city FROM table_name_58 WHERE country = "india" AND airport = "sardar vallabhbhai patel international airport"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about department_id over the email , and order from low to high by the y-axis please.
SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID
nvbench
CREATE TABLE table_50097 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text )
What nationality is Kentucky and the player Tayshaun Prince?
SELECT "Nationality" FROM table_50097 WHERE "School/Club Team" = 'kentucky' AND "Player" = 'tayshaun prince'
wikisql
CREATE TABLE table_name_50 ( grid INTEGER, time_retired VARCHAR )
What was the highest grid for a time/retired of +19.1 secs?
SELECT MAX(grid) FROM table_name_50 WHERE time_retired = "+19.1 secs"
sql_create_context
CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, date_joined_staff time, date_left_staff time ) CREATE TABLE vehicles ( vehicle_id number, vehicle_details text ) CREATE TABLE...
How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed?
SELECT COUNT(*) FROM lessons AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin" AND T1.lesson_status_code = "Completed"
spider
CREATE TABLE table_204_832 ( id number, "name" text, "nationality" text, "club" text, "from" number, "until" text )
marc dos santos started as coach the same year as what other coach ?
SELECT "name" FROM table_204_832 WHERE "name" <> 'marc dos santos' AND "from" = (SELECT "from" FROM table_204_832 WHERE "name" = 'marc dos santos')
squall
CREATE TABLE table_20014 ( "Position" real, "Team" text, "Points" real, "Played" real, "Won" real, "Drawn" real, "Lost" real, "For" real, "Against" real, "Difference" text )
Name the most losst for corinthians
SELECT MIN("Lost") FROM table_20014 WHERE "Team" = 'Corinthians'
wikisql
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank i...
tell me about flights from SALT LAKE CITY to ST. PETERSBURG
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 = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
看看09年7月25号到17年3月26号8275886这个医疗机构的新生儿门诊的就诊记录
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '8275886' AND mzjzjlb.JZKSRQ BETWEEN '2009-07-25' AND '2017-03-26' AND mzjzjlb.ZSEBZ > 0
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
what is the difference between patient 016-18575's sao2 second measured on the current icu visit compared to the first value measured on the current icu visit?
SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18575') AND patient.unitdischargetime IS NULL) AND...
eicu
CREATE TABLE products ( product_id number, product_name text, product_price number, product_description text ) CREATE TABLE customer_addresses ( customer_id number, address_id number, date_from time, address_type text, date_to time ) CREATE TABLE order_deliveries ( location_cod...
Find the name of the first 5 customers.
SELECT customer_name FROM customers ORDER BY date_became_customer LIMIT 5
spider
CREATE TABLE table_80371 ( "2002/ 03" text, "2004/ 05" text, "2006/ 07" text, "2007/ 08" text, "2008/ 09" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text )
Name the 2008/09 with 2004/05 of ranking tournaments
SELECT "2008/ 09" FROM table_80371 WHERE "2004/ 05" = 'ranking tournaments'
wikisql
CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE...
How many papers in 1986
SELECT DISTINCT COUNT(1) FROM paper WHERE year = 1986
scholar
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight in...
does flight DL 323 / DL 229 from BOSTON to DENVER stop in PHILADELPHIA
SELECT DISTINCT flight_stop.flight_id, flight_stop.stop_number FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_leg, flight_stop WHERE ((FLIGHT_1.flight_nu...
atis
CREATE TABLE table_49385 ( "Missouri vs." text, "Overall Record" text, "at Columbia" text, "at Opponent's Venue" text, "at Neutral Site" text, "Last 5 Meetings" text, "Last 10 Meetings" text, "Current Streak" text )
What were the last 10 meetings when the opponent's venue was mu, 11-7?
SELECT "Last 10 Meetings" FROM table_49385 WHERE "at Opponent's Venue" = 'mu, 11-7'
wikisql
CREATE TABLE table_name_65 ( set_5 VARCHAR, date VARCHAR, set_4 VARCHAR )
What is the set 5 if the Date is jun 7, and a Set 4 is 21-25?
SELECT set_5 FROM table_name_65 WHERE date = "jun 7" AND set_4 = "21-25"
sql_create_context
CREATE TABLE table_1893276_2 ( finish VARCHAR, eliminated VARCHAR )
When jim is eliminated what is the finish?
SELECT finish FROM table_1893276_2 WHERE eliminated = "Jim"
sql_create_context
CREATE TABLE table_203_223 ( id number, "name" text, "gauge" text, "builder" text, "type" text, "date" number, "works number" number, "notes" text )
based on the table , which locomotive was built first ?
SELECT "name" FROM table_203_223 ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_name_9 ( catalog VARCHAR, date VARCHAR )
What is the Catalog with a Date that is march 13, 2002?
SELECT catalog FROM table_name_9 WHERE date = "march 13, 2002"
sql_create_context
CREATE TABLE table_38720 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the average week of a game with a result of l 10-7 attended by 37,500?
SELECT AVG("Week") FROM table_38720 WHERE "Result" = 'l 10-7' AND "Attendance" < '37,500'
wikisql
CREATE TABLE table_25247 ( "Year" text, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" real, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text )
How many years was Pontiac the manufacturer for Joe Gibbs Racing?
SELECT COUNT("Year") FROM table_25247 WHERE "Team" = 'Joe Gibbs Racing' AND "Manufacturer" = 'Pontiac'
wikisql
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Courses ( course_id INTEGER, author_...
Find the dates of the tests taken with result 'Pass', and count them by a bar chart, and list in descending by the y-axis.
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" ORDER BY COUNT(date_test_taken) DESC
nvbench
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar...
Can 182 be taken by undergrads ?
SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 182
advising
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,...
项目编号为46663891790在医疗就诊22050027313里面费用明细的处方号和处方流水号分别是什么?
SELECT t_kc22.PRESCRIPTION_CODE, t_kc22.PRESCRIPTION_ID FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '46663891790'
css
CREATE TABLE mzb ( 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...
查询3252243医院的科室小儿头颈肿瘤科的医疗费总额,时间范围是零五年八月九日到零五年十二月三十日
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '3252243' AND qtb.MED_ORG_DEPT_NM = '小儿头颈肿瘤科' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '3252243' AND gyb.MED_ORG_DEPT_NM = '小儿头颈肿瘤科' UNION SELECT zyb.MED_CLINIC_...
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 demographic (...
what is the discharge time for the patient id 65759?
SELECT demographic.dischtime FROM demographic WHERE demographic.subject_id = "65759"
mimicsql_data
CREATE TABLE table_17325580_6 ( game VARCHAR, date VARCHAR )
How many games occur on the date December 12?
SELECT COUNT(game) FROM table_17325580_6 WHERE date = "December 12"
sql_create_context
CREATE TABLE table_2772 ( "Episode" text, "Location" text, "Headliner" text, "Comedians" text, "Airdate" text )
Who were the comedians on episode 1x03?
SELECT "Comedians" FROM table_2772 WHERE "Episode" = '1x03'
wikisql
CREATE TABLE table_19161046_1 ( bus_width___bit__ VARCHAR, core___mhz__ VARCHAR )
What's the bus width (in bit) of the model whose core is 650 MHz?
SELECT COUNT(bus_width___bit__) FROM table_19161046_1 WHERE core___mhz__ = 650
sql_create_context
CREATE TABLE table_204_350 ( id number, "date" text, "opponents" text, "venue" text, "result" text, "scorers" text, "attendance" number, "report 1" text, "report 2" text )
what was the result of the game before the game of march 9 , 1968 ?
SELECT "result" FROM table_204_350 WHERE "date" < (SELECT "date" FROM table_204_350 WHERE "date" = '09-mar-68') ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_28688313_1 ( written_by VARCHAR, us_viewers__in_millions_ VARCHAR )
Who wrote the episode with 7.52 million US viewers?
SELECT written_by FROM table_28688313_1 WHERE us_viewers__in_millions_ = "7.52"
sql_create_context
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 demographic (...
how many patients admitted before 2162 had procedure title int insert dual- cham dev?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2162" AND procedures.short_title = "Int insert dual-cham dev"
mimicsql_data
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 )
What is the total revenue of each manufacturer, and show by the total number of revenue in asc.
SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY SUM(Revenue)
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
how many patients whose gender is f and admission year is less than 2200?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admityear < "2200"
mimicsql_data
CREATE TABLE table_44644 ( "Election" real, "Number of PNC votes" text, "Share of votes" text, "Seats" text, "Outcome of election" text )
How many seats did the election before 2004 with 3.4% share of votes have?
SELECT "Seats" FROM table_44644 WHERE "Election" < '2004' AND "Share of votes" = '3.4%'
wikisql
CREATE TABLE table_test_8 ( "id" int, "anemia" bool, "intra_aortic_balloon_pump_iabp" bool, "systolic_blood_pressure_sbp" int, "intravenous_pressors" bool, "fever" bool, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "vasopressors" bool, "renal_disease" bool, "temperatur...
known calculated creatinine clearance < 30 ml / min, hemoglobin < 10 g / dl or platelet count < 150000 for the present admission
SELECT * FROM table_test_8 WHERE creatinine_clearance_cl < 30 OR hemoglobin_a1c_hba1c < 10 OR platelet_count < 150000
criteria2sql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( ro...
count how many times patient 72198 have had a pacu out pacu urine output on the last intensive care unit visit.
SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72198) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND outputevents.itemid IN (SELEC...
mimic_iii
CREATE TABLE table_204_832 ( id number, "name" text, "nationality" text, "club" text, "from" number, "until" text )
how long did colin clarke coach the puerto rico islanders ?
SELECT "until" - "from" FROM table_204_832 WHERE "name" = 'colin clarke' AND "club" = 'puerto rico islanders'
squall
CREATE TABLE table_13972 ( "Draw" real, "Artist" text, "Song" text, "Result" text, "Place" real )
What's the draw having the result of 10%?
SELECT AVG("Draw") FROM table_13972 WHERE "Result" = '10%'
wikisql
CREATE TABLE table_name_49 ( to_par VARCHAR, score VARCHAR )
What was the to par score in the match that had a score of 76-71-78-67=292?
SELECT COUNT(to_par) FROM table_name_49 WHERE score = 76 - 71 - 78 - 67 = 292
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
What is the total number of patients from hispanic/latino - puertorican ethnic origin who were born before 2107.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.dob_year < "2107"
mimicsql_data
CREATE TABLE table_1601027_1 ( headphone_class VARCHAR, us_msrp VARCHAR )
How many headphone classes have a US MSRP of $150?
SELECT COUNT(headphone_class) FROM table_1601027_1 WHERE us_msrp = "$150"
sql_create_context
CREATE TABLE table_name_24 ( result VARCHAR, field VARCHAR, date VARCHAR )
What is the result of the game at Bishop Kearney Field on August 2?
SELECT result FROM table_name_24 WHERE field = "bishop kearney field" AND date = "august 2"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the sum of salary bin hire_date by time in a bar chart, sort from high to low by the y axis.
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(SALARY) DESC
nvbench
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 procedures ( ...
count the number of patients whose age is less than 68 and procedure icd9 code is 8321?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "68" AND procedures.icd9_code = "8321"
mimicsql_data
CREATE TABLE table_5542 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
Which 2011's tournament was Indian Wells?
SELECT "2011" FROM table_5542 WHERE "Tournament" = 'indian wells'
wikisql
CREATE TABLE table_204_755 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number )
how many wins were before their win on october 26 ?
SELECT COUNT(*) FROM table_204_755 WHERE "result" = 'w' AND "date" < (SELECT "date" FROM table_204_755 WHERE "date" = 'october 26, 1978')
squall
CREATE TABLE table_62086 ( "Device" text, "Carrier" text, "Package Version" text, "Applications" text, "Software Platform" text )
WHAT IS THE PACKAGE VERSION FOR blackberry storm 9530, APPLICATION 5.0.0.419, AND MTS MOBILITY?
SELECT "Package Version" FROM table_62086 WHERE "Device" = 'blackberry storm 9530' AND "Applications" = '5.0.0.419' AND "Carrier" = 'mts mobility'
wikisql
CREATE TABLE table_8524 ( "Player" text, "Position" text, "Premier League" real, "FA Cup" real, "League Cup" real, "UEFA Cup" real, "Total" real )
What is the lowest FA Cup when the league cup is 1, and the total is more than 23?
SELECT MIN("FA Cup") FROM table_8524 WHERE "League Cup" = '1' AND "Total" > '23'
wikisql
CREATE TABLE table_55040 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
On what Date did the Away team essendon play?
SELECT "Date" FROM table_55040 WHERE "Away team" = 'essendon'
wikisql
CREATE TABLE table_41318 ( "Medal" text, "Name" text, "Sport" text, "Event" text, "Date" text )
What is the Sport with a Name that is gustav larsson?
SELECT "Sport" FROM table_41318 WHERE "Name" = 'gustav larsson'
wikisql
CREATE TABLE table_name_52 ( position VARCHAR, player VARCHAR, province___club VARCHAR, date_of_birth__age_ VARCHAR )
What is Position, when Province / Club is Example, when Date of Birth (Age) is Example, and when Player is Michael Elumeze?
SELECT position FROM table_name_52 WHERE province___club = "example" AND date_of_birth__age_ = "example" AND player = "michael elumeze"
sql_create_context
CREATE TABLE table_78637 ( "Nat." text, "Name" text, "Since" real, "App(GS/Sub)" text, "Goals" real, "Ends" real, "Transfer fee" text )
When the transfer fee is 8.5m, what is the total ends?
SELECT SUM("Ends") FROM table_78637 WHERE "Transfer fee" = '£8.5m'
wikisql
CREATE TABLE table_name_86 ( home_team VARCHAR, away_team VARCHAR )
Who was the home team that played against Manchester United?
SELECT home_team FROM table_name_86 WHERE away_team = "manchester united"
sql_create_context
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE ...
list all flights from MEMPHIS to SEATTLE
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 = 'SEATTL...
atis
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, Owne...
title with specific unicode character.
SELECT p.Id AS "post_link", p.Score, LENGTH(p.Title) FROM Posts AS p WHERE p.Title LIKE '%' + NCHAR(128505) + '%' COLLATE Latin1_General_BIN
sede
CREATE TABLE table_51296 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What is the pick number of the DB?
SELECT COUNT("Pick #") FROM table_51296 WHERE "Position" = 'db'
wikisql