table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_47949 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Nickname" text )
Which Affiliation has a Nickname of cougars?
SELECT "Affiliation" FROM table_47949 WHERE "Nickname" = 'cougars'
CREATE TABLE table_74139 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Points" real )
what is the record for score 1-3?
SELECT "Record" FROM table_74139 WHERE "Score" = '1-3'
CREATE TABLE table_name_4 ( player VARCHAR, place VARCHAR )
Which player has a place of t2?
SELECT player FROM table_name_4 WHERE place = "t2"
CREATE TABLE fault_log_parts ( fault_log_entry_id number, part_fault_id number, fault_status text ) CREATE TABLE engineer_skills ( engineer_id number, skill_id number ) CREATE TABLE skills ( skill_id number, skill_code text, skill_description text ) CREATE TABLE staff ( staff_id n...
Which kind of part has the least number of faults? List the part name.
SELECT T1.part_name FROM parts AS T1 JOIN part_faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY COUNT(*) LIMIT 1
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 diagnoses long title is diverticulosis of colon with hemorrhage and lab test fluid is blood?
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.long_title = "Diverticulosis of colon with hemorrhage" AND lab.fluid = "Blood"
CREATE TABLE table_52468 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text )
What is the hometown of the player who is headed to Duke?
SELECT "Hometown" FROM table_52468 WHERE "College" = 'duke'
CREATE TABLE table_name_94 ( loss INTEGER, gain VARCHAR, avg_g VARCHAR )
What is the lowest Loss number when the Gain is less than 61 and the Avg/G is 6?
SELECT MIN(loss) FROM table_name_94 WHERE gain < 61 AND avg_g = 6
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostHistoryTypes ( Id number, Name te...
Search questions by any keyword.
SELECT p.CreationDate, p.Body, p.Id AS "post_link" FROM Posts AS p WHERE p.PostTypeId = 1 AND p.Body LIKE '%##keyword1##%' LIMIT 100
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 ( ...
Calculate the total number of portuguese speaking patients.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "PORT"
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
asked and closed per week.
WITH closedPerWeek AS (SELECT weeksAgo, COUNT(*) AS closedQuestions FROM (SELECT DATEDIFF(week, ClosedDate, GETDATE()) AS weeksAgo FROM Posts AS p WHERE PostTypeId = 1 AND NOT ClosedDate IS NULL) AS a GROUP BY weeksAgo), askedPerWeek AS (SELECT weeksAgo, COUNT(*) AS askedQuestions FROM (SELECT DATEDIFF(week, CreationDa...
CREATE TABLE country ( Country_id int, Country_name text, Capital text, Official_native_language text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE match_season ( Season re...
What are the draft pick numbers and draft classes for players who play the Defender position Show bar chart, I want to rank from high to low by the Y-axis.
SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Pick_Number DESC
CREATE TABLE table_name_86 ( team_2 VARCHAR, score VARCHAR )
What is Team 2, when Score is 2 - 1?
SELECT team_2 FROM table_name_86 WHERE score = "2 - 1"
CREATE TABLE table_20154 ( "Kinship" text, "Proto-Austronesian" text, "Proto-Malayo-Polynesian" text, "Proto-Oceanic" text, "Proto-Polynesian" text )
Name the number of proto austronesian for *natu
SELECT COUNT("Proto-Austronesian") FROM table_20154 WHERE "Proto-Oceanic" = '*natu'
CREATE TABLE table_21149 ( "Religion" text, "Suriname" text, "Paramaribo" text, "Wanica" text, "Nickerie" text, "Coronie" text, "Saramacca" text, "Commewijne" text, "Marowijne" text, "Para" text, "Brokopondo" text, "Sipaliwini" text )
Name the coronie for marowijne being 6.8%
SELECT "Coronie" FROM table_21149 WHERE "Marowijne" = '6.8%'
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, ...
specify type of admission and discharge time of patient id 42820
SELECT demographic.admission_type, demographic.dischtime FROM demographic WHERE demographic.subject_id = "42820"
CREATE TABLE table_73636 ( "Episode number Production number" text, "Title" text, "Original airdate" text, "Rating/Share in Households" text, "18\u201349 Rating Live+SD / Live+7" text, "Share" text, "Live+SD Total viewers" text, "Live+7 Day DVR Total viewers" text )
When did the fourth episode of the season (4 1-04) first air?
SELECT "Original airdate" FROM table_73636 WHERE "Episode number Production number" = '4 1-04'
CREATE TABLE table_21831 ( "Year" real, "Network" text, "Play-by-play" text, "Colour commentator(s)" text, "Sideline reporters" text, "Pregame host" text, "Pregame analysts" text )
Who did the play-by-play when the pregame host was Brian Williams and the sideline reporters were Steve Armitage and Brenda Irving?
SELECT "Play-by-play" FROM table_21831 WHERE "Pregame host" = 'Brian Williams' AND "Sideline reporters" = 'Steve Armitage and Brenda Irving'
CREATE TABLE students ( student_id number, student_details text ) CREATE TABLE people_addresses ( person_address_id number, person_id number, address_id number, date_from time, date_to time ) CREATE TABLE people ( person_id number, first_name text, middle_name text, last_na...
which course has most number of registered students?
SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE ...
what paper has Hans Kerp published in Nature journal ?
SELECT DISTINCT paper.paperid FROM author, paper, venue, writes WHERE author.authorname = 'Hans Kerp' AND venue.venueid = paper.venueid AND venue.venuename = 'Nature' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
CREATE TABLE table_76821 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What country has the score og 66-70-69-71=276?
SELECT "Country" FROM table_76821 WHERE "Score" = '66-70-69-71=276'
CREATE TABLE table_8369 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real )
What is the Score when Deportes Savio is the Home team?
SELECT "Score" FROM table_8369 WHERE "Home" = 'deportes savio'
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, descript...
what flights go from BALTIMORE to NEWARK wednesday morning
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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND date_day.day_number = 23 AND date_day.month_number = 4 AND d...
CREATE TABLE table_6036 ( "City" text, "State" text, "School" text, "Colony Name" text, "Date Founded" text )
Which City has a State of massachusetts, and a School of northeastern university?
SELECT "City" FROM table_6036 WHERE "State" = 'massachusetts' AND "School" = 'northeastern university'
CREATE TABLE table_name_43 ( name VARCHAR, pos VARCHAR )
What's the name of the person in the CF Pos?
SELECT name FROM table_name_43 WHERE pos = "cf"
CREATE TABLE table_62666 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What was the score of the golfer representing Scotland?
SELECT "Score" FROM table_62666 WHERE "Country" = 'scotland'
CREATE TABLE table_79169 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What was Anders Forsbrand's score when the TO par is +4?
SELECT "Score" FROM table_79169 WHERE "To par" = '+4' AND "Player" = 'anders forsbrand'
CREATE TABLE accounts ( account_id number, statement_id number, account_details text ) CREATE TABLE documents_with_expenses ( document_id number, budget_type_code text, document_details text ) CREATE TABLE projects ( project_id number, project_details text ) CREATE TABLE ref_budget_co...
Show ids for all documents with budget types described as 'Government'.
SELECT T1.document_id FROM documents_with_expenses AS T1 JOIN ref_budget_codes AS T2 ON T1.budget_type_code = T2.budget_type_code WHERE T2.budget_type_description = "Government"
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 ...
provide the number of patients whose days of hospital stay is greater than 69 and drug code is metr500?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "69" AND prescriptions.formulary_drug_cd = "METR500"
CREATE TABLE table_name_28 ( report VARCHAR, winning_constructor VARCHAR, name VARCHAR )
Name the Report with Winning constructor of maserati, and a Name of monza grand prix?
SELECT report FROM table_name_28 WHERE winning_constructor = "maserati" AND name = "monza grand prix"
CREATE TABLE table_73966 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Patient Portrayer" text, "Original air date" text, "Production code" text )
Who was the writter for the episode identified by the production code 2t5954?
SELECT "Written by" FROM table_73966 WHERE "Production code" = '2T5954'
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 the average age of patients whose marital status is married and discharge location is snf?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.discharge_location = "SNF"
CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE region ( Region_id int, Region_code text, R...
Show the name for regions and the number of storms for each region in a pie chart.
SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
what is the total number of patients diagnosed with peritonitis nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Peritonitis NOS"
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmoun...
Find questions awaiting answers and with a given tag.
SELECT u.Id AS "user_link", u.Reputation AS "reputation", q.LastActivityDate AS "last_active", q.ViewCount AS "views", q.Id AS "post_id", q.Id AS "post_link" FROM Posts AS q JOIN PostTags AS pt ON pt.PostId = q.Id JOIN Tags AS t ON t.Id = pt.TagId JOIN Users AS u ON u.Id = q.OwnerUserId WHERE q.PostTypeId = 1 AND q.Ans...
CREATE TABLE table_2112220_6 ( tournaments_played INTEGER, year VARCHAR )
Name the tournaments played for 2004
SELECT MIN(tournaments_played) FROM table_2112220_6 WHERE year = 2004
CREATE TABLE table_name_57 ( evening_gown VARCHAR, swimsuit VARCHAR, average VARCHAR )
Which is the total number of evening gowns for swimsui less than 9.36 and average less than 9.23?
SELECT COUNT(evening_gown) FROM table_name_57 WHERE swimsuit < 9.36 AND average < 9.23
CREATE TABLE playlisttrack ( playlistid number, trackid number ) CREATE TABLE playlist ( playlistid number, name text ) CREATE TABLE genre ( genreid number, name text ) CREATE TABLE track ( trackid number, name text, albumid number, mediatypeid number, genreid number, ...
How many distinct cities does the employees live in?
SELECT COUNT(DISTINCT city) FROM employee
CREATE TABLE table_465 ( "Name" text, "Pennant" text, "Builder" text, "Laid Down" text, "Launched" text, "Commissioned" text, "Fate" text )
What is the name for 30 september 1943?
SELECT "Name" FROM table_465 WHERE "Launched" = '30 September 1943'
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 the number of patients who were inserted drug-eluting coronary artery stent(s) and had joint fluid lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Insertion of drug-eluting coronary artery stent(s)" AND lab.fluid = "Joint Fluid"
CREATE TABLE table_14981555_1 ( venue VARCHAR, distance VARCHAR )
Where was the 1400 m held?
SELECT venue FROM table_14981555_1 WHERE distance = "1400 m"
CREATE TABLE table_23483182_1 ( no_in_season VARCHAR, us_viewers__million_ VARCHAR )
What number was there 6.01 million u.s. drivers?
SELECT no_in_season FROM table_23483182_1 WHERE us_viewers__million_ = "6.01"
CREATE TABLE table_79603 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
What was the attendance for the away team Solihull Moors?
SELECT "Attendance" FROM table_79603 WHERE "Away team" = 'solihull moors'
CREATE TABLE table_75369 ( "Country" text, "Project Name" text, "Year startup" text, "Operator" text, "Peak" text )
What is the Peak with a Project Name that is talakan ph 1?
SELECT "Peak" FROM table_75369 WHERE "Project Name" = 'talakan ph 1'
CREATE TABLE table_69412 ( "Installation" text, "Cluj" real, "Oradea" real, "Baia Mare" real, "Bistrita" real, "Satu Mare" real, "Zalau" real, "Electrica North Transylvania" real )
What is the smallest Satu Mare value associated with Baia Mare over 523?
SELECT MIN("Satu Mare") FROM table_69412 WHERE "Baia Mare" > '523'
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 cost ( costid num...
tell me the name of the intake that patient 005-40894 had for the last time until 05/09/2103?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-40894')) AND intakeoutput.cellpath LIKE '%intake%' AND S...
CREATE TABLE table_15578 ( "State" text, "Born/Died" text, "Active service" text, "Chief Judge" text, "Senior status" text, "Appointed by" text, "Reason for termination" text )
Which state has a Reason for termination of retirement, and an Active service of 1926 1928?
SELECT "State" FROM table_15578 WHERE "Reason for termination" = 'retirement' AND "Active service" = '1926–1928'
CREATE TABLE table_2269 ( "Number" real, "Name" text, "Kilometer" real, "Pavement" text, "Length (in m)" real, "Average climb (%)" real )
What is the minimum length of the locations where the average climb percentage is exactly 59%?
SELECT MIN("Length (in m)") FROM table_2269 WHERE "Average climb (%)" = '59'
CREATE TABLE table_17102076_5 ( team VARCHAR, location_attendance VARCHAR )
Name the team for arco arena 13,685
SELECT team FROM table_17102076_5 WHERE location_attendance = "ARCO Arena 13,685"
CREATE TABLE table_name_36 ( points_gained INTEGER, fans_took VARCHAR )
What is the points gained of the match where fans took 403 [sunday]?
SELECT SUM(points_gained) FROM table_name_36 WHERE fans_took = "403 [sunday]"
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...
calculate the average age of married patients on government insurance
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.insurance = "Government"
CREATE TABLE table_11621915_1 ( purse__ INTEGER, score VARCHAR )
what's the maximum purse( $ ) with score value of 204 (-9)
SELECT MAX(purse__) AS $__ FROM table_11621915_1 WHERE score = "204 (-9)"
CREATE TABLE table_25833 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the high rebounds for 17-33
SELECT "High rebounds" FROM table_25833 WHERE "Record" = '17-33'
CREATE TABLE table_29296103_10 ( tournament VARCHAR, champion VARCHAR )
which tournament was the champion pat cash 4 6, 6 4, 6 3?
SELECT tournament FROM table_29296103_10 WHERE champion = "Pat Cash 4–6, 6–4, 6–3"
CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price...
What are the memories and carriers of phones. Show the proportion.
SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier
CREATE TABLE table_name_70 ( location VARCHAR, game VARCHAR )
What is Location, when Game is 42?
SELECT location FROM table_name_70 WHERE game = 42
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
give me the number of patients whose year of birth is less than 2129 and lab test name is albumin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2129" AND lab.label = "Albumin"
CREATE TABLE table_name_12 ( crowd VARCHAR, date VARCHAR, away_team VARCHAR )
What was the attendence of the game on 26 April 1948 and an away team of Hawthorn?
SELECT crowd FROM table_name_12 WHERE date = "26 april 1948" AND away_team = "hawthorn"
CREATE TABLE table_6047 ( "Month" text, "Week" real, "Offensive" text, "Defensive" text, "Goalkeeper" text, "Rookie" text )
Who was the rookie that played week 6?
SELECT "Rookie" FROM table_6047 WHERE "Week" = '6'
CREATE TABLE table_11884814_3 ( evening_gown VARCHAR, swimsuit VARCHAR )
What was the evening gown score when the swimsuit was 9.61?
SELECT evening_gown FROM table_11884814_3 WHERE swimsuit = "9.61"
CREATE TABLE table_18481791_2 ( title VARCHAR, directed_by VARCHAR )
What was the title of the episode directed by John T. Kretchmer?
SELECT title FROM table_18481791_2 WHERE directed_by = "John T. Kretchmer"
CREATE TABLE table_262481_2 ( enrollment VARCHAR, left VARCHAR, nickname VARCHAR )
What is the enrollment for the institution nicknamed the panthers that left in 2012?
SELECT enrollment FROM table_262481_2 WHERE left = "2012" AND nickname = "Panthers"
CREATE TABLE table_name_65 ( worldwide_gross VARCHAR, director VARCHAR )
What was the worldwide gross for the film directed by joe pytka?
SELECT worldwide_gross FROM table_name_65 WHERE director = "joe pytka"
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 PostNoticeTypes ( Id number, ClassId number, Name text, ...
select all question which tags 'java'.
SELECT * FROM Posts WHERE Tags LIKE '%<java>%' AND PostTypeId = 1 AND AcceptedAnswerId != 0
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarter and the average of price , and group by attribute headquarter, rank by the Y-axis in asc.
SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Price)
CREATE TABLE table_60207 ( "Benalla DFL" text, "Wins" real, "Losses" real, "Draws" real, "Byes" real, "Against" real )
What is the highest value for Byes, when Against is less than 1794, when Losses is '6', and when Draws is less than 0?
SELECT MAX("Byes") FROM table_60207 WHERE "Against" < '1794' AND "Losses" = '6' AND "Draws" < '0'
CREATE TABLE table_76813 ( "1976" text, "1977" text, "1978" text, "1979" text, "1980" text )
what is 1977 when 1980 is chile?
SELECT "1977" FROM table_76813 WHERE "1980" = 'chile'
CREATE TABLE table_name_21 ( score VARCHAR, rank VARCHAR )
What is the lowest first half when the score is larger than 621 and the rank 35?
SELECT MIN(1 AS st_half) FROM table_name_21 WHERE score > 621 AND rank = 35
CREATE TABLE table_57382 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Which driver had a time/retired of fuel system?
SELECT "Driver" FROM table_57382 WHERE "Time/Retired" = 'fuel system'
CREATE TABLE table_1341718_43 ( district VARCHAR, incumbent VARCHAR )
How many districts does Ed Jones represent?
SELECT COUNT(district) FROM table_1341718_43 WHERE incumbent = "Ed Jones"
CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHA...
A pie chart for returning the number of the lot details of lots that belong to investors with details 'l'?
SELECT lot_details, COUNT(lot_details) FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" GROUP BY lot_details
CREATE TABLE table_33284 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the away team's score against Hawthorn?
SELECT "Away team score" FROM table_33284 WHERE "Away team" = 'hawthorn'
CREATE TABLE table_204_68 ( id number, "name" text, "profession" text, "hometown" text, "term expires" number, "office" text )
other than william stuart price , which other businessman was born in tulsa ?
SELECT "name" FROM table_204_68 WHERE "name" <> 'william stuart price' AND "hometown" = 'tulsa'
CREATE TABLE table_204_84 ( id number, "no" number, "peak" text, "location" text, "elevation (m)" number, "prominence (m)" number, "col height (m)" number, "col location" text, "parent" text )
which peak is higher , mont blanc or monte rosa ?
SELECT "peak" FROM table_204_84 WHERE "peak" IN ('mont blanc', 'monte rosa') ORDER BY "elevation (m)" DESC LIMIT 1
CREATE TABLE table_27550 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real )
What was the final score of the game with 7523 in attendance?
SELECT "Final score" FROM table_27550 WHERE "Attendance" = '7523'
CREATE TABLE table_66874 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text, "Note" text )
Name the catalog for alfa records and cd format
SELECT "Catalog" FROM table_66874 WHERE "Label" = 'alfa records' AND "Format" = 'cd'
CREATE TABLE table_name_41 ( record VARCHAR, week VARCHAR, kickoff VARCHAR, game_site VARCHAR )
Which Record has a Kickoff of 12:00pm cst, and a Game site of arrowhead stadium, and a Week of 15?
SELECT record FROM table_name_41 WHERE kickoff = "12:00pm cst" AND game_site = "arrowhead stadium" AND week = "15"
CREATE TABLE table_58327 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What was the winning score on May 3, 1998?
SELECT "Winning score" FROM table_58327 WHERE "Date" = 'may 3, 1998'
CREATE TABLE table_14188 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real )
What is the Constituency number for Pandhana?
SELECT "Constituency number" FROM table_14188 WHERE "Name" = 'pandhana'
CREATE TABLE table_name_83 ( result VARCHAR, award VARCHAR )
Name the result for the bafta tv awards
SELECT result FROM table_name_83 WHERE award = "bafta tv awards"
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
Find those themes and years for all exhibitions with ticket prices lower than 15, show me a stacked bar chart that groups by themes, counts year, and the x-axis is Year, I want to show how many year in descending order.
SELECT Year, COUNT(Year) FROM exhibition WHERE Ticket_Price < 15 GROUP BY Theme ORDER BY COUNT(Year) DESC
CREATE TABLE table_name_10 ( purse VARCHAR, year VARCHAR )
What is the Purse listed for the Year of 1998?
SELECT purse FROM table_name_10 WHERE year = "1998"
CREATE TABLE table_20899 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
Who picked dimitri tsoumpas?
SELECT "CFL Team" FROM table_20899 WHERE "Player" = 'Dimitri Tsoumpas'
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, ...
Days to Close a Duplicate Question by Creation Month.
SELECT date1 AS creationDate, AVG(diff1) AS avgDaysToClose FROM (SELECT DATEDIFF(day, d.CreationDate, ClosedDate) AS "diff1", FORMAT(d.CreationDate, 'yy-MM') AS "date1", FORMAT(d.ClosedDate, 'yy-MM') AS "date2", (d.Id) AS id FROM Posts AS d LEFT JOIN PostHistory AS ph ON ph.PostId = d.Id LEFT JOIN PostLinks AS pl ON pl...
CREATE TABLE table_name_5 ( week VARCHAR, date VARCHAR )
Tell me the number of weeks for bye
SELECT COUNT(week) FROM table_name_5 WHERE date = "bye"
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( ...
what is the four most common procedure given to patients with age 50s until 3 years ago?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-3 yea...
CREATE TABLE table_31904 ( "Round" text, "Match" text, "Name" text, "Team 1" text, "!!Team 2" text )
Name the team 1 for round 3
SELECT "Team 1" FROM table_31904 WHERE "Round" = '3'
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId...
Total of questions asked per year. This query fetches the amount of questions asked per month, organized by year and month.
SELECT TIME_TO_STR(CreationDate, '%Y') AS year, COUNT(Id) AS total FROM Posts WHERE PostTypeId = 1 GROUP BY TIME_TO_STR(CreationDate, '%Y') ORDER BY TIME_TO_STR(CreationDate, '%Y')
CREATE TABLE table_63834 ( "Rank" real, "Attendance" real, "Visiting Team" text, "Date" text, "Result" text )
What is the Rank of the game with an Attendance of 93,039?
SELECT COUNT("Rank") FROM table_63834 WHERE "Attendance" = '93,039'
CREATE TABLE table_train_192 ( "id" int, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "diabetic" string, "fasting_plasma_glucose" int, "NOUSE" float )
patients with type ii diabetes
SELECT * FROM table_train_192 WHERE diabetic = 'ii'
CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking...
What are the facility codes of the apartments with more than four bedrooms, and count them by a bar chart, show by the facility_code from high to low.
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY facility_code DESC
CREATE TABLE table_2595 ( "Year" text, "Day" text, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text )
Who manufactured the car that won with an average speed of 126.259 mph?
SELECT "Manufacturer" FROM table_2595 WHERE "Average Speed (mph)" = '126.259'
CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text )
Show the number of teams in elimination in a bar chart, and order in desc by the total number.
SELECT Team, COUNT(Team) FROM Elimination GROUP BY Team ORDER BY COUNT(Team) DESC
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program_cours...
Does CMPLXSYS 391 have morning classes ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'CMPLXSYS' AND course.number = 391 AND semester.semester = 'WN' AND semester.semester_id = course...
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 hispanic/latino-puerto rican patients have lab test item id 50967?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND lab.itemid = "50967"
CREATE TABLE table_15515 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the method of the match with a 3-4 record?
SELECT "Method" FROM table_15515 WHERE "Record" = '3-4'
CREATE TABLE table_64929 ( "Event" text, "Date" text, "Location" text, "Winning skip" text, "Runner-up skip" text )
What's the location of the National event?
SELECT "Location" FROM table_64929 WHERE "Event" = 'the national'
CREATE TABLE table_name_39 ( championship VARCHAR, circuit VARCHAR )
Which championship had a Circuit of le mans?
SELECT championship FROM table_name_39 WHERE circuit = "le mans"
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...
find me the age and status of death of patient alice nixon.
SELECT demographic.age, demographic.expire_flag FROM demographic WHERE demographic.name = "Alice Nixon"
CREATE TABLE table_27393 ( "Language" text, "Padilla Municipality" real, "Tomina Municipality" real, "Sopachuy Municipality" real, "Villa Alcal\u00e1 Municipality" real, "El Villar Municipality" real )
Name the number of tomina for villa alcala for 176
SELECT COUNT("Tomina Municipality") FROM table_27393 WHERE "Villa Alcal\u00e1 Municipality" = '176'
CREATE TABLE table_204_473 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number )
what are the number of times ferrari is listed as the constructor ?
SELECT COUNT(*) FROM table_204_473 WHERE "constructor" = 'ferrari'