table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_2076522_2 ( enrollment__fall_2010_ VARCHAR, location_s_ VARCHAR )
What is the enrollment for the school in bottineau?
SELECT enrollment__fall_2010_ FROM table_2076522_2 WHERE location_s_ = "Bottineau"
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
among patients who were prescribed cefazolin 2 gm in ns 100 ml ivpb after they had been diagnosed with esophageal ca show me the five year survival rate.
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
CREATE TABLE table_name_31 ( score VARCHAR, date VARCHAR, away_team VARCHAR )
What is the score on 23 November 1983 with exeter city as the away team?
SELECT score FROM table_name_31 WHERE date = "23 november 1983" AND away_team = "exeter city"
CREATE TABLE table_55713 ( "Game #" real, "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text, "Points" real )
What is the points where Toronto was the home team and the game number was larger than 63?
SELECT MAX("Points") FROM table_55713 WHERE "Home" = 'toronto' AND "Game #" > '63'
CREATE TABLE table_17949 ( "Season" text, "Airdate" text, "The Mole" text, "Winner" text, "Runner-up" text, "Prize money" text, "International destination" text )
what's the mole with prize money being 24,475
SELECT "The Mole" FROM table_17949 WHERE "Prize money" = '€24,475'
CREATE TABLE table_26907 ( "Codename (main article)" text, "Brand name (list)" text, "Cores" real, "L3 Cache" text, "Socket" text, "TDP" text, "I/O Bus" text )
What is the i/o bus for the brand name Core i3-21xx?
SELECT "I/O Bus" FROM table_26907 WHERE "Brand name (list)" = 'Core i3-21xx'
CREATE TABLE product ( product_id number, product_name text, product_details text ) CREATE TABLE problems ( problem_id number, product_id number, closure_authorised_by_staff_id number, reported_by_staff_id number, date_problem_reported time, date_problem_closed time, problem_des...
What are the product ids for the problems reported by Christop Berge with closure authorised by Ashley Medhurst?
SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop" AND T2.staff_last_name = "Berge" INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Ashley"...
CREATE TABLE table_77228 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
What is the Sum of ERP W, when Call Sign is K216GA?
SELECT SUM("ERP W") FROM table_77228 WHERE "Call sign" = 'k216ga'
CREATE TABLE table_45015 ( "Event" text, "Score" real, "Name" text, "Nation" text, "Games" text, "Date" text )
For the 27 arrow match event, what's the sum of all scores for that event?
SELECT SUM("Score") FROM table_45015 WHERE "Event" = '27 arrow match'
CREATE TABLE table_27498 ( "Year" real, "Population" real, "Index" real, "Violent" real, "Property" real, "Murder" real, "Forcible rape" real, "Robbery" real, "Aggravated assault" real, "Burglary" real, "Larceny Theft" real, "Vehicle Theft" real )
What was the number of murders the year forcible rapes were at 166?
SELECT "Murder" FROM table_27498 WHERE "Forcible rape" = '166'
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
when was the first microbiology test of patient 031-22988, until 16 months ago?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND DATETIME(microlab.culturetakentime) <= DATETIME(...
CREATE TABLE table_name_59 ( score INTEGER, player VARCHAR )
What was the top score for grier jones?
SELECT MAX(score) FROM table_name_59 WHERE player = "grier jones"
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, Cr...
Questions on a specific date.
SELECT * FROM Posts WHERE CreationDate = '##PostDate##' LIMIT 10
CREATE TABLE customers ( id number, first_name text, last_name text, company text, address text, city text, state text, country text, postal_code text, phone text, fax text, email text, support_rep_id number ) CREATE TABLE genres ( id number, name text ) CRE...
What are the first and last names of the 5 customers who purchased something most recently?
SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5
CREATE TABLE table_name_74 ( opponent VARCHAR, date VARCHAR )
Who was the opponent on May 20?
SELECT opponent FROM table_name_74 WHERE date = "may 20"
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients whose admission location is trsf within this facility and days of hospital stay is greater than 30?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.days_stay > "30"
CREATE TABLE table_name_77 ( place VARCHAR, player VARCHAR )
What is Brian Gay's place?
SELECT place FROM table_name_77 WHERE player = "brian gay"
CREATE TABLE table_66198 ( "Title" text, "Series" text, "Director" text, "Production Num." text, "Release date" text )
what is the title when the release date is 1938-12-17 and the production number is 8610?
SELECT "Title" FROM table_66198 WHERE "Release date" = '1938-12-17' AND "Production Num." = '8610'
CREATE TABLE table_name_41 ( score VARCHAR, opponent VARCHAR )
What was the score of the game against the San Diego Chargers?
SELECT score FROM table_name_41 WHERE opponent = "san diego chargers"
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...
Draw a pie chart about the proportion of All_Road and Team_ID.
SELECT All_Road, Team_ID FROM basketball_match
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, ...
Calculate the minimum age of patients admitted to emergency on the same day
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.days_stay = "0"
CREATE TABLE table_name_3 ( away_team VARCHAR, crowd INTEGER )
What was the away team at the match where the crowd was larger than 30,000?
SELECT away_team FROM table_name_3 WHERE crowd > 30 OFFSET 000
CREATE TABLE table_29574 ( "Name/Name of Act" text, "Age(s)" text, "Genre" text, "Act" text, "Hometown" text, "Qtr. Final (Week)" real, "Semi Final (Week)" text, "Position Reached" text )
What is the age of the act who is a rapper?
SELECT "Age(s)" FROM table_29574 WHERE "Act" = 'Rapper'
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Da...
Plot the number of payment method code by grouped by payment method code as a bar graph
SELECT Payment_Method_Code, COUNT(Payment_Method_Code) FROM Payments GROUP BY Payment_Method_Code
CREATE TABLE table_204_567 ( id number, "team" text, "location" text, "stadium" text, "capacity" number, "manager" text, "captain" text, "kit manufacturer" text, "shirt sponsor" text )
what stadium can hold no more than 2500 people ?
SELECT "stadium" FROM table_204_567 WHERE "capacity" <= 2500
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 Votes ( Id number, PostId number, VoteTypeId nu...
Users by number of tag edits.
SELECT UserId AS "user_link", COUNT(Id) FROM PostHistory WHERE PostHistoryTypeId = 6 GROUP BY UserId ORDER BY COUNT(Id) DESC
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many male patients had the diagnosis long title microscopic hematuria?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Microscopic hematuria"
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text ) CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real )
Show me a scatter plot of people id and total for .
SELECT People_ID, Total FROM body_builder
CREATE TABLE table_204_129 ( id number, "place" number, "team" text, "titles" number, "runners-up" number, "winning years" text )
how many more titles did team maccabi tel aviv win than every other team combined ?
SELECT (SELECT "titles" FROM table_204_129 WHERE "team" = 'maccabi tel aviv') - (SELECT SUM("titles") FROM table_204_129 WHERE "team" <> 'maccabi tel aviv')
CREATE TABLE table_24210 ( "Order" real, "Couple" text, "Karen" text, "Nicky" text, "Jason" text, "Ruthie" text, "Robin" text, "Total" text, "Scoreboard" text, "Song" text, "Public Vote %" text, "Result" text )
Name the number of song for scoreboard being 3rd
SELECT COUNT("Song") FROM table_24210 WHERE "Scoreboard" = '3rd'
CREATE TABLE table_18143210_2 ( first_season_of_current_spell_in_top_division VARCHAR, first_season_in_top_division VARCHAR )
When was the 'first season of current spell in top division' if the first season in top division is in 1964-65?
SELECT first_season_of_current_spell_in_top_division FROM table_18143210_2 WHERE first_season_in_top_division = "1964-65"
CREATE TABLE table_79064 ( "Elimination" text, "Wrestler" text, "Team" text, "Eliminated by" text, "Elimination Move" text, "Time" text )
Which Wrestler plays for Team Batista which was Elimated by Orton on Elimination 8?
SELECT "Wrestler" FROM table_79064 WHERE "Team" = 'team batista' AND "Eliminated by" = 'orton' AND "Elimination" = '8'
CREATE TABLE table_5765 ( "Opposition" text, "Score" text, "Venue" text, "City" text, "Year" real )
Which Venue has a Year of 1911?
SELECT "Venue" FROM table_5765 WHERE "Year" = '1911'
CREATE TABLE table_name_73 ( total VARCHAR, rank VARCHAR, silver VARCHAR, bronze VARCHAR )
How many total show when silver is 0, bronze is 1, and the rank is less than 3?
SELECT COUNT(total) FROM table_name_73 WHERE silver = 0 AND bronze = 1 AND rank < 3
CREATE TABLE table_name_12 ( record VARCHAR, method VARCHAR )
What was the record when the TKO (elbows) method was used?
SELECT record FROM table_name_12 WHERE method = "tko (elbows)"
CREATE TABLE table_5677 ( "County" text, "Per capita income" text, "Median household income" text, "Median family income" text, "Population" real, "Number of households" real )
When the Per capita income is $29,194, what is the average population?
SELECT AVG("Population") FROM table_5677 WHERE "Per capita income" = '$29,194'
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, lan...
tell me the price of a procedure called insert infusion pump?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_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 = 'insert infusion pump'))
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 age is less than 85 and diagnoses icd9 code is 53541?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "85" AND diagnoses.icd9_code = "53541"
CREATE TABLE table_42360 ( "Volume:Issue" text, "Issue Date(s)" text, "Weeks on Top" real, "Song" text, "Artist" text )
What was the issue date for the song by Paul Mccartney and Michael Jackson?
SELECT "Issue Date(s)" FROM table_42360 WHERE "Artist" = 'paul mccartney and michael jackson'
CREATE TABLE table_name_51 ( airline VARCHAR, notes VARCHAR )
What is the Airline when the notes show aoc 135?
SELECT airline FROM table_name_51 WHERE notes = "aoc 135"
CREATE TABLE table_name_16 ( date VARCHAR, visitor VARCHAR, record VARCHAR )
What day was the visitor Chicago Black Hawks and the record 0-2?
SELECT date FROM table_name_16 WHERE visitor = "chicago black hawks" AND record = "0-2"
CREATE TABLE table_204_55 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number )
how many games were scheduled between september 3rd and january 2nd ?
SELECT COUNT(*) FROM table_204_55
CREATE TABLE table_52270 ( "Name" text, "Years" text, "Area" text, "Authority" text, "Decile" text, "Roll" real )
What is the authority status of the school in Ellerslie with a decile of 7?
SELECT "Authority" FROM table_52270 WHERE "Area" = 'ellerslie' AND "Decile" = '7'
CREATE TABLE table_80169 ( "Representative" text, "Years" text, "State" text, "Party" text, "Lifespan" text )
What is the lifespan of Joseph Vance, a democratic-republican from Ohio?
SELECT "Lifespan" FROM table_80169 WHERE "State" = 'ohio' AND "Representative" = 'joseph vance' AND "Party" = 'democratic-republican'
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskStates ( Id number, ...
zero voted answers to total answers.
SELECT CAST(a.zero_voted_answers * 100.0 AS FLOAT) / a.total_answers AS percentage FROM (SELECT COUNT(*) AS total_answers, COUNT(CASE WHEN Score = 0 THEN 1 ELSE NULL END) AS zero_voted_answers FROM Posts WHERE OwnerUserId = '##UserId##' AND PostTypeId = 2) AS a
CREATE TABLE table_name_69 ( standard_order VARCHAR, traditional_chinese VARCHAR )
Which number is ?
SELECT standard_order FROM table_name_69 WHERE traditional_chinese = "國殤"
CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number, secretary_vote number, treasurer_vote number, class_president_vote number, class_senator_vote number ) CREATE TABLE student ( stuid number, ...
List the major of each male student.
SELECT major FROM student WHERE sex = "M"
CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, date_joined_staff time, date_left_staff time ) CREATE TABLE addresses ( address_id number, line_1_number_building text, ci...
List the states which have between 2 to 4 staffs living there.
SELECT T1.state_province_county FROM addresses AS T1 JOIN staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING COUNT(*) BETWEEN 2 AND 4
CREATE TABLE table_68885 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What team did Johnson (11-7) play for?
SELECT "Opponent" FROM table_68885 WHERE "Loss" = 'johnson (11-7)'
CREATE TABLE table_name_96 ( Id VARCHAR )
Which 2002 has a 2009 of 2r?
SELECT 2002 FROM table_name_96 WHERE 2009 = "2r"
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 procedures ( ...
provide the number of patients whose diagnoses short title is seroma complicting proc and lab test category is hematology?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Seroma complicting proc" AND lab."CATEGORY" = "Hematology"
CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE member_of_club ( stuid number, clu...
Which clubs have one or more members from the city with code 'HOU'? Give me the names of the clubs.
SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = "HOU"
CREATE TABLE table_53572 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text )
What's the heigh of the player who went to lake howell high school?
SELECT "Height" FROM table_53572 WHERE "School" = 'lake howell high school'
CREATE TABLE table_35254 ( "Rank" real, "Airport" text, "Location" text, "Code (IATA)" text, "Total Cargo (Metric Tonnes)" text, "2003 Rank" text, "% Change" text )
What 2003 rank does the airport IATA code SIN have?
SELECT "2003 Rank" FROM table_35254 WHERE "Code (IATA)" = 'sin'
CREATE TABLE table_80274 ( "Year" text, "Team" text, "Chassis" text, "Engine" text, "Rank" text )
What rank did the chassis reynard 94i have in 1996?
SELECT "Rank" FROM table_80274 WHERE "Chassis" = 'reynard 94i' AND "Year" = '1996'
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, ...
indicate the yearly average volume of urine that patient 018-81471 has had since 1751 days ago.
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-81471')) AND intakeoutput.celllabel = 'urine...
CREATE TABLE table_47038 ( "Name" text, "Period" text, "Games" real, "Wins" real, "Draws" real, "Lost" real, "Win Ratio" text )
What is the highest number of games with more than 0 draws and 11 losses?
SELECT MAX("Games") FROM table_47038 WHERE "Draws" > '0' AND "Lost" = '11'
CREATE TABLE table_name_68 ( country VARCHAR, to_par VARCHAR, player VARCHAR )
WHAT COUNTRY HAS A TO PAR OF +1, WITH WOODY AUSTIN?
SELECT country FROM table_name_68 WHERE to_par = "+1" AND player = "woody austin"
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
what were the three most frequent drugs that were prescribed to hypoxemia - due to hypercarbia male patients in the 30s in the same month after being diagnosed with hypoxemia - due to hypercarbia until 3 years ago?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypoxemia - due to hypercarbia' AND DATETIME(diagn...
CREATE TABLE tryout ( cName VARCHAR, decision VARCHAR, pPos VARCHAR )
Which college has any student who is a goalie and succeeded in the tryout.
SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie'
CREATE TABLE actor ( actor_id number, name text, musical_id number, character text, duration text, age number ) CREATE TABLE musical ( musical_id number, name text, year number, award text, category text, nominee text, result text )
What are the distinct nominees of the musicals with the award that is not 'Tony Award'?
SELECT DISTINCT nominee FROM musical WHERE award <> "Tony Award"
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
compared to second measured on the current icu visit is the sao2 of patient 3125 greater than the value first measured on the current 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 = 3125) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_it...
CREATE TABLE table_name_12 ( team VARCHAR, class VARCHAR, points VARCHAR, year VARCHAR )
Name the Team which has Points larger than 9, and a Year larger than 1971, and a Class of 250cc?
SELECT team FROM table_name_12 WHERE points > 9 AND year > 1971 AND class = "250cc"
CREATE TABLE table_name_44 ( time VARCHAR, res VARCHAR, location VARCHAR, round VARCHAR )
What time is associated with the event that happened in Tokyo, Japan, ending in a draw, with 3 rounds?
SELECT time FROM table_name_44 WHERE location = "tokyo, japan" AND round = 3 AND res = "draw"
CREATE TABLE table_64537 ( "Rank" text, "Group" text, "Name" text, "Nationality" text, "Mark" text )
Who has a mark of 6.17 in group B?
SELECT "Name" FROM table_64537 WHERE "Group" = 'b' AND "Mark" = '6.17'
CREATE TABLE table_26957063_3 ( _percentage_similarity_to_c7orf38 INTEGER, _percentage_identity_to_c7orf38 VARCHAR )
What is the % similarity to C7orf38 of the animal whose % identity to C7orf38 is 81?
SELECT MAX(_percentage_similarity_to_c7orf38) FROM table_26957063_3 WHERE _percentage_identity_to_c7orf38 = 81
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLO...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the sum of manager_id bin hire_date by weekday in a bar chart, could you order y-axis in asc order?
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID)
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 ) ...
get me the number of patients on base type drug prescription who have diagnoses icd9 code 78321.
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 = "78321" AND prescriptions.drug_type = "BASE"
CREATE TABLE table_name_91 ( championship VARCHAR, score VARCHAR )
Which Championship has a Score of 2 6, 4 6, 4 6?
SELECT championship FROM table_name_91 WHERE score = "2–6, 4–6, 4–6"
CREATE TABLE table_name_37 ( opponent VARCHAR, result VARCHAR, location VARCHAR )
Who was the opponent with the loss in Westbury, NY?
SELECT opponent FROM table_name_37 WHERE result = "loss" AND location = "westbury, ny"
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_J...
Find the number of classes offered for all class rooms that held at least 2 classes Show bar chart, rank from high to low by the Y.
SELECT CLASS_ROOM, COUNT(*) FROM CLASS GROUP BY CLASS_ROOM ORDER BY COUNT(*) DESC
CREATE TABLE cinema ( LOCATION VARCHAR, openning_year VARCHAR )
What is the location with the most cinemas opened in year 2010 or later?
SELECT LOCATION FROM cinema WHERE openning_year >= 2010 GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_55690 ( "Season" real, "Series Name" text, "Champion" text, "Team Champion" text, "Secondary Class Champion" text )
Who was the champion of JD Motorsport after 2005?
SELECT "Champion" FROM table_55690 WHERE "Season" > '2005' AND "Team Champion" = 'jd motorsport'
CREATE TABLE table_name_29 ( period VARCHAR, chart VARCHAR )
Name the period for Chart of g-music j-pop/k-pop chart
SELECT period FROM table_name_29 WHERE chart = "g-music j-pop/k-pop chart"
CREATE TABLE table_name_20 ( position VARCHAR, round VARCHAR, name VARCHAR )
What is the Position with a round 3 pick for r. jay soward?
SELECT position FROM table_name_20 WHERE round < 3 AND name = "r. jay soward"
CREATE TABLE table_name_62 ( dialcode VARCHAR, location VARCHAR )
What is the Dialcode of whitechapel?
SELECT dialcode FROM table_name_62 WHERE location = "whitechapel"
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 treatment ( treat...
how much changes in the weight of patient 006-181433 last measured on the current hospital visit compared to the first value measured on the current hospital visit?
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1) - (...
CREATE TABLE table_2027 ( "Name" text, "Nation" text, "Seasons" text, "Championship Titles" text, "Race Starts" real, "Poles" real, "Wins" real, "Podiums" real, "Fastest Laps" real )
How many nations do the FMS international team represent?
SELECT COUNT("Nation") FROM table_2027 WHERE "Name" = 'FMS International'
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what is the four year survival probability for the patients diagnosed with hyponatremia - due to adrenal insufficiency?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
CREATE TABLE table_75940 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Rank" text, "Points" real )
What is the total number of points of the honda hr-1 engine?
SELECT COUNT("Points") FROM table_75940 WHERE "Engine" = 'honda hr-1'
CREATE TABLE table_name_10 ( grid INTEGER, laps VARCHAR, constructor VARCHAR )
what is the highest grid when the laps is less than 44 and the constructor is renault?
SELECT MAX(grid) FROM table_name_10 WHERE laps < 44 AND constructor = "renault"
CREATE TABLE table_17905 ( "Series number" text, "Episode number" real, "Date of first broadcast" text, "Total viewers" real, "Series average" real )
what is the episode number where the total viewers is 614000?
SELECT MIN("Episode number") FROM table_17905 WHERE "Total viewers" = '614000'
CREATE TABLE table_name_4 ( year VARCHAR, engine VARCHAR, points VARCHAR )
How many entrants have a mercedes fo 108w 2.4l v8 engine and over 0 points?
SELECT COUNT(year) FROM table_name_4 WHERE engine = "mercedes fo 108w 2.4l v8" AND points > 0
CREATE TABLE table_32924 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the earliest week the team played the chicago cardinals in front of less than 25,312?
SELECT MIN("Week") FROM table_32924 WHERE "Opponent" = 'chicago cardinals' AND "Attendance" < '25,312'
CREATE TABLE table_name_52 ( studio_analysts VARCHAR, ice_level_reporters VARCHAR )
Which studio analyst has Scott Oake for the ice level reporter?
SELECT studio_analysts FROM table_name_52 WHERE ice_level_reporters = "scott oake"
CREATE TABLE table_39742 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text )
Which date had a home team of the Wizards?
SELECT "Date" FROM table_39742 WHERE "Home" = 'wizards'
CREATE TABLE player_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won NUMERIC, points_max INTEGER, votes_first NUMERIC ) CREATE TABLE fielding_outfield ( player_id TEXT, year INTEGER, stint INTEGER, glf NUMERIC, gcf NUMERIC, grf NUM...
For each year, bin the year into day of the week interval, and return the average of the number of times the team Boston Red Stockings won in the postseasons using a line chart, list by the year in descending.
SELECT year, AVG(COUNT(*)) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY year DESC
CREATE TABLE table_name_22 ( site VARCHAR, opponent VARCHAR )
On which site was the game against Louisville played?
SELECT site FROM table_name_22 WHERE opponent = "louisville"
CREATE TABLE table_7520 ( "Heat" real, "Lane" real, "Name" text, "Country" text, "Mark" text )
What is the mark number when the lane for Rabangaki Nawai when it is greater than 2 and the heat is larger than 4?
SELECT "Mark" FROM table_7520 WHERE "Lane" > '2' AND "Heat" > '4' AND "Name" = 'rabangaki nawai'
CREATE TABLE table_11688 ( "Year" real, "Tournament" text, "Partner" text, "Opponent in the final" text, "Score" text )
Name the opponent in the final for year of 1888
SELECT "Opponent in the final" FROM table_11688 WHERE "Year" = '1888'
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationD...
Has the most questions with only very few accept vote.
SELECT OwnerUserId AS "user_link", COUNT(*) - COUNT(AcceptedAnswerId) AS HasNoAccept, COUNT(AcceptedAnswerId) AS HasAccepted FROM Posts WHERE PostTypeId = 1 AND OwnerUserId > 0 AND CommunityOwnedDate IS NULL AND AnswerCount > 0 GROUP BY OwnerUserId HAVING COUNT(*) > '##MaxAcceptRatio:int?10##' * COUNT(AcceptedAnswerId)...
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...
A bar chart shows the distribution of Sex and the average of Weight , and group by attribute Sex, I want to rank in asc by the y-axis.
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight)
CREATE TABLE table_25781 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who had the high assists when the score was l 85 118 (ot)
SELECT "High assists" FROM table_25781 WHERE "Score" = 'L 85–118 (OT)'
CREATE TABLE table_name_98 ( ekstraklasa INTEGER, total INTEGER )
How much Ekstraklasa has a Total smaller than 3?
SELECT SUM(ekstraklasa) FROM table_name_98 WHERE total < 3
CREATE TABLE table_65497 ( "Index" text, "Score" text, "PALOP rank" text, "CPLP rank" text, "n Africa rank" text, "World rank" text, "Year" real )
What year had a score of 0.586?
SELECT COUNT("Year") FROM table_65497 WHERE "Score" = '0.586'
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
how many times on the first hospital visit patient 26218 receives entral infus nutrit sub?
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'entral infus nutrit sub') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26218 AND NOT admissions.di...
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
what is diagnoses long title of subject name stephanie suchan?
SELECT diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Stephanie Suchan"
CREATE TABLE table_63619 ( "School" text, "Location" text, "Mascot" text, "# / County" text, "Year Joined" real, "Previous Conference" text, "Year Left" real, "Conference Joined" text )
How much Year Left has a Location of howe?
SELECT SUM("Year Left") FROM table_63619 WHERE "Location" = 'howe'
CREATE TABLE table_name_65 ( longitude INTEGER, diameter__km_ VARCHAR, latitude VARCHAR )
Tell me the sum of longitude for diameter being 22.6 and latitude less than -12.4
SELECT SUM(longitude) FROM table_name_65 WHERE diameter__km_ = 22.6 AND latitude < -12.4
CREATE TABLE table_name_91 ( week INTEGER, attendance VARCHAR )
Which Week has an Attendance of 20,112?
SELECT MAX(week) FROM table_name_91 WHERE attendance = 20 OFFSET 112