table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_name_30 ( pick__number VARCHAR, reg_gp VARCHAR, pl_gp VARCHAR )
How many picks had a Reg GP that was over 906, when the Pl GP was bigger than 99?
SELECT COUNT(pick__number) FROM table_name_30 WHERE reg_gp > 906 AND pl_gp > 99
CREATE TABLE table_203_153 ( id number, "stamp issue date" text, "stamp set" text, "#cards" text, "card set ref" text, "qty. issued" number )
which card was issued most ?
SELECT "stamp set" FROM table_203_153 ORDER BY "qty. issued" DESC LIMIT 1
CREATE TABLE book_club ( Id VARCHAR )
How many book clubs are there?
SELECT COUNT(*) FROM book_club
CREATE TABLE table_56764 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the grid total for bruce mclaren with over 73 laps?
SELECT SUM("Grid") FROM table_56764 WHERE "Laps" > '73' AND "Driver" = 'bruce mclaren'
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airline ( airline_code varchar,...
do you have an early morning direct flight from PHILADELPHIA 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
CREATE TABLE table_name_78 ( format VARCHAR, release_date VARCHAR )
What format was released in August 1996?
SELECT format FROM table_name_78 WHERE release_date = "august 1996"
CREATE TABLE table_36685 ( "Name" text, "Number" text, "Namesake" text, "Albedo feature name" text, "Area" text, "Current map" text )
What is the current map designation for Debussy?
SELECT "Current map" FROM table_36685 WHERE "Name" = 'debussy'
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, ...
What are the number of the dates that have an average sea level pressure between 30.3 and 31?
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31
CREATE TABLE table_name_21 ( ecclesiastical_province VARCHAR, type VARCHAR, latin_name VARCHAR )
What Ecclesiastical Province has a type diocese and a latin name alexiensis?
SELECT ecclesiastical_province FROM table_name_21 WHERE type = "diocese" AND latin_name = "alexiensis"
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_...
is the heart rate of patient 32153 less second measured on the current icu visit than it was 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 = 32153) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i...
CREATE TABLE table_30713 ( "Player" text, "Nation" text, "TeBe career" text, "League matches" real, "League goals" real, "Cup matches" real, "Cup goals" real )
What is the number of league goals for players with 10 league matches and a TeBe career of 2003?
SELECT "League goals" FROM table_30713 WHERE "League matches" = '10' AND "TeBe career" = '2003'
CREATE TABLE table_1953516_1 ( winning_span VARCHAR, name VARCHAR )
What is the winning span for the name of bernard gallacher?
SELECT winning_span FROM table_1953516_1 WHERE name = "Bernard Gallacher"
CREATE TABLE table_15478 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text )
On what dates did the draw at the Antigua Recreation Ground happen?
SELECT "Date" FROM table_15478 WHERE "Result" = 'draw' AND "Venue" = 'antigua recreation ground'
CREATE TABLE table_59839 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" real )
What To par has a Score of 71-73-71-71=286?
SELECT "To par" FROM table_59839 WHERE "Score" = '71-73-71-71=286'
CREATE TABLE table_38064 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Opponent" text, "Score" text )
What was the score on a clay surface in a year later than 2006 with David Ferrer as an opponent?
SELECT "Score" FROM table_38064 WHERE "Surface" = 'clay' AND "Year" > '2006' AND "Opponent" = 'david ferrer'
CREATE TABLE trip ( id VARCHAR, duration VARCHAR )
What is the id of the trip that has the shortest duration?
SELECT id FROM trip ORDER BY duration LIMIT 1
CREATE TABLE table_28329 ( "Frequency (Hz)" text, "R (\u03a9/km)" text, "L (mH/km)" text, "G (\u03bcS/km)" text, "C (nF/km)" text )
What is the g ( s/km)when the frequency (hz) is 100k?
SELECT "G (\u03bcS/km)" FROM table_28329 WHERE "Frequency (Hz)" = '100k'
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TAB...
Programming Languages - Javascript - Per Month.
SELECT COUNT(*) AS PostCount, YEAR(P.CreationDate), MONTH(P.CreationDate) FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE T.TagName LIKE ('%javascript%') GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDER BY 2 DESC, 3 DESC
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, language text, marital_status text, ethnicity text, age number ) CREATE ...
calculate the length of the first hospital stay of patient 65883.
SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 65883 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
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 ) ...
how many patients had aspart insulin prescriptions during the same hospital visit after being diagnosed with s/p interventional vascular procedure, since 2100?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p interventional vascular procedure' AND STRFTIME('%y', diagnosis.diagn...
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE ...
i want to leave before 800 in the morning what flight should i take to ATLANTA from BOSTON
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.departure_time < 800 AND flight.to_airport = AIRPORT_SERVICE_1.airpor...
CREATE TABLE table_204_979 ( id number, "place" number, "nation" text, "5 hoops" text, "3 balls,\n2 ribbons" text, "total" number )
how many teams score 19.000 or greater in the 5 hoops competition ?
SELECT COUNT("nation") FROM table_204_979 WHERE "5 hoops" >= 19.000
CREATE TABLE Student ( StuID VARCHAR, city_code VARCHAR )
Show ids for all students who live in CHI.
SELECT StuID FROM Student WHERE city_code = "CHI"
CREATE TABLE table_25403 ( "Season" real, "Episodes" real, "Timeslot (ET)" text, "Season Premiere" text, "Season Finale" text, "TV Season" text, "Rank" text, "Viewers (in millions)" text )
What rank number had a season premiere on December 24, 2011?
SELECT "Rank" FROM table_25403 WHERE "Season Premiere" = 'December 24, 2011'
CREATE TABLE table_name_26 ( away_team VARCHAR )
What is the Away Team Score of the Collingwood Home Team?
SELECT away_team AS score FROM table_name_26 WHERE away_team = "collingwood"
CREATE TABLE table_203_270 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
what was the most marathons that pavel loskutov ran in any year ?
SELECT COUNT(*) FROM table_203_270 GROUP BY "year" ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_17693171_1 ( laps INTEGER )
If the laps is 191, what is the maximum laps led?
SELECT MAX(laps) AS Led FROM table_17693171_1 WHERE laps = 191
CREATE TABLE table_name_90 ( episode_count VARCHAR, dvd_title VARCHAR )
What the episode count for Ben 10: Alien Force Volume 8 on DVD?
SELECT episode_count FROM table_name_90 WHERE dvd_title = "ben 10: alien force volume 8"
CREATE TABLE table_12246 ( "7:00 am" text, "8:00 am" text, "9:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:00 pm" text, "3:30 pm" text, "4:00 pm" text, "4:30 pm" text, "5:00 pm" text, "6:30 pm" ...
What is on at 2pm on the channel that shows The New Batman/Superman Adventures at 4:30pm?
SELECT "2:00 pm" FROM table_12246 WHERE "4:30 pm" = 'the new batman/superman adventures'
CREATE TABLE table_6549 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
What is the result of the game on May 14 with Philadelphia as the road team?
SELECT "Result" FROM table_6549 WHERE "Road Team" = 'philadelphia' AND "Date" = 'may 14'
CREATE TABLE table_name_23 ( four VARCHAR, date VARCHAR )
Name the four for 6 march 1801
SELECT four FROM table_name_23 WHERE date = "6 march 1801"
CREATE TABLE table_name_87 ( chassis VARCHAR, year VARCHAR )
What chassis has the year 1987?
SELECT chassis FROM table_name_87 WHERE year = 1987
CREATE TABLE table_name_3 ( opponent VARCHAR, result VARCHAR )
Who was the opponent against which the result was w20-0?
SELECT opponent FROM table_name_3 WHERE result = "w20-0"
CREATE TABLE table_71202 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Pos." text, "Class Pos." text )
What is the class of the co-driver emanuele pirro jj lehto?
SELECT "Class" FROM table_71202 WHERE "Co-Drivers" = 'emanuele pirro jj lehto'
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 average age of emergency hospital admission patients who are suffering from gastrointestinal bleed as their primary disease.
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "GASTROINTESTINAL BLEED"
CREATE TABLE table_56134 ( "Nation" text, "Gold" text, "Silver" text, "Bronze" text, "Total" real )
What is the bronze when silver is 4 and gold is 1 and the total is more than 2
SELECT "Bronze" FROM table_56134 WHERE "Total" > '2' AND "Gold" = '1' AND "Silver" = '4'
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...
Questions per day between two dates.
SELECT DAY(CreationDate), COUNT(Id) FROM Posts WHERE PostTypeId = 3 AND Posts.CreationDate >= '##Date1##' AND Posts.CreationDate <= '##Date2##' GROUP BY DAY(CreationDate) ORDER BY DAY(CreationDate)
CREATE TABLE table_76957 ( "Date" text, "Opponent" text, "Site" text, "Result" text, "Attendance" text )
On which date was the result w20-0?
SELECT "Date" FROM table_76957 WHERE "Result" = 'w20-0'
CREATE TABLE table_39875 ( "Team" text, "Location" text, "Years in senior / adult league" text, "2013 BAFA Adult division" text, "2013 BAFA Adult flag division" text, "2013 BAFA Junior division" text, "Other teams" text )
What is the 2013 BAFA adult flag division in Aylesbury?
SELECT "2013 BAFA Adult flag division" FROM table_39875 WHERE "Location" = 'aylesbury'
CREATE TABLE table_name_29 ( edges INTEGER, dual_archimedean_solid VARCHAR, vertices VARCHAR )
Which Edges have a Dual Archimedean solid of truncated icosidodecahedron, and Vertices larger than 62?
SELECT MIN(edges) FROM table_name_29 WHERE dual_archimedean_solid = "truncated icosidodecahedron" AND vertices > 62
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
how many of the patients with dysphagia nec had a lab test for blood gas?
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 = "Dysphagia NEC" AND lab."CATEGORY" = "Blood Gas"
CREATE TABLE table_204_58 ( id number, "year" number, "position" text )
what is the total number of nations that made it to round 1 but not past that round from 1957 to 2013 ?
SELECT COUNT(*) FROM table_204_58 WHERE "position" = 'round 1'
CREATE TABLE table_27902171_5 ( team VARCHAR, location_attendance VARCHAR )
What is every team with location attendance of Seattle Center Coliseum 14,180?
SELECT team FROM table_27902171_5 WHERE location_attendance = "Seattle Center Coliseum 14,180"
CREATE TABLE table_204_922 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many total medals did colombia win ?
SELECT "total" FROM table_204_922 WHERE "nation" = 'colombia'
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 drug name of drug code zeasp?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ZEASP"
CREATE TABLE table_38057 ( "Region" text, "Total Population" real, "Manchu" real, "Percentage in Manchu Population" text, "Regional Percentage of Population" real )
What is the lowest population associated with a Regional Percentage of Population of 2.95?
SELECT MIN("Total Population") FROM table_38057 WHERE "Regional Percentage of Population" = '2.95'
CREATE TABLE table_name_37 ( best_5_year_period VARCHAR, best_15_year_period VARCHAR )
Which best 5-year period has a best 15-year period of alekhine; lasker?
SELECT best_5_year_period FROM table_name_37 WHERE best_15_year_period = "alekhine; lasker"
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHA...
Show the location codes and the number of documents in each location. Show a pie chart.
SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code
CREATE TABLE table_28578594_1 ( no INTEGER, driver VARCHAR )
Name the least number for nello pagani
SELECT MIN(no) FROM table_28578594_1 WHERE driver = "Nello Pagani"
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CR...
Find the average gpa of all students in each department with a bar chart, could you list by the y axis from low to high?
SELECT DEPT_CODE, AVG(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY AVG(STU_GPA)
CREATE TABLE table_name_83 ( team VARCHAR, points_against VARCHAR )
Which team has 123 points agaibst the other team?
SELECT team FROM table_name_83 WHERE points_against = "123"
CREATE TABLE table_32157 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
Which competition held the 1st position in 2009?
SELECT "Competition" FROM table_32157 WHERE "Position" = '1st' AND "Year" = '2009'
CREATE TABLE table_44761 ( "Name" text, "WSU Year(s)" text, "Position" text, "Team" text, "Pro Year(s)" text )
What is Pro Year(s), when Team is Cincinnati Royals?
SELECT "Pro Year(s)" FROM table_44761 WHERE "Team" = 'cincinnati royals'
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
count the number of patients whose diagnoses short title is wheelchair dependence and drug type is base?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Wheelchair dependence" AND prescriptions.drug_type = "BASE"
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_...
what 's the cheapest one way flight from OAKLAND to BOSTON
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city...
CREATE TABLE table_61275 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the To Par score for the player from France?
SELECT "To par" FROM table_61275 WHERE "Country" = 'france'
CREATE TABLE Movie ( title VARCHAR, mID VARCHAR ) CREATE TABLE Rating ( rID VARCHAR, stars INTEGER, mID VARCHAR )
Find the title and star rating of the movie that got the least rating star for each reviewer.
SELECT T2.title, T1.rID, T1.stars, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID
CREATE TABLE table_name_75 ( bronze VARCHAR, rank VARCHAR, silver VARCHAR, gold VARCHAR )
What is the total number of Bronze, when Silver is greater than 0, when Gold is greater than 3, and when Rank is 1?
SELECT COUNT(bronze) FROM table_name_75 WHERE silver > 0 AND gold > 3 AND rank = "1"
CREATE TABLE table_204_894 ( id number, "season" number, "winner" text, "score" text, "runners-up" text, "venue" text )
tell me the total number of goals scored in the 2010 match .
SELECT "score" + "score" FROM table_204_894 WHERE "season" = 2010
CREATE TABLE table_78178 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
What city has larger than 94.1 as a frequency?
SELECT "City of license" FROM table_78178 WHERE "Frequency MHz" > '94.1'
CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team int, Draft_Pick_Number int, Draft_Class text, College text ) CREATE TABLE country ( Country_id int, Country_name text, Capital text, Official_native_language text ) CREATE TABLE playe...
Give me a bar chart that groups and counts the years played for players from team 'Columbus Crew'.
SELECT Years_Played, COUNT(Years_Played) FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Columbus Crew" GROUP BY Years_Played
CREATE TABLE table_203_165 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
what was the number of medals earned by indonesia -lrb- ina -rrb- ?
SELECT "total" FROM table_203_165 WHERE "nation" = 'indonesia (ina)'
CREATE TABLE table_22355_44 ( nation VARCHAR, athlete VARCHAR )
Name the nation for abdon pamich category:articles with hcards
SELECT nation FROM table_22355_44 WHERE athlete = "Abdon Pamich Category:Articles with hCards"
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, Cr...
Questions with 'best approach' or 'best option'.
SELECT Post.Id AS "post_link", Post.OwnerUserId AS "user_link", Post.Score, Post.CreationDate, Post.ViewCount FROM Posts AS Post WHERE Post.PostTypeId = 1 AND Post.ClosedDate IS NULL AND (Post.Body LIKE '%best approach%' OR Post.Body LIKE '%best option%' OR Post.Body LIKE '%best strategy%') LIMIT 100
CREATE TABLE item ( Id VARCHAR )
List all information in the item table.
SELECT * FROM item
CREATE TABLE table_name_84 ( virtues VARCHAR, significant_relationship VARCHAR )
The Significant Relationship of Parents belongs with what Virtue?
SELECT virtues FROM table_name_84 WHERE significant_relationship = "parents"
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id numb...
Find a user's 30 shortest posts (both questions and answers).. Obtains a user's shortest 30 posts, including both questions *and* answers.
SELECT Id AS "post_link", LENGTH(Body) AS "characters", REPLACE(REPLACE(Body, '<p>', ' '), '</p>', '') AS "body", Score AS "total_score" FROM Posts WHERE (OwnerUserId = @UserId) ORDER BY LENGTH(Body) LIMIT 30
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
what's patient 022-89058's length of stay in the first icu stay?
SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-89058') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1
CREATE TABLE table_name_42 ( report VARCHAR, winning_driver VARCHAR, fastest_lap VARCHAR )
When the driver jonathan summerton won and dane cameron had the fastest lap, what was the report?
SELECT report FROM table_name_42 WHERE winning_driver = "jonathan summerton" AND fastest_lap = "dane cameron"
CREATE TABLE table_name_51 ( q_ INTEGER )
What is the total of q > 1.4 when q > 1.3 is 455, and q >1.2 is less than 3,028?
SELECT SUM(q_) > _1.4 FROM table_name_51 WHERE q_ > _1.3 = 455 AND q_ > _1.2 < 3 OFFSET 028
CREATE TABLE table_name_60 ( gold INTEGER, silver VARCHAR, rank VARCHAR )
Which Gold has a Total larger than 3, a Rank of total, and a Silver larger than 8?
SELECT AVG(gold) FROM table_name_60 WHERE "total" > 3 AND rank = "total" AND silver > 8
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, show me about the distribution of founder and the sum of price , and group by attribute founder in a bar chart, and could you rank by the total number in ascending?
SELECT Founder, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Price)
CREATE TABLE table_name_92 ( ends VARCHAR, type VARCHAR )
What ends has transferred as the type?
SELECT ends FROM table_name_92 WHERE type = "transferred"
CREATE TABLE table_10822 ( "Year" real, "Artist" text, "Mintage (Proof)" text, "Issue Price (Proof)" text, "Mintage (BU)[ clarification needed ]" text, "Issue Price (BU)[ clarification needed ]" text )
What's listed as the Issue Price (BU) [Clarification Needed] with a Mintage (Proof) of 29,586?
SELECT "Issue Price (BU)[ clarification needed ]" FROM table_10822 WHERE "Mintage (Proof)" = '29,586'
CREATE TABLE table_204_245 ( id number, "#" number, "wrestlers" text, "reign" number, "date" text, "days\nheld" number, "location" text, "event" text, "notes" text )
how many tag teams held the title for more than 300 days ?
SELECT COUNT("wrestlers") FROM table_204_245 WHERE "days\nheld" > 300
CREATE TABLE table_name_7 ( date VARCHAR, opponent VARCHAR, tv_time VARCHAR, game_site VARCHAR )
Which Date has a TV Time of cbs 1:00pm, and a Game Site of rca dome, and an Opponent of cincinnati bengals?
SELECT date FROM table_name_7 WHERE tv_time = "cbs 1:00pm" AND game_site = "rca dome" AND opponent = "cincinnati bengals"
CREATE TABLE table_72127 ( "Village (German)" text, "Village (Slovenian)" text, "Number of people 1991" real, "Percent of Slovenes 1991" text, "Percent of Slovenes 1951" text )
Provide me with the names of all the villages (German) that has 76.3% of Slovenes in 1951.
SELECT "Village (German)" FROM table_72127 WHERE "Percent of Slovenes 1951" = '76.3%'
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( med...
what was the organism that was discovered in the last other microbiology test of patient 031-3355 this month?
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND microlab.culturesite = 'other' AND DATETIME(microlab.cult...
CREATE TABLE table_50834 ( "Year" text, "Team" text, "Attempts" text, "Completions" text, "Completion %" text, "Yards" text )
What was the team Vanderberg belonged to when there was 42 completions?
SELECT "Team" FROM table_50834 WHERE "Completions" = '42'
CREATE TABLE table_3070 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Wildcats points" real, "Opponents" real, "Record" text )
What is the number of the first game?
SELECT MIN("Game") FROM table_3070
CREATE TABLE table_18521 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
What party did incumbent Wright Patman belong to?
SELECT "Party" FROM table_18521 WHERE "Incumbent" = 'Wright Patman'
CREATE TABLE table_55008 ( "Date" text, "Ship" text, "Type" text, "Nationality" text, "Tonnage GRT" real )
Which Nationality has a Tonnage GRT larger than 2,890, and a Ship of mount temple?
SELECT "Nationality" FROM table_55008 WHERE "Tonnage GRT" > '2,890' AND "Ship" = 'mount temple'
CREATE TABLE table_57825 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How big was the crowd in game that featured the visiting team of north melbourne?
SELECT "Crowd" FROM table_57825 WHERE "Away team" = 'north melbourne'
CREATE TABLE music_festival ( Volume VARCHAR, Result VARCHAR ) CREATE TABLE volume ( Song VARCHAR, Volume_ID VARCHAR )
Please show the songs that have result 'nominated' at music festivals.
SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1.Result = "Nominated"
CREATE TABLE table_65333 ( "Vessel" text, "Origin" text, "Type" text, "In service" real, "Unit" text )
Which vessel has a type of logistic support?
SELECT "Vessel" FROM table_65333 WHERE "Type" = 'logistic support'
CREATE TABLE table_19626 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
What was the score in the game played on December 2, 1984?
SELECT "Record" FROM table_19626 WHERE "Date" = 'December 2, 1984'
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE...
Draw a bar chart about the distribution of Time and meter_100 , I want to display in asc by the y axis please.
SELECT Time, meter_100 FROM swimmer ORDER BY meter_100
CREATE TABLE table_18093 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
In the 2008/2009 season one team had 1 losing bonus, How many points did that team score that year?
SELECT "Points for" FROM table_18093 WHERE "Losing bonus" = '1'
CREATE TABLE table_6740 ( "Buechel & Manhart spelling (pronunciation)" text, "Ullrich" text, "Brandon University" text, "Deloria & Boas" text, "Dakota Mission" text, "Rood & Taylor" text, "Riggs" text, "Williamson" text, "University of Minnesota" text, "White Hat" text )
Riggs of e, and a Buechel & Manhart spelling (pronunciation) of e had what ullrich?
SELECT "Ullrich" FROM table_6740 WHERE "Riggs" = 'e' AND "Buechel & Manhart spelling (pronunciation)" = 'e'
CREATE TABLE table_6796 ( "Episode" text, "VII Season" text, "VIII Season" text, "XII Season" text, "XIII Season" text )
What is XII Season, when Episode is 6?
SELECT "XII Season" FROM table_6796 WHERE "Episode" = '6'
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of founder and the average of price , and group by attribute founder, and I want to list in descending by the bars.
SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC
CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE party ( Party_ID int, Minister text, Took_offi...
Show party names and the number of events for each party in a bar chart, could you order by the x axis from high to low?
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name DESC
CREATE TABLE table_1277350_1 ( thursday_iuppiter__jupiter_ VARCHAR, saturday_saturnus___saturn_ VARCHAR )
what's the thursday iuppiter (jupiter) with saturday saturnus ( saturn) being jesarn
SELECT thursday_iuppiter__jupiter_ FROM table_1277350_1 WHERE saturday_saturnus___saturn_ = "Jesarn"
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, ic...
count the number of times that patient 007-2498 has in 02/2104 had emesis output.
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-2498')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.cel...
CREATE TABLE table_21225 ( "Province" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real )
When the blank ends at 1, what is the PA?
SELECT COUNT("PA") FROM table_21225 WHERE "Blank Ends" = '1'
CREATE TABLE table_204_484 ( id number, "song" text, "artists" text, "release" text, "year" number, "notes" text )
how many times was skrein listed as an artist on a song ?
SELECT COUNT(*) FROM table_204_484 WHERE "artists" = 'skrein'
CREATE TABLE table_37526 ( "Type" text, "Numbers" text, "Year built" real, "Quantity built" text, "Power (horsepower)" real, "Max Speed (km/h)" real )
What is the numbers of the thn unit with a power greater than 220?
SELECT "Numbers" FROM table_37526 WHERE "Power (horsepower)" > '220' AND "Type" = 'thn'
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_care...
how many days has it been since the last time patient 76332 was given a sodium test on this hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76332 AND admissions.d...
CREATE TABLE table_54390 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyres" text, "Driver" text, "Rounds" text )
Tell me the constructor for alberto colombo and chassis of a1
SELECT "Constructor" FROM table_54390 WHERE "Driver" = 'alberto colombo' AND "Chassis" = 'a1'
CREATE TABLE table_name_57 ( champion VARCHAR, runner_up VARCHAR )
Who was the champion when atl tico wanderers was the runner-up?
SELECT champion FROM table_name_57 WHERE runner_up = "atlético wanderers"