table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_55148 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which team has an away score of 18.14 (122)?
SELECT "Home team" FROM table_55148 WHERE "Away team score" = '18.14 (122)'
CREATE TABLE table_204_188 ( id number, "rank" number, "player" text, "points" number, "points defending" number, "points won" number, "new points" number, "withdrew due to" text )
who was the highest ranking player to withdraw from the 2010 french open tournament ?
SELECT "player" FROM table_204_188 ORDER BY "rank" LIMIT 1
CREATE TABLE table_27298240_26 ( aorist VARCHAR, present VARCHAR )
What aorist has bude in present tense?
SELECT aorist FROM table_27298240_26 WHERE present = "bude"
CREATE TABLE table_name_90 ( date_aired VARCHAR, network VARCHAR )
Which date was the show aired on the RTL Televizija network?
SELECT date_aired FROM table_name_90 WHERE network = "rtl televizija"
CREATE TABLE table_61581 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Which country won in 1988?
SELECT "Country" FROM table_61581 WHERE "Year(s) won" = '1988'
CREATE TABLE table_27871460_2 ( network VARCHAR, state_or_territory VARCHAR )
Which network was located in Illinois?
SELECT network FROM table_27871460_2 WHERE state_or_territory = "Illinois"
CREATE TABLE medicine_enzyme_interaction ( medicine_id VARCHAR ) CREATE TABLE medicine ( id VARCHAR, Name VARCHAR, FDA_approved VARCHAR )
What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with.
SELECT T1.id, T1.Name, T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC
CREATE TABLE table_18681 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What is the last year that someone is first elected?
SELECT MAX("First elected") FROM table_18681
CREATE TABLE table_24648 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
How many wins when the average start is 29.0?
SELECT COUNT("Wins") FROM table_24648 WHERE "Avg. Start" = '29.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, visualize the relationship between code and code .
SELECT T1.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code
CREATE TABLE table_23703 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text )
Name the least podiums for 0 wins and 2005 season for 321 points
SELECT MIN("Podiums") FROM table_23703 WHERE "Wins" = '0' AND "Season" = '2005' AND "Points" = '321'
CREATE TABLE table_31198 ( "Skip (Club)" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real )
What is the lowest overall amount of w's?
SELECT MIN("W") FROM table_31198
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Tags ( Id number, TagName text, Count num...
Questions which you answered, by title keyword.
SELECT a.Id AS "post_link", a.Body FROM Posts AS a INNER JOIN Posts AS b ON a.ParentId = b.Id WHERE a.OwnerUserId = '##UserId##' AND LOWER(b.Title) LIKE '%##Keyword##%' ORDER BY a.Id DESC
CREATE TABLE table_34231 ( "Player" text, "Rec." real, "Yards" real, "Avg." real, "Long" real )
What is Darrius Heyward-Bey's average with more than 20 yards and less than 80 long?
SELECT COUNT("Avg.") FROM table_34231 WHERE "Yards" > '20' AND "Player" = 'darrius heyward-bey' AND "Long" < '80'
CREATE TABLE table_name_64 ( score VARCHAR, to_par VARCHAR, country VARCHAR )
What was the score for the player from the United states that was +1 to par?
SELECT score FROM table_name_64 WHERE to_par = "+1" AND country = "united states"
CREATE TABLE table_204_200 ( id number, "iso/iec standard" text, "title" text, "status" text, "description" text, "wg" number )
what is the difference in the year published between iso/iec 15288 and iso/ice 20000-1 ?
SELECT ABS((SELECT "status" FROM table_204_200 WHERE "iso/iec standard" = 'iso/iec 15288') - (SELECT "status" FROM table_204_200 WHERE "iso/iec standard" = 'iso/iec 20000-1'))
CREATE TABLE table_name_96 ( winner VARCHAR, general_classification VARCHAR, stage VARCHAR )
Name the winner for nick nuyens for general classification and stage of 2
SELECT winner FROM table_name_96 WHERE general_classification = "nick nuyens" AND stage = "2"
CREATE TABLE table_name_69 ( bronze INTEGER, gold VARCHAR, total VARCHAR, silver VARCHAR )
Which Bronze has a Total smaller than 2, and a Silver larger than 0, and a Gold smaller than 0?
SELECT SUM(bronze) FROM table_name_69 WHERE total < 2 AND silver > 0 AND gold < 0
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code v...
list airlines that fly from SEATTLE to SALT LAKE CITY
SELECT DISTINCT airline.airline_code FROM airline, 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 = 'SEATTLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n...
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 short title is dmii oth uncntrld?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "DMII oth uncntrld"
CREATE TABLE table_60429 ( "Date" text, "Venue" text, "Score" text, "Competition" text, "Report" text )
What is the Venue of the Friendly Competition with a Score of 1 4?
SELECT "Venue" FROM table_60429 WHERE "Competition" = 'friendly' AND "Score" = '1–4'
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...
Show me about the distribution of Team_Name and Team_ID in a bar chart, sort X-axis from low to high order.
SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_Name
CREATE TABLE table_12199 ( "Preferences" text, "1. vs 2." real, "1. vs 3." real, "2. vs 3." real, "Total" real )
What is 1 vs 2 when total is more than 28 and 2 vs 3 is 8?
SELECT "1. vs 2." FROM table_12199 WHERE "Total" > '28' AND "2. vs 3." = '8'
CREATE TABLE table_name_99 ( best VARCHAR, name VARCHAR )
Justin Wilson has what has his best time?
SELECT best FROM table_name_99 WHERE name = "justin wilson"
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnon...
Questions per month in specific tags. How many questions per month does each tag in group has
SELECT COUNT(Id) FROM Posts WHERE Tags LIKE '%<php>%' AND CreationDate > '2012-06-01' AND CreationDate < '2012-06-03'
CREATE TABLE table_name_40 ( total INTEGER, gold VARCHAR, silver VARCHAR )
Who scored the lowest with 8 gold medals and less than 4 silver medals?
SELECT MIN(total) FROM table_name_40 WHERE gold = 8 AND silver < 4
CREATE TABLE table_name_41 ( score VARCHAR, visitor VARCHAR, date VARCHAR )
What's the score on December 1 when Philadelphia visited?
SELECT score FROM table_name_41 WHERE visitor = "philadelphia" AND date = "december 1"
CREATE TABLE table_name_14 ( attendance VARCHAR, date VARCHAR )
How many were in Attendance on December 11, 1954?
SELECT COUNT(attendance) FROM table_name_14 WHERE date = "december 11, 1954"
CREATE TABLE table_name_46 ( broadcast_date VARCHAR, viewers__in_millions_ VARCHAR )
What is the broadcast date with 7.0 million viewers?
SELECT broadcast_date FROM table_name_46 WHERE viewers__in_millions_ = "7.0"
CREATE TABLE table_18118221_1 ( annual_interchanges__millions__2011_12 VARCHAR, annual_entry_exit__millions__2011_12 VARCHAR )
How many annual interchanges in the millions occurred in 2011-12 when the number of annual entry/exits was 36.609 million?
SELECT annual_interchanges__millions__2011_12 FROM table_18118221_1 WHERE annual_entry_exit__millions__2011_12 = "36.609"
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) ...
has patient 004-7984 actually visited the hospital until 2102?
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '004-7984' AND STRFTIME('%y', patient.hospitaladmittime) <= '2102'
CREATE TABLE table_204_445 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
at which world indoor championships did peter widen achieve a higher position : 1989 or 1991 ?
SELECT "year" FROM table_204_445 WHERE "year" IN (1989, 1991) ORDER BY "position" LIMIT 1
CREATE TABLE staff ( staff_id number, gender text, first_name text, last_name text, email_address text, phone_number text ) CREATE TABLE products ( product_id number, parent_product_id number, product_category_code text, date_product_first_available time, date_product_discon...
What are the last names of staff with email addressed containing the substring 'wrau'?
SELECT last_name FROM staff WHERE email_address LIKE "%wrau%"
CREATE TABLE table_55950 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the away score when they played at Brunswick Street Oval?
SELECT "Away team score" FROM table_55950 WHERE "Venue" = 'brunswick street oval'
CREATE TABLE table_11545282_6 ( years_for_jazz VARCHAR, player VARCHAR )
During which years did Jim Farmer play for Jazz?
SELECT years_for_jazz FROM table_11545282_6 WHERE player = "Jim Farmer"
CREATE TABLE storm ( storm_id number, name text, dates_active text, max_speed number, damage_millions_usd number, number_deaths number ) CREATE TABLE region ( region_id number, region_code text, region_name text ) CREATE TABLE affected_region ( region_id number, storm_id nu...
What is the average and maximum damage in millions for storms that had a max speed over 1000?
SELECT AVG(damage_millions_usd), MAX(damage_millions_usd) FROM storm WHERE max_speed > 1000
CREATE TABLE table_39859 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" text )
What was the Purse ($) total for Iowa?
SELECT COUNT("Purse( $ )") FROM table_39859 WHERE "Location" = 'iowa'
CREATE TABLE table_name_38 ( date_of_appointment VARCHAR, team VARCHAR, replaced_by VARCHAR )
What was the date of appointment for Christos Kassianos who belonged to AEK?
SELECT date_of_appointment FROM table_name_38 WHERE team = "aek" AND replaced_by = "christos kassianos"
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE dual_carrier ( main_airline varchar,...
show flights and fare information from PITTSBURGH connecting through DENVER to OAKLAND
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, fare, flight, flight_fare, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAK...
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
since 2104, has any urine, voided specimen microbiology test been carried out on patient 025-19271?
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-19271')) AND microlab.culturesite = 'urine, voided specimen' AND STRFTIME('%y'...
CREATE TABLE perpetrator ( Perpetrator_ID int, People_ID int, Date text, Year real, Location text, Country text, Killed int, Injured int ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, "Home Town" text )
Return a bar chart on what are the countries of perpetrators? Show each country and the corresponding number of perpetrators there, and list in descending by the y axis please.
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC
CREATE TABLE table_name_24 ( home VARCHAR, score VARCHAR )
Who was the home team at the Nuggets game that had a score of 116 105?
SELECT home FROM table_name_24 WHERE score = "116–105"
CREATE TABLE table_12691 ( "Matches" real, "Wins" real, "Draw" real, "Losses" real, "Against" real )
What is the highest Losses, when Wins is '1', and when Matches is less than 2?
SELECT MAX("Losses") FROM table_12691 WHERE "Wins" = '1' AND "Matches" < '2'
CREATE TABLE table_79049 ( "Team" text, "1982" text, "1983" text, "1984" real, "Total points" real, "Seasons" real, "Points average" real )
What is the total for 1984 for the team with 100 points total and more than 3 seasons?
SELECT SUM("1984") FROM table_79049 WHERE "Total points" = '100' AND "Seasons" > '3'
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...
since 10/2105, was there any microbiology test result for the other of patient 031-3355?
SELECT COUNT(*) 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 STRFTIME('%y-%m', microlab.cult...
CREATE TABLE table_11440 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text )
What Constellation has a 20h56m40s Right Ascension (J2000)?
SELECT "Constellation" FROM table_11440 WHERE "Right ascension ( J2000 )" = '20h56m40s'
CREATE TABLE table_75246 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which Opponent has a Record of 38 20 12 2?
SELECT "Opponent" FROM table_75246 WHERE "Record" = '38–20–12–2'
CREATE TABLE table_name_10 ( english_translation VARCHAR, artist VARCHAR )
what is the english translation when the artist is ann christine?
SELECT english_translation FROM table_name_10 WHERE artist = "ann christine"
CREATE TABLE table_12715053_1 ( molecular_target VARCHAR, compound_name VARCHAR )
What is the molecular target listed under the compounded name of hemiasterlin (e7974)
SELECT molecular_target FROM table_12715053_1 WHERE compound_name = "Hemiasterlin (E7974)"
CREATE TABLE table_name_96 ( productions VARCHAR, herbie VARCHAR )
Which production had Rex Robbins as Herbie?
SELECT productions FROM table_name_96 WHERE herbie = "rex robbins"
CREATE TABLE table_17675 ( "Character" text, "Portrayed by" text, "Main cast seasons" text, "Recurring cast seasons" text, "# of episodes" real )
Kevin lucas appears in which seasons?
SELECT "Recurring cast seasons" FROM table_17675 WHERE "Character" = 'Kevin Lucas'
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
since 1 year ago, what was the minimum monthly number of patients diagnosed with pressure ulcer,stage nos?
SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'pressure ulcer,stage nos') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year'...
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
provide me the number of patients with a diagnoses icd9 code 2809 who are younger than 31 years of age.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "31" AND diagnoses.icd9_code = "2809"
CREATE TABLE table_name_99 ( total VARCHAR, fa_trophy VARCHAR, player VARCHAR )
How many Total that has a FA Trophy of 0 and a Player of charlie butler?
SELECT COUNT(total) FROM table_name_99 WHERE fa_trophy = 0 AND player = "charlie butler"
CREATE TABLE table_48035 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text )
How much is the crowd attending at colonial stadium where Hawthorn plays?
SELECT "Crowd" FROM table_48035 WHERE "Ground" = 'colonial stadium' AND "Home team" = 'hawthorn'
CREATE TABLE table_name_78 ( away_team VARCHAR, venue VARCHAR )
What was the away score at VFL Park?
SELECT away_team AS score FROM table_name_78 WHERE venue = "vfl park"
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 ...
when was last time patient 3273 was measured with a greater arterial bp mean than 76.0 on 10/11/last year?
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3273)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
CREATE TABLE table_36235 ( "Frequency" real, "Callsign" text, "Brand" text, "City of License" text, "Website" text, "Webcast" text )
The KTRH.com website includes which type of webcast?
SELECT "Webcast" FROM table_36235 WHERE "Website" = 'ktrh.com'
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, ...
Is 662 offered in Spring 2019 in the afternoon ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time >= '12:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 662 AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester AND semester.year = 2019
CREATE TABLE table_65708 ( "Score" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What 2011 has 12.7% as the 2010?
SELECT "2011" FROM table_65708 WHERE "2010" = '12.7%'
CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREA...
Give me a histogram for what are the names and average salaries for departments with average salary higher than 42000?, and list in ascending by the y axis.
SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY AVG(salary)
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
when did patient 030-34260 get the enteral water flushes last time in a day before?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260')) AND intakeoutput.cellpath LIKE '%intake%...
CREATE TABLE table_name_77 ( gain VARCHAR, long VARCHAR, avg_g VARCHAR )
How much Gain has a Long of 29, and an Avg/G smaller than 33.7?
SELECT COUNT(gain) FROM table_name_77 WHERE long = 29 AND avg_g < 33.7
CREATE TABLE table_19328 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" text, "2nd (m)" text, "Points" text, "Overall WC points (Rank)" text )
Who is shown for the 2nd (m) of 220.5?
SELECT "Name" FROM table_19328 WHERE "2nd (m)" = '220.5'
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId nu...
Probability of a closed question to get reopened. NowClosed: the questions closed now. ClosedOnce: questions closed at least once. This query does not see the now deleted questions.
SELECT COUNT(ClosedDate) AS NowClosed, COUNT(*) AS ClosedOnce FROM Posts WHERE Id IN (SELECT DISTINCT PostId FROM PostHistory WHERE PostHistoryTypeId = 10)
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, ...
data explorer query to find winner of (proposed) new contest. https://photo.meta.stackexchange.com/questions/5899/sql-help-wanted-data-explorer-query-to-find-winner-of-proposed-new-contest/5900#5900
SELECT p.Id, p.CreationDate, DATEADD(ww, -1, GETDATE()), DATEADD(ww, 0, GETDATE()) FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'lens'
CREATE TABLE table_16835 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text )
Which country is the player that went to Oregon?
SELECT "Nationality" FROM table_16835 WHERE "School/Club Team" = 'Oregon'
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, ...
what is the unabbreviated version of the necator americanus?
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'necator americanus' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'necator americanus'
CREATE TABLE table_name_40 ( cardinalatial_title VARCHAR, elector VARCHAR, elevated VARCHAR, place_of_birth VARCHAR )
What's the Cardinalatial Title has the Elevated of December 18, 1182, the Place of birth of Lucca, and the Electo rof Pandolfo?
SELECT cardinalatial_title FROM table_name_40 WHERE elevated = "december 18, 1182" AND place_of_birth = "lucca" AND elector = "pandolfo"
CREATE TABLE table_name_10 ( tag_team VARCHAR, time VARCHAR )
Name the Tag Team with a Time of 03:34?
SELECT tag_team FROM table_name_10 WHERE time = "03:34"
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
has patient 006-195541 had laboratory tests until 104 months ago?
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195541')) AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-104 month')
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostNotices ( Id number, PostId number, PostNot...
Posts tagged with only one selected tag, plus the score and number of answers. Finds posts tagged only with the one tag input below.
SELECT Id AS "post_link", Score, AnswerCount FROM Posts WHERE PostTypeId = 1 AND Tags = '<##Tag##>' AND ClosedDate IS NULL ORDER BY CreationDate DESC
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 chartevents ( row_id number, subject_id number, had...
get the id of the patients who had been diagnosed with prim central sleep apnea until 2104.
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'prim central sleep apnea') AND STRFTIME('%y', diagnoses_icd.charttime) <= ...
CREATE TABLE table_12244 ( "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 1:30pm before One Life to Live at 2:00pm?
SELECT "1:30 pm" FROM table_12244 WHERE "2:00 pm" = 'one life to live'
CREATE TABLE table_name_39 ( opponent VARCHAR, save VARCHAR )
Who is the opponent with a save of ||33,453||36 27?
SELECT opponent FROM table_name_39 WHERE save = "||33,453||36–27"
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 ...
how many patients whose insurance is medicare and diagnoses icd9 code is 3019?
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 = "3019"
CREATE TABLE table_51427 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
What is the player that went to st. benedict's prep?
SELECT "Player" FROM table_51427 WHERE "School" = 'st. benedict''s prep'
CREATE TABLE table_name_64 ( pick VARCHAR, round VARCHAR, position VARCHAR )
How many Pick has a Round smaller than 13, and a Position of fullback?
SELECT COUNT(pick) FROM table_name_64 WHERE round < 13 AND position = "fullback"
CREATE TABLE table_20451 ( "Country" text, "Name" text, "Host" text, "Channel" text, "First Premiere" text, "Regular Judge" text, "Seasons" real )
Name the number of regular judge when host is bernie chan
SELECT COUNT("Regular Judge") FROM table_20451 WHERE "Host" = 'Bernie Chan'
CREATE TABLE table_60911 ( "Season" real, "Years" text, "Final Standing" real, "Points" real, "Top Goal Scorer" text )
What is the final standing in 1981 82?
SELECT "Final Standing" FROM table_60911 WHERE "Years" = '1981–82'
CREATE TABLE table_name_83 ( ground VARCHAR, competition VARCHAR, time VARCHAR )
What is the ground of the tim trophy competition, which had a time of 23:00 cet?
SELECT ground FROM table_name_83 WHERE competition = "tim trophy" AND time = "23:00 cet"
CREATE TABLE table_52253 ( "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text )
What was the pole position for the belgian grand prix?
SELECT "Pole Position" FROM table_52253 WHERE "Race" = 'belgian grand prix'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
provide the number of patients whose insurance is medicare and diagnoses short title is neutropenia nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.short_title = "Neutropenia NOS"
CREATE TABLE table_55675 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Tell me the time/retired with Laps of 47 and driver of ren arnoux
SELECT "Time/Retired" FROM table_55675 WHERE "Laps" = '47' AND "Driver" = 'rené arnoux'
CREATE TABLE table_31661 ( "Date" text, "Result" text, "Opponent" text, "Method" text, "Round" real )
What resulted after 4 rounds with Ed Mahone?
SELECT "Result" FROM table_31661 WHERE "Round" > '4' AND "Opponent" = 'ed mahone'
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid ...
when did patient 025-44495 get its first sputum, expectorated microbiology test this month?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, expectorated' AN...
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...
find the number of urgent hospital admission patients before the year 2194.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear < "2194"
CREATE TABLE table_16422 ( "Location" text, "Monday" text, "Tuesday" text, "Wednesday" text, "Thursday" text, "Friday" text, "Saturday" text, "Sunday" text )
what's the tuesday time with location being millhopper
SELECT "Tuesday" FROM table_16422 WHERE "Location" = 'Millhopper'
CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( transaction_...
Bar chart x axis lot details y axis the number of lot details, rank in ascending by the total number.
SELECT lot_details, COUNT(lot_details) FROM Lots GROUP BY lot_details ORDER BY COUNT(lot_details)
CREATE TABLE table_204_641 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number )
what is the difference in points between chris amon and jim clark ?
SELECT ABS((SELECT "points" FROM table_204_641 WHERE "driver" = 'chris amon') - (SELECT "points" FROM table_204_641 WHERE "driver" = 'jim clark'))
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
How many patients discharge location is snf and were diagnosed with the primary disease upper gi bleed?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "UPPER GI BLEED"
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, Rejecti...
Which tags had the most bounties offered in past 30 days?.
SELECT COUNT(*) AS Bounty_Num, SUM(Votes.BountyAmount) AS Bounty_Amt, Tags.TagName FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId AND Posts.PostTypeId = 1 AND Posts.CreationDate >= DATEADD(day, -30, GETDATE()) AND Posts.CreationDate <= GETDATE() INNER JOIN Votes...
CREATE TABLE table_1500 ( "Finish" text, "Race" text, "Distance" text, "Jockey" text, "Time" text, "Victory Margin (in lengths)" text, "Runner up" text, "Track" text, "Surface" text, "Date" text )
With a date of 8/3/08, what was the length of the victory margin?
SELECT COUNT("Victory Margin (in lengths)") FROM table_1500 WHERE "Date" = '8/3/08'
CREATE TABLE table_name_60 ( year INTEGER, chassis VARCHAR, points VARCHAR )
What is the earliest year with a mp4-17d chassis and less than 142 points.
SELECT MIN(year) FROM table_name_60 WHERE chassis = "mp4-17d" AND points < 142
CREATE TABLE table_name_16 ( regular_season_champion_s_ VARCHAR, record VARCHAR, tournament_champion VARCHAR )
Which Regular Season Champion(s) has a Record of 9 0, and a Tournament Champion of north carolina?
SELECT regular_season_champion_s_ FROM table_name_16 WHERE record = "9–0" AND tournament_champion = "north carolina"
CREATE TABLE table_name_44 ( tickets_sold___available VARCHAR, gross_revenue__2011_ VARCHAR )
How many tickets were sold/available when the gross revenue (2011) was $366,916?
SELECT tickets_sold___available FROM table_name_44 WHERE gross_revenue__2011_ = "$366,916"
CREATE TABLE table_name_74 ( place VARCHAR, score VARCHAR )
what place has score 66-74-68-73=281
SELECT place FROM table_name_74 WHERE score = 66 - 74 - 68 - 73 = 281
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 name and the sum of revenue , and group by attribute name in a bar chart, I want to list by the Name in ascending please.
SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
CREATE TABLE table_16388478_4 ( home_team VARCHAR )
What is the home team score where the home team is Fremantle?
SELECT home_team AS score FROM table_16388478_4 WHERE home_team = "Fremantle"
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicatio...
what was the top five most frequent diagnoses that patients were given after receiving antihyperlipidemic agent - hmg-coa reductase inhibitor in the same month since 2105?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antihyperlipidemic agent - hmg-coa reduc...