instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is the title of the episode directed by Mark Tinker?
CREATE TABLE table_16438 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (millions)" text)
SELECT "Title" FROM table_16438 WHERE "Directed by" = 'Mark Tinker'
What is the hawthorn score at the year 2000?
CREATE TABLE table_28211103_1 (hawthorn_score VARCHAR,year VARCHAR)
SELECT hawthorn_score FROM table_28211103_1 WHERE year = 2000
Which club was founded in 1962?
CREATE TABLE table_name_25 (club VARCHAR,founded VARCHAR)
SELECT club FROM table_name_25 WHERE founded = 1962
how many patients admitted before the year 2198 are diagnosed with primary disease aortic insufficiency\re-do sternotomy; aortic valve replacement?
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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.admityear < "2198"
what is the team that played in 2006?
CREATE TABLE table_37060 ("Player" text,"Team" text,"Score" text,"Versus" text,"Year" real)
SELECT "Team" FROM table_37060 WHERE "Year" = '2006'
What is the record of the match with a win res., a 5:00 time, and more than 3 rounds?
CREATE TABLE table_61351 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Record" FROM table_61351 WHERE "Res." = 'win' AND "Time" = '5:00' AND "Round" > '3'
Questions with [data-processing] as only tag.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivileg...
SELECT Id AS "post_link", CreationDate, Tags FROM Posts WHERE Tags = '<data-processing>' ORDER BY Score DESC LIMIT 1000
What is the score of player brian watts, who has a to par of 5?
CREATE TABLE table_name_5 (score VARCHAR,to_par VARCHAR,player VARCHAR)
SELECT score FROM table_name_5 WHERE to_par = 5 AND player = "brian watts"
give me the number of patients whose admission type is urgent and admission year is less than 2194?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear < "2194"
On what date was a record set in the team pursuit (8 laps) event?
CREATE TABLE table_name_75 (date VARCHAR,event VARCHAR)
SELECT date FROM table_name_75 WHERE event = "team pursuit (8 laps)"
what was the monthly minimum amount of output amt-blake drain given to patient 007-4119 since 89 months 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 MIN(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 = '007-4119')) AND intakeoutput.celllabel = 'output...
What year was the Honda ra168e 1.5 v6 t engine used?
CREATE TABLE table_70491 ("Year" real,"Chassis" text,"Engine" text,"Tyres" text,"Pts. \u2021" text)
SELECT "Year" FROM table_70491 WHERE "Engine" = 'honda ra168e 1.5 v6 t'
What is the mean amount of staying councilors with an election result amounting to less than 10 with the Green party, and a new council bigger than 0?
CREATE TABLE table_name_76 (staying_councillors INTEGER,new_council VARCHAR,election_result VARCHAR,party VARCHAR)
SELECT AVG(staying_councillors) FROM table_name_76 WHERE election_result < 10 AND party = "green" AND new_council > 0
Number of users with reputation at least N.
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)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 PostTags (PostId number,TagId number)CREATE TABLE...
SELECT COUNT(Id) AS "number_of_users" FROM Users WHERE Reputation >= '##minrep##' AND CreationDate > @months_ago
how many players went to indiana
CREATE TABLE table_204_585 (id number,"year" text,"player" text,"high school" text,"college" text,"nba/aba draft" text)
SELECT COUNT("player") FROM table_204_585 WHERE "college" = 'indiana'
If the winner is Bernhard Eisel, what is the stage maximum?
CREATE TABLE table_22941863_19 (stage INTEGER,winner VARCHAR)
SELECT MAX(stage) FROM table_22941863_19 WHERE winner = "Bernhard Eisel"
what is the name ofhte company where the plant is in burnaston?
CREATE TABLE table_250309_1 (company VARCHAR,plant VARCHAR)
SELECT company FROM table_250309_1 WHERE plant = "Burnaston"
Which Week has Points For larger than 19, and an Opponent of philadelphia eagles, and Points Against larger than 7?
CREATE TABLE table_name_17 (week INTEGER,points_against VARCHAR,points_for VARCHAR,opponent VARCHAR)
SELECT MAX(week) FROM table_name_17 WHERE points_for > 19 AND opponent = "philadelphia eagles" AND points_against > 7
What is Date, when Name is 'Guay, Albert , 32'?
CREATE TABLE table_name_48 (date VARCHAR,name VARCHAR)
SELECT date FROM table_name_48 WHERE name = "guay, albert , 32"
how many hours have passed since patient 006-2586 was admitted to the intensive care unit?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '006-2586' AND patient.unitdischargetime IS NULL
What are the different role codes for users, and how many users have each Show bar chart, and rank by the total number in ascending please.
CREATE TABLE Document_Sections_Images (section_id INTEGER,image_id INTEGER)CREATE TABLE Documents (document_code VARCHAR(15),document_structure_code VARCHAR(15),document_type_code VARCHAR(15),access_count INTEGER,document_name VARCHAR(80))CREATE TABLE Document_Sections (section_id INTEGER,document_code VARCHAR(15),sect...
SELECT role_code, COUNT(*) FROM Users GROUP BY role_code ORDER BY COUNT(*)
How many patients had a joint fluid lab test done and were diagnosed with acute/chronic systolic/diastolic heart failure?
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 (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,ethni...
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 = "Ac/chr syst/dia hrt fail" AND lab.fluid = "Joint Fluid"
find out the short title of diagnoses and long title of diagnoses for patient with patient id 11221.
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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT diagnoses.short_title, procedures.long_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "11221"
What is the Electorate when the term of office was 1955 1972, for Peter Howson?
CREATE TABLE table_59815 ("Member" text,"Party" text,"Electorate" text,"State" text,"Term of office" text)
SELECT "Electorate" FROM table_59815 WHERE "Term of office" = '1955–1972' AND "Member" = 'peter howson'
Distribution of bounties over tags.
CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE PostLinks (Id number,Creatio...
SELECT TagName, COUNT(BountyAmount) AS nrOfBounties, SUM(BountyAmount) AS bountyHeight, AVG(BountyAmount) AS avgBounty FROM (SELECT VoteTypeId, BountyAmount, TagName FROM Votes AS v INNER JOIN PostTags AS m ON v.PostId = m.PostId INNER JOIN Tags AS t ON m.TagId = t.Id) AS P WHERE NOT BountyAmount IS NULL AND VoteTypeId...
What dipole moment has a density of 1.092 g/ml?
CREATE TABLE table_44376 ("Solvent" text,"Chemical Formula" text,"Boiling point" text,"Dielectric constant" text,"Density" text,"Dipole moment (D)" text)
SELECT "Dipole moment ( D )" FROM table_44376 WHERE "Density" = '1.092 g/ml'
Show different parties of people along with the number of people in each party.
CREATE TABLE debate (debate_id number,date text,venue text,num_of_audience number)CREATE TABLE people (people_id number,district text,name text,party text,age number)CREATE TABLE debate_people (debate_id number,affirmative number,negative number,if_affirmative_win others)
SELECT party, COUNT(*) FROM people GROUP BY party
Visualize the total smallest rating of different movie title using a bar chart, and could you order from high to low by the y axis?
CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Movie (mID int,title text,year int,director text)
SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY SUM(MIN(T1.stars)) DESC
how many patients were diagnosed with cardiac arrest and did not come back to hospital within the same month in 2105?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype tex...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cardiac arrest' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1) - (SELECT COUNT(DISTINC...
Which area has a telephone of (052) of 3862279?
CREATE TABLE table_34899 ("Number" real,"Name of administrative unit" text,"Telephone (052)" text,"Area (km 2)" real,"Population (people)" real)
SELECT "Area (km 2 )" FROM table_34899 WHERE "Telephone (052)" = '3862279'
List the name and cost of all procedures sorted by the cost from the highest to the lowest.
CREATE TABLE procedures (name VARCHAR,cost VARCHAR)
SELECT name, cost FROM procedures ORDER BY cost DESC
If the team is Worcester, what is the 2005-2006 points?
CREATE TABLE table_25734 ("Rank" real,"Team" text,"Total Points" real,"2008-09 Points" real,"2007-08 Points" real,"2006-07 Points" real,"2005-06 Points" real)
SELECT "2005-06 Points" FROM table_25734 WHERE "Team" = 'Worcester'
How many Seat Orders (Right to Left) have a Series 3 of deborah meaden?
CREATE TABLE table_78695 ("Seat Order (Right to Left)" real,"Series 1" text,"Series 2" text,"Series 3" text,"Series 5" text,"Series 9" text,"Series 11" text)
SELECT COUNT("Seat Order (Right to Left)") FROM table_78695 WHERE "Series 3" = 'deborah meaden'
give me the number of patients whose days of hospital stay is greater than 0 and drug name is heparin sodium (preservative free)?
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,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "0" AND prescriptions.drug = "Heparin Sodium (Preservative Free)"
serum creatinine < 1.5 mg / dl for male and < 1.4 mg / dl for female
CREATE TABLE table_train_203 ("id" int,"gender" string,"perforation" bool,"hemoglobin_a1c_hba1c" float,"peptic_ulcer_disease" bool,"serum_c_peptide" float,"gastrointestinal_disease" bool,"serum_creatinine" float,"age" float,"NOUSE" float)
SELECT * FROM table_train_203 WHERE (gender = 'male' AND serum_creatinine < 1.5) OR (gender = 'female' AND serum_creatinine < 1.4)
Self-answered questions with no other answers.
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId numbe...
SELECT q.Id AS "post_link", q.CreationDate, q.Score FROM ((SELECT Posts.* FROM Posts WHERE PostTypeId = 1 AND AnswerCount = 1 AND CommunityOwnedDate IS NULL) AS q JOIN (SELECT Posts.* FROM Posts WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL) AS a ON q.Id = a.ParentId) WHERE q.OwnerUserId = a.OwnerUserId AND q.Ans...
what is the total maximum cost of a hospital that includes a drug called dexamethasone until 4 years ago?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,chartti...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'dexamethasone') AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY cost.hadm_id) AS t1
What championship was in 1985?
CREATE TABLE table_name_30 (championship VARCHAR,year VARCHAR)
SELECT championship FROM table_name_30 WHERE year = 1985
What are the id and name of the mountains that have at least 2 photos Show bar chart, order from low to high by the y axis.
CREATE TABLE photos (id int,camera_lens_id int,mountain_id int,color text,name text)CREATE TABLE mountain (id int,name text,Height real,Prominence real,Range text,Country text)CREATE TABLE camera_lens (id int,brand text,name text,focal_length_mm real,max_aperture real)
SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id ORDER BY T1.id
What is the internet when the position is more than 13?
CREATE TABLE table_name_12 (internet VARCHAR,position INTEGER)
SELECT internet FROM table_name_12 WHERE position > 13
How many games had Robin Lopez (10) for the most rebounds?
CREATE TABLE table_27733258_2 (game VARCHAR,high_rebounds VARCHAR)
SELECT COUNT(game) FROM table_27733258_2 WHERE high_rebounds = "Robin Lopez (10)"
Who were the Paraguay scorers on June 15, 2008?
CREATE TABLE table_49931 ("Date" text,"Venue" text,"Score" text,"Comp" text,"Paraguay scorers" text,"Report" text)
SELECT "Paraguay scorers" FROM table_49931 WHERE "Date" = 'june 15, 2008'
how many patients whose admission year is less than 2124 and lab test category is blood gas?
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 text,name text,marital_status text,age text,dob text,gender text,la...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2124" AND lab."CATEGORY" = "Blood Gas"
Name the song title with time of 1:51
CREATE TABLE table_name_75 (song_title VARCHAR,time VARCHAR)
SELECT song_title FROM table_name_75 WHERE time = "1:51"
what is the result for 1970 at yankee stadium?
CREATE TABLE table_name_7 (result VARCHAR,year VARCHAR,location VARCHAR)
SELECT result FROM table_name_7 WHERE year = 1970 AND location = "yankee stadium"
What was the course called that had an Edition of 117th?
CREATE TABLE table_name_68 (course VARCHAR,edition VARCHAR)
SELECT course FROM table_name_68 WHERE edition = "117th"
Which Club/province has a Position of centre, and Caps of 27?
CREATE TABLE table_name_75 (club_province VARCHAR,position VARCHAR,caps VARCHAR)
SELECT club_province FROM table_name_75 WHERE position = "centre" AND caps = 27
What was the Attendance on November 26?
CREATE TABLE table_8905 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Stadium" text,"Record" text,"Attendance" text)
SELECT "Attendance" FROM table_8905 WHERE "Date" = 'november 26'
Who did wilson reis fight against that lasted less than 3 rounds with a time of 1:02?
CREATE TABLE table_name_25 (opponent VARCHAR,round VARCHAR,time VARCHAR)
SELECT opponent FROM table_name_25 WHERE round < 3 AND time = "1:02"
find the number of patients with medicaid insurance whose primary disease is syncope;telemetry.
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,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.diagnosis = "SYNCOPE;TELEMETRY"
What was the score of the Home team in the game that had the Away team of south melbourne?
CREATE TABLE table_52375 ("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_52375 WHERE "Away team" = 'south melbourne'
did patient 1912's arterial bp [systolic] on the last hospital encounter be greater than 121.0?
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 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)CREA...
SELECT COUNT(*) > 0 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 = 1912 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND chartevents.itemid ...
Who was the home team for the match at Stadion pod Vrmcem?
CREATE TABLE table_name_77 (home VARCHAR,venue VARCHAR)
SELECT home FROM table_name_77 WHERE venue = "stadion pod vrmcem"
Return the famous release date for the oldest artist.
CREATE TABLE artist (artist_id number,artist text,age number,famous_title text,famous_release_date text)CREATE TABLE volume (volume_id number,volume_issue text,issue_date text,weeks_on_top number,song text,artist_id number)CREATE TABLE music_festival (id number,music_festival text,date_of_ceremony text,category text,vo...
SELECT famous_release_date FROM artist ORDER BY age DESC LIMIT 1
What is the earliest year that has a Bristol engine?
CREATE TABLE table_name_98 (year INTEGER,engine VARCHAR)
SELECT MIN(year) FROM table_name_98 WHERE engine = "bristol"
For those records from the products and each product's manufacturer, find name and the sum of manufacturer , and group by attribute name, and visualize them by a bar chart, order from low to high by the Name.
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)
SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
What was the record at the game that had a score of 7-10?
CREATE TABLE table_80392 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT "Record" FROM table_80392 WHERE "Score" = '7-10'
A pie chart for what are the number of the countries of all airlines whose names start with Orbit?
CREATE TABLE airlines (alid integer,name text,iata varchar(2),icao varchar(3),callsign text,country text,active varchar(2))CREATE TABLE airports (apid integer,name text,city text,country text,x real,y real,elevation bigint,iata character varchar(3),icao character varchar(4))CREATE TABLE routes (rid integer,dst_apid int...
SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country
Number of users with reputation grouped and ordered by last access date.
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId numbe...
SELECT DATEADD(day, DATEDIFF(day, 0, LastAccessDate), 0) AS "Last access date", COUNT(*) AS "Users" FROM Users WHERE Reputation >= '##Reputation:int?5##' GROUP BY DATEADD(day, DATEDIFF(day, 0, LastAccessDate), 0) ORDER BY DATEADD(day, DATEDIFF(day, 0, LastAccessDate), 0)
Deleted questions by specific gold badge holder.
CREATE TABLE PostHistoryTypes (Id number,Name text)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 PostTags (PostId number,TagId number)CREATE TABLE PostNoticeTypes ...
SELECT 'ex' + 'cel' AS "tag"
Who was the opponent on June 3?
CREATE TABLE table_name_50 (opponent VARCHAR,date VARCHAR)
SELECT opponent FROM table_name_50 WHERE date = "june 3"
What location and attendance were there for game 5?
CREATE TABLE table_29952 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Location Attendance" FROM table_29952 WHERE "Game" = '5'
Return a bar chart on what are the names and distances for all airplanes?, and list from low to high by the Y please.
CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,0))CREATE TABLE certificate (eid number(9,0),aid number(9,0))CREATE TABLE employee (eid number(9,0),name varchar2(30),salary number(10,2))CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),dep...
SELECT name, distance FROM aircraft ORDER BY distance
How many innings for the player with an average of 22.61?
CREATE TABLE table_28846752_12 (innings VARCHAR,average VARCHAR)
SELECT innings FROM table_28846752_12 WHERE average = "22.61"
What is the lowest score that wes ellis got?
CREATE TABLE table_46480 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text)
SELECT MIN("Score") FROM table_46480 WHERE "Player" = 'wes ellis'
what flights go from DENVER to ATLANTA
CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREA...
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA...
Draw a bar chart about the distribution of All_Home and the sum of School_ID , and group by attribute All_Home, and order All_Home from low to high order please.
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 (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home
what intake did patient 006-133605 have the first time the previous day.
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetaken...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605')) AND intakeoutput.cellpath LIKE '%intake%' AND ...
What is the max torque of the 1.2 mpi engine?
CREATE TABLE table_name_11 (max_torque_at_rpm VARCHAR,engine_name VARCHAR)
SELECT max_torque_at_rpm FROM table_name_11 WHERE engine_name = "1.2 mpi"
Which Population is the highest one that has a Density (inhabitants/km 2) larger than 2805.8, and a Rank of 1st, and an Altitude (mslm) smaller than 122?
CREATE TABLE table_75418 ("Rank" text,"City" text,"Population" real,"Area (km 2)" real,"Density (inhabitants/km 2)" real,"Altitude (mslm)" real)
SELECT MAX("Population") FROM table_75418 WHERE "Density (inhabitants/km 2 )" > '2805.8' AND "Rank" = '1st' AND "Altitude (mslm)" < '122'
What launched has 158 days (5 months, 8 days) as the time elapsed?
CREATE TABLE table_name_91 (launched VARCHAR,time_elapsed VARCHAR)
SELECT launched FROM table_name_91 WHERE time_elapsed = "158 days (5 months, 8 days)"
how many number is located at registration f-bvff?
CREATE TABLE table_23458 ("Number" real,"Registration" text,"First flew" text,"Last flew" text,"Flying hours" real,"Location" text)
SELECT COUNT("Number") FROM table_23458 WHERE "Registration" = 'F-BVFF'
What is the seed for lyon (32) was DNQ?
CREATE TABLE table_23844 ("Seed" real,"Player" text,"Marseille (32 draw)" text,"Metz (32)" text,"Lyon (32)" text,"Paris (48 - byes)" text)
SELECT MAX("Seed") FROM table_23844 WHERE "Lyon (32)" = 'DNQ'
What is the Total of Set 2 of 21:12?
CREATE TABLE table_name_58 (total VARCHAR,set_2 VARCHAR)
SELECT total FROM table_name_58 WHERE set_2 = "21:12"
What is the difficulty ranking for all CS-LSA classes ?
CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wedn...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course, program, program_course WHERE program_course.course_id = course.course_id AND program.name LIKE 'CS-LSA' AND program.program_id = program_course.program_id
in the previous year, what were the top four most commonly prescribed medications to patients during the same month after the prescription of cefazolin 2 gm in ns 100 ml ivpb?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE intakeoutput (intak...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'cefazolin 2 gm in ns 100 ml ivpb' AND DATETIME(medi...
What percentage is listed in column r1b1a2 (r-m269) for the 77.8% r1b1c (r-v88)?
CREATE TABLE table_21481509_4 (r1b1a2__r_m269_ VARCHAR,r1b1c__r_v88_ VARCHAR)
SELECT r1b1a2__r_m269_ FROM table_21481509_4 WHERE r1b1c__r_v88_ = "77.8%"
what is the number of patients whose insurance is self pay and lab test name is granular casts?
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 (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,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "Granular Casts"
What is Nationality of daniel goneau?
CREATE TABLE table_name_11 (nationality VARCHAR,player VARCHAR)
SELECT nationality FROM table_name_11 WHERE player = "daniel goneau"
Which Time has an Opponent of shamil abdurahimov?
CREATE TABLE table_name_39 (time VARCHAR,opponent VARCHAR)
SELECT time FROM table_name_39 WHERE opponent = "shamil abdurahimov"
tell me, what were the top three most commonly prescribed drugs in 2102?
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 t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE STRFTIME('%y', medication.drugstarttime) = '2102' GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 3
What is every value for Serbs if value for Hungarians is 9.26%?
CREATE TABLE table_2925 ("Year" real,"Population" real,"Serbs" text,"Germans" text,"Romanians" text,"Hungarians" text,"Croats" text,"Roma" text,"Slovaks" text,"Rest" text)
SELECT "Serbs" FROM table_2925 WHERE "Hungarians" = '9.26%'
Average answer score of top 10.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance te...
SELECT u.DisplayName, AVG(CAST(p.Score AS FLOAT(4))) AS AvgScore FROM Posts AS p JOIN Users AS u ON u.Id = p.OwnerUserId WHERE PostTypeId = 2 AND OwnerUserId IN (SELECT Id FROM Users ORDER BY Reputation DESC LIMIT 10) GROUP BY u.DisplayName ORDER BY AvgScore DESC
what is 2000 when 2012 is w and 2011 is 4r?
CREATE TABLE table_name_54 (Id VARCHAR)
SELECT 2000 FROM table_name_54 WHERE 2012 = "w" AND 2011 = "4r"
Closed Questions by Join Date.
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 Opened.cYear, Opened.cMonth, openedQuestions, closedQuestions, (1.0 * closedQuestions / openedQuestions) FROM (SELECT YEAR(Users.CreationDate) AS cYear, MONTH(Users.CreationDate) AS cMonth, COUNT(*) AS closedQuestions FROM Posts JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Posts.PostTypeId = 1 AND NOT Closed...
Can you tell me the Score that has the Date of 11/17/1979?
CREATE TABLE table_47083 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Record" text)
SELECT "Score" FROM table_47083 WHERE "Date" = '11/17/1979'
provide the number of patients whose days of hospital stay is greater than 10 and procedure long title is coronary arteriography using two catheters?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "10" AND procedures.long_title = "Coronary arteriography using two catheters"
Show the number of venue from each venue, sort how many venue in desc order.
CREATE TABLE submission (Submission_ID int,Scores real,Author text,College text)CREATE TABLE Acceptance (Submission_ID int,Workshop_ID int,Result text)CREATE TABLE workshop (Workshop_ID int,Date text,Venue text,Name text)
SELECT Venue, COUNT(Venue) FROM workshop GROUP BY Venue ORDER BY COUNT(Venue) DESC
What year did was the Inside Soap Awards won?
CREATE TABLE table_52360 ("Year" real,"Result" text,"Award" text,"Film or series" text,"Character" text)
SELECT AVG("Year") FROM table_52360 WHERE "Result" = 'won' AND "Award" = 'inside soap awards'
who is playing for when the opponent is deportes savio and the date is 2010-03-11?
CREATE TABLE table_13871 ("Date" text,"Season" text,"Playing for" text,"Opponent" text,"Final score" text)
SELECT "Playing for" FROM table_13871 WHERE "Opponent" = 'deportes savio' AND "Date" = '2010-03-11'
Which college had rounds smaller than 2?
CREATE TABLE table_67015 ("Round" real,"Pick" real,"Name" text,"Position" text,"College" text)
SELECT "College" FROM table_67015 WHERE "Round" < '2'
Name the macedonian for il/elle avait entendu
CREATE TABLE table_22305 ("English" text,"German" text,"Dutch" text,"Latin" text,"Romanian" text,"Portuguese" text,"Spanish" text,"Italian" text,"French" text,"Greek (Modern)" text,"Bulgarian" text,"Macedonian" text,"Polish (extinct)" text)
SELECT "Macedonian" FROM table_22305 WHERE "French" = 'il/elle avait entendu'
Which Games have a Drawn smaller than 1, and a Lost smaller than 1?
CREATE TABLE table_38247 ("Games" real,"Drawn" real,"Lost" real,"Points difference" text,"Points" real)
SELECT "Games" FROM table_38247 WHERE "Drawn" < '1' AND "Lost" < '1'
What is Jockey, when Post is 12?
CREATE TABLE table_name_53 (jockey VARCHAR,post VARCHAR)
SELECT jockey FROM table_name_53 WHERE post = 12
provide the number of patients whose days of hospital stay is greater than 43 and drug name is artificial tears preserv. free?
CREATE TABLE diagnoses (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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "43" AND prescriptions.drug = "Artificial Tears Preserv. Free"
Name the least touchdowns for 11 points
CREATE TABLE table_72532 ("Player" text,"Position" text,"Starter" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real)
SELECT MIN("Touchdowns") FROM table_72532 WHERE "Points" = '11'
Who is the player with a +3 to par and a 74-71-68=213 score?
CREATE TABLE table_77213 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Player" FROM table_77213 WHERE "To par" = '+3' AND "Score" = '74-71-68=213'
to how many patients was drug code repa0.5 administered?
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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "REPA0.5"
What is the result for w. arthur winstead?
CREATE TABLE table_72408 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "Result" FROM table_72408 WHERE "Incumbent" = 'W. Arthur Winstead'
what is the title of the episode daphne field wrote?
CREATE TABLE table_2626495_1 (title VARCHAR,written_by VARCHAR)
SELECT title FROM table_2626495_1 WHERE written_by = "Daphne Field"