table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_9029 ( "Date" text, "Time" text, "ACC Team" text, "Big Ten Team" text, "Location" text, "Television" text, "Attendance" real, "Winner" text, "Challenge Leader" text )
Who is the challenge leader that played on 9:30 pm on Wed., Nov. 28?
SELECT "Challenge Leader" FROM table_9029 WHERE "Time" = '9:30 pm' AND "Date" = 'wed., nov. 28'
CREATE TABLE table_34521 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What was the 1st leg of the match that had an aggregate of 4-3?
SELECT "1st leg" FROM table_34521 WHERE "Agg." = '4-3'
CREATE TABLE reservations ( code number, room text, checkin text, checkout text, rate number, lastname text, firstname text, adults number, kids number ) CREATE TABLE rooms ( roomid text, roomname text, beds number, bedtype text, maxoccupancy number, basepric...
Find the name of rooms whose price is higher than the average price.
SELECT roomname FROM rooms WHERE baseprice > (SELECT AVG(baseprice) FROM rooms)
CREATE TABLE Events ( Event_ID INTEGER, Address_ID INTEGER, Channel_ID INTEGER, Event_Type_Code CHAR(15), Finance_ID INTEGER, Location_ID INTEGER ) CREATE TABLE Assets_in_Events ( Asset_ID INTEGER, Event_ID INTEGER ) CREATE TABLE Parties ( Party_ID INTEGER, Party_Details VARCHA...
Bar chart x axis product name y axis how many product name, rank by the the number of product name in ascending.
SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name ORDER BY COUNT(Product_Name)
CREATE TABLE table_name_66 ( road_numbers VARCHAR, class VARCHAR )
what is the road numbers when the class is z-7?
SELECT road_numbers FROM table_name_66 WHERE class = "z-7"
CREATE TABLE table_40100 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
Which Position has an Against larger than 17, and a Team of juventus, and a Drawn smaller than 4?
SELECT MIN("Position") FROM table_40100 WHERE "Against" > '17' AND "Team" = 'juventus' AND "Drawn" < '4'
CREATE TABLE table_43699 ( "Rank" real, "Date" text, "Attendance" real, "Opponent" text, "Texas Result" text )
Who was the opponent on September 26, 2009?
SELECT "Opponent" FROM table_43699 WHERE "Date" = 'september 26, 2009'
CREATE TABLE table_67717 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real )
What is the total number of points when draw is 4?
SELECT COUNT("Points") FROM table_67717 WHERE "Draw" = '4'
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 time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyeve...
since 2 years ago, how many patients with hpt c w/o hepat coma nos were diagnosed in the same month after being diagnosed with quadriplegia, unspecifd?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hpt c w/o hepat co...
CREATE TABLE table_name_63 ( player VARCHAR, country VARCHAR )
What player is from France?
SELECT player FROM table_name_63 WHERE country = "france"
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...
tell me the number of patients with a diagnoses of full incontinence of feces who were admitted before the year 2154.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2154" AND diagnoses.short_title = "Full incontinence-feces"
CREATE TABLE table_204_160 ( id number, "rank" number, "name" text, "nationality" text, "time" text, "notes" text )
how many canadian swimmers were there ?
SELECT COUNT("name") FROM table_204_160 WHERE "nationality" = 'canada'
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
count the number of times that patient 004-64091 when they visited the hospital last time underwent a palliative care consultation procedure.
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit...
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE chart...
has a microbiological test been carried out this year for patient 14621?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14621) AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
CREATE TABLE table_name_78 ( year VARCHAR, host_city VARCHAR, hosts VARCHAR )
What year will Bangkok be the host city and Alicia Keys host?
SELECT year FROM table_name_78 WHERE host_city = "bangkok" AND hosts = "alicia keys"
CREATE TABLE table_203_583 ( id number, "title" text, "release" number, "6th gen" text, "handheld" text, "note" text )
how many more games were released in 2005 than 2003 ?
SELECT (SELECT COUNT("title") FROM table_203_583 WHERE "release" = 2005) - (SELECT COUNT("title") FROM table_203_583 WHERE "release" = 2003)
CREATE TABLE table_17995 ( "Year" real, "Competition" text, "Location" text, "Event" text, "Final-Rank" text, "Final-Score" text, "Qualifying Rank" real, "Qualifying Score" text )
what is the highest qualifying rank where the competition is olympic trials, the final-rank is 4 and qualifying score is 15.100?
SELECT MAX("Qualifying Rank") FROM table_17995 WHERE "Competition" = 'Olympic Trials' AND "Final-Rank" = '4' AND "Qualifying Score" = '15.100'
CREATE TABLE table_75806 ( "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the highest number listed under against when there were 15 losses and more than 1 win?
SELECT MAX("Against") FROM table_75806 WHERE "Losses" = '15' AND "Wins" > '1'
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE c...
how many hours have elapsed since the first time patient 808 stayed in careunit sicu in this hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 808 AND admissions.dischtime IS NULL) AND transfers.careunit = 'sicu' ORDER BY transfers.intime LIMIT 1
CREATE TABLE table_name_13 ( draw INTEGER, points VARCHAR, goals_conceded VARCHAR )
Name the the highest Draw which has Points of 22 and Goals Conceded smaller than 26?
SELECT MAX(draw) FROM table_name_13 WHERE points = "22" AND goals_conceded < 26
CREATE TABLE table_204_175 ( id number, "pos" text, "no." number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "laps led" number, "points" number )
who raced the fastest ?
SELECT "driver" FROM table_204_175 ORDER BY "pos" LIMIT 1
CREATE TABLE table_1724 ( "Player" text, "League" real, "Scottish Cup" real, "League Cup" real, "Challenge Cup" real, "Total" real )
Name the most challenge cup for damon gray
SELECT MAX("Challenge Cup") FROM table_1724 WHERE "Player" = 'Damon Gray'
CREATE TABLE district ( District_ID int, District_name text, Headquartered_City text, City_Population real, City_Area real ) CREATE TABLE store ( Store_ID int, Store_Name text, Type text, Area_size real, Number_of_product_category real, Ranking int ) CREATE TABLE store_prod...
Find all types of store and number of them. Show the proportion.
SELECT Type, COUNT(*) FROM store GROUP BY Type
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
was the urinary specific gravity value of patient 022-82169 last measured on the last hospital visit less than that first measured on the last hospital visit?
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-82169' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
CREATE TABLE branch ( branch_id number, name text, open_year text, address_road text, city text, membership_amount text ) CREATE TABLE member ( member_id number, card_number text, name text, hometown text, level number ) CREATE TABLE purchase ( member_id number, bra...
What are names for top three branches with most number of membership?
SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3
CREATE TABLE table_53991 ( "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
Who wrote the episode that has the production code ad1c05?
SELECT "Written by" FROM table_53991 WHERE "Production code" = 'ad1c05'
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
provide the number of patients whose discharge location is home health care and procedure short title is hemodialysis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Hemodialysis"
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
what is the number of patients whose primary disease is s/p fall and lab test abnormal status is delta?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "S/P FALL" AND lab.flag = "delta"
CREATE TABLE table_203_621 ( id number, "player" text, "games played" number, "minutes played" number, "minutes played per game" number, "rebounds" number, "rebounds per game" number, "assists" number, "assists per game" number, "field goal %" number, "free throw %" number, ...
give the number of players covered by the table .
SELECT COUNT("player") FROM table_203_621
CREATE TABLE table_name_60 ( mountains_classification VARCHAR, winner VARCHAR, general_classification VARCHAR )
What is the mountain classification of Mario Cipollini, who has a general classification of Pavel tonkov?
SELECT mountains_classification FROM table_name_60 WHERE winner = "mario cipollini" AND general_classification = "pavel tonkov"
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 minimum days of hospital stay of patients whose year of birth is greater than 2065?
SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2065"
CREATE TABLE table_29207 ( "Model" text, "Speed (GHz)" text, "L2 Cache (MB)" real, "L3 Cache (MB)" real, "FSB (MHz)" real, "TDP (W)" real )
How many different FSB are there for the 7140N model?
SELECT COUNT("FSB (MHz)") FROM table_29207 WHERE "Model" = '7140N'
CREATE TABLE table_4093 ( "Country" text, "Area (km 2 )" real, "Population(2012)" real, "Density (/km 2 )" real, "GDP (nominal), USD (2012)" text, "GDP (nominal) per capita, USD (2012)" text, "HDI (2012)" text, "Capital" text )
How few km 2 does the area with Nay Pyi Taw as capital cover?
SELECT MIN("Area (km 2 )") FROM table_4093 WHERE "Capital" = 'Nay Pyi Taw'
CREATE TABLE match_result ( Rank int, Club_ID int, Gold int, Big_Silver int, Small_Silver int, Bronze int, Points int ) CREATE TABLE club ( Club_ID int, Club_name text, Region text, Start_year int ) CREATE TABLE player_coach ( Player_ID int, Coach_ID int, Starti...
Show different occupations along with the number of players in each occupation Show bar chart, and show y-axis from high to low order.
SELECT Occupation, COUNT(*) FROM player GROUP BY Occupation ORDER BY COUNT(*) DESC
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 primary disease and drug dose of subject id 18480?
SELECT demographic.diagnosis, prescriptions.drug_dose FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "18480"
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,...
give me the number of patients whose admission location is phys referral/normal deli and admission year is less than 2177?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.admityear < "2177"
CREATE TABLE product ( product_name VARCHAR, product_id VARCHAR ) CREATE TABLE problems ( product_id VARCHAR )
How many problems does the product with the most problems have? List the number of the problems and product name.
SELECT COUNT(*), T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Find All_Neutral and Team_ID , and visualize them by a bar chart, sort in descending by the Team_ID.
SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY Team_ID DESC
CREATE TABLE table_54619 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the score of the home game at Tampa Bay?
SELECT "Score" FROM table_54619 WHERE "Home" = 'tampa bay'
CREATE TABLE enzyme ( name VARCHAR, location VARCHAR, product VARCHAR, id VARCHAR ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id VARCHAR, interaction_type VARCHAR )
What are the distinct name, location and products of the enzymes which has any 'inhibitor' interaction?
SELECT DISTINCT T1.name, T1.location, T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor'
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 item id is 51218 and lab test abnormal status is abnormal?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51218" AND lab.flag = "abnormal"
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, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Name the courses that count for upper level electives .
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
CREATE TABLE table_58366 ( "Mid Gippsland FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
Name the sum of draws for losses less than 2 and wins of 16
SELECT SUM("Draws") FROM table_58366 WHERE "Wins" = '16' AND "Losses" < '2'
CREATE TABLE table_55183 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text, "Record" text )
What is the kickoff time for the Hubert H. Humphrey Metrodome?
SELECT "Kickoff [a ]" FROM table_55183 WHERE "Game site" = 'hubert h. humphrey metrodome'
CREATE TABLE table_204_637 ( id number, "type" text, "gauge" text, "railway" text, "works no." text, "year" text, "builder" text )
how many total garratts did south african railways have ?
SELECT COUNT(*) FROM table_204_637 WHERE "railway" = 'south african railways'
CREATE TABLE table_21362 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the score for Milwaukee?
SELECT "Score" FROM table_21362 WHERE "Team" = 'Milwaukee'
CREATE TABLE table_47598 ( "Rank" text, "Team" text, "Run 1" text, "Run 2" text, "Run 3" text, "Final" text )
Which run 2 with final of 5:24.47?
SELECT "Run 2" FROM table_47598 WHERE "Final" = '5:24.47'
CREATE TABLE machine ( machine_id number, making_year number, class text, team text, machine_series text, value_points number, quality_rank number ) CREATE TABLE repair_assignment ( technician_id number, repair_id number, machine_id number ) CREATE TABLE repair ( repair_id ...
What is the name of the technician whose team is not 'NYY'?
SELECT name FROM technician WHERE team <> "NYY"
CREATE TABLE store_district ( Store_ID int, District_ID int ) CREATE TABLE store ( Store_ID int, Store_Name text, Type text, Area_size real, Number_of_product_category real, Ranking int ) CREATE TABLE store_product ( Store_ID int, Product_ID int ) CREATE TABLE product ( pr...
Return a bar chart on what are the district names and city populations for all districts that between 200,000 and 2,000,000 residents?, show by the y-axis in descending.
SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000 ORDER BY City_Population DESC
CREATE TABLE table_44446 ( "Designation" text, "Name" text, "Launch date" text, "ISS docking date" text, "Deorbit date" text )
When did the ATV that deorbited on 29 september 2008, launch?
SELECT "Launch date" FROM table_44446 WHERE "Deorbit date" = '29 september 2008'
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...
give me the number of patients whose diagnoses short title is toxic encephalopathy and drug route is im?
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.short_title = "Toxic encephalopathy" AND prescriptions.route = "IM"
CREATE TABLE table_name_18 ( operating_system_version VARCHAR, storage___flash__ VARCHAR )
Which operating system has a storage (flash) of 128MB?
SELECT operating_system_version FROM table_name_18 WHERE storage___flash__ = "128mb"
CREATE TABLE table_76167 ( "Year" text, "Winner" text, "Points" real, "Playoff result" text, "Win #" real )
What is Winner, when Win # is greater than 1, and when Points is less than 94?
SELECT "Winner" FROM table_76167 WHERE "Win #" > '1' AND "Points" < '94'
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE class_of_service ( booking_...
what is AA 's schedule of morning flights to ATLANTA
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE (city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight.departure_time BETWEEN 0 AND 1200 AND flight.to_airport = airport_service.airport_code) AND flight.airline_code = 'AA'
CREATE TABLE actor ( actor_id number, first_name text, last_name text, last_update time ) CREATE TABLE staff ( staff_id number, first_name text, last_name text, address_id number, picture others, email text, store_id number, active boolean, username text, passwor...
Return the titles of any movies with an R rating.
SELECT title FROM film WHERE rating = 'R'
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 prescriptions...
give me the number of patients whose admission type is urgent and insurance is self pay?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.insurance = "Self Pay"
CREATE TABLE table_17080868_8 ( location_attendance VARCHAR, game VARCHAR )
54 is the game where location attendance are.
SELECT location_attendance FROM table_17080868_8 WHERE game = 54
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Find ACC_Regular_Season and ACC_Percent , and visualize them by a bar chart, and could you order by the y axis from high to low?
SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( ...
what is the name of a drug that patient 99647 was prescribed within the same hospital visit after having received a open reduct face fx nec procedure since 01/2105?
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 99647 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce...
CREATE TABLE table_name_89 ( chassis VARCHAR, team VARCHAR )
Which chassis has marlboro brm as the team?
SELECT chassis FROM table_name_89 WHERE team = "marlboro brm"
CREATE TABLE table_34170 ( "Team" text, "City, Region" text, "Arena" text, "Colours" text, "Head coach" text )
What team is in the toyota h llin arena?
SELECT "Team" FROM table_34170 WHERE "Arena" = 'toyota höllin'
CREATE TABLE table_45434 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text )
What is Record, when Date is October 31?
SELECT "Record" FROM table_45434 WHERE "Date" = 'october 31'
CREATE TABLE table_12028543_3 ( losingteam VARCHAR, cup_finaldate VARCHAR )
How many losingteams were for the cup finaldate 20 August 1989?
SELECT COUNT(losingteam) FROM table_12028543_3 WHERE cup_finaldate = "20 August 1989"
CREATE TABLE table_name_91 ( couple VARCHAR, results VARCHAR, style VARCHAR )
Which couple participated in the Paso Doble style and were safe?
SELECT couple FROM table_name_91 WHERE results = "safe" AND style = "paso doble"
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Average question score this month.
SELECT AVG(Score) FROM Posts WHERE PostTypeId = 1 AND CreationDate > DATEADD(month, -1, GETDATE())
CREATE TABLE table_26220 ( "Season" real, "Champion" text, "Count" real, "Runners-up" text, "Third place" text, "Top scorer" text, "Top scorers club" text, "Goals" text )
How many season had Melgar as a champion?
SELECT COUNT("Season") FROM table_26220 WHERE "Champion" = 'Melgar'
CREATE TABLE table_name_8 ( year VARCHAR, events_won_by_kclMS INTEGER )
How many years were the events won by KCLMS less than 7?
SELECT COUNT(year) FROM table_name_8 WHERE events_won_by_kclMS < 7
CREATE TABLE table_name_96 ( score VARCHAR, opponent_in_the_final VARCHAR )
What was the final score of the Paul Goldstein match?
SELECT score FROM table_name_96 WHERE opponent_in_the_final = "paul goldstein"
CREATE TABLE table_52704 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text )
What is the constructor where the circuit is Silverstone?
SELECT "Constructor" FROM table_52704 WHERE "Circuit" = 'silverstone'
CREATE TABLE table_name_15 ( losses INTEGER, benalla_dfl VARCHAR, wins VARCHAR )
When Benall DFL is Goorambat with less than 13 wins, what is the least amount of losses?
SELECT MIN(losses) FROM table_name_15 WHERE benalla_dfl = "goorambat" AND wins < 13
CREATE TABLE subjects ( subject_id number, subject_name text ) CREATE TABLE student_course_enrolment ( registration_id number, student_id number, course_id number, date_of_enrolment time, date_of_completion time ) CREATE TABLE course_authors_and_tutors ( author_id number, author_tu...
On what dates did the student whose personal name is 'Karson' enroll in and complete the courses?
SELECT T1.date_of_enrolment, T1.date_of_completion FROM student_course_enrolment AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id WHERE T2.personal_name = "Karson"
CREATE TABLE table_name_35 ( losses VARCHAR, draws VARCHAR, wins VARCHAR )
What's the number of losses when the wins were more than 11 and had 0 draws?
SELECT COUNT(losses) FROM table_name_35 WHERE draws = 0 AND wins > 11
CREATE TABLE table_name_31 ( lost VARCHAR, drawn VARCHAR, games VARCHAR )
What is the total number of losses that have 1 draw and games over 7?
SELECT COUNT(lost) FROM table_name_31 WHERE drawn = 1 AND games > 7
CREATE TABLE table_name_25 ( date VARCHAR, away VARCHAR )
On what date were the Ottawa Swans the away team?
SELECT date FROM table_name_25 WHERE away = "ottawa swans"
CREATE TABLE table_name_77 ( tournament VARCHAR )
What is the 2009 for 2012 1R in Wimbledon and a 2011 2r?
SELECT 2009 FROM table_name_77 WHERE 2012 = "1r" AND tournament = "wimbledon" AND 2011 = "2r"
CREATE TABLE table_38268 ( "Driver" text, "Season" text, "Entries" real, "Front row starts" real, "Percentage" text )
What was the highest front row starts for Alain Prost?
SELECT MAX("Front row starts") FROM table_38268 WHERE "Driver" = 'alain prost'
CREATE TABLE table_43333 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the mean number in the top 5 when the top 25 is 1 and there's fewer than 0 wins?
SELECT AVG("Top-5") FROM table_43333 WHERE "Top-25" = '1' AND "Wins" < '0'
CREATE TABLE table_name_98 ( venue VARCHAR, year VARCHAR, notes VARCHAR )
What was the venue that had 5000 m after 2009?
SELECT venue FROM table_name_98 WHERE year > 2009 AND notes = "5000 m"
CREATE TABLE table_40257 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
What was the highest grid value for riders with manufacturer of Aprilia and time of +1.660?
SELECT MAX("Grid") FROM table_40257 WHERE "Manufacturer" = 'aprilia' AND "Time/Retired" = '+1.660'
CREATE TABLE table_1341423_38 ( candidates VARCHAR, incumbent VARCHAR )
How many candidates were there in the district won by Joe Hoeffel?
SELECT COUNT(candidates) FROM table_1341423_38 WHERE incumbent = "Joe Hoeffel"
CREATE TABLE table_19551 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
what's the nhl team with college/junior/club team being brandon wheat kings (wchl)
SELECT "NHL team" FROM table_19551 WHERE "College/junior/club team" = 'Brandon Wheat Kings (WCHL)'
CREATE TABLE table_23137 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What nationality for neil korzack?
SELECT "Nationality" FROM table_23137 WHERE "Player" = 'Neil Korzack'
CREATE TABLE table_63505 ( "Party" text, "County" real, "City" real, "Borough" real, "Town" real, "Total" real )
What average city has a total less than 2, with a borough greater than 0?
SELECT AVG("City") FROM table_63505 WHERE "Total" < '2' AND "Borough" > '0'
CREATE TABLE table_name_95 ( tenure VARCHAR, cause_of_death VARCHAR, badge_serial_number VARCHAR )
What is the Tenure of the Officer who died in a helicopter accident with Badge/Serial Number 16805?
SELECT tenure FROM table_name_95 WHERE cause_of_death = "helicopter accident" AND badge_serial_number = "16805"
CREATE TABLE table_3952 ( "Code" text, "District" text, "Headquarters" text, "Population (2001 Census)" real, "Population (2011 Census)" real, "Area (km\u00b2)" real, "Density in 2011 (/km\u00b2)" text )
What's the code of the district in which 312520 people lived in 2011?
SELECT "Code" FROM table_3952 WHERE "Population (2011 Census)" = '312520'
CREATE TABLE table_name_28 ( crowd INTEGER, venue VARCHAR )
What was the average size of the crowd for matches held at Corio Oval?
SELECT AVG(crowd) FROM table_name_28 WHERE venue = "corio oval"
CREATE TABLE table_name_60 ( result VARCHAR, date VARCHAR )
WHAT IS THE RESULT OF THE GAME ON APRIL 23?
SELECT result FROM table_name_60 WHERE date = "april 23"
CREATE TABLE table_name_94 ( preliminaries INTEGER, evening_gown VARCHAR )
What is the lowest Preliminary score of a contestant that has an Evening Gown score of 8.472?
SELECT MIN(preliminaries) FROM table_name_94 WHERE evening_gown = 8.472
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Students ( stud...
List the number of completion students in each day and group by date of completion in a line chart, and show from high to low by the X-axis please.
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment GROUP BY date_of_completion ORDER BY date_of_completion DESC
CREATE TABLE party ( minister VARCHAR, party_name VARCHAR )
Show all ministers who do not belong to Progress Party.
SELECT minister FROM party WHERE party_name <> 'Progress Party'
CREATE TABLE table_64678 ( "World record" text, "Snatch" text, "Akakios Kakiasvilis ( GRE )" text, "188kg" text, "Athens , Greece" text )
What world record has the 188kg as 187kg?
SELECT "World record" FROM table_64678 WHERE "188kg" = '187kg'
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 difference in weight was there in patient 006-118236 last measured on the last hospital visit compared to the second to last value measured on the last hospital visit?
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-118236' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS N...
CREATE TABLE table_1601792_4 ( television_station VARCHAR, transmitted VARCHAR, frequency VARCHAR )
What is the station that is transmitted at 20 kw and has a frequency of 48 uhf?
SELECT television_station FROM table_1601792_4 WHERE transmitted = "20 kW" AND frequency = "48 UHF"
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar...
What are some of the 400 / 500 -level PHYSICS courses with the least workload ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN program_course WHERE ((course.number < 400 + 100 AND course.number >= 400) OR (course.number < 500 + 100 AND course.number >= 500)) AND course.department = 'PHYSICS' AND program_course.workload = (SELECT MIN(PR...
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name te...
Number of entries in PostHistory.
SELECT COUNT(*) FROM PostHistory
CREATE TABLE table_name_84 ( d_50 VARCHAR, d_41 VARCHAR )
What is the D 50 when the D 41 is d 41?
SELECT d_50 FROM table_name_84 WHERE d_41 = "d 41"
CREATE TABLE table_55442 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What did the home team score when playing against Collingwood?
SELECT "Home team score" FROM table_55442 WHERE "Away team" = 'collingwood'
CREATE TABLE table_67074 ( "Competition" text, "1993\u2013 94" text, "1994\u2013 95" text, "1995\u2013 96" text, "1996\u2013 97" text, "1997\u2013 98" text, "1998\u2013 99" text, "1999\u2013 2000" text, "2000\u2013 01" text, "2001\u2013 02" text, "2002\u2013 03" text, "20...
Name the 2014 which has a 2003-04 of did not participate and a 2005 of did not participate
SELECT "2014" FROM table_67074 WHERE "2003\u2013 04" = 'did not participate' AND "2005" = 'did not participate'
CREATE TABLE table_5950 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff" text, "Game site" text, "Record" text, "Match Report" text )
What was the result when the new england patriots played?
SELECT "Result" FROM table_5950 WHERE "Opponent" = 'new england patriots'
CREATE TABLE table_name_31 ( round VARCHAR, fixtures VARCHAR )
What is the Round when the value for Fixtures is 2?
SELECT round FROM table_name_31 WHERE fixtures = 2