table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_name_63 ( winner VARCHAR, college VARCHAR, hometown VARCHAR )
Who is the winner who attended college at Connecticut and is from North Syracuse, NY?
SELECT winner FROM table_name_63 WHERE college = "connecticut" AND hometown = "north syracuse, ny"
CREATE TABLE Things ( thing_id INTEGER, organization_id INTEGER, Type_of_Thing_Code CHAR(15), service_type_code CHAR(10), service_details VARCHAR(255) ) CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_details VARCHAR(2...
Give me a bar chart that the X-axis is the date_moved_in and the Y-axis is Count them, rank Y-axis in asc order.
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in ORDER BY COUNT(date_moved_in)
CREATE TABLE table_5607 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the Final" text, "Score" text )
Which tournament was played on October 1, 2006?
SELECT "Tournament" FROM table_5607 WHERE "Date" = 'october 1, 2006'
CREATE TABLE table_name_15 ( position VARCHAR, player VARCHAR )
What position does Mikhail Kravets play?
SELECT position FROM table_name_15 WHERE player = "mikhail kravets"
CREATE TABLE project_staff ( staff_id number, project_id number, role_code text, date_from time, date_to time, other_details text ) CREATE TABLE projects ( project_id number, organisation_id number, project_details text ) CREATE TABLE project_outcomes ( project_id number, o...
How many project members were leaders or started working before '1989-04-24 23:51:54'?
SELECT COUNT(*) FROM project_staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54'
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, ...
Which courses does Prof. Stephen Cooper teach ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Stephen Cooper%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id ...
CREATE TABLE table_name_19 ( population INTEGER, code VARCHAR, area__km_2__ VARCHAR )
What's the population with a code more than 90902 and an area less than 1,335.47?
SELECT MIN(population) FROM table_name_19 WHERE code > 90902 AND area__km_2__ < 1 OFFSET 335.47
CREATE TABLE table_10776 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the week 12 result?
SELECT "Result" FROM table_10776 WHERE "Week" = '12'
CREATE TABLE table_11465521_2 ( tv VARCHAR, opponent VARCHAR )
Which channel had the game against the Minnesota Vikings?
SELECT tv FROM table_11465521_2 WHERE opponent = "Minnesota Vikings"
CREATE TABLE table_name_41 ( date VARCHAR, home_team VARCHAR )
What is the date of the home team from South Melbourne?
SELECT date FROM table_name_41 WHERE home_team = "south melbourne"
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_...
get the SATURDAY fare from WASHINGTON to TORONTO
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, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TORONTO' AND DAYS_1.day_name =...
CREATE TABLE table_203_801 ( id number, "season" text, "division" text, "tier" text, "position" number, "cup" text )
how long does this table cover in years ?
SELECT MAX("season") - MIN("season") FROM table_203_801
CREATE TABLE table_203_541 ( id number, "games" text, "host city" text, "dates" text, "nations" number, "participants" number, "events" number )
what dates did the 1984 summer olympics take place ?
SELECT "dates" FROM table_203_541 WHERE "games" = '1984 summer olympics'
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 average days of hospital stay of patients whose primary disease is gangrene?
SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "GANGRENE"
CREATE TABLE table_10380 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the total number of people that attended the glenferrie oval venue?
SELECT SUM("Crowd") FROM table_10380 WHERE "Venue" = 'glenferrie oval'
CREATE TABLE table_48429 ( "Name" text, "Daytime" text, "Evening" text, "Saturday" text, "Sunday" text )
Name the Daytime which has a Name of exmouth?
SELECT "Daytime" FROM table_48429 WHERE "Name" = 'exmouth'
CREATE TABLE fires ( fire_year number, discovery_date number, discovery_doy number, discovery_time text, stat_cause_code number, stat_cause_descr text, cont_date text, cont_doy text, cont_time text, fire_size number, fire_size_class text, latitude number, longitude nu...
What is the leading cause of wildfires?
SELECT stat_cause_descr FROM fires GROUP BY stat_cause_descr ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_20812 ( "Official #" real, "TF1 #" real, "French title" text, "English title" text, "Air date (France)" text, "Original Beechwood Bunny Tale / Source material" text )
Who was responsible for original beechwood bunny tale / source material for the episode title 'The Monster of Blueberry Lake'?
SELECT "Original Beechwood Bunny Tale / Source material" FROM table_20812 WHERE "English title" = 'The Monster of Blueberry Lake'
CREATE TABLE table_204_466 ( id number, "rank" number, "bib" number, "country" text, "time" text, "penalties (p+s)" text, "deficit" text )
how many countries were represented ?
SELECT COUNT("country") FROM table_204_466
CREATE TABLE table_65094 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "TV Time" text, "Attendance" text )
What is the Opponent of the game after Week 3 with a Result of L 10 6?
SELECT "Opponent" FROM table_65094 WHERE "Week" > '3' AND "Result" = 'l 10–6'
CREATE TABLE table_name_33 ( opponent_in_the_final VARCHAR, date VARCHAR )
Who was the opponent on the 28 july 2013 final?
SELECT opponent_in_the_final FROM table_name_33 WHERE date = "28 july 2013"
CREATE TABLE table_245711_2 ( season VARCHAR, final_record VARCHAR )
how many time is the final record is 9 16 5?
SELECT COUNT(season) FROM table_245711_2 WHERE final_record = "9–16–5"
CREATE TABLE table_name_62 ( podiums INTEGER, f_laps VARCHAR, season VARCHAR, position VARCHAR )
What is the highest number of podiums before 2008 with a 5th position and more than 0 f/laps?
SELECT MAX(podiums) FROM table_name_62 WHERE season < 2008 AND position = "5th" AND f_laps > 0
CREATE TABLE table_name_81 ( gold INTEGER, total VARCHAR, bronze VARCHAR, rank VARCHAR )
How many gold have a bronze of 1, a rank smaller than 6, and a total less than 3?
SELECT SUM(gold) FROM table_name_81 WHERE bronze = 1 AND rank < 6 AND total < 3
CREATE TABLE table_name_41 ( series VARCHAR, date VARCHAR )
On May 8 what series is it?
SELECT series FROM table_name_41 WHERE date = "may 8"
CREATE TABLE weather ( date text, max_temperature_f number, mean_temperature_f number, min_temperature_f number, max_dew_point_f number, mean_dew_point_f number, min_dew_point_f number, max_humidity number, mean_humidity number, min_humidity number, max_sea_level_pressure_inc...
Give me ids for all the trip that took place in a zip code area with average mean temperature above 60.
SELECT T1.id FROM trip AS T1 JOIN weather AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.zip_code HAVING AVG(T2.mean_temperature_f) > 60
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE outputevents ( ...
what was the last time of intake of patient 3277 on 07/30/this year?
SELECT inputevents_cv.charttime 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 = 3277)) AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 's...
CREATE TABLE table_52183 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
I want the attendance for week larger than 10 and result of l 22-21
SELECT "Attendance" FROM table_52183 WHERE "Week" > '10' AND "Result" = 'l 22-21'
CREATE TABLE table_40336 ( "Year" text, "GP/GS" text, "Shots" real, "Goals" real, "Assists" real, "Points" real )
What is the lowest Shots with a Point that is larger than 32?
SELECT MIN("Shots") FROM table_40336 WHERE "Points" > '32'
CREATE TABLE table_43032 ( "Maximum Ceiling Temperature" text, "Temperature Rating" text, "Temperature Classification" text, "Color Code (with Fusible Link)" text, "Glass Bulb Color" text )
What is the temperature rating of the intermediate temperature classification?
SELECT "Temperature Rating" FROM table_43032 WHERE "Temperature Classification" = 'intermediate'
CREATE TABLE table_13899 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
How many heats does Julia Wilkinson have?
SELECT COUNT("Heat") FROM table_13899 WHERE "Name" = 'julia wilkinson'
CREATE TABLE table_39753 ( "Office" text, "Democratic ticket" text, "Republican ticket" text, "Socialist ticket" text, "Workers ticket" text )
What is the Office when the Republican ticket shows seymour lowman?
SELECT "Office" FROM table_39753 WHERE "Republican ticket" = 'seymour lowman'
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 number of patients whose gender is m and diagnoses short title is opioid dependence-contin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.short_title = "Opioid dependence-contin"
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Student...
A bar chart for finding the number of the dates of the tests taken with result 'Pass', sort Y-axis in descending order.
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" GROUP BY date_test_taken ORDER BY COUNT(date_test_taken) DESC
CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text )
Find the person who has exactly one friend.
SELECT name FROM personfriend GROUP BY name HAVING COUNT(*) = 1
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CRE...
i want the list of DAILY flights from MILWAUKEE to ST. LOUIS
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 = 'ST....
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Courses...
Draw a bar chart about the distribution of login_name and gender_mf .
SELECT login_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
CREATE TABLE table_name_75 ( position INTEGER, drawn VARCHAR, points VARCHAR )
At what average position is the drawn 9 and the points greater than 25?
SELECT AVG(position) FROM table_name_75 WHERE drawn = 9 AND points > 25
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
For generating a list of plain-text links to remaining posts with default alt text.
SELECT 'http://meta.judaism.stackexchange.com/a/' + CAST(Id AS TEXT) + ' ' FROM Posts WHERE (Body LIKE '%alt text%' OR Body LIKE '%enter image description here%') AND (Title IS NULL OR NOT Title LIKE '%alt text%') ORDER BY Id
CREATE TABLE table_19018191_5 ( l_apps VARCHAR, total_g VARCHAR )
Name the number of apps for total g is 8
SELECT COUNT(l_apps) FROM table_19018191_5 WHERE total_g = 8
CREATE TABLE table_30253 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
How many pick# for CFL team of Toronto Argonauts?
SELECT COUNT("Pick #") FROM table_30253 WHERE "CFL Team" = 'Toronto Argonauts'
CREATE TABLE table_47624 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What event had the opponent Ryan Bow?
SELECT "Event" FROM table_47624 WHERE "Opponent" = 'ryan bow'
CREATE TABLE table_79783 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
When was the record 27-25?
SELECT "Date" FROM table_79783 WHERE "Record" = '27-25'
CREATE TABLE table_name_2 ( drawn VARCHAR, cambridge_united_career VARCHAR, lost VARCHAR )
How many draws have a Cambridge United career of 2008 2009 and less than 13 losses?
SELECT COUNT(drawn) FROM table_name_2 WHERE cambridge_united_career = "2008–2009" AND lost < 13
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 patients are diagnosed with icd9 code 5679 and had a main drug type?
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 = "5679" AND prescriptions.drug_type = "MAIN"
CREATE TABLE table_47995 ( "Year" real, "Network" text, "Title" text, "Notes" text, "Language" text )
What are the notes for Happy Camp?
SELECT "Notes" FROM table_47995 WHERE "Title" = 'happy camp'
CREATE TABLE table_203_724 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many countries do not have any gold medals ?
SELECT COUNT("nation") FROM table_203_724 WHERE "gold" = 0
CREATE TABLE organisation_types ( organisation_type text, organisation_type_description text ) CREATE TABLE grants ( grant_id number, organisation_id number, grant_amount number, grant_start_date time, grant_end_date time, other_details text ) CREATE TABLE documents ( document_id n...
What are the result description of the project whose detail is 'sint'?
SELECT T1.outcome_description FROM research_outcomes AS T1 JOIN project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint'
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 ethnicity is white and age is less than 49?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.age < "49"
CREATE TABLE table_71338 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Which opponent led to a 56-59 record?
SELECT "Opponent" FROM table_71338 WHERE "Record" = '56-59'
CREATE TABLE table_38377 ( "Team" text, "Manufacturer" text, "Car model" text, "Engine" text, "Driver" text )
What Car Model has the Manufacturer of Saab, and Driver Dean Randle?
SELECT "Car model" FROM table_38377 WHERE "Manufacturer" = 'saab' AND "Driver" = 'dean randle'
CREATE TABLE table_name_39 ( location VARCHAR, years_in_gfl VARCHAR )
What's the location where the Years in GFL was 1988-?
SELECT location FROM table_name_39 WHERE years_in_gfl = "1988-"
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,...
provide the number of patients whose year of death is less than or equal to 2174?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2174.0"
CREATE TABLE table_30555 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
Which team drafted Ron Annear?
SELECT "NHL team" FROM table_30555 WHERE "Player" = 'Ron Annear'
CREATE TABLE table_name_62 ( place VARCHAR, player VARCHAR )
Where did Jay Haas place?
SELECT place FROM table_name_62 WHERE player = "jay haas"
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time, I want to list by the sum department id in ascending.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(DEPARTMENT_ID)
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...
give me the number of patients whose year of death is less than or equal to 2174 and lab test fluid is pleural?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2174.0" AND lab.fluid = "Pleural"
CREATE TABLE table_74098 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Team Nickname" text, "Primary conference" text )
How many primary conferences were held in Allendale, Michigan?
SELECT COUNT("Primary conference") FROM table_74098 WHERE "Location" = 'Allendale, Michigan'
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
what was the three most common procedure given to patients aged 60 or above until 4 years ago?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY...
CREATE TABLE table_25740774_1 ( position VARCHAR, season VARCHAR )
How many positions are shown for the 2010 season?
SELECT COUNT(position) FROM table_25740774_1 WHERE season = 2010
CREATE TABLE table_203_478 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number )
when was their second win ?
SELECT "date" FROM table_203_478 WHERE "result" = 'w' AND "date" > (SELECT "date" FROM table_203_478 WHERE "result" = 'w' ORDER BY "date" LIMIT 1) ORDER BY "date" LIMIT 1
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length in...
could you please tell me the airlines that fly from TORONTO to SAN DIEGO
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n...
CREATE TABLE table_204_713 ( id number, "rank" number, "bib" number, "athlete" text, "country" text, "time" text, "deficit" text )
did marcus hellner or jean marc gaillard rank tenth ?
SELECT "athlete" FROM table_204_713 WHERE "rank" = 10
CREATE TABLE table_203_865 ( id number, "place" number, "athlete" text, "nation" text, "best mark" text, "throw 1" number, "throw 2" number, "throw 3" number, "throw 4" number, "throw 5" number, "throw 6" number )
which athlete placed top ?
SELECT "athlete" FROM table_203_865 ORDER BY "place" LIMIT 1
CREATE TABLE table_65475 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "County" text )
What counties mascot are the Red Ramblers?
SELECT "County" FROM table_65475 WHERE "Mascot" = 'red ramblers'
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, ...
provide the number of patients whose days of hospital stay is greater than 6 and lab test category is hematology?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "6" AND lab."CATEGORY" = "Hematology"
CREATE TABLE table_name_94 ( election_date VARCHAR, member VARCHAR )
What is the election date for the electorate of member charles brown category:articles with hcards?
SELECT election_date FROM table_name_94 WHERE member = "charles brown category:articles with hcards"
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 admission location and diagnoses short title of subject id 98220?
SELECT demographic.admission_location, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "98220"
CREATE TABLE ref_incident_type ( incident_type_code text, incident_type_description text ) CREATE TABLE teachers ( teacher_id number, address_id number, first_name text, middle_name text, last_name text, gender text, cell_mobile_number text, email_address text, other_details...
What are the line 1 and average monthly rentals of all student addresses?
SELECT T1.line_1, AVG(T2.monthly_rental) FROM addresses AS T1 JOIN student_addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id
CREATE TABLE table_19517448_3 ( yards_per_attempt VARCHAR, total_yards VARCHAR )
How many yards per attempt were there when total yards were 513?
SELECT yards_per_attempt FROM table_19517448_3 WHERE total_yards = "513"
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CR...
how old was patient 1258's age on the last hospital encounter?
SELECT admissions.age FROM admissions WHERE admissions.subject_id = 1258 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
CREATE TABLE table_20370 ( "N\u00b0" real, "Television service" text, "Country" text, "Language" text, "Content" text, "DAR" text, "HDTV" text, "Package/Option" text )
How many values of HDTV apply when television service is elite shopping tv?
SELECT COUNT("HDTV") FROM table_20370 WHERE "Television service" = 'Elite Shopping TV'
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, Revision...
Test for Language Percentages over Time.
SELECT Name, YEAR(p.CreationDate) AS Year, MONTH(p.CreationDate) AS Month, COUNT(*) AS Posts, p.CommentCount AS CommentCount, p.Id AS ID FROM Posts AS p CROSS JOIN (VALUES ('C')) AS Language(Name) WHERE (SUBSTRING(p.Body, 0, STR_POSITION(p.Body, CHAR(10))) LIKE '%_>,\_' + name + ',_:\%') GROUP BY Name, YEAR(p.CreationD...
CREATE TABLE table_name_95 ( tournament VARCHAR, score VARCHAR )
What Tournament had a Score of 4 6, 6 7, 3 6?
SELECT tournament FROM table_name_95 WHERE score = "4–6, 6–7, 3–6"
CREATE TABLE table_name_75 ( position VARCHAR, school_club_team VARCHAR )
What position is listed for the nebraska team?
SELECT position FROM table_name_75 WHERE school_club_team = "nebraska"
CREATE TABLE table_name_11 ( prize VARCHAR, winner VARCHAR )
What was the prize for winner benny spindler?
SELECT prize FROM table_name_11 WHERE winner = "benny spindler"
CREATE TABLE table_name_66 ( date VARCHAR, sport VARCHAR, record VARCHAR, time__seconds_ VARCHAR )
What is the Date, when the Record is, 'track', when the Time (seconds) is longer than 43.564, and when the Sport is luge - women's singles?
SELECT date FROM table_name_66 WHERE record = "track" AND time__seconds_ > 43.564 AND sport = "luge - women's singles"
CREATE TABLE table_name_37 ( laps INTEGER, time_retired VARCHAR, grid VARCHAR )
Name the highest laps for time/retired of engine and grid of 5
SELECT MAX(laps) FROM table_name_37 WHERE time_retired = "engine" AND grid = 5
CREATE TABLE table_78419 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
In the game where the home team scored 15.17 (107), who was the away team?
SELECT "Away team" FROM table_78419 WHERE "Home team score" = '15.17 (107)'
CREATE TABLE table_name_58 ( score VARCHAR, opposition VARCHAR, year VARCHAR )
What score has Leicestershire as the opponent after 1906?
SELECT score FROM table_name_58 WHERE opposition = "leicestershire" AND year > 1906
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) ...
give me the number of patients whose discharge location is snf and primary disease is left internal jugular vein thrombosis;left arm edema?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA"
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id numbe...
how much is the changes in arterial bp mean of patient 28959 second measured on the first icu visit compared to the first value measured on the first icu 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 = 28959) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item...
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE admissions ( row_id numb...
what is the minimum hospital cost that involves a free skin graft nec since 2105?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'free skin graft nec')) AND STRFTIME('%y', cost.chargetime...
CREATE TABLE claims_processing_stages ( claim_status_description VARCHAR, claim_status_name VARCHAR )
What is the description of the claim status 'Open'?
SELECT claim_status_description FROM claims_processing_stages WHERE claim_status_name = "Open"
CREATE TABLE table_name_45 ( name VARCHAR, shoulder VARCHAR )
What is the name of the gun with a shoulder that measures 10.688 (.420)?
SELECT name FROM table_name_45 WHERE shoulder = "10.688 (.420)"
CREATE TABLE table_name_10 ( d_47 VARCHAR, d_42 VARCHAR )
Name the D 47 which has D 42 of d 22
SELECT d_47 FROM table_name_10 WHERE d_42 = "d 22"
CREATE TABLE table_12962773_5 ( height VARCHAR, position VARCHAR, current_club VARCHAR )
what's the height with position being forward and current club being real madrid
SELECT height FROM table_12962773_5 WHERE position = "Forward" AND current_club = "Real Madrid"
CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, icao text ) CREATE ...
Find the id of routes whose source and destination airports are in the United States.
SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States')
CREATE TABLE table_33661 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
What is the name of the replacement manager for the Bolton Wanderers?
SELECT "Replaced by" FROM table_33661 WHERE "Team" = 'bolton wanderers'
CREATE TABLE table_48108 ( "Rank" real, "Title" text, "Studio" text, "Director" text, "Worldwide Gross" text )
What is the average rank for the film directed by michael bay?
SELECT AVG("Rank") FROM table_48108 WHERE "Director" = 'michael bay'
CREATE TABLE table_75789 ( "Date" text, "Time" text, "Home" text, "Away" text, "Score" text, "Ground" text )
Who has the Home Score of 52-54?
SELECT "Home" FROM table_75789 WHERE "Score" = '52-54'
CREATE TABLE table_51014 ( "Constituency" text, "Electorate" real, "Votes" real, "Turnout" real, "Spoilt" real, "Percent Yes" real )
WHAT IS THE AVERAGE VOTE FOR DUBLIN SOUTH, AND SPOILT SMALLER THAN 3,387?
SELECT AVG("Votes") FROM table_51014 WHERE "Constituency" = 'dublin south' AND "Spoilt" < '3,387'
CREATE TABLE table_70316 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the Blue Jays lowest attendance when their record was 52-48?
SELECT MIN("Attendance") FROM table_70316 WHERE "Record" = '52-48'
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 of the patients on government insurance had aortocor bypas-2 cor art?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Aortocor bypas-2 cor art"
CREATE TABLE table_name_9 ( date VARCHAR, game_site VARCHAR )
What Date was the Game at Griffith Stadium?
SELECT date FROM table_name_9 WHERE game_site = "griffith stadium"
CREATE TABLE table_49416 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Record" text )
What is the earliest day in November with a record of 15-7-1?
SELECT MIN("November") FROM table_49416 WHERE "Record" = '15-7-1'
CREATE TABLE table_name_87 ( position VARCHAR, overall VARCHAR, college VARCHAR )
What is the position with an overall less than 128 for Brigham Young college?
SELECT position FROM table_name_87 WHERE overall < 128 AND college = "brigham young"
CREATE TABLE table_name_40 ( opponent VARCHAR, date VARCHAR )
What opponent has December 6, 1964 as the date?
SELECT opponent FROM table_name_40 WHERE date = "december 6, 1964"
CREATE TABLE party ( party_id number, party_theme text, location text, first_year text, last_year text, number_of_hosts number ) CREATE TABLE host ( host_id number, name text, nationality text, age text ) CREATE TABLE party_host ( party_id number, host_id number, is...
Show the nations that have both hosts older than 45 and hosts younger than 35.
SELECT nationality FROM host WHERE age > 45 INTERSECT SELECT nationality FROM host WHERE age < 35
CREATE TABLE nuclear_power_plants ( id text, name text, latitude text, longitude text, country text, status text, reactortype text, reactormodel text, constructionstartat text, operationalfrom text, operationalto text, capacity text, lastupdatedat text, source tex...
Where is the first BWR type power plant built and located?
SELECT longitude, latitude FROM nuclear_power_plants WHERE reactortype = "BWR" ORDER BY constructionstartat LIMIT 1