context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_48532 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text )
What is Part 1, when Part 3 is 'heldu'?
SELECT "Part 1" FROM table_48532 WHERE "Part 3" = 'heldu'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
在2006年5月28日到2010年11月23日之间患者柏蕴秀所有检验结果指标记录的检测人为花嘉淑的检验指标流水号分别是多少?
SELECT jyjgzbb.JYZBLSH 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.JZLSH_MZJZJLB AND jyb...
css
CREATE TABLE table_name_64 ( opponent VARCHAR, date VARCHAR )
Which Opponent is on 17 november 2002?
SELECT opponent FROM table_name_64 WHERE date = "17 november 2002"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID ...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of job_id and the sum of salary , and group by attribute job_id in a bar chart.
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID
nvbench
CREATE TABLE table_44030 ( "Test" text, "Subject" text, "Mean score" text, "Standard deviation" text, "Number of Students" text )
What test had 49,608 students?
SELECT "Test" FROM table_44030 WHERE "Number of Students" = '49,608'
wikisql
CREATE TABLE table_32642 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What day does the away team score 7.8 (50)?
SELECT "Date" FROM table_32642 WHERE "Away team score" = '7.8 (50)'
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...
what is primary disease and procedure short title of subject id 1875?
SELECT demographic.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "1875"
mimicsql_data
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...
was heartrate from patient 029-16737 less than 128.0 during this month?
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 = '029-16737')) AND vitalperiodic.heartrate < 128.0 AND NOT vitalperiod...
eicu
CREATE TABLE table_64498 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" real, "Average Ratings" text )
what is the tv station when the average ratings is 19.5%?
SELECT "TV Station" FROM table_64498 WHERE "Average Ratings" = '19.5%'
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...
what is date of birth and days of hospital stay of subject id 2560?
SELECT demographic.dob, demographic.days_stay FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_54300 ( "Year" real, "Meeting" text, "Venue" text, "Result" text, "Event" text, "Extra" real )
What venue had less than 7.4 extra and the result of 4th?
SELECT "Venue" FROM table_54300 WHERE "Extra" < '7.4' AND "Result" = '4th'
wikisql
CREATE TABLE table_48994 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real )
what is the average drawn when the points is more than 15, lost is 1 and played is less than 14?
SELECT AVG("Drawn") FROM table_48994 WHERE "Points" > '15' AND "Lost" = '1' AND "Played" < '14'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
what was the name of drug that was prescribed first to patient 70267 during this hospital encounter?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70267 AND admissions.dischtime IS NULL) ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE table_51384 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the Rank of the Nation of Germany when the Total is more than 2?
SELECT COUNT("Rank") FROM table_51384 WHERE "Nation" = 'germany' AND "Total" > '2'
wikisql
CREATE TABLE table_54973 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
I want the total number of Grids for heinz-harald frentzen
SELECT COUNT("Grid") FROM table_54973 WHERE "Driver" = 'heinz-harald frentzen'
wikisql
CREATE TABLE table_17001658_10 ( high_rebounds VARCHAR, high_assists VARCHAR )
For High Assists of Raymond Felton (12), who were the High rebounds?
SELECT high_rebounds FROM table_17001658_10 WHERE high_assists = "Raymond Felton (12)"
sql_create_context
CREATE TABLE table_58985 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
What was the lowest pick number with an overall 86?
SELECT MIN("Pick #") FROM table_58985 WHERE "Overall" = '86'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, ...
what is the number of patients who are in ward 48 since 2100?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 48 AND STRFTIME('%y', transfers.intime) >= '2100')
mimic_iii
CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, cases number, drink text ) CREATE TABLE appellations ( no number, appelation text, county text, state text, area text,...
Give the average price and case of wines made from Zinfandel grapes in the year 2009.
SELECT AVG(price), AVG(cases) FROM wine WHERE year = 2009 AND grape = "Zinfandel"
spider
CREATE TABLE table_47794 ( "Official Name" text, "Status" text, "Area km 2" real, "Population" real, "Census Ranking" text )
What is Official Name, when Census Ranking is 769 of 5,008?
SELECT "Official Name" FROM table_47794 WHERE "Census Ranking" = '769 of 5,008'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(...
For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time, and list by the sum department id from high to low.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_43142 ( "Date" text, "Time" text, "Home" text, "Away" text, "Score" text, "Ground" text )
Who was the away team for the Etobicoke Kangaroos home game?
SELECT "Away" FROM table_43142 WHERE "Home" = 'etobicoke kangaroos'
wikisql
CREATE TABLE table_204_345 ( id number, "discipline" text, "amanda" number, "bernie" number, "javine h" number, "julia" number, "michelle" number )
what is the last discipline listed on this chart ?
SELECT "discipline" FROM table_204_345 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_13787 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
What were the notes for the player who finished with a rank smaller than 2?
SELECT "Notes" FROM table_13787 WHERE "Rank" < '2'
wikisql
CREATE TABLE residents ( resident_id number, property_id number, date_moved_in time, date_moved_out time, other_details text ) CREATE TABLE customer_events ( customer_event_id number, customer_id number, date_moved_in time, property_id number, resident_id number, thing_id nu...
What is each customer's move in date, and the corresponding customer id and details?
SELECT T2.date_moved_in, T1.customer_id, T1.customer_details FROM customers AS T1 JOIN customer_events AS T2 ON T1.customer_id = T2.customer_id
spider
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( ...
count the number of patients who have been dead after having been diagnosed with asthma / bronchospasm - moderate during the same month in 2105.
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'asthma / bronchospasm - moderate') AS t1 GROUP BY t1.uniquepid H...
eicu
CREATE TABLE table_21698 ( "Winner" text, "Country" text, "Winter Olympics" text, "FIS Nordic World Ski Championships" text, "Holmenkollen" text )
What is the FIS Nordic World Ski Championships when holmenkollen is 1976?
SELECT "FIS Nordic World Ski Championships" FROM table_21698 WHERE "Holmenkollen" = '1976'
wikisql
CREATE TABLE table_203_450 ( id number, "team" text, "outgoing manager" text, "manner of departure" text, "date of vacancy" text, "replaced by" text, "date of appointment" text, "position in table" text )
who was manager of manchester city after stuart pearce left in 2007 ?
SELECT "replaced by" FROM table_203_450 WHERE "outgoing manager" = 'stuart pearce'
squall
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
what is the first specimen test given to patient 7375 in 04/2100?
SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7375) AND STRFTIME('%y-%m', microbiologyevents.charttime) = '2100-04' ORDER BY microbiologyevents.charttime LIMIT 1
mimic_iii
CREATE TABLE table_203_346 ( id number, "date" text, "location" text, "venue" text, "opening act" text, "supporting" text )
did the calgary or the toronto leg take place on august 11 ?
SELECT "location" FROM table_203_346 WHERE "location" IN ('calgary', 'toronto') AND "date" = 8 AND "date" = 11
squall
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, ...
count the number of patients whose year of death is less than or equal to 2164 and drug name is multivitamins?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2164.0" AND prescriptions.drug = "Multivitamins"
mimicsql_data
CREATE TABLE table_32781 ( "NBR class" real, "Type" text, "Introduced" real, "Driving wheel" text, "Total" real, "Extinct" real )
What is the car with the lowest extinct year that has a NBR class of 32?
SELECT MIN("Extinct") FROM table_32781 WHERE "NBR class" = '32'
wikisql
CREATE TABLE table_16731248_1 ( bypass_ports INTEGER )
What is the minimum number of bypass ports listed?
SELECT MIN(bypass_ports) FROM table_16731248_1
sql_create_context
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 demographic ...
how many patients whose age is less than 70 and item id is 50965?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "70" AND lab.itemid = "50965"
mimicsql_data
CREATE TABLE table_26533354_8 ( round INTEGER, player VARCHAR )
Name the most round for jordan cameron
SELECT MAX(round) FROM table_26533354_8 WHERE player = "Jordan Cameron"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
All the views (log scaled). http://meta.stackexchange.com/questions/244534/were-working-on-a-new-stat-to-help-convey-the-reach-of-your-posts-here
WITH question_score AS (SELECT CAST(ViewCount AS INT) AS ask_views, OwnerUserId AS UserId, Id AS PostId FROM Posts WHERE PostTypeId = 1 AND AnswerCount > 0 AND Score > 0 GROUP BY OwnerUserId, Id, ViewCount), answer_score AS (SELECT CAST(q.ViewCount AS INT) AS answer_views, a.OwnerUserId AS UserId, a.Id AS PostId FROM P...
sede
CREATE TABLE table_name_17 ( position VARCHAR, overall VARCHAR, round VARCHAR, pick VARCHAR )
Which Position has a Round smaller than 8, a Pick of 20, and an Overall smaller than 186?
SELECT position FROM table_name_17 WHERE round < 8 AND pick = 20 AND overall < 186
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instruc...
What is the weekly schedule for 418 ?
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o...
advising
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TAB...
Out of EECS 545 and EECS 470 , which is easier ?
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 545 OR course.number = 470) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
advising
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...
what's the average total cost of a hospital that includes a laboratory troponin - i test since 2103?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'troponin - i')) AND STRFTIME('%y', cost.chargetime) >= '2103' GROUP ...
eicu
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients whose ethnicity is black/cape verdean and procedure icd9 code is 4341?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND procedures.icd9_code = "4341"
mimicsql_data
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
count the number of patients whose admission year is less than 2173 and lab test name is alanine aminotransferase (alt)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2173" AND lab.label = "Alanine Aminotransferase (ALT)"
mimicsql_data
CREATE TABLE table_204_888 ( id number, "location" text, "mile" number, "destinations" text, "notes" text )
what is the next destination after limestone road north ?
SELECT "destinations" FROM table_204_888 WHERE id = (SELECT id FROM table_204_888 WHERE "destinations" = 'limestone road north') + 1
squall
CREATE TABLE table_64336 ( "play" text, "author" text, "company" text, "base" text, "country" text )
Which company has an author of Aristophanes and play of Plutus?
SELECT "company" FROM table_64336 WHERE "author" = 'aristophanes' AND "play" = 'plutus'
wikisql
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE fare ( fare_id int, from_...
what do you know about RENTAL CAR in DENVER
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'RENTAL CAR'
atis
CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(15), product_name VARCHAR(80), product_price DOUBLE ) CREATE TABLE Contacts ( contact_id INTEGER, customer_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(50), contact_phone VARCHAR(80...
Bar chart x axis product name y axis how many product name
SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name
nvbench
CREATE TABLE table_27698941_6 ( game VARCHAR, high_rebounds VARCHAR )
How many games are shown for the game where andre iguodala (9) had the high rebounds?
SELECT COUNT(game) FROM table_27698941_6 WHERE high_rebounds = "Andre Iguodala (9)"
sql_create_context
CREATE TABLE table_name_15 ( crowd VARCHAR, score VARCHAR )
How many people attended the score of w 7-6?
SELECT crowd FROM table_name_15 WHERE score = "w 7-6"
sql_create_context
CREATE TABLE table_name_44 ( method VARCHAR, res VARCHAR, time VARCHAR )
What method resulted in a win and a time of 4:36?
SELECT method FROM table_name_44 WHERE res = "win" AND time = "4:36"
sql_create_context
CREATE TABLE table_19662262_6 ( bbm VARCHAR, strike_rate VARCHAR )
What is the BBM when the strike rate is 42.2?
SELECT bbm FROM table_19662262_6 WHERE strike_rate = "42.2"
sql_create_context
CREATE TABLE table_38415 ( "Character" text, "Actor" text, "Years" text, "Series" text, "Episode Count" real )
Which Series has an Actor of tom ward?
SELECT "Series" FROM table_38415 WHERE "Actor" = 'tom ward'
wikisql
CREATE TABLE table_2943 ( "Rank" real, "Building [A ]" text, "City" text, "Country" text, "Height (m)" text, "Height (ft)" text, "Floors" real, "Built" text )
How many different ranks does the Cathay Pacific Plaza 2 have?
SELECT COUNT("Rank") FROM table_2943 WHERE "Building [A ]" = 'Cathay Pacific Plaza 2'
wikisql
CREATE TABLE table_name_78 ( winning_driver VARCHAR, pole_position VARCHAR )
What driver was the winner when Joakim Bonnier was in the Pole Position?
SELECT winning_driver FROM table_name_78 WHERE pole_position = "joakim bonnier"
sql_create_context
CREATE TABLE table_name_53 ( venue VARCHAR, result VARCHAR, score VARCHAR )
Which Venue has a Result of 5-1, and a Score of 3-0?
SELECT venue FROM table_name_53 WHERE result = "5-1" AND score = "3-0"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many of patients who underwent the procedure titled open reduction of fracture with internal fixation, femur also had the lab test category as blood gas?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Open reduction of fracture with internal fixation, femur" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_23242968_1 ( directed_by VARCHAR, written_by VARCHAR )
Who directed the episode that was written by Jonathan Fener?
SELECT directed_by FROM table_23242968_1 WHERE written_by = "Jonathan Fener"
sql_create_context
CREATE TABLE table_11682 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the average grid for jo siffert?
SELECT AVG("Grid") FROM table_11682 WHERE "Driver" = 'jo siffert'
wikisql
CREATE TABLE table_name_79 ( result VARCHAR, date VARCHAR )
Which Result that is on june 5?
SELECT result FROM table_name_79 WHERE date = "june 5"
sql_create_context
CREATE TABLE table_53560 ( "Year" real, "Venue" text, "Location" text, "Winning team" text, "Score" text, "U.S. Captain" text, "International Captain" text )
what is the location when the year is less than 1998 and the international captain is david graham?
SELECT "Location" FROM table_53560 WHERE "Year" < '1998' AND "International Captain" = 'david graham'
wikisql
CREATE TABLE table_27262 ( "Air date" text, "Reward" text, "Immunity" text, "Eliminated" text, "Vote" text, "Finish" text )
Who was eliminated when immunity went to kent (j rgen)?
SELECT "Eliminated" FROM table_27262 WHERE "Immunity" = 'Kent (Jürgen)'
wikisql
CREATE TABLE table_2308381_2 ( year VARCHAR, starts VARCHAR )
Name the year for 15 starts
SELECT year FROM table_2308381_2 WHERE starts = 15
sql_create_context
CREATE TABLE table_36627 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the loss when the score was 7-1?
SELECT "Loss" FROM table_36627 WHERE "Score" = '7-1'
wikisql
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...
37631577362这个医疗就诊是哪天出院
SELECT qtb.OUT_HOSP_DATE FROM qtb WHERE qtb.MED_CLINIC_ID = '37631577362' UNION SELECT gyb.OUT_HOSP_DATE FROM gyb WHERE gyb.MED_CLINIC_ID = '37631577362' UNION SELECT zyb.OUT_HOSP_DATE FROM zyb WHERE zyb.MED_CLINIC_ID = '37631577362' UNION SELECT mzb.OUT_HOSP_DATE FROM mzb WHERE mzb.MED_CLINIC_ID = '37631577362'
css
CREATE TABLE table_5017 ( "Season" text, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Position" text )
How many wins did Team Autotecnica, with 0 podiums, have?
SELECT "Wins" FROM table_5017 WHERE "Podiums" = '0' AND "Team" = 'team autotecnica'
wikisql
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code v...
show me the fares for DL flights from DALLAS to SAN FRANCISCO
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city...
atis
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHA...
Show all calendar dates and day Numbers in a line chart.
SELECT Calendar_Date, Day_Number FROM Ref_Calendar
nvbench
CREATE TABLE table_40823 ( "AIRLINE" text, "ICAO" text, "IATA" text, "CALLSIGN" text, "COMMENCED OPERATIONS" text )
What airline has a IATA of BX?
SELECT "AIRLINE" FROM table_40823 WHERE "IATA" = 'bx'
wikisql
CREATE TABLE table_name_70 ( rank INTEGER, time VARCHAR )
What rank did rower have with the time of 6:52.74?
SELECT SUM(rank) FROM table_name_70 WHERE time = "6:52.74"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, give me the comparison about the sum of price over the name , and group by attribute name, and could you sort from low to high by the y axis?
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Price
nvbench
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
从二00九年一月一日到二0一三年四月三十日期间,979661的药品总共被开出了多少,总金额共有多少
SELECT SUM(t_kc22.QTY), SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '979661' AND t_kc22.STA_DATE BETWEEN '2009-01-01' AND '2013-04-30'
css
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE lab ( labid numbe...
what time did patient 002-68632 get his last output (ml)-urethral catheter straight-tip;temperature probe 16 fr. output on the first icu visit?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-68632') AND NOT patient.unitdischargetime IS NULL...
eicu
CREATE TABLE table_name_67 ( opponent VARCHAR, high_rebounds VARCHAR )
What is Opponent, when High Rebounds is 'Pierson (6)'?
SELECT opponent FROM table_name_67 WHERE high_rebounds = "pierson (6)"
sql_create_context
CREATE TABLE table_1214035_1 ( league VARCHAR, open_cup VARCHAR )
For which league is the open cup the quarter finals
SELECT league FROM table_1214035_1 WHERE open_cup = "Quarter Finals"
sql_create_context
CREATE TABLE table_29614 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Points" real )
Name the record for prudential center - 12,880
SELECT "Record" FROM table_29614 WHERE "Location/Attendance" = 'Prudential Center - 12,880'
wikisql
CREATE TABLE table_name_39 ( skip VARCHAR, third VARCHAR )
Which Skip has a Third of sara carlsson?
SELECT skip FROM table_name_39 WHERE third = "sara carlsson"
sql_create_context
CREATE TABLE table_12769 ( "Year" real, "Competition" text, "Venue" text, "Distance" text, "Result" text )
What year was the competition vitry-sur-seine humarathon?
SELECT AVG("Year") FROM table_12769 WHERE "Competition" = 'vitry-sur-seine humarathon'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
what were the top three most frequent diagnoses among the patients whose age was 30s until 2104?
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY diagnosis....
eicu
CREATE TABLE ref_colors ( color_code text, color_description text ) CREATE TABLE ref_characteristic_types ( characteristic_type_code text, characteristic_type_description text ) CREATE TABLE product_characteristics ( product_id number, characteristic_id number, product_characteristic_value...
What are the names, details and data types of the characteristics which are never used by any product?
SELECT characteristic_name, other_characteristic_details, characteristic_data_type FROM characteristics EXCEPT SELECT t1.characteristic_name, t1.other_characteristic_details, t1.characteristic_data_type FROM characteristics AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id
spider
CREATE TABLE table_58120 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What day did the VFL play Punt Road Oval?
SELECT "Date" FROM table_58120 WHERE "Venue" = 'punt road oval'
wikisql
CREATE TABLE table_name_20 ( to_par INTEGER, player VARCHAR )
What is the average To Par, when Player is 'Billy Casper'?
SELECT AVG(to_par) FROM table_name_20 WHERE player = "billy casper"
sql_create_context
CREATE TABLE table_name_64 ( romaji_title VARCHAR, japanese_title VARCHAR )
Which Romaji Title has a Japanese Title of ?
SELECT romaji_title FROM table_name_64 WHERE japanese_title = "女王の教室"
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM...
在那些和编号为83066305680的检验指标记录有着一样的检测指标名称以及检测指标结果定量单位的记录上,有着哪些检测指标结果定量不大于那个检验指标记录的情况呢?
SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '83066305680') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '83066305680') AND jyjgzbb.JCZBJGDL <= (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '83066305680')
css
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...
provide the number of patients whose discharge location is long term care hospital and diagnoses long title is hypotension of hemodialysis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND diagnoses.long_title = "Hypotension of hemodialysis"
mimicsql_data
CREATE TABLE table_name_32 ( ihsaa_class VARCHAR, mascot VARCHAR )
Name the IHSAA Class of Mascot of pioneers?
SELECT ihsaa_class FROM table_name_32 WHERE mascot = "pioneers"
sql_create_context
CREATE TABLE table_18478 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
John W. Heselton was first elected in what year?
SELECT MAX("First elected") FROM table_18478 WHERE "Incumbent" = 'John W. Heselton'
wikisql
CREATE TABLE table_14902 ( "School" text, "Team" text, "Division Record" text, "Overall Record" text, "Season Outcome" text )
For the Delmar school what is the division record?
SELECT "Division Record" FROM table_14902 WHERE "School" = 'delmar'
wikisql
CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID ...
Bar chart x axis location code y axis how many location code, and I want to order from high to low by the bars.
SELECT Location_Code, COUNT(Location_Code) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_Code DESC
nvbench
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE days ( days_code varchar, ...
could you please show me all flights from MILWAUKEE to MONTREAL
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 = 'MONT...
atis
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
show me the number of patients who are less than 76 years of age and their drug name is simvastatin.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "76" AND prescriptions.drug = "Simvastatin"
mimicsql_data
CREATE TABLE diagnoses_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 patients ( row_id number, subject_id number, gender text, dob...
what is the average number of patients diagnosed with traffic acc nos-motcycl monthly in 2105?
SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'traffic acc nos-motcycl') AND STRFTIME('%y', diagnoses_icd.charttime) = '2105' GROUP BY STRFTIME('%y-%...
mimic_iii
CREATE TABLE table_25965 ( "Year" real, "Host City" text, "Host School" text, "Champion" text, "Second Place" text, "Third Place" text )
Which years did Michigan state university come in third place?
SELECT "Year" FROM table_25965 WHERE "Third Place" = 'Michigan State University'
wikisql
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...
how many patients on long-term use of insulin had a lab test for urobilinogen?
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.short_title = "Long-term use of insulin" AND lab.label = "Urobilinogen"
mimicsql_data
CREATE TABLE table_1140114_5 ( constructor VARCHAR, winning_driver VARCHAR )
How many different constructors had Paul Thiel as a winning driver?
SELECT COUNT(constructor) FROM table_1140114_5 WHERE winning_driver = "Paul Thiel"
sql_create_context
CREATE TABLE table_14024 ( "Actor" text, "Character" text, "Soap Opera" text, "Years" text, "Duration" text )
What years have joyce couwenberg as the character?
SELECT "Years" FROM table_14024 WHERE "Character" = 'joyce couwenberg'
wikisql
CREATE TABLE table_41321 ( "Draw" real, "Song" text, "Performer" text, "Points" real, "Rank" text )
Which Points has a Performer of rob burke band and a Draw larger than 1?
SELECT AVG("Points") FROM table_41321 WHERE "Performer" = 'rob burke band' AND "Draw" > '1'
wikisql
CREATE TABLE table_test_21 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "tachycardia" int, "body_weight" float, "renal_disease" bool, "anaemia" bool, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "cardiogenic_shock" bool, ...
the patient has severe bradycardia with heart rate < 45 beats / minute.
SELECT * FROM table_test_21 WHERE severe_bradycardia = 1 AND heart_rate < 45
criteria2sql
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is the number of patients with primary disease s/p hanging who had psychiatric facility-partial hospitalization discharge?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.diagnosis = "S/P HANGING"
mimicsql_data
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 was the first height of patient 8562 in a month before?
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 = 8562)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht' ...
mimic_iii
CREATE TABLE table_56543 ( "Round" text, "Player" text, "Position" text, "Team" text, "College" text )
Who plays g position for the st. louis bombers?
SELECT "Player" FROM table_56543 WHERE "Team" = 'st. louis bombers' AND "Position" = 'g'
wikisql
CREATE TABLE table_name_80 ( attendance INTEGER, score VARCHAR )
What is the sum of attendance when the score was 2:0?
SELECT SUM(attendance) FROM table_name_80 WHERE score = "2:0"
sql_create_context