table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_46742 ( "Country" text, "Amateur Era" real, "Open Era" real, "All-time" real, "First title" real, "Last title" real )
What is the sum of All-Time, when Amateur Era is less than 0?
SELECT SUM("All-time") FROM table_46742 WHERE "Amateur Era" < '0'
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...
What courses should I take before BCS 439 ?
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'BCS' AND number = 439
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 death status and diagnoses icd9 code of subject name bruce harris?
SELECT demographic.expire_flag, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Bruce Harris"
CREATE TABLE table_32253 ( "Season" real, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "Podiums" text, "Points" text, "Final Placing" text )
What was the points with 7 races?
SELECT "Points" FROM table_32253 WHERE "Races" = '7'
CREATE TABLE table_30818 ( "Pick" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
Who did Edmonton Oilers get for their draft pick?
SELECT "Player" FROM table_30818 WHERE "NHL team" = 'Edmonton Oilers'
CREATE TABLE table_name_96 ( outcome VARCHAR, score_in_the_final VARCHAR )
Which Outcome has a Score in the final of 4 6, 5 7?
SELECT outcome FROM table_name_96 WHERE score_in_the_final = "4–6, 5–7"
CREATE TABLE table_30511 ( "Pick" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
what is the number of the chosen club where the hc dukla tren n (slovakia) is from
SELECT COUNT("Pick") FROM table_30511 WHERE "College/junior/club team" = 'HC Dukla Trenčín (Slovakia)'
CREATE TABLE table_17814458_1 ( capacity_in_persons_hour INTEGER, construction_year_s_ VARCHAR )
Name the least capacity for persons hour for 1983
SELECT MIN(capacity_in_persons_hour) FROM table_17814458_1 WHERE construction_year_s_ = "1983"
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
when was the first time that patient 027-139111 had a maximum systemicsystolic on 07/06/2103.
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-139111')) AND NOT vitalperiodic.systemicsystoli...
CREATE TABLE table_204_903 ( id number, "title" text, "character" text, "broadcaster" text, "episodes" number, "date" number )
were there more than four episodes that featured cynthia ?
SELECT (SELECT "episodes" FROM table_204_903 WHERE "character" = 'cynthia') > 4
CREATE TABLE table_train_152 ( "id" int, "systolic_blood_pressure_sbp" int, "creatinine_clearance_cl" float, "diastolic_blood_pressure_dbp" int, "total_cholesterol" int, "urine_protein" int, "proteinuria" int, "NOUSE" float )
creatinine > 1.6 mg / dl
SELECT * FROM table_train_152 WHERE creatinine_clearance_cl > 1.6
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, Po...
Top 50 users from Auckland.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%auckland%' OR UPPER(Location) LIKE '%AUCKLAND' ORDER BY Reputation DESC LIMIT 50
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDa...
Questions from a user with no accepted answer.
SELECT questions.Id AS "post_link", COUNT(*) AS "AnswerCount" FROM Posts AS questions JOIN Posts AS answers ON answers.ParentId = questions.Id WHERE questions.OwnerUserId = '##UserId##' AND questions.PostTypeId = 1 AND questions.AcceptedAnswerId IS NULL GROUP BY questions.Id
CREATE TABLE program ( program_id number, name text, origin text, launch number, owner text ) CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, share_in_percent number ) CREATE TABLE channel ( channel_id number, name text, owner text, s...
Count the number of distinct channel owners.
SELECT COUNT(DISTINCT owner) FROM channel
CREATE TABLE table_name_10 ( winner VARCHAR, young_rider_classification VARCHAR, mountains_classification VARCHAR, general_classification VARCHAR, points_classification VARCHAR )
Who was the winner when the General classification was held by Miguel Indurain, the Points classification held by Mario Cipollini, the Mountains classification held by Claudio Chiappucci, and the Young RIder classification held by Pavel Tonkov?
SELECT winner FROM table_name_10 WHERE general_classification = "miguel indurain" AND points_classification = "mario cipollini" AND mountains_classification = "claudio chiappucci" AND young_rider_classification = "pavel tonkov"
CREATE TABLE table_20236726_2 ( builder VARCHAR, wd_no VARCHAR )
Name the builder for wd number being 22
SELECT builder FROM table_20236726_2 WHERE wd_no = 22
CREATE TABLE table_name_60 ( route INTEGER, rank VARCHAR, elevation VARCHAR )
On what Route is the mountain with a Rank less than 33 and an Elevation of 11,312 feet 3448 m?
SELECT MAX(route) FROM table_name_60 WHERE rank < 33 AND elevation = "11,312 feet 3448 m"
CREATE TABLE table_76493 ( "Game" real, "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" text )
What is the venue of game 3?
SELECT "Venue" FROM table_76493 WHERE "Game" = '3'
CREATE TABLE table_name_12 ( player VARCHAR, to_par VARCHAR, score VARCHAR )
What Player's had a To par of +1 and a Score of 73-71-73=217?
SELECT player FROM table_name_12 WHERE to_par = "+1" AND score = 73 - 71 - 73 = 217
CREATE TABLE view_unit_status ( apt_id number, apt_booking_id number, status_date time, available_yn others ) CREATE TABLE apartments ( apt_id number, building_id number, apt_type_code text, apt_number text, bathroom_count number, bedroom_count number, room_count text ) CRE...
What is the minimum and maximum number of bathrooms of all the apartments?
SELECT MIN(bathroom_count), MAX(bathroom_count) FROM apartments
CREATE TABLE table_4962 ( "Date" real, "Opponent" text, "Result" text, "Odds" text, "Location" text, "Score" text )
What was the score for a game with the odds of p + 2 after 1847?
SELECT "Score" FROM table_4962 WHERE "Odds" = 'p + 2' AND "Date" > '1847'
CREATE TABLE store_district ( store_id number, district_id number ) CREATE TABLE product ( product_id number, product text, dimensions text, dpi number, pages_per_minute_color number, max_page_size text, interface text ) CREATE TABLE district ( district_id number, district_...
Find the list of page size which have more than 3 product listed
SELECT max_page_size FROM product GROUP BY max_page_size HAVING COUNT(*) > 3
CREATE TABLE table_72729 ( "Series #" real, "Season #" real, "Title" text, "Directed by:" text, "Written by:" text, "Original air date" text )
Who directed the episode that was written by Jackson Gillis and Originally aired on May 21, 1955?
SELECT "Directed by:" FROM table_72729 WHERE "Written by:" = 'Jackson Gillis' AND "Original air date" = 'May 21, 1955'
CREATE TABLE table_71138 ( "Auckland" text, "Canterbury" text, "Central Districts" text, "Otago" text, "Wellington" text )
What is Auckland thats got Otago of 184 R.C. Blunt & W. Hawksworth V (C) 1931/32?
SELECT "Auckland" FROM table_71138 WHERE "Otago" = '184 r.c. blunt & w. hawksworth v (c) 1931/32'
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
show me patient 013-17922's daily maximum mchc since 160 months ago.
SELECT MAX(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 = '013-17922')) AND lab.labname = 'mchc' AND DATETIME(lab.labresulttime) >= DATETIME(...
CREATE TABLE table_44814 ( "Round" real, "Pick" real, "Player" text, "Position" text, "Nationality" text, "School/Club Team" text )
In what Round was Grant Long Drafted?
SELECT MIN("Round") FROM table_44814 WHERE "Player" = 'grant long'
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, ...
had patient 27146 received meds since 12/2105?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27146) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-12'
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city var...
Which professor will be teaching HJCS 477 next semester ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester...
CREATE TABLE table_name_58 ( tournament VARCHAR )
What Tournament was the 2010 Olympic Games?
SELECT tournament FROM table_name_58 WHERE 2010 = "olympic games"
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) 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...
On the ANTHRCUL 500 -level which courses are for 17 -credits ?
SELECT DISTINCT department, name, number FROM course WHERE credits = 17 AND department = 'ANTHRCUL' AND number < 500 + 100 AND number >= 500
CREATE TABLE table_30490 ( "Team" text, "Female \u00e9p\u00e9e" text, "Male \u00e9p\u00e9e" text, "Female foil" text, "Male foil" text, "Female saber" text, "Male saber" text, "Average fencers rank" text, "Initial Team rank" real )
What female fenced with a saber on the team that had an average fencer rank of 3.5?
SELECT "Female saber" FROM table_30490 WHERE "Average fencers rank" = '3.5'
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
What is the averag weights for people of each sex? Show a bar chart.
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex
CREATE TABLE table_16317 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What was the college for the player with the cfl team of Edmonton Eskimos (via calgary)?
SELECT "College" FROM table_16317 WHERE "CFL Team" = 'Edmonton Eskimos (via Calgary)'
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row...
calculate the number of patients who received a periph nerve destruction procedure two or more times.
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'periph nerve destruct...
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationD...
How many answers are there?.
SELECT COUNT(A.Id) FROM Posts AS A WHERE A.PostTypeId = 2
CREATE TABLE table_name_83 ( bleeding_time VARCHAR, platelet_count VARCHAR, condition VARCHAR )
Name the bleeding time with platelet count of unaffected and condition of factor xii deficiency
SELECT bleeding_time FROM table_name_83 WHERE platelet_count = "unaffected" AND condition = "factor xii deficiency"
CREATE TABLE table_name_2 ( played INTEGER, drawn VARCHAR, lost VARCHAR, percentage VARCHAR )
what is the highest number of games played when there was 2 losses, percentage was 0.00% and more than 0 draws?
SELECT MAX(played) FROM table_name_2 WHERE lost = 2 AND percentage = "0.00%" AND drawn > 0
CREATE TABLE competition ( Competition_type VARCHAR, Country VARCHAR )
What are the types and countries of competitions?
SELECT Competition_type, Country FROM competition
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 ...
Give me the number of patients with atrial septal defect/mitral valve replacement repair atrial-septal defect/sda who underwent catheter based invasive electrophysiologic testing.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ATRIAL SEPTAL DEFECT\MITRAL VALVE REPLACEMENT;REPAIR ATRIAL-SEPTAL DEFECT/SDA" AND procedures.short_title = "Cath base invasv ep test"
CREATE TABLE table_name_36 ( fastest_lap VARCHAR, grand_prix VARCHAR )
Who had the fastest lap at the Australian Grand Prix?
SELECT fastest_lap FROM table_name_36 WHERE grand_prix = "australian grand prix"
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( ro...
when was patient 4401's heart rate last measured less than 90.0 since 12/25/2105?
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4401)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat...
CREATE TABLE table_name_80 ( away_team VARCHAR, home_team VARCHAR )
When the home team was geelong, who played as the away team?
SELECT away_team FROM table_name_80 WHERE home_team = "geelong"
CREATE TABLE table_64918 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text )
What is the rank for the rowers with the time of 6:24.35?
SELECT "Rank" FROM table_64918 WHERE "Time" = '6:24.35'
CREATE TABLE table_29141354_7 ( scores VARCHAR, andrew_and_jacks_guest VARCHAR )
What was the score for the episode with Matt Smith as Andrew and Jack's guest?
SELECT scores FROM table_29141354_7 WHERE andrew_and_jacks_guest = "Matt Smith"
CREATE TABLE table_229059_2 ( score VARCHAR, champion VARCHAR )
What was the score in the tournament won by Jan Stephenson?
SELECT score FROM table_229059_2 WHERE champion = "Jan Stephenson"
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 ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is drug route of drug name ascorbic acid?
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Ascorbic Acid"
CREATE TABLE table_203_215 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
how many times did japan place in the top 2 ?
SELECT COUNT(*) FROM table_203_215 WHERE "position" <= 2
CREATE TABLE table_27361255_1 ( location VARCHAR, institution VARCHAR )
Where is Robert Morris University-Illinois held?
SELECT location FROM table_27361255_1 WHERE institution = "Robert Morris University-Illinois"
CREATE TABLE table_1341577_50 ( result VARCHAR, incumbent VARCHAR )
What was the final result for Les Aspin?
SELECT result FROM table_1341577_50 WHERE incumbent = "Les Aspin"
CREATE TABLE storm ( damage_millions_USD INTEGER, max_speed INTEGER )
Show the average and maximum damage for all storms with max speed higher than 1000.
SELECT AVG(damage_millions_USD), MAX(damage_millions_USD) FROM storm WHERE max_speed > 1000
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ...
Top 50 Stack Overflow Users Of Nepal.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC), Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%nepal%' OR UPPER(Location) LIKE '%NP' ORDER BY Reputation DESC LIMIT 50
CREATE TABLE accounts ( account_id number, customer_id number, account_name text, other_account_details text ) CREATE TABLE financial_transactions ( transaction_id number, previous_transaction_id number, account_id number, card_id number, transaction_type text, transaction_date ...
What are the different card type codes, and how many different customers hold each type?
SELECT card_type_code, COUNT(DISTINCT customer_id) FROM customers_cards GROUP BY card_type_code
CREATE TABLE table_71854 ( "Matches" real, "Innings" real, "Not Out" real, "High Score" text, "Runs" real, "Average" real )
What is the high run total associated with a high score of 385 and under 407 innings?
SELECT MAX("Runs") FROM table_71854 WHERE "High Score" = '385' AND "Innings" < '407'
CREATE TABLE table_name_77 ( place VARCHAR, country VARCHAR, player VARCHAR )
Where is john daly of united states from?
SELECT place FROM table_name_77 WHERE country = "united states" AND player = "john daly"
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...
how many patients whose drug route is po?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "PO"
CREATE TABLE table_56198 ( "Rank" real, "Player" text, "Country" text, "Earnings( $ )" real, "Wins" real )
What is the highest rank for gene littler with under 3 wins and under $962,133?
SELECT MAX("Rank") FROM table_56198 WHERE "Earnings( $ )" < '962,133' AND "Player" = 'gene littler' AND "Wins" < '3'
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
how much of a difference has patient 010-6010 in anion gap second measured on the first hospital visit compared to the first value measured on the first 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 = '010-6010' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit...
CREATE TABLE table_43633 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is Event, when Round is '1', when Location is 'New Town, North Dakota , United States' and when Time is '4:12'?
SELECT "Event" FROM table_43633 WHERE "Round" = '1' AND "Location" = 'new town, north dakota , united states' AND "Time" = '4:12'
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, ...
How many distinct types of accounts are there?
SELECT COUNT(DISTINCT acc_type) FROM customer
CREATE TABLE table_12082 ( "Draw" real, "Artist" text, "Song" text, "Points" real, "Place" real )
Where did the artist All Mixed Up place?
SELECT MIN("Place") FROM table_12082 WHERE "Artist" = 'all mixed up'
CREATE TABLE table_name_48 ( attendance VARCHAR, home_team VARCHAR )
What was the attendance for the home team of Walsall?
SELECT attendance FROM table_name_48 WHERE home_team = "walsall"
CREATE TABLE table_64351 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Playing against the Seattle Seahawks in a week after week 1 before 69,149 people what was the result of the game?
SELECT "Result" FROM table_64351 WHERE "Week" > '1' AND "Attendance" = '69,149' AND "Opponent" = 'seattle seahawks'
CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Ra...
Show the number of faculty members for each rank in a bar chart.
SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank
CREATE TABLE table_738 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
what's the party with incumbent being herbert covington bonner
SELECT "Party" FROM table_738 WHERE "Incumbent" = 'Herbert Covington Bonner'
CREATE TABLE table_32250 ( "Season" real, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "Podiums" text, "Points" text, "Final Placing" text )
What are the points for the GP3 series with 2 podiums?
SELECT "Points" FROM table_32250 WHERE "Series" = 'gp3 series' AND "Podiums" = '2'
CREATE TABLE table_38734 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which Venue has a Result of 5-1, and a Score of 3-0?
SELECT "Venue" FROM table_38734 WHERE "Result" = '5-1' AND "Score" = '3-0'
CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE election ( ...
For each party, use a bar chart to show the number of its delegates, sort bars in asc order.
SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party
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...
what is diagnoses short title and procedure short title of subject name lue white?
SELECT diagnoses.short_title, procedures.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Lue White"
CREATE TABLE musical ( musical_id number, name text, year number, award text, category text, nominee text, result text ) CREATE TABLE actor ( actor_id number, name text, musical_id number, character text, duration text, age number )
What are the names of actors, ordered alphabetically?
SELECT name FROM actor ORDER BY name
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, ...
calculate the total dose of pregestimil ng in patient 17398 on 08/21/2102.
SELECT SUM(inputevents_cv.amount) 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 = 17398)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
CREATE TABLE table_name_40 ( partner VARCHAR, style VARCHAR, results VARCHAR )
Who was the partner for the jazz piece in the bottom three?
SELECT partner FROM table_name_40 WHERE style = "jazz" AND results = "bottom three"
CREATE TABLE table_name_51 ( unit VARCHAR, novelty VARCHAR )
What unit has gen et sp nov as the novelty?
SELECT unit FROM table_name_51 WHERE novelty = "gen et sp nov"
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 ) ...
how many patients whose language is *lit and lab test name is creatine kinase, mb isoenzyme?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.language = "*LIT" AND lab.label = "Creatine Kinase, MB Isoenzyme"
CREATE TABLE table_name_44 ( draws INTEGER, against VARCHAR, wins VARCHAR )
Can you tell me the sum of Draws that has the Against larger than 1106, and the Wins larger than 13?
SELECT SUM(draws) FROM table_name_44 WHERE against > 1106 AND wins > 13
CREATE TABLE table_name_77 ( total INTEGER, gold INTEGER )
What is the average Total with a Gold that is larger than 4?
SELECT AVG(total) FROM table_name_77 WHERE gold > 4
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, ...
how many patients on continuous invasive mechanical ventilation for more than or equal to 96 consecutive hours had medicaid insurance?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "Continuous invasive mechanical ventilation for 96 consecutive hours or more"
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, h...
tell me the difference between the total amount of input of patient 15447 on the current icu visit and the total amount of output of the patient?
SELECT (SELECT SUM(inputevents_cv.amount) 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 = 15447) AND icustays.outtime IS NULL)) - (SELECT SUM(outputevents.value) FROM outpu...
CREATE TABLE college ( state VARCHAR, enr INTEGER )
What is the number of states that has some colleges whose enrollment is smaller than the average enrollment?
SELECT COUNT(DISTINCT state) FROM college WHERE enr < (SELECT AVG(enr) FROM college)
CREATE TABLE table_name_89 ( platform VARCHAR, title VARCHAR )
What's the platform of Super Mario All-Stars?
SELECT platform FROM table_name_89 WHERE title = "super mario all-stars"
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...
how many patients whose procedure icd9 code is 3950?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "3950"
CREATE TABLE table_347 ( "Year" real, "Song name" text, "Film name" text, "Co-singer" text, "Music director" text, "Lyricist" text, "Language" text )
Who was the lyricist for gopal krishna and co singer of solo?
SELECT "Lyricist" FROM table_347 WHERE "Film name" = 'Gopal Krishna' AND "Co-singer" = 'Solo'
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
count the number of patients who received a venous cath nec procedure two or more times since 2 years ago?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'venous cath nec') AND...
CREATE TABLE table_57079 ( "Player" text, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text )
Who is the player from Auburn?
SELECT "Player" FROM table_57079 WHERE "School/Club Team" = 'auburn'
CREATE TABLE table_name_34 ( date VARCHAR, team VARCHAR, venue VARCHAR )
What day did Glentoran play at Windsor Park, Belfast?
SELECT date FROM table_name_34 WHERE team = "glentoran" AND venue = "windsor park, belfast"
CREATE TABLE table_name_50 ( to_par VARCHAR, country VARCHAR, place VARCHAR, score VARCHAR )
What is the to par of the player from the United States with a place of t1 and a 76-68=144 score?
SELECT to_par FROM table_name_50 WHERE country = "united states" AND place = "t1" AND score = 76 - 68 = 144
CREATE TABLE table_55411 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the combined of Crowd when richmond played at home?
SELECT COUNT("Crowd") FROM table_55411 WHERE "Home team" = 'richmond'
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
what is the name of the drug prescribed for patient 030-52395 in the same hospital visit after they has been diagnosed with gi obstruction / ileus - gastric obstruction until 6 months ago?
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
CREATE TABLE table_35708 ( "Source" text, "Date" text, "Fidesz" text, "MSZP" text, "SZDSZ" text, "Jobbik" text, "others" text )
What is the SZDSZ percentage with a Jobbik of 5% and a Fidesz of 68%?
SELECT "SZDSZ" FROM table_35708 WHERE "Jobbik" = '5%' AND "Fidesz" = '68%'
CREATE TABLE table_40246 ( "Season" real, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Position" text )
Which teams had the 1st position and entered 1 race?
SELECT "Team" FROM table_40246 WHERE "Races" = '1' AND "Position" = '1st'
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
since 5 years ago, what are the top three most frequent diagnoses patients were given in the same hospital encounter after receiving exc/dest hrt lesion open?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_i...
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTasks (...
Questions with a particular tag.
SELECT p.Id AS "post_link", p.Tags FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId WHERE p.Id IN (SELECT p.Id FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE PostTypeId = 1 AND TagName = 'mythology') AND p.ClosedDate IS NULL GROUP BY p.Id, p.Tags...
CREATE TABLE table_43564 ( "Year" text, "Matches" real, "Wins" real, "Losses" real, "No Result" real, "Win %" text )
What is the total number of wins in 2010, when there were more than 14 matches?
SELECT COUNT("Wins") FROM table_43564 WHERE "Year" = '2010' AND "Matches" > '14'
CREATE TABLE table_27476 ( "Rank" real, "Rank w/o Hydropower" real, "State" text, "% Renewable" text, "% Renewable w/o Hydro" text, "Renewable electricity (GW\u00b7h)" real, "Renewable electricity w/o Hydro (GW\u00b7h)" real, "Total electricity (GW\u00b7h)" real )
How many data was given the total electricity in GW-h if the renewable electricity w/o hydro (GW-h) is 3601?
SELECT COUNT("Total electricity (GW\u00b7h)") FROM table_27476 WHERE "Renewable electricity w/o Hydro (GW\u00b7h)" = '3601'
CREATE TABLE table_name_80 ( year INTEGER, city VARCHAR )
What is the lowest year when the city is casablanca?
SELECT MIN(year) FROM table_name_80 WHERE city = "casablanca"
CREATE TABLE table_14070062_3 ( points VARCHAR, try_bonus VARCHAR )
How many points does the club with a try bonus of 10 have?
SELECT points FROM table_14070062_3 WHERE try_bonus = "10"
CREATE TABLE table_40538 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text )
When Centerfold model is on 3-04?
SELECT "Centerfold model" FROM table_40538 WHERE "Date" = '3-04'
CREATE TABLE table_203_687 ( id number, "#" number, "title" text, "time" text, "performer(s)" text, "songwriters" text, "producer(s)" text, "samples and notes" text )
what title had the longest run time ?
SELECT "title" FROM table_203_687 ORDER BY "time" DESC LIMIT 1
CREATE TABLE table_train_72 ( "id" int, "extracorporeal_membrane_oxygenation_ecmo_cannulation" bool, "heart_disease" bool, "meningitis_or_encephalitis" bool, "sepsis" bool, "cancer" bool, "prisoners" bool, "NOUSE" float )
history of extracorporeal membrane oxygenation ( ecmo ) cannulation.
SELECT * FROM table_train_72 WHERE extracorporeal_membrane_oxygenation_ecmo_cannulation = 1
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 diagnoses ( ...
what is diagnoses short title of subject id 2560?
SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "2560"
CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(50), country varchar2(20), f_id number(10), genre_is varchar2(20), rating nu...
What is the average song rating for each language Plot them as bar chart, and show by the languages in desc.
SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages DESC