table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE...
i need an early flight from DALLAS to HOUSTON
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.departure_time <= 1000 AND flight.departure_time >= 0) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTON' AND flight.to...
CREATE TABLE table_name_69 ( wins INTEGER, points VARCHAR )
Name the least wins for 6 points
SELECT MIN(wins) FROM table_name_69 WHERE points = 6
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...
count the number of patients whose diagnoses icd9 code is 3310 and lab test fluid is pleural?
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.icd9_code = "3310" AND lab.fluid = "Pleural"
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 diagnosis ( diagn...
is patient 032-21820's mpv value last measured on the current hospital visit greater than the value first measured on the current 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 = '032-21820' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'mpv' ...
CREATE TABLE table_16029 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What is the score of the match with partner Jim Pugh?
SELECT "Score" FROM table_16029 WHERE "Partner" = 'Jim Pugh'
CREATE TABLE table_name_14 ( date VARCHAR, score VARCHAR )
On what Date was the Score 105-128?
SELECT date FROM table_name_14 WHERE score = "105-128"
CREATE TABLE match_result ( rank number, club_id number, gold number, big_silver number, small_silver number, bronze number, points number ) CREATE TABLE coach ( coach_id number, coach_name text, gender text, club_id number, rank number ) CREATE TABLE player ( playe...
Show the names and genders of players with a coach starting after 2011.
SELECT T3.player_name, T3.gender FROM player_coach AS T1 JOIN coach AS T2 ON T1.coach_id = T2.coach_id JOIN player AS T3 ON T1.player_id = T3.player_id WHERE T1.starting_year > 2011
CREATE TABLE table_17488 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
How many episodes were written only by William N. Fordes?
SELECT COUNT("Series #") FROM table_17488 WHERE "Written by" = 'William N. Fordes'
CREATE TABLE table_49737 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Who was the away team when Manchester United played at home on 10 February 1951?
SELECT "Away team" FROM table_49737 WHERE "Date" = '10 february 1951' AND "Home team" = 'manchester united'
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 average age of patients whose admission type is emergency and year of birth is greater than 2080?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year > "2080"
CREATE TABLE performance ( songid number, bandmate number, stageposition text ) CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE instruments ( songid number, bandmateid number, instrument text ) CREATE TABLE vocals ( songid number, bandmate numbe...
What are the unique labels for the albums?
SELECT COUNT(DISTINCT label) FROM albums
CREATE TABLE table_5909 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
What was the attendance when Nuneaton Borough was the home team?
SELECT "Attendance" FROM table_5909 WHERE "Home team" = 'nuneaton borough'
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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime ...
what is the four year survival rate of a person with fall from slipping nec?
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id...
CREATE TABLE table_47396 ( "Rank" real, "Rider" text, "Team" text, "Time" text, "Speed" text )
Who was the rider with 120.953 mph speed?
SELECT "Rider" FROM table_47396 WHERE "Speed" = '120.953 mph'
CREATE TABLE table_51936 ( "Club" text, "Sport" text, "League" text, "Venue" text, "Established" real, "Championships" real )
Which WNBA team that won at least 2 championships was established most recently?
SELECT MAX("Established") FROM table_51936 WHERE "League" = 'wnba' AND "Championships" > '2'
CREATE TABLE table_name_52 ( rank INTEGER, name VARCHAR, time VARCHAR )
What was the rank of flori lang when his time was less than 22.27
SELECT SUM(rank) FROM table_name_52 WHERE name = "flori lang" AND time < 22.27
CREATE TABLE table_10674 ( "Team" text, "Lost" real, "Tied" real, "Pct." real, "Years" real, "Total Games" real, "Conference" text )
What were the total games in the Big Ten conference when Nebraska lost fewer than 488 games and had a Pct less than 0.7014?
SELECT SUM("Total Games") FROM table_10674 WHERE "Conference" = 'big ten' AND "Lost" < '488' AND "Team" = 'nebraska' AND "Pct." < '0.7014'
CREATE TABLE Shipment_Items ( shipment_id INTEGER, order_item_id INTEGER ) CREATE TABLE Products ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255) ) CREATE TABLE Shipments ( shipment_id INTEGER, order_id INTEGER, invoice_number INTEGER, shipment_tracking_...
What are the dates of the orders made by the customer named 'Jeramie', and count them by a bar chart
SELECT date_order_placed, COUNT(date_order_placed) FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie"
CREATE TABLE table_name_47 ( country VARCHAR, player VARCHAR )
what country has tiger woods
SELECT country FROM table_name_47 WHERE player = "tiger woods"
CREATE TABLE table_name_38 ( spouse VARCHAR, birth VARCHAR )
Which Spouse has a Birth of 30 may 1653?
SELECT spouse FROM table_name_38 WHERE birth = "30 may 1653"
CREATE TABLE table_name_93 ( label VARCHAR, catalogue VARCHAR )
What is the label for catalogue of RT-346-5?
SELECT label FROM table_name_93 WHERE catalogue = "rt-346-5"
CREATE TABLE table_77357 ( "Name" text, "Birth" text, "Marriage" text, "Became Dauphine" text, "Ceased to be Dauphine" text, "Death" text, "Husband" text )
When was became dauphine when birth is 1393?
SELECT "Became Dauphine" FROM table_77357 WHERE "Birth" = '1393'
CREATE TABLE table_45055 ( "Season" text, "Races" real, "Wins" real, "Podiums" real, "Poles" real, "Fastest Laps" real )
What is the total number of wins in the 2007 season when the fastest laps is 0, there are less than 0 podiums, and there are less than 16 races?
SELECT SUM("Wins") FROM table_45055 WHERE "Fastest Laps" = '0' AND "Races" < '16' AND "Season" = '2007' AND "Podiums" < '0'
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 admitted before the year 2198 are diagnosed with primary disease coronary artery disease\coronary artery bypass graft /sda?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.admityear < "2198"
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 prescription...
specify the maximum age of male patients who remained admitted in hospital for 20 days.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay = "20"
CREATE TABLE table_54173 ( "Driver" text, "Car #" real, "Make" text, "Points" real, "Laps" real, "Winnings" text )
Which is the lowest point value that had not only a Chevrolet car, but also a car number smaller than 24, total laps of 312, and a winning purse of $122,325?
SELECT MIN("Points") FROM table_54173 WHERE "Make" = 'chevrolet' AND "Car #" < '24' AND "Laps" = '312' AND "Winnings" = '$122,325'
CREATE TABLE table_24887326_8 ( score_1 VARCHAR, away_team VARCHAR )
What was the score when the away team was norwich city?
SELECT score_1 FROM table_24887326_8 WHERE away_team = "Norwich City"
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Find Stack Overflow Users In Your City. A simply query to find users in your city or country.
SELECT Id, Reputation, DisplayName FROM Users WHERE Location LIKE '%##Location##%' ORDER BY Reputation DESC
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases IN...
Return a bar chart on how many wines are there for each grape?, list from low to high by the Grape please.
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY Grape
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length in...
show me the flights from BALTIMORE to PITTSBURGH
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITT...
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS va...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday by a bar chart, could you show by the y-axis in descending?
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(EMPLOYEE_ID) DESC
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
Comments containing given keyword between two dates.
SELECT Id AS "comment_link", Text FROM Comments WHERE Text LIKE '%##Word##%' AND CreationDate >= '##Date1##' AND CreationDate <= '##Date2##'
CREATE TABLE table_name_19 ( finish INTEGER, year VARCHAR, start VARCHAR, engine VARCHAR )
What was the finish associated with under 11 starts, a honda engine, before 2003?
SELECT AVG(finish) FROM table_name_19 WHERE start < 11 AND engine = "honda" AND year < 2003
CREATE TABLE table_76554 ( "Date" text, "Captain 1" text, "Team 2" text, "Captain 2" text, "Venue" text, "Result" text )
Which Result has a Captain 2 of louis burger?
SELECT "Result" FROM table_76554 WHERE "Captain 2" = 'louis burger'
CREATE TABLE table_name_92 ( result VARCHAR, score VARCHAR )
What was the result of the match that had a score of 58-6?
SELECT result FROM table_name_92 WHERE score = "58-6"
CREATE TABLE table_204_556 ( id number, "rank" number, "athlete" text, "country" text, "time" text, "notes" text )
how many women competed during the 1980 winter olympic women 's 1000 metres in speed skating ?
SELECT COUNT("athlete") FROM table_204_556
CREATE TABLE table_64265 ( "Rank" text, "Rider" text, "Team" text, "Speed" text, "Time" text )
What is the speed for rank 1?
SELECT "Speed" FROM table_64265 WHERE "Rank" = '1'
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...
what were the top five frequently prescribed drugs that patients were prescribed during the same hospital visit after having received a ventilator weaning procedure since 2102?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'ventilator wean...
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 diagnoses ( ...
what is the average age of female patient discharged to home health care?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "HOME HEALTH CARE"
CREATE TABLE table_32259 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
What venue featured a notes of 2:38:44?
SELECT "Venue" FROM table_32259 WHERE "Notes" = '2:38:44'
CREATE TABLE table_train_83 ( "id" int, "systolic_blood_pressure_sbp" int, "renal_disease" bool, "diabetic" string, "estimated_glomerular_filtration_rate_egfr" int, "iq" int, "geriatric_depression_scale_gds" int, "NOUSE" float )
diagnosis of type i diabetes
SELECT * FROM table_train_83 WHERE diabetic = 'i'
CREATE TABLE table_11761 ( "Name" text, "Location" text, "Elevation + Height" text, "Delivery" text, "Purpose" text, "Yield" text )
Which Elevation + Height has a Delivery of barge and a Location of bikini, yurochi aka irioj (dog)?
SELECT "Elevation + Height" FROM table_11761 WHERE "Delivery" = 'barge' AND "Location" = 'bikini, yurochi aka irioj (dog)'
CREATE TABLE table_54360 ( "Candidate" text, "Contributions" real, "Loans Received" real, "All Receipts" real, "Operating Expenditures" real, "All Disbursements" real )
How much in average Loans Received has Contributions less than 34,986,088, Disbursements more than 251,093,944 for Dennis Kucinich with Operating Expenditures more than 3,638,219?
SELECT AVG("Loans Received") FROM table_54360 WHERE "Contributions" < '34,986,088' AND "All Disbursements" > '251,093,944' AND "Candidate" = 'dennis kucinich †' AND "Operating Expenditures" > '3,638,219'
CREATE TABLE table_name_44 ( viewers VARCHAR, order VARCHAR )
What is the average 18-49 for the episode that had an order number higher than 35 and less than 3.5 viewers?
SELECT AVG(18 AS _49) FROM table_name_44 WHERE viewers < 3.5 AND order > 35
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...
Give me the comparison about the average of School_ID over the All_Home , and group by attribute All_Home by a bar chart, and could you show by the X in desc please?
SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC
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 prescription...
provide the number of patients who have a medicare insurance and diagnosis icd9 code is 79439.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.icd9_code = "79439"
CREATE TABLE table_name_39 ( winner VARCHAR, prize VARCHAR )
Who was the winner of the prize z 1,226,711?
SELECT winner FROM table_name_39 WHERE prize = "zł 1,226,711"
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...
among patients tested for chloride, how many of them were aged below 82?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "82" AND lab.label = "Chloride"
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
the last time during the last year patient 015-96048 was diagnosed with what was?
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-96048')) AND DATETIME(diagnosis.diagnosistime, 'start of year...
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 diagnosis ( diagn...
what were the four most frequently ordered specimen tests for patients who were previously diagnosed with anemia - iron deficiency anemia secondary to chronic blood in 2105 within the same hospital visit?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'anemia - ...
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
Return a histogram on how old is each gender, on average?, show by the Y-axis from high to low.
SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY AVG(age) DESC
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, ...
Most effective Fastest Guns in the West (enlightened percentage times quantity). Top 500 most effective Fastest Guns in the West Enlightened badges weighted against total Accepted answers with score >= 10 Enlightened requires an Accepted Answer with score >= 10, posted first. The higher their number * higher percen...
SELECT a.OwnerUserId AS "user_link", COUNT(DISTINCT a.Id) AS "accepted", COUNT(DISTINCT b.Id) AS "enlightened", (CAST(COUNT(DISTINCT b.Id) AS FLOAT) / COUNT(DISTINCT a.Id)) * 100.0 AS "percentage_enlightened", COUNT(DISTINCT b.Id) * (CAST(COUNT(DISTINCT b.Id) AS FLOAT) / COUNT(DISTINCT a.Id)) * 100.0 AS "weighting" FRO...
CREATE TABLE table_name_10 ( record VARCHAR, date VARCHAR )
What is the Record on July 12?
SELECT record FROM table_name_10 WHERE date = "july 12"
CREATE TABLE table_5095 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text )
What was the result of the game against Luxembourg?
SELECT "Results\u00b9" FROM table_5095 WHERE "Opponent" = 'luxembourg'
CREATE TABLE table_34712 ( "Year" text, "National Champion" text, "Runner-Up" text, "Location" text, "Host" text )
What was the Runner-up in the Monroe County Sports Commission?
SELECT "Runner-Up" FROM table_34712 WHERE "Host" = 'monroe county sports commission'
CREATE TABLE table_27146 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real )
What was the team record after the Frankfurt Galaxy matchup?
SELECT "Team record" FROM table_27146 WHERE "Opponent" = 'Frankfurt Galaxy'
CREATE TABLE table_34301 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "School/Club Team" text )
What is the school/club team of the player with a pick larger than 83?
SELECT "School/Club Team" FROM table_34301 WHERE "Pick" > '83'
CREATE TABLE table_name_86 ( res VARCHAR, opponent VARCHAR )
The match against Mark Hunt had what result?
SELECT res FROM table_name_86 WHERE opponent = "mark hunt"
CREATE TABLE table_33273 ( "Rank by average" real, "Place" real, "Couple" text, "Total points" real, "Number of dances" real, "Average" real )
How many dances placed below 1 with a point total of 40?
SELECT "Number of dances" FROM table_33273 WHERE "Place" > '1' AND "Total points" = '40'
CREATE TABLE table_name_59 ( year_named VARCHAR, diameter__km_ VARCHAR )
What was the year when the diameter was 729 km?
SELECT year_named FROM table_name_59 WHERE diameter__km_ = 729
CREATE TABLE table_17510803_2 ( points_against VARCHAR, lost VARCHAR )
How many points against have a lose of 13?
SELECT points_against FROM table_17510803_2 WHERE lost = "13"
CREATE TABLE table_77368 ( "Movie Title" text, "Year" real, "Role" text, "Director" text, "Producer" text )
What year was Sam Kazman a producer?
SELECT "Year" FROM table_77368 WHERE "Producer" = 'sam kazman'
CREATE TABLE Departments ( department_id INTEGER, dept_store_id INTEGER, department_name VARCHAR(80) ) CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Staff ( staff_id INTEGER, staff_gender VARCHAR(1), ...
For each payment method, return how many customers use it, and order from low to high by the the total number please.
SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code ORDER BY COUNT(*)
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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d...
what is the drug that patient 23061 has been prescribed two times until 44 months ago?
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23061) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-44 month') GROUP BY prescriptions.dru...
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 ) CR...
what are the five most frequently given microbiology tests for patients who have received other skin & subq i & d previously within the same month since 3 years ago?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
CREATE TABLE table_name_63 ( high_assists VARCHAR, record VARCHAR )
Who had the most assists in the game that led to a 3-7 record?
SELECT high_assists FROM table_name_63 WHERE record = "3-7"
CREATE TABLE table_name_29 ( associate_professors INTEGER, assistant_professors VARCHAR, professors VARCHAR )
What is the maximum number of associate professors when there are more than 5 assistant professors and fewer than 14 professors?
SELECT MAX(associate_professors) FROM table_name_29 WHERE assistant_professors > 5 AND professors < 14
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the sum of employee_id , and group by attribute job_id, list by the Y from low to high.
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID)
CREATE TABLE table_43029 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the total number of Silver when Bronze was smaller than 1 with a total smaller than 2 in Bulgaria?
SELECT COUNT("Silver") FROM table_43029 WHERE "Bronze" < '1' AND "Total" < '2' AND "Nation" = 'bulgaria'
CREATE TABLE table_30233 ( "Week #" real, "Dance/song" text, "Horwood" text, "Goodman" text, "Dixon" text, "Tonioli" text, "Total" text, "Result" text )
On week 11 when Dixon scored an 8, what was tonioli's score?
SELECT "Tonioli" FROM table_30233 WHERE "Week #" = '11' AND "Dixon" = '8'
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, ...
Please show the trend about the number of days with max temperature reaches 80 change over dates, I want to display x-axis from low to high order.
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 GROUP BY date ORDER BY date
CREATE TABLE table_68598 ( "Outcome" text, "Year" real, "Tournament" text, "Partner" text, "Opponent" text, "Score" text )
What score has an opponent gan teik chai lin woon fui?
SELECT "Score" FROM table_68598 WHERE "Opponent" = 'gan teik chai lin woon fui'
CREATE TABLE table_name_70 ( place__posición_ INTEGER, points__pts_ VARCHAR, goals_scored__gf_ VARCHAR )
What is the sum of the places of the team with more than 49 points and less than 54 goals scored?
SELECT SUM(place__posición_) FROM table_name_70 WHERE points__pts_ > 49 AND goals_scored__gf_ < 54
CREATE TABLE table_33178 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the away team score when the away team is Essendon?
SELECT "Away team score" FROM table_33178 WHERE "Away team" = 'essendon'
CREATE TABLE table_1013129_3 ( nationality VARCHAR, nhl_team VARCHAR )
What is the nationality of the player from Vancouver Canucks?
SELECT nationality FROM table_1013129_3 WHERE nhl_team = "Vancouver Canucks"
CREATE TABLE table_13498 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real )
what is the highest longitude for county mountrail and the water (sqmi) is less than 0.075?
SELECT MAX("Longitude") FROM table_13498 WHERE "County" = 'mountrail' AND "Water (sqmi)" < '0.075'
CREATE TABLE table_24896 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
Who directed the title written by cherry chevapravatdumrong?
SELECT "Directed by" FROM table_24896 WHERE "Written by" = 'Cherry Chevapravatdumrong'
CREATE TABLE table_name_76 ( points VARCHAR, record VARCHAR, march VARCHAR )
How many Points have a Record of 40 21 12 3, and a March larger than 28?
SELECT COUNT(points) FROM table_name_76 WHERE record = "40–21–12–3" AND march > 28
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, ...
provide the number of male patients who had angioplasty of other non-coronary vessel(s).
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.short_title = "Angio oth non-coronary"
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
Group and count the state province attribute of the location table to visualize a bar chart, and could you show bar from low to high order?
SELECT STATE_PROVINCE, COUNT(STATE_PROVINCE) FROM locations GROUP BY STATE_PROVINCE ORDER BY STATE_PROVINCE
CREATE TABLE table_name_20 ( event VARCHAR, method VARCHAR )
What is the event name when the method is submission (brabo choke)?
SELECT event FROM table_name_20 WHERE method = "submission (brabo choke)"
CREATE TABLE table_name_53 ( round VARCHAR, record VARCHAR )
What is Round, when Record is '4-1'?
SELECT round FROM table_name_53 WHERE record = "4-1"
CREATE TABLE table_26831 ( "Series" real, "Season" text, "Original air date" text, "Production code" text, "Episode title" text )
What original air date was for the episode with production code of 108?
SELECT "Original air date" FROM table_26831 WHERE "Production code" = '108'
CREATE TABLE table_name_80 ( remixed_by VARCHAR, version VARCHAR, album VARCHAR )
Which Remixed by has a Version of album version, and an Album of les mots?
SELECT remixed_by FROM table_name_80 WHERE version = "album version" AND album = "les mots"
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by weekday.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
CREATE TABLE table_4499 ( "Name" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text )
What is the Report of Winning Team Penske Racing, and what was Rick Mears' Pole position?
SELECT "Report" FROM table_4499 WHERE "Winning team" = 'penske racing' AND "Pole Position" = 'rick mears'
CREATE TABLE table_49458 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text )
What is the Original airdate of the episode after Season 6 Directed by Erik Wiese?
SELECT "Original airdate" FROM table_49458 WHERE "Directed by" = 'erik wiese' AND "Season #" > '6'
CREATE TABLE table_69645 ( "Tournament" text, "Date" text, "Surface" text, "Round" text, "Opponent" text )
Name the date for grass surface for quarterfinal at the nsw building society open tournament
SELECT "Date" FROM table_69645 WHERE "Surface" = 'grass' AND "Round" = 'quarterfinal' AND "Tournament" = 'nsw building society open'
CREATE TABLE table_name_99 ( hs_principal VARCHAR, wr_principal VARCHAR, ms_principal VARCHAR )
Who is the h.s. principal with Dave Lovering as w.r. principal and Marty Pizur as m.s. principal?
SELECT hs_principal FROM table_name_99 WHERE wr_principal = "dave lovering" AND ms_principal = "marty pizur"
CREATE TABLE player_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first text ) CREATE TABLE player ( player_id text, birth_year text, birth_month text, birth_day text, birth_country text, birth_st...
What is the average pay for players not inducted into the hall of fame?
SELECT AVG(T2.salary) FROM salary AS T2 JOIN hall_of_fame AS T1 ON T1.player_id = T2.player_id WHERE T1.inducted = "N"
CREATE TABLE table_28211988_4 ( mens_doubles VARCHAR, season VARCHAR )
Name the winners of the mens doubles in the season of 1963/64.
SELECT mens_doubles FROM table_28211988_4 WHERE season = "1963/64"
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is average days of hospital stay of patients whose year of death is less than 2174?
SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.dod_year < "2174.0"
CREATE TABLE table_37234 ( "Storm name" text, "Dates active" text, "Max 1-min wind mph (km/h)" text, "Min. press. ( mbar )" text, "Damage (millions USD )" text, "Deaths" text )
What is the damage of storm three?
SELECT "Damage (millions USD )" FROM table_37234 WHERE "Storm name" = 'three'
CREATE TABLE company ( Company_ID real, Name text, Headquarters text, Industry text, Sales_in_Billion real, Profits_in_Billion real, Assets_in_Billion real, Market_Value_in_Billion real ) CREATE TABLE people ( People_ID int, Age int, Name text, Nationality text, Grad...
Show the different headquarters and number of companies at each headquarter, and I want to show y axis in descending order.
SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
what are the four most frequently ordered specimen tests for patients that were previously diagnosed with vomiting during the same month in this year?
SELECT t3.culturesite FROM (SELECT t2.culturesite, 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 = 'vomiting' AND DATETIME(diagnosis.diagnosisti...
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 are with admission type elective and with lab test name triglycer?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Triglycer"
CREATE TABLE table_name_38 ( agg VARCHAR, team_1 VARCHAR )
What was the Agg., when Team 1 was VSADC?
SELECT agg FROM table_name_38 WHERE team_1 = "vsadc"
CREATE TABLE table_15582870_1 ( college VARCHAR, weight VARCHAR )
Which college did the player weighing 207 pounds attend?
SELECT college FROM table_15582870_1 WHERE weight = 207
CREATE TABLE table_18852984_2 ( all_bills_sponsored INTEGER )
What is the greatest number of bills sponsored in any year?
SELECT MAX(all_bills_sponsored) FROM table_18852984_2
CREATE TABLE table_name_81 ( attendance VARCHAR, date VARCHAR, week VARCHAR )
What was the attendance on November 3, 1968, that was a week smaller than 8?
SELECT COUNT(attendance) FROM table_name_81 WHERE date = "november 3, 1968" AND week < 8