instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
how many hours have elapsed since patient 12726 first received an intake of lipids 20% on the current icu visit?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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 t...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12726) AND icustays.outtime IS NULL)...
What is the point average for the game that has FGM-FGA of 11-28 and a number smaller than 7?
CREATE TABLE table_54820 ("Number" real,"Opponent" text,"Box Score" text,"Points" real,"FGM - FGA" text,"3PM - 3PA" text,"FTM - FTA" text,"Assists" real,"Rebounds" real,"Steals" real,"Blocks" real)
SELECT AVG("Points") FROM table_54820 WHERE "FGM - FGA" = '11-28' AND "Number" < '7'
What teacher taught Pamela Campbell when he took PAT 513 ?
CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)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,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varch...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN student_record ON student_record.offering_id = offering_instructor.offering_id INNER JOIN student ON student.student_id = student_record.student_id INNER JOIN course_...
What is the Music for the Dance that Scored 25 (9, 8, 8) and a Result of bottom 2?
CREATE TABLE table_32612 ("Couple" text,"Score" text,"Dance" text,"Music" text,"Result" text)
SELECT "Music" FROM table_32612 WHERE "Score" = '25 (9, 8, 8)' AND "Result" = 'bottom 2'
Name the league cup for northern ireland
CREATE TABLE table_22357065_1 (league VARCHAR,nation VARCHAR)
SELECT league AS Cup FROM table_22357065_1 WHERE nation = "Northern Ireland"
team he played most games with .
CREATE TABLE table_203_258 (id number,"year" number,"team" text,"games" number,"combined tackles" number,"tackles" number,"assisted tackles" number,"sacks" number,"forced fumbles" number,"fumble recoveries" number,"fumble return yards" number,"interceptions" number,"interception return yards" number,"yards per intercep...
SELECT "team" FROM table_203_258 GROUP BY "team" ORDER BY SUM("games") DESC LIMIT 1
What is the minimum number of bypass ports listed?
CREATE TABLE table_1520 ("Engine" text,"Exhaust Ports" text,"Bypass Ports" real,"Bypass Boosters" text,"SPI" text,"Tapered Grind" text,"Number on cyl." text)
SELECT MIN("Bypass Ports") FROM table_1520
What Competition has an Event of 4x100 m relay and has the Time of 38.89?
CREATE TABLE table_45038 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text,"Time" text)
SELECT "Competition" FROM table_45038 WHERE "Event" = '4x100 m relay' AND "Time" = '38.89'
What is the Displacement of the Iveco F1CE3481E Engine?
CREATE TABLE table_37030 ("Model" text,"Engine" text,"Displacement" text,"Valvetrain" text,"Fuel system" text,"Max. power at rpm" text,"Max. torque at rpm" text)
SELECT "Displacement" FROM table_37030 WHERE "Engine" = 'iveco f1ce3481e'
how many patients whose drug name is levetiracetam?
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 text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Levetiracetam"
Name the score for march 8
CREATE TABLE table_31449 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Score" FROM table_31449 WHERE "Date" = 'March 8'
How many golds does the nation having a rank of 8, fewer than 5 bronzes and more than 1 silver have?
CREATE TABLE table_36059 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Gold") FROM table_36059 WHERE "Bronze" < '5' AND "Silver" > '1' AND "Rank" > '8'
Show the average amount of transactions with type code 'SALE'.
CREATE TABLE purchases (purchase_transaction_id number,purchase_details text)CREATE TABLE sales (sales_transaction_id number,sales_details text)CREATE TABLE ref_transaction_types (transaction_type_code text,transaction_type_description text)CREATE TABLE transactions_lots (transaction_id number,lot_id number)CREATE TABL...
SELECT AVG(amount_of_transaction) FROM transactions WHERE transaction_type_code = "SALE"
what opponent is listed in the top of the table ?
CREATE TABLE table_204_774 (id number,"#" number,"date" text,"venue" text,"opponent" text,"score" text,"result" text,"competition" text)
SELECT "opponent" FROM table_204_774 WHERE id = 1
Which position has more than 4 points, less than 12 tries, a squad number of more than 1, and where Ali Lauitiiti is a player?
CREATE TABLE table_name_58 (position VARCHAR,player VARCHAR,squad_no VARCHAR,points VARCHAR,tries VARCHAR)
SELECT position FROM table_name_58 WHERE points > 4 AND tries < 12 AND squad_no > 1 AND player = "ali lauitiiti"
What was the year of the competition in which Odd Grenland was the runner-up?
CREATE TABLE table_52279 ("Years" text,"Winners" text,"Runners-Up" text,"Score" text,"Third" text)
SELECT "Years" FROM table_52279 WHERE "Runners-Up" = 'odd grenland'
What was the host of the round at Hammons Student Center?
CREATE TABLE table_4671 ("Region" text,"Host" text,"Venue" text,"City" text,"State" text)
SELECT "Host" FROM table_4671 WHERE "Venue" = 'hammons student center'
Users accusing other users of plagiarism (double-sigh).
CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,Reje...
SELECT c.PostId AS "post_link", c.Text FROM Comments AS c WHERE c.Text LIKE '%http%plagiari%e%http%' OR c.Text LIKE '%http%cop%http%' OR c.Text LIKE '%http%stole%http%'
who had high rebounds at game 69?
CREATE TABLE table_27700375_10 (high_rebounds VARCHAR,game VARCHAR)
SELECT high_rebounds FROM table_27700375_10 WHERE game = 69
Find the emails of customers who has filed a complaints of the product with the most complaints.
CREATE TABLE customers (email_address VARCHAR,customer_id VARCHAR)CREATE TABLE complaints (customer_id VARCHAR)
SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY COUNT(*) LIMIT 1
how many patients are discharged to home with age below 62?
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 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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.age < "62"
how many hours is it since the last time patient 31854 had a criticare hn intake on the current icu visit?
CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)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,had...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854) AND icustays.outtime IS NULL)...
Name the order in office for spiro agnew
CREATE TABLE table_2026548_1 (order_in_office VARCHAR,vice_president VARCHAR)
SELECT order_in_office FROM table_2026548_1 WHERE vice_president = "Spiro Agnew"
What was the venue of the competition that held the 1st position in 2011?
CREATE TABLE table_name_68 (venue VARCHAR,position VARCHAR,year VARCHAR)
SELECT venue FROM table_name_68 WHERE position = "1st" AND year = 2011
Give me the comparison about Team_ID over the ACC_Road , and group by attribute All_Home, and display in ascending by the x-axis.
CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)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_Perce...
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road
Tags where I have an answer with score 5 or more.
CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body ...
SELECT DISTINCT '<' + CAST(Tags.TagName AS TEXT) + '>' AS "tags", Ans.Id AS "post_link", Ans.Score FROM (((SELECT Posts.* FROM Posts JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id WHERE Posts.OwnerUserId = @userId AND PostTypes.Name = 'Answer' AND Posts.Score > 5) AS Ans JOIN Posts ON Ans.ParentId = Posts.Id) JOIN P...
Give me a bar chart that bins the payment date into the day of the week interval and then shows the amount of each payment categorized by the payment method code, and then sort the bars in ascending order of date.
CREATE TABLE Settlements (Settlement_ID INTEGER,Claim_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settled DATE,Amount_Claimed INTEGER,Amount_Settled INTEGER,Customer_Policy_ID INTEGER)CREATE TABLE Payments (Payment_ID INTEGER,Settlement_ID INTEGER,Payment_Method_Code VARCHAR(255),Date_Payment_Made DATE,Amount_Payment IN...
SELECT Date_Payment_Made, COUNT(Date_Payment_Made) FROM Payments GROUP BY Payment_Method_Code ORDER BY Date_Payment_Made
What district has Albert Rains as their representative?
CREATE TABLE table_1342149_3 (district VARCHAR,incumbent VARCHAR)
SELECT district FROM table_1342149_3 WHERE incumbent = "Albert Rains"
how many movies has morrison acted in after 2010 ?
CREATE TABLE table_202_279 (id number,"year" number,"title" text,"role" text,"notes" text)
SELECT COUNT("title") FROM table_202_279 WHERE "year" > 2010
What is the lowest Draft, when Nationality is 'Canada', when Player is 'Shane Doan Category:Articles with hCards', and when Round is less than 1?
CREATE TABLE table_12484 ("Draft" real,"Round" real,"Pick" real,"Player" text,"Nationality" text)
SELECT MIN("Draft") FROM table_12484 WHERE "Nationality" = 'canada' AND "Player" = 'shane doan category:articles with hcards' AND "Round" < '1'
Name the team classification for stage of 6
CREATE TABLE table_name_47 (team_classification VARCHAR,stage VARCHAR)
SELECT team_classification FROM table_name_47 WHERE stage = "6"
WHAT POINTS 1 HAD A 22 LOST?
CREATE TABLE table_name_88 (points_1 VARCHAR,lost VARCHAR)
SELECT points_1 FROM table_name_88 WHERE lost = 22
what is the total number of schools that were demolished ?
CREATE TABLE table_203_40 (id number,"p.s. #" number,"school name" text,"neighborhood" text,"low grade" text,"high grade" number,"year closed" text,"building status" text)
SELECT COUNT("school name") FROM table_203_40 WHERE "building status" = 'demolished'
Can I enroll in 400 -level classes for the Fall or Winter term ?
CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requireme...
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE ((SEM...
List the dates and vote percents of elections.
CREATE TABLE representative (representative_id number,name text,state text,party text,lifespan text)CREATE TABLE election (election_id number,representative_id number,date text,votes number,vote_percent number,seats number,place number)
SELECT date, vote_percent FROM election
What player attended california university?
CREATE TABLE table_26916717_1 (name VARCHAR,team_school VARCHAR)
SELECT name FROM table_26916717_1 WHERE team_school = "California"
how many black/cape verdean patients had mcv lab test?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND lab.label = "MCV"
What are the former counties of the Great Grimsby district?
CREATE TABLE table_2801185_2 (former_county VARCHAR,district VARCHAR)
SELECT former_county FROM table_2801185_2 WHERE district = "Great Grimsby"
which NW flights stop in DENVER before 1200
CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE date_day (month_numb...
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight, flight_stop WHERE city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND flight_stop.arrival_time < 1200 AND flight_stop.stop_airport = airport_service.airport_code AND flight.airline_code = 'NW' AND flight.flight_id = flight_sto...
List all the username and passwords of users with the most popular role.
CREATE TABLE users (user_name VARCHAR,password VARCHAR,role_code VARCHAR)
SELECT user_name, password FROM users GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1
what yea had more proteins 2008 or 1997 ?
CREATE TABLE table_203_589 (id number,"protein" text,"natural host" text,"normal function" text,"prion state" text,"prion phenotype" text,"year identified" number)
SELECT "year identified" FROM table_203_589 WHERE "year identified" IN (2008, 1997) GROUP BY "year identified" ORDER BY COUNT("protein") DESC LIMIT 1
How many male (sex is M) students have class senator votes in the fall election cycle?
CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR)CREATE TABLE STUDENT (StuID VARCHAR,Sex VARCHAR)
SELECT COUNT(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.Sex = "M" AND T2.Election_Cycle = "Fall"
What is the best finish where the scoring rank is 97?
CREATE TABLE table_1253 ("Year" real,"Events played" real,"Cuts made" real,"Wins" real,"2nds" real,"Top 10s" real,"Best finish" text,"Earnings ($)" real,"Rank" text,"Scoring average" text,"Scoring rank" text)
SELECT "Best finish" FROM table_1253 WHERE "Scoring rank" = '97'
Show the number of customer address history in each month and bin date to by month interval with a bar chart, and I want to sort in asc by the y axis.
CREATE TABLE Products (product_id INTEGER,product_type_code VARCHAR(15),product_name VARCHAR(80),product_price DOUBLE)CREATE TABLE Customer_Address_History (customer_id INTEGER,address_id INTEGER,date_from DATETIME,date_to DATETIME)CREATE TABLE Customer_Orders (order_id INTEGER,customer_id INTEGER,order_date DATETIME,o...
SELECT date_to, COUNT(date_to) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id ORDER BY COUNT(date_to)
What country had a paste publication in 2009?
CREATE TABLE table_name_9 (country VARCHAR,year VARCHAR,publication VARCHAR)
SELECT country FROM table_name_9 WHERE year = 2009 AND publication = "paste"
What was the attendance at the game played at Moorabbin Oval?
CREATE TABLE table_name_78 (crowd VARCHAR,venue VARCHAR)
SELECT crowd FROM table_name_78 WHERE venue = "moorabbin oval"
What was the score of the 7:00pm game at Scotiabank Place against the Philadelphia Flyers?
CREATE TABLE table_name_12 (score VARCHAR,opponent VARCHAR,time VARCHAR,location VARCHAR)
SELECT score FROM table_name_12 WHERE time = "7:00pm" AND location = "scotiabank place" AND opponent = "philadelphia flyers"
What is the number of races associated with Team ASM and 0 poles?
CREATE TABLE table_name_19 (races VARCHAR,poles VARCHAR,team VARCHAR)
SELECT races FROM table_name_19 WHERE poles = "0" AND team = "asm"
When martha brae, river is the hydrographic basin what is the rainfall totals (million m 3)?
CREATE TABLE table_26609958_1 (rainfall_totals__million_m_3__ VARCHAR,hydrographic_basin VARCHAR)
SELECT rainfall_totals__million_m_3__ FROM table_26609958_1 WHERE hydrographic_basin = "Martha Brae, River"
List the number of the phone numbers of all employees, I want to show in descending by the y axis.
CREATE TABLE PlaylistTrack (PlaylistId integer,TrackId integer)CREATE TABLE MediaType (MediaTypeId integer,Name varchar(120))CREATE TABLE Album (AlbumId integer,Title varchar(160),ArtistId integer)CREATE TABLE InvoiceLine (InvoiceLineId integer,InvoiceId integer,TrackId integer,UnitPrice decimal(10,2),Quantity integer)...
SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone) DESC
what is age and admission time of subject id 2560?
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 procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT demographic.age, demographic.admittime FROM demographic WHERE demographic.subject_id = "2560"
What championship had Francesca Schiavone in the finals?
CREATE TABLE table_38329 ("Outcome" text,"Date" text,"Championship" text,"Surface" text,"Opponent in the final" text,"Score in the final" text)
SELECT "Championship" FROM table_38329 WHERE "Opponent in the final" = 'francesca schiavone'
What's the Comment field in ReviewTaskResults?.
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 CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwne...
SELECT Comment FROM ReviewTaskResults WHERE NOT Comment IS NULL AND ReviewTaskResultTypeId != 3
Name the current club for player sacha giffa
CREATE TABLE table_17886 ("No" real,"Player" text,"Height" text,"Position" text,"Year born" real,"Current Club" text)
SELECT "Current Club" FROM table_17886 WHERE "Player" = 'Sacha Giffa'
what is diagnoses short title of subject id 21796?
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 FROM diagnoses WHERE diagnoses.subject_id = "21796"
which song stayed at no. 1 for the most amount of weeks .
CREATE TABLE table_203_197 (id number,"#" number,"title" text,"artist" text,"highest pos. reached" number,"weeks at no. 1" text)
SELECT "title" FROM table_203_197 ORDER BY "weeks at no. 1" DESC LIMIT 1
how many games had an attendance of 50,000 or greater fans ?
CREATE TABLE table_203_158 (id number,"date" text,"time" text,"opponent#" text,"rank#" text,"site" text,"tv" text,"result" text,"attendance" number)
SELECT COUNT(*) FROM table_203_158 WHERE "attendance" >= 50000
How many values for percentage of marine area are for the Atlantic marine ecozone with an exclusive economic zone area less than 996,439?
CREATE TABLE table_name_78 (percentage_of_marine_area__foreez_ VARCHAR,ecozone VARCHAR,area__km²__exclusive_economic_zone VARCHAR)
SELECT COUNT(percentage_of_marine_area__foreez_) FROM table_name_78 WHERE ecozone = "atlantic marine" AND area__km²__exclusive_economic_zone < 996 OFFSET 439
What is the mission that has ambassador of local position, and a resident country of democratic republic of congo?
CREATE TABLE table_6674 ("Mission" text,"Resident Country" text,"Local Location" text,"Local Mission" text,"Local Position" text)
SELECT "Mission" FROM table_6674 WHERE "Local Position" = 'ambassador' AND "Resident Country" = 'democratic republic of congo'
Gold badge ranking in India.
CREATE TABLE PostHistoryTypes (Id number,Name text)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,La...
SELECT u.DisplayName, u.Id, REPLACE(CAST(TIME_TO_STR(b.Date, '%d %b %Y') AS TEXT(30)), ' ', '/') FROM Users AS u JOIN Badges AS b ON u.Id = b.UserId WHERE b.Name = 'css' AND b.Class = 1 ORDER BY b.Date DESC
Oldest question without any answer.
CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId...
SELECT * FROM Posts WHERE AnswerCount = 0 ORDER BY CreationDate
Which Oilers points have a Record of 10 6, and Oilers first downs larger than 14?
CREATE TABLE table_name_1 (oilers_points INTEGER,record VARCHAR,oilers_first_downs VARCHAR)
SELECT AVG(oilers_points) FROM table_name_1 WHERE record = "10–6" AND oilers_first_downs > 14
Show the name for regions and the number of storms for each region.
CREATE TABLE region (region_id number,region_code text,region_name text)CREATE TABLE affected_region (region_id number,storm_id number,number_city_affected number)CREATE TABLE storm (storm_id number,name text,dates_active text,max_speed number,damage_millions_usd number,number_deaths number)
SELECT T1.region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id
What are full names and salaries of employees working in the city of London?
CREATE TABLE departments (department_id number,department_name text,manager_id number,location_id number)CREATE TABLE regions (region_id number,region_name text)CREATE TABLE job_history (employee_id number,start_date time,end_date time,job_id text,department_id number)CREATE TABLE employees (employee_id number,first_na...
SELECT first_name, last_name, salary FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T3.city = 'London'
What are the first and last name of the faculty who has the most students?
CREATE TABLE Student (advisor VARCHAR)CREATE TABLE Faculty (fname VARCHAR,lname VARCHAR,FacID VARCHAR)
SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1
How many dates for the week of 4?
CREATE TABLE table_23916462_3 (date VARCHAR,week VARCHAR)
SELECT COUNT(date) FROM table_23916462_3 WHERE week = 4
the first time patient 025-44842 was prescribed alprazolam 0.25 mg po tabs and dextrose 50% at the same time during this month?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio...
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'dextrose 50%' AND patient.uniquepid = '025-44842' AND DATETIME(medication.drugstarttime, 'start of month') = DATETIME(CUR...
Which club has a try bonus of 9 and 43 tries against?
CREATE TABLE table_name_38 (club VARCHAR,tries_against VARCHAR,try_bonus VARCHAR)
SELECT club FROM table_name_38 WHERE tries_against = "43" AND try_bonus = "9"
How many papers were written on question answering in the past year ?
CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE field (fieldid int)CREATE TABLE author (...
SELECT DISTINCT COUNT(paper.paperid) FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'question answering' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016
What is the location of the gold medal match?
CREATE TABLE table_name_30 (location VARCHAR,competition VARCHAR)
SELECT location FROM table_name_30 WHERE competition = "gold medal match"
Name the winner for rest day for 13 july
CREATE TABLE table_name_98 (winner VARCHAR,course VARCHAR,date VARCHAR)
SELECT winner FROM table_name_98 WHERE course = "rest day" AND date = "13 july"
Get users that have in username ' '.
CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans...
SELECT * FROM Users WHERE DisplayName LIKE 'irc'
Name the total number of states for july 1 2010 density is 1209
CREATE TABLE table_21836 ("Rank" real,"County" text,"State" text,"Land area (km\u00b2)" text,"Land area (mi\u00b2)" text,"April 1,2010 census" real,"April 1,2010 density (/km\u00b2)" real,"April 1,2010 density (/mi\u00b2)" real,"July 1,2010 official estimate" real,"July 1,2010 density (/km\u00b2)" real,"July 1,2010 den...
SELECT COUNT("State") FROM table_21836 WHERE "July 1, 2010 density (/mi\u00b2)" = '1209'
Who was the rider with 120.953 mph speed?
CREATE TABLE table_name_79 (rider VARCHAR,speed VARCHAR)
SELECT rider FROM table_name_79 WHERE speed = "120.953 mph"
What is the team for 1976?
CREATE TABLE table_46440 ("Year" text,"Player" text,"Team" text,"League" text,"Position" text)
SELECT "Team" FROM table_46440 WHERE "Year" = '1976'
Return the title and director of the movie released in the year 2000 or earlier that had the highest worldwide gross.
CREATE TABLE movie (movie_id number,title text,year number,director text,budget_million number,gross_worldwide number)CREATE TABLE book_club (book_club_id number,year number,author_or_editor text,book_title text,publisher text,category text,result text)CREATE TABLE culture_company (company_name text,type text,incorpora...
SELECT title, director FROM movie WHERE year <= 2000 ORDER BY gross_worldwide DESC LIMIT 1
What is Runner(s)-Up when Margin of Victory is 6 Strokes?
CREATE TABLE table_name_87 (runner_s__up VARCHAR,margin_of_victory VARCHAR)
SELECT runner_s__up FROM table_name_87 WHERE margin_of_victory = "6 strokes"
Show all flight numbers with aircraft Airbus A340-300.
CREATE TABLE aircraft (aid number,name text,distance number)CREATE TABLE certificate (eid number,aid number)CREATE TABLE flight (flno number,origin text,destination text,distance number,departure_date time,arrival_date time,price number,aid number)CREATE TABLE employee (eid number,name text,salary number)
SELECT T1.flno FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300"
Name the injunctive for garyo 'he did
CREATE TABLE table_16337329_5 (injunctive VARCHAR,past_habitual VARCHAR)
SELECT injunctive FROM table_16337329_5 WHERE past_habitual = "गर्यो garyo 'he did'"
how to draw a line with a bar in the same time in a pareto chart.
CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGui...
SELECT Title FROM Posts WHERE Title LIKE '%Pareto%'
How many documents are created in each day? Bin the document date by year interval and group by document type with a group line chart, and I want to sort Document_Date in asc order.
CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR(15),Budget_Type_Description VARCHAR(255))CREATE TABLE Projects (Project_ID INTEGER,Project_Details VARCHAR(255))CREATE TABLE Documents (Document_ID INTEGER,Document_Type_Code CHAR(15),Project_ID INTEGER,Document_Date DATETIME,Document_Name VARCHAR(255),Document_Descr...
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name ORDER BY Document_Date
Name the player for ol
CREATE TABLE table_20649850_1 (player VARCHAR,position VARCHAR)
SELECT player FROM table_20649850_1 WHERE position = "OL"
What is the lowest year that has hypo-meeting as the tournament, with 8002 as the points?
CREATE TABLE table_name_52 (year INTEGER,tournament VARCHAR,points VARCHAR)
SELECT MIN(year) FROM table_name_52 WHERE tournament = "hypo-meeting" AND points = "8002"
What is the area of the civil parish kilworth and townland monadrishane?
CREATE TABLE table_31492 ("Townland" text,"Area(acres)" real,"Barony" text,"Civil parish" text,"Poor law union" text)
SELECT "Area( acres )" FROM table_31492 WHERE "Civil parish" = 'Kilworth' AND "Townland" = 'Monadrishane'
If the losing bonus was 6, what is the tries for?
CREATE TABLE table_name_76 (tries_for VARCHAR,losing_bonus VARCHAR)
SELECT tries_for FROM table_name_76 WHERE losing_bonus = "6"
Name the opponent for october 2, 1983
CREATE TABLE table_1134 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Game Site" text,"Attendance" real)
SELECT "Opponent" FROM table_1134 WHERE "Date" = 'October 2, 1983'
What is Set 2, when Total is '52:44'?
CREATE TABLE table_61477 ("Date" text,"Score" text,"Set 1" text,"Set 2" text,"Total" text)
SELECT "Set 2" FROM table_61477 WHERE "Total" = '52:44'
Site users overlap with SO. Original inspiration: http://data.stackexchange.com/stackoverflow/query/168043/accountid-comparison
CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,...
SELECT 'Aviation SE User Count', COUNT(*) FROM "stackexchange.aviation".Users AS fu UNION ALL SELECT 'Users of both SO and AviationSE', COUNT(*) FROM "stackexchange.aviation".Users AS fu JOIN Users AS u ON fu.AccountId = u.AccountId
How many of the patients on elective admission were born before 2043?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dob_year < "2043"
when patient 021-190775 received the last laboratory test until 11/2105?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,disch...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-190775')) AND STRFTIME('%y-%m', lab.labresulttime) <= '2105-11' ORDER BY lab.la...
In the final Stage with a Mountains Classification of Christophe Moreau, what is the Team Classification?
CREATE TABLE table_45371 ("Stage" text,"Winner" text,"General Classification" text,"Mountains Classification" text,"Points Classification" text,"Sprints classification" text,"Team Classification" text)
SELECT "Team Classification" FROM table_45371 WHERE "Mountains Classification" = 'christophe moreau' AND "Stage" = 'final'
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the sum of salary bin hire_date by weekday in a bar chart.
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 job_history (EMPLOYEE_ID decimal(6,0)...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
What is the torque of 1.2 petrol?
CREATE TABLE table_36679 ("Name" text,"Capacity" text,"Power" text,"Type" text,"Torque" text)
SELECT "Torque" FROM table_36679 WHERE "Name" = '1.2 petrol'
Get the number of catholic religious background patients who had a total protein lab test.
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "CATHOLIC" AND lab.label = "Protein, Total"
What is the Date of the game with a Record of 5-3?
CREATE TABLE table_63152 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Score" text,"Record" text)
SELECT "Date" FROM table_63152 WHERE "Record" = '5-3'
What is Tom Gillis' score?
CREATE TABLE table_name_33 (score VARCHAR,player VARCHAR)
SELECT score FROM table_name_33 WHERE player = "tom gillis"
What is the club for Sam Magri?
CREATE TABLE table_name_9 (current_club VARCHAR,player VARCHAR)
SELECT current_club FROM table_name_9 WHERE player = "sam magri"
What was the overall score when set 1 was 23 25?
CREATE TABLE table_name_33 (score VARCHAR,set_1 VARCHAR)
SELECT score FROM table_name_33 WHERE set_1 = "23–25"
What gold has a year after 1970, with milan as the place?
CREATE TABLE table_name_65 (gold VARCHAR,year VARCHAR,place VARCHAR)
SELECT gold FROM table_name_65 WHERE year > 1970 AND place = "milan"
Who has ties of 5?
CREATE TABLE table_52812 ("Name" text,"TKM career" text,"Ties" real,"Dou W/L" text,"Sin W/L" text)
SELECT "Name" FROM table_52812 WHERE "Ties" = '5'