instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
what's the primary payload(s) with launch date being july 8, 1994 | CREATE TABLE table_14118521_1 (primary_payload_s_ VARCHAR,launch_date VARCHAR) | SELECT primary_payload_s_ FROM table_14118521_1 WHERE launch_date = "July 8, 1994" |
What is the 1st leg that has a Rc Cannes Team 1? | CREATE TABLE table_name_40 (team_1 VARCHAR) | SELECT 1 AS st_leg FROM table_name_40 WHERE team_1 = "rc cannes" |
What was the Bhofen #2 score and rank for the player whose GA-PA score and rank was 227.5 (19)? | CREATE TABLE table_14948647_1 (bhofen_number2__rk_ VARCHAR,ga_pa__rk_ VARCHAR) | SELECT bhofen_number2__rk_ FROM table_14948647_1 WHERE ga_pa__rk_ = "227.5 (19)" |
How many points did the Giants get when attendance was 78,673? | CREATE TABLE table_43087 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Giants' points" text,"Opponents' Points" text,"Record" text,"TV Time" text,"Attendance" text) | SELECT "Giants' points" FROM table_43087 WHERE "Attendance" = '78,673' |
how long has internacional de madrid cf been playing in the 3 division ? | CREATE TABLE table_203_783 (id number,"season" text,"tier" number,"division" text,"place" text) | SELECT COUNT(*) FROM table_203_783 WHERE "division" = '3a' |
what is diagnoses long title of subject id 94756? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "94756" |
Who was the opponent in games over 58, after Feb 16, and having a record of 40-20-4? | CREATE TABLE table_name_47 (opponent VARCHAR,record VARCHAR,game VARCHAR,february VARCHAR) | SELECT opponent FROM table_name_47 WHERE game > 58 AND february > 16 AND record = "40-20-4" |
active smokers | CREATE TABLE table_train_189 ("id" int,"alt" float,"hyperglycemia" bool,"liver_disease" bool,"smoking" bool,"alcohol_abuse" bool,"drug_abuse" bool,"triglyceride_tg" float,"NOUSE" float) | SELECT * FROM table_train_189 WHERE smoking = 1 |
Which Tries against has Points against larger than 156, and Points for of 127, and Tries for larger than 17? | CREATE TABLE table_14230 ("Team" text,"Tries for" real,"Tries against" real,"Try diff" text,"Points for" real,"Points against" real,"Points diff" text) | SELECT AVG("Tries against") FROM table_14230 WHERE "Points against" > '156' AND "Points for" = '127' AND "Tries for" > '17' |
What's the lowest gold with a total over 15 and less than 16 silver? | CREATE TABLE table_46040 ("Rank" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MIN("Gold") FROM table_46040 WHERE "Total" > '15' AND "Silver" < '16' |
Show the names and total passengers for all train stations not in London. Visualize by bar chart. | CREATE TABLE train (Train_ID int,Name text,Time text,Service text)CREATE TABLE train_station (Train_ID int,Station_ID int)CREATE TABLE station (Station_ID int,Name text,Annual_entry_exit real,Annual_interchanges real,Total_Passengers real,Location text,Main_Services text,Number_of_Platforms int) | SELECT Name, Total_Passengers FROM station WHERE Location <> 'London' |
Find meter_200 and the sum of meter_100 , and group by attribute meter_200, and visualize them by a bar chart. | CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te... | SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 |
Please compare the number of the church by open date (bin into the weekday) using a bar chart. | CREATE TABLE people (People_ID int,Name text,Country text,Is_Male text,Age int)CREATE TABLE wedding (Church_ID int,Male_ID int,Female_ID int,Year int)CREATE TABLE church (Church_ID int,Name text,Organized_by text,Open_Date int,Continuation_of text) | SELECT Open_Date, COUNT(Open_Date) FROM church |
What is the Branding of the Metro Manila Frequency with a Callsign of DWBL? | CREATE TABLE table_name_19 (branding VARCHAR,location VARCHAR,callsign VARCHAR) | SELECT branding FROM table_name_19 WHERE location = "metro manila" AND callsign = "dwbl" |
I want to know the home team score for essendon away team | CREATE TABLE table_55245 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_55245 WHERE "Away team" = 'essendon' |
Which Source has a Remainder of 15%, and a Topinka of 26%? | CREATE TABLE table_name_78 (source VARCHAR,remainder VARCHAR,topinka__r_ VARCHAR) | SELECT source FROM table_name_78 WHERE remainder = "15%" AND topinka__r_ = "26%" |
What is the earliest round where collingswood lost by 36 points? | CREATE TABLE table_29033869_3 (round INTEGER,result__includes_margin_ VARCHAR) | SELECT MIN(round) FROM table_29033869_3 WHERE result__includes_margin_ = "Lost by 36 points" |
What is the date of entered service for the locomotive with a broad gauge and a serial no of 83-1018? | CREATE TABLE table_name_76 (entered_service VARCHAR,gauge VARCHAR,serial_no VARCHAR) | SELECT entered_service FROM table_name_76 WHERE gauge = "broad" AND serial_no = "83-1018" |
What is the home team's score in the game played at glenferrie oval? | CREATE TABLE table_name_40 (home_team VARCHAR,venue VARCHAR) | SELECT home_team AS score FROM table_name_40 WHERE venue = "glenferrie oval" |
Tags containing special characters (Stack Overflow). Adapted from answer by hvd (https://stackoverflow.com/a/45380894/3357935) | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,... | SELECT * FROM Tags WHERE TagName LIKE '%^-+a-z0-9.%' |
What was the away team when the home team was South Melbourne? | CREATE TABLE table_52175 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Date" text) | SELECT "Away team" FROM table_52175 WHERE "Home team" = 'south melbourne' |
With a 0-2 series, what is the high points? | CREATE TABLE table_77490 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text) | SELECT "High points" FROM table_77490 WHERE "Series" = '0-2' |
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of job_id and department_id , sort from low to high by the JOB_ID. | CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),S... | SELECT JOB_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID |
Find the total number of students enrolled in the colleges that were founded after the year of 1850 for each affiliation type. | CREATE TABLE university (school_id number,school text,location text,founded number,affiliation text,enrollment number,nickname text,primary_conference text)CREATE TABLE basketball_match (team_id number,school_id number,team_name text,acc_regular_season text,acc_percent text,acc_home text,acc_road text,all_games text,al... | SELECT SUM(enrollment), affiliation FROM university WHERE founded > 1850 GROUP BY affiliation |
what team scored 17 | CREATE TABLE table_5590 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Record" text) | SELECT "Date" FROM table_5590 WHERE "Game" = '17' |
Which club had a player born in 1983? | CREATE TABLE table_17888 ("No" real,"Player" text,"Height" text,"Position" text,"Year born" real,"Current Club" text) | SELECT "Current Club" FROM table_17888 WHERE "Year born" = '1983' |
select count (case when p.PostTypeId=1 then 1 end) from Posts;. | CREATE TABLE PostsWithDeleted (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,LastEditDate time,LastActivityDate time,Title text,Ta... | SELECT u.Age, COUNT(CASE WHEN p.PostTypeId = 1 AND p.Score = 0 THEN 1 END) AS equals, COUNT(CASE WHEN p.PostTypeId = 1 AND p.Score > 0 THEN 1 END) AS bolshe FROM Users AS u JOIN Posts AS p ON u.Id = p.OwnerUserId GROUP BY u.Age HAVING COUNT(CASE WHEN p.PostTypeId = 1 THEN 1 END) > 50 |
what is the name of the medicine that patient 010-40637 was prescribed with within 2 days after having been diagnosed with intracranial injury - with subdural hematoma since 35 months ago? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE patient (... | SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-40637') AND diagnosis.diagnos... |
List the software platform shared by the greatest number of devices. | CREATE TABLE device (Software_Platform VARCHAR) | SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1 |
What Type of game was played on Date of July 29? | CREATE TABLE table_75017 ("Date" text,"City" text,"Opponent" text,"Results\u00b9" text,"Type of game" text) | SELECT "Type of game" FROM table_75017 WHERE "Date" = 'july 29' |
what is the number of patients whose marital status is married and ethnicity is white - russian? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.ethnicity = "WHITE - RUSSIAN" |
Bar chart x axis occupation y axis how many occupation, display in descending by the Y-axis. | CREATE TABLE club (Club_ID int,Club_name text,Region text,Start_year int)CREATE TABLE player_coach (Player_ID int,Coach_ID int,Starting_year int)CREATE TABLE coach (Coach_ID int,Coach_name text,Gender text,Club_ID int,Rank int)CREATE TABLE player (Player_ID int,Sponsor_name text,Player_name text,Gender text,Residence t... | SELECT Occupation, COUNT(Occupation) FROM player GROUP BY Occupation ORDER BY COUNT(Occupation) DESC |
what was the total of patient 002-52932's input until 05/22/2100? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid ... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-52932')) AND intakeoutput.cellpath LIKE '%in... |
What Venue has more than 1 Championship and was Established after 1957? | CREATE TABLE table_name_4 (venue VARCHAR,championships VARCHAR,established VARCHAR) | SELECT venue FROM table_name_4 WHERE championships = 1 AND established > 1957 |
Name the outcome with tournament of mexico f12, obreg n | CREATE TABLE table_name_57 (outcome VARCHAR,tournament VARCHAR) | SELECT outcome FROM table_name_57 WHERE tournament = "mexico f12, obregón" |
Bin all date of transactions into the YEAR interval, and sum the share count of each bin What is the trend?, and order by the X-axis from high to low please. | CREATE TABLE Transactions_Lots (transaction_id INTEGER,lot_id INTEGER)CREATE TABLE Sales (sales_transaction_id INTEGER,sales_details VARCHAR(255))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 Purchase... | SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction DESC |
how many callings of trains arriving at 09.06 | CREATE TABLE table_22274 ("Departure" text,"Going to" text,"Calling at" text,"Arrival" text,"Operator" text) | SELECT COUNT("Calling at") FROM table_22274 WHERE "Arrival" = '09.06' |
Does Detroit have a soccer team? | CREATE TABLE table_name_34 (soccer VARCHAR,school VARCHAR) | SELECT soccer FROM table_name_34 WHERE school = "detroit" |
which bank has four times as many assets at taib yatirim bank ? | CREATE TABLE table_202_236 (id number,"bank" text,"foundation" number,"# of branches\nas of 30 september 2012" number,"total assets (million tl)\nas of 30 september 2012" number) | SELECT "bank" FROM table_202_236 WHERE "total assets (million tl)\nas of 30 september 2012" = (SELECT "total assets (million tl)\nas of 30 september 2012" FROM table_202_236 WHERE "bank" = 'taib yatırım bank') * 4 |
What are the years won when the to par is +5? | CREATE TABLE table_name_76 (year_s__won VARCHAR,to_par VARCHAR) | SELECT year_s__won FROM table_name_76 WHERE to_par = "+5" |
show me the respiration change in patient 027-136480 second measured on the current icu visit compared to the first value measured on the current icu visit? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio... | SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-136480') AND patient.unitdischargetime IS N... |
What are all the winning records when the result is Scotland won on points table and the Runner-Up result is [[|]] 4 points? | CREATE TABLE table_4048 ("Year" real,"Host Nation(s)" text,"Final Venue" text,"Winner" text,"Result" text,"Runner-up" text) | SELECT "Winner" FROM table_4048 WHERE "Result" = 'Scotland won on points table' AND "Runner-up" = '[[|]] 4 points' |
How many years had scores of 10 12, 6 1, 6 3? | CREATE TABLE table_2127933_3 (year VARCHAR,score VARCHAR) | SELECT COUNT(year) FROM table_2127933_3 WHERE score = "10–12, 6–1, 6–3" |
what is days of hospital stay of subject name sheila riley? | 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,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id te... | SELECT demographic.days_stay FROM demographic WHERE demographic.name = "Sheila Riley" |
What kind of competition had an attendance of more than 914 people and the Wightlink Raiders as an opponent? | CREATE TABLE table_39179 ("Date" real,"Opponent" text,"Venue" text,"Result" text,"Attendance" real,"Competition" text) | SELECT "Competition" FROM table_39179 WHERE "Attendance" > '914' AND "Opponent" = 'wightlink raiders' |
provide the number of patients whose age is less than 41 and procedure long title is insertion of drug-eluting coronary artery stent(s)? | 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 text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "41" AND procedures.long_title = "Insertion of drug-eluting coronary artery stent(s)" |
Who was the away team of the game at the time 15:00? | CREATE TABLE table_name_57 (away VARCHAR,time VARCHAR) | SELECT away FROM table_name_57 WHERE time = "15:00" |
what's the original air date with title 'hell | CREATE TABLE table_79 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text) | SELECT "Original air date" FROM table_79 WHERE "Title" = 'Hell' |
Name the sum of drawn with lost more than 1 and games less than 5 | CREATE TABLE table_37133 ("Games" real,"Drawn" real,"Lost" real,"Goal difference" text,"Points" real) | SELECT SUM("Drawn") FROM table_37133 WHERE "Lost" > '1' AND "Games" < '5' |
What is Pos., when Height is 'm (ft 10in)', and when Date of Birth is '1983-05-29'? | CREATE TABLE table_name_45 (pos VARCHAR,height VARCHAR,date_of_birth VARCHAR) | SELECT pos FROM table_name_45 WHERE height = "m (ft 10in)" AND date_of_birth = "1983-05-29" |
Which city has a First season of current spell in Segunda Divisi n smaller than 2013? | CREATE TABLE table_name_69 (city VARCHAR,first_season_of_current_spell_in_segunda_división INTEGER) | SELECT city FROM table_name_69 WHERE first_season_of_current_spell_in_segunda_división < 2013 |
has neostigmine, ns, or morphine sulfate been prescribed for patient 25847 since 02/2101? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_items (row_id number,itemid number,label te... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25847) AND prescriptions.drug IN ('neostigmine', 'ns', 'morphine sulfate') AND STRFTIME('%y-%m', prescriptions.startdate) >= '2101-02' |
Show different builders of railways, along with the corresponding number of railways using each builder. | CREATE TABLE railway (Builder VARCHAR) | SELECT Builder, COUNT(*) FROM railway GROUP BY Builder |
what is the one year survival rate of patients who were prescribed with mycophenolate mofetil after the fracture of ilium-closed? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... |
What is the total number of losses for years with fewer than 9 wins? | CREATE TABLE table_name_82 (losses VARCHAR,wins INTEGER) | SELECT COUNT(losses) FROM table_name_82 WHERE wins < 9 |
Name the points for pontrhydyfen rfc | CREATE TABLE table_15467476_2 (points VARCHAR,club VARCHAR) | SELECT points FROM table_15467476_2 WHERE club = "Pontrhydyfen RFC" |
Which class has less in quantity than 174 between the years 1921 23? | CREATE TABLE table_10412 ("Class" text,"Type" text,"Quantity" real,"Date" text,"LNER Class" text,"1946 LNER nos." text) | SELECT "Class" FROM table_10412 WHERE "Quantity" < '174' AND "Date" = '1921–23' |
What is the Title written by Terri Hughes & Ron Milbauer, and an Original air date of march 6, 2001? | CREATE TABLE table_41606 ("Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text) | SELECT "Title" FROM table_41606 WHERE "Written by" = 'terri hughes & ron milbauer' AND "Original air date" = 'march 6, 2001' |
Comments like accepting, with keywords. | 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 ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId nu... | SELECT Id AS "comment_link", Score, CreationDate, LENGTH(Text) FROM Comments WHERE Text LIKE '%accepting%' AND LENGTH(Text) >= '##MinLength:int?40##' AND LENGTH(Text) < '##MaxLength:int?55##' AND (Text LIKE 'Thank%' OR Text LIKE 'Please%' OR Text LIKE '%-1%') ORDER BY Score DESC, LENGTH(Text) |
how many days have passed since patient 022-78423's hospital admission? | 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,systemicsystolic number,systemicdiastolic number,systemicmean number,obs... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '022-78423' AND patient.hospitaldischargetime IS NULL |
Query to get all posts in 2017. | 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 ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,R... | SELECT COUNT(*) FROM Posts WHERE YEAR(Posts.CreationDate) = 2017 |
Tell me the player from dallas burn | CREATE TABLE table_31690 ("Pick #" real,"MLS team" text,"Player" text,"Position" text,"Affiliation" text) | SELECT "Player" FROM table_31690 WHERE "MLS team" = 'dallas burn' |
What question should I be upvoted on and am not?. | CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat... | SELECT Id AS "post_link" FROM Posts WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND AnswerCount = 1 AND Id IN (SELECT ParentId FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = '##UserId##' AND Score = 0) ORDER BY CreationDate DESC |
What is the purse when Aidan O'brien was the trainer? | CREATE TABLE table_name_95 (purse VARCHAR,trainer VARCHAR) | SELECT purse FROM table_name_95 WHERE trainer = "aidan o'brien" |
Name the total number of date for 10 | CREATE TABLE table_3069 ("Round" real,"Date" text,"Country" text,"Circuit" text,"Sprint Winner" text,"Main Winner" text,"Report" text) | SELECT COUNT("Date") FROM table_3069 WHERE "Round" = '10' |
Who is the player from Tennessee? | CREATE TABLE table_45428 ("Player" text,"Nationality" text,"Jersey Number(s)" text,"Position" text,"Years" text,"From" text) | SELECT "Player" FROM table_45428 WHERE "From" = 'tennessee' |
What is Country, when To Par is '+11'? | CREATE TABLE table_name_37 (country VARCHAR,to_par VARCHAR) | SELECT country FROM table_name_37 WHERE to_par = "+11" |
What are the birth dates of employees living in Edmonton? | CREATE TABLE EMPLOYEE (BirthDate VARCHAR,City VARCHAR) | SELECT BirthDate FROM EMPLOYEE WHERE City = "Edmonton" |
What is the score of Tommy Bolt | CREATE TABLE table_15792 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text) | SELECT MIN("Score") FROM table_15792 WHERE "Player" = 'tommy bolt' |
What is the average price across all products? | CREATE TABLE manufacturers (code number,name text,headquarter text,founder text,revenue number)CREATE TABLE products (code number,name text,price number,manufacturer number) | SELECT AVG(price) FROM products |
Episode of 16 involves which performer 1? | CREATE TABLE table_name_64 (performer_1 VARCHAR,episode VARCHAR) | SELECT performer_1 FROM table_name_64 WHERE episode = 16 |
Show the proportion of the product name for each product using a pie chart | CREATE TABLE Order_Items (order_item_id INTEGER,order_id INTEGER,product_id INTEGER,order_quantity VARCHAR(80))CREATE TABLE Customer_Address_History (customer_id INTEGER,address_id INTEGER,date_from DATETIME,date_to DATETIME)CREATE TABLE Addresses (address_id INTEGER,line_1_number_building VARCHAR(80),city VARCHAR(50),... | SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name |
when patient 22295 first got an operation? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,d... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22295) ORDER BY procedures_icd.charttime LIMIT 1 |
What is the total for Bob Tway for the year won before 2002 with a to par bigger than 7? | CREATE TABLE table_70427 ("Player" text,"Country" text,"Year won" real,"Total" real,"To par" real) | SELECT COUNT("Total") FROM table_70427 WHERE "Year won" < '2002' AND "Player" = 'bob tway' AND "To par" > '7' |
what are the three most common microbiological tests that patients had in the same hospital encounter after receiving a anticonvulsant - lorazepam procedure until 1 year ago? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'anticonvu... |
Which players have a pick number of 27? | CREATE TABLE table_16397 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text) | SELECT "Player" FROM table_16397 WHERE "Pick #" = '27' |
patient 006-47576 had received any laboratory test since 08/2102? | 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 number,respiration number,systemicsystolic number,systemicdiasto... | 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-47576')) AND STRFTIME('%y-%m', lab.labresulttime) >= '2102-08' |
Users with the most self-accepts. | CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId nu... | SELECT q.OwnerUserId AS "user_link", COUNT(*) AS "self_accepts" FROM Posts AS q INNER JOIN Posts AS a ON a.Id = q.AcceptedAnswerId WHERE q.OwnerUserId = a.OwnerUserId GROUP BY q.OwnerUserId ORDER BY 'self_accepts' DESC LIMIT 500 |
Deleted by community, undeleted by community - longest time as deleted. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewRejectionReasons (Id number,Name te... | WITH Raw AS (SELECT RANK() OVER (PARTITION BY PostId ORDER BY Id) AS N, PostId, PostHistoryTypeId, CreationDate, Text FROM PostHistory WHERE PostHistoryTypeId BETWEEN 12 AND 13) SELECT Del.PostId AS "post_link", 'site://posts/' + CAST(Del.PostId AS TEXT) + '/revisions|revisions' AS Revisions, 'site://posts/' + CAST(Del... |
What is the latest year with a 34-0 result? | CREATE TABLE table_name_60 (year INTEGER,result VARCHAR) | SELECT MAX(year) FROM table_name_60 WHERE result = "34-0" |
On July 8, what was the score? | CREATE TABLE table_21326 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location/Attendance" text,"Record" text) | SELECT "Score" FROM table_21326 WHERE "Date" = 'July 8' |
Who was drafted by the Washington Capitals? | CREATE TABLE table_2840500_2 (player VARCHAR,nhl_team VARCHAR) | SELECT player FROM table_2840500_2 WHERE nhl_team = "Washington Capitals" |
What's the number of the episode seen by 2.24 million people in the US? | CREATE TABLE table_21696800_1 (_number VARCHAR,us_viewers__million_ VARCHAR) | SELECT _number FROM table_21696800_1 WHERE us_viewers__million_ = "2.24" |
What is the Head Coach of Novy Urengoy? | CREATE TABLE table_name_43 (head_coach VARCHAR,town VARCHAR) | SELECT head_coach FROM table_name_43 WHERE town = "novy urengoy" |
who does john hendrie play for ? | CREATE TABLE table_203_637 (id number,"player" text,"for" text,"against" text,"result" text,"date" text) | SELECT "for" FROM table_203_637 WHERE "player" = 'john hendrie' |
What are the number of the dates of birth of entrepreneurs with investor 'Simon Woodroffe' or 'Peter Jones'?, and display by the X-axis in descending please. | CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Date_of_Birth text)CREATE TABLE entrepreneur (Entrepreneur_ID int,People_ID int,Company text,Money_Requested real,Investor text) | SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY Date_of_Birth DESC |
How many rankings did the 5th season have? | CREATE TABLE table_18762 ("Season" text,"Timeslot" text,"Season Premiere" text,"Season Finale" text,"Episodes" real,"TV Season" text,"Ranking" text,"Viewers (in millions)" text) | SELECT COUNT("Ranking") FROM table_18762 WHERE "Season" = '5th' |
Name the score for chicago | CREATE TABLE table_23186738_9 (score VARCHAR,team VARCHAR) | SELECT score FROM table_23186738_9 WHERE team = "Chicago" |
Tell me the leading scorer for grizzlies | CREATE TABLE table_name_59 (leading_scorer VARCHAR,visitor VARCHAR) | SELECT leading_scorer FROM table_name_59 WHERE visitor = "grizzlies" |
Top 50 users from Turkey. | CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%turkey' ORDER BY Reputation DESC LIMIT 50 |
Which tournament had a clay surface and a score of 6 1, 3 6, 6 2? | CREATE TABLE table_60931 ("Outcome" text,"Date" real,"Tournament" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score in the final" text) | SELECT "Tournament" FROM table_60931 WHERE "Surface" = 'clay' AND "Score in the final" = '6–1, 3–6, 6–2' |
Name the champion for london hunt and country club ( london , on ) | CREATE TABLE table_20670 ("Year" real,"Dates" text,"Champion" text,"Country" text,"Score" real,"To par" text,"Margin of victory" text,"Tournament location" text,"Purse (US $)" real,"Winners share" text) | SELECT "Champion" FROM table_20670 WHERE "Tournament location" = 'London Hunt and Country Club ( London , ON )' |
What day did Alex Best exit? | CREATE TABLE table_name_26 (exited VARCHAR,celebrity VARCHAR) | SELECT exited FROM table_name_26 WHERE celebrity = "alex best" |
what are the five most frequently ordered lab tests for patients who have received cv cath plcmt w guidance previously within the same month this year? | CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_procedures (row_id number,icd9_code ... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i... |
List the name of rooms with king or queen bed. | CREATE TABLE rooms (roomid text,roomname text,beds number,bedtype text,maxoccupancy number,baseprice number,decor text)CREATE TABLE reservations (code number,room text,checkin text,checkout text,rate number,lastname text,firstname text,adults number,kids number) | SELECT roomname FROM rooms WHERE bedtype = "King" OR bedtype = "Queen" |
Questions closed as primarily opinion-based. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREA... | SELECT p.Id AS "post_link" FROM Posts AS p INNER JOIN PostHistory AS ph ON p.Id = ph.PostId WHERE PostTypeId = 1 AND NOT ClosedDate IS NULL AND PostHistoryTypeId = 10 AND Comment = '105' AND AnswerCount > 0 AND Score >= '##MinScore:int##' ORDER BY p.CreationDate DESC |
which leage had a league cup of 46 (1) | CREATE TABLE table_19729 ("Name" text,"Years" text,"League" text,"FA Cup" text,"League Cup" text,"Europe" text,"Other a" text,"Total" text) | SELECT "League" FROM table_19729 WHERE "League Cup" = '46 (1)' |
How many division titles does the team with 23 playoff appearances and more than 1 conference titles have? | CREATE TABLE table_name_87 (division_titles INTEGER,playoff_appearances VARCHAR,conference_titles VARCHAR) | SELECT SUM(division_titles) FROM table_name_87 WHERE playoff_appearances = 23 AND conference_titles > 1 |
What largest bronze number has a gold number that is bigger than 1? | CREATE TABLE table_name_66 (bronze INTEGER,gold INTEGER) | SELECT MAX(bronze) FROM table_name_66 WHERE gold > 1 |
what is the number of patients whose procedure icd9 code is 8960 and drug type is base? | 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,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "8960" AND prescriptions.drug_type = "BASE" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.