instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of employee_id over the job_id , and group by attribute job_id, and could you show in desc by the names?
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
what number is us viewers in season 12?
CREATE TABLE table_26494 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"U.S. viewers (millions)" text)
SELECT "U.S. viewers (millions)" FROM table_26494 WHERE "No. in season" = '12'
What is the type of station that is in the movies group?
CREATE TABLE table_name_18 (type VARCHAR,group VARCHAR)
SELECT type FROM table_name_18 WHERE group = "movies"
What is the most recent year that China won a bronze?
CREATE TABLE table_38120 ("Year" real,"Location" text,"Gold" text,"Silver" text,"Bronze" text)
SELECT MAX("Year") FROM table_38120 WHERE "Bronze" = 'china'
What is the episode # of the episode that aired on April 5, 1998?
CREATE TABLE table_name_23 (episode__number VARCHAR,original_airdate VARCHAR)
SELECT episode__number FROM table_name_23 WHERE original_airdate = "april 5, 1998"
A bar chart for finding the number of the dates of the tests taken with result 'Pass', I want to show by the y-axis in ascending.
CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))CREATE TABLE Courses (course_id INTEGER,author_id INTEGER,subject_id INTEGER,course_name VARCHAR(120),course_description VARCHAR(255))CREATE TABLE Students (student_id INTEGER,date_of_registration DATETIME,date_of_latest_logon DATETIME,login_name VARCH...
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" GROUP BY date_test_taken ORDER BY COUNT(date_test_taken)
Average score for a tag. Returns the average score for a tag. Not sure about the accuracy, but it satisfied my curiosity enough.
CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,...
SELECT CAST(SUM(Score) AS FLOAT) / CAST(COUNT(Score) AS FLOAT) AS AvgScore FROM Posts
What country is player mike sullivan from?
CREATE TABLE table_name_89 (country VARCHAR,player VARCHAR)
SELECT country FROM table_name_89 WHERE player = "mike sullivan"
number of ACL papers by author
CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE field (fieldid int)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE...
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid GROUP BY writes.authorid
For patients born after the year 2060, calculate the maximum duration of stay in the hospital
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 MAX(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2060"
When 8 is the public and the result is safe what is the highest rank?
CREATE TABLE table_23250 ("Rank" real,"Couple" text,"Judges" real,"Public" real,"Total" real,"Vote percentage" text,"Result" text)
SELECT MAX("Rank") FROM table_23250 WHERE "Result" = 'Safe' AND "Public" = '8'
What was the distance in 1997?
CREATE TABLE table_36991 ("Distance" text,"Event" text,"Record" text,"Nationality" text,"Year" real,"Location" text)
SELECT "Distance" FROM table_36991 WHERE "Year" = '1997'
What was the round of 16 result for felipe saucedo?
CREATE TABLE table_29521180_35 (round_of_16 VARCHAR,athlete VARCHAR)
SELECT round_of_16 FROM table_29521180_35 WHERE athlete = "Felipe Saucedo"
What is the 10:00 feature with 1 vs. 100 at 8:30?
CREATE TABLE table_69428 ("7:00" text,"7:30" text,"8:00" text,"8:30" text,"9:00" text,"9:30" text,"10:00" text)
SELECT "10:00" FROM table_69428 WHERE "8:30" = '1 vs. 100'
what's the competition where aggregate is 4 7
CREATE TABLE table_1061075_1 (competition VARCHAR,aggregate VARCHAR)
SELECT competition FROM table_1061075_1 WHERE aggregate = "4–7"
What is the greatest lane with an overall rank of 79 and a time larger than 26.1?
CREATE TABLE table_name_24 (lane INTEGER,overall_rank VARCHAR,time VARCHAR)
SELECT MAX(lane) FROM table_name_24 WHERE overall_rank = "79" AND time > 26.1
Where in Tongyong is Hanyu Sanmin?
CREATE TABLE table_44881 ("Hanyu" text,"Tongyong" text,"Pe\u030dh-\u014de-j\u012b" text,"Chinese" text,"Area (km\u00b2)" real,"No. of villages" real,"Population (2010)" real)
SELECT "Tongyong" FROM table_44881 WHERE "Hanyu" = 'sanmin'
what is the English meaning of the old English name 's turnesd g'?
CREATE TABLE table_2624098_1 (english_day_name_meaning VARCHAR,old_english_day_name VARCHAR)
SELECT english_day_name_meaning FROM table_2624098_1 WHERE old_english_day_name = "Sæturnesdæg"
my answers not tagged <excel> THAT SHOULD BE.
CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body te...
SELECT a.ParentId AS "post_link", q.Tags, a.Score FROM Posts AS q LEFT OUTER JOIN Posts AS a ON q.Id = a.ParentId WHERE a.OwnerUserId = '##UserID##' AND q.Tags LIKE '%excel%' AND NOT q.Tags LIKE '%<excel>%' ORDER BY a.Score DESC
Which Week has an Opponent of san francisco 49ers?
CREATE TABLE table_53479 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT MAX("Week") FROM table_53479 WHERE "Opponent" = 'san francisco 49ers'
What is the college/junior/club team for player don barber?
CREATE TABLE table_3653 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT "College/junior/club team" FROM table_3653 WHERE "Player" = 'Don Barber'
What was the size of the crowd that saw the Home team score 11.10 (76)?
CREATE TABLE table_33256 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT COUNT("Crowd") FROM table_33256 WHERE "Home team score" = '11.10 (76)'
Papers by Frank Keller and Mirella Lapata
CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE author (authorid int,authorname varchar...
SELECT DISTINCT WRITES_0.paperid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Frank Keller' AND AUTHOR_1.authorname = 'Mirella Lapata' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.p...
what was the average sao2 on 01/06/last year for patient 3242.
CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)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 patients (row_id numbe...
SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3242)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2'...
Who was the runner up at the Volvo Masters Andalucia?
CREATE TABLE table_20584 ("No." real,"Date" text,"Tournament" text,"Winning score" text,"To par" text,"Margin of victory" text,"Runner(s)-up" text)
SELECT "Runner(s)-up" FROM table_20584 WHERE "Tournament" = 'Volvo Masters Andalucia'
Which 2008 has an Airport of hurghada international airport?
CREATE TABLE table_name_20 (airport VARCHAR)
SELECT AVG(2008) FROM table_name_20 WHERE airport = "hurghada international airport"
What were the bowling figures for the competition at Pietermaritzburg?
CREATE TABLE table_56380 ("Bowling figures Wickets-Runs (Overs)" text,"Bowler" text,"Versus" text,"Venue" text,"Date" text)
SELECT "Bowling figures Wickets-Runs (Overs)" FROM table_56380 WHERE "Venue" = 'pietermaritzburg'
What is the average total of kenwyne jones, who has more than 10 premier leagues?
CREATE TABLE table_46962 ("Name" text,"Premier League" real,"League Cup" real,"FA Cup" real,"Total" real)
SELECT AVG("Total") FROM table_46962 WHERE "Name" = 'kenwyne jones' AND "Premier League" > '10'
what's the average cost of a hospital that includes a drug called albuterol-ipratropium (duoneb) inhalation solution 3 ml in 2104?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'albuterol-ipratropium (duoneb) inhalation solu...
Display a bar chart for what are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor?, and show in desc by the total number please.
CREATE TABLE entrepreneur (Entrepreneur_ID int,People_ID int,Company text,Money_Requested real,Investor text)CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Date_of_Birth text)
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC
what is the primary disease and diagnosis of the patient id 8440?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT demographic.diagnosis, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "8440"
show me the flights from SAN FRANCISCO to PITTSBURGH on tuesday
CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,...
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 22 AND date_day.month_number = 3 AN...
On what surface was the game played with a score of 6 4, 6 4?
CREATE TABLE table_21892 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text)
SELECT "Surface" FROM table_21892 WHERE "Score" = '6–4, 6–4'
papers before 2010 about character recognition
CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE field (fieldid int)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'character recognition' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year < 2010
Which country has a score of 70-71-72=213?
CREATE TABLE table_51118 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Country" FROM table_51118 WHERE "Score" = '70-71-72=213'
Which Sales Total has a Chart of oricon monthly albums chart?
CREATE TABLE table_name_30 (sales_total VARCHAR,chart VARCHAR)
SELECT sales_total FROM table_name_30 WHERE chart = "oricon monthly albums chart"
What Nationality is the Iowa State team?
CREATE TABLE table_name_69 (nationality VARCHAR,school_club_team VARCHAR)
SELECT nationality FROM table_name_69 WHERE school_club_team = "iowa state"
In which year did he finish 11th?
CREATE TABLE table_name_31 (year VARCHAR,result VARCHAR)
SELECT COUNT(year) FROM table_name_31 WHERE result = "11th"
What' the series number of the episode with season number 13?
CREATE TABLE table_2592 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text)
SELECT MIN("No. in series") FROM table_2592 WHERE "No. in season" = '13'
give me the number of patients whose diagnoses short title is history of tobacco use and lab test category is blood gas?
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 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 tex...
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 = "History of tobacco use" AND lab."CATEGORY" = "Blood Gas"
What's the production time with more than 2.737 built and a 280s model?
CREATE TABLE table_12357 ("Model" text,"Chassis code" text,"Production time" text,"Number built" real,"Engine" text)
SELECT "Production time" FROM table_12357 WHERE "Number built" > '2.737' AND "Model" = '280s'
What is galway county's total?
CREATE TABLE table_name_80 (total INTEGER,county VARCHAR)
SELECT SUM(total) FROM table_name_80 WHERE county = "galway"
Select the names of manufacturer whose products have an average price higher than or equal to $150.
CREATE TABLE Manufacturers (name VARCHAR,code VARCHAR)CREATE TABLE products (Price INTEGER,manufacturer VARCHAR,price INTEGER)
SELECT AVG(T1.price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name HAVING AVG(T1.price) >= 150
what was the difference in score between the barrage and the lizards on june 2 .
CREATE TABLE table_203_853 (id number,"date" text,"opponent" text,"home/away" text,"field" text,"result" text)
SELECT ABS("result" - "result") FROM table_203_853 WHERE "date" = 'june 2'
Find the ids of the nurses who are on call in block floor 1 and block code 1.
CREATE TABLE room (roomnumber number,roomtype text,blockfloor number,blockcode number,unavailable boolean)CREATE TABLE trained_in (physician number,treatment number,certificationdate time,certificationexpires time)CREATE TABLE block (blockfloor number,blockcode number)CREATE TABLE physician (employeeid number,name text...
SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1
when was patient 002-30780 prescribed a drug for the first time on the last hospital encounter?
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 intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,cellla...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-30780' AND NOT patient.hospitaldischargetime IS NULL ORDER...
what is the latest flight on wednesday going from ATLANTA to WASHINGTON
CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,conn...
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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 23 AND date_day.month_number = 4 A...
what's the acronym with department being department of finance kagawaran ng pananalapi
CREATE TABLE table_658 ("Department" text,"Acronym" text,"Office" text,"Incumbent" text,"in Office since" text)
SELECT "Acronym" FROM table_658 WHERE "Department" = 'Department of Finance Kagawaran ng Pananalapi'
Visualize the average experience working length of journalists working on different role type using a pie chart.
CREATE TABLE event (Event_ID int,Date text,Venue text,Name text,Event_Attendance int)CREATE TABLE journalist (journalist_ID int,Name text,Nationality text,Age text,Years_working int)CREATE TABLE news_report (journalist_ID int,Event_ID int,Work_Type text)
SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type
Which Semifinalists has a Finalist of andre agassi?
CREATE TABLE table_name_23 (semifinalists VARCHAR,finalist VARCHAR)
SELECT semifinalists FROM table_name_23 WHERE finalist = "andre agassi"
What is the date of birth and language of Kurt Buczek?
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 demographic.dob, demographic.language FROM demographic WHERE demographic.name = "Kurt Buczek"
Who had a rank more than 48, and a last in 2005?
CREATE TABLE table_name_16 (name VARCHAR,rank VARCHAR,last VARCHAR)
SELECT name FROM table_name_16 WHERE rank > 48 AND last = 2005
Name the high points 31-27
CREATE TABLE table_22669044_9 (high_points VARCHAR,record VARCHAR)
SELECT high_points FROM table_22669044_9 WHERE record = "31-27"
Which Score has a Time of 5:00pm?
CREATE TABLE table_76691 ("Date" text,"Time" text,"Opponent" text,"Score" text,"Site" text,"City" text)
SELECT "Score" FROM table_76691 WHERE "Time" = '5:00pm'
How many distinct characteristic names does the product 'cumin' have?
CREATE TABLE characteristics (characteristic_id number,characteristic_type_code text,characteristic_data_type text,characteristic_name text,other_characteristic_details text)CREATE TABLE product_characteristics (product_id number,characteristic_id number,product_characteristic_value text)CREATE TABLE ref_characteristic...
SELECT COUNT(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame"
what is procedure icd9 code and procedure long title of subject id 813?
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 procedures.icd9_code, procedures.long_title FROM procedures WHERE procedures.subject_id = "813"
Which Bronze has a Rank of 9?
CREATE TABLE table_40751 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Bronze") FROM table_40751 WHERE "Rank" = '9'
In which year was the Tournament of european indoor championships played where the Extra was 800 m and the Result was 2nd?
CREATE TABLE table_name_95 (year VARCHAR,result VARCHAR,extra VARCHAR,tournament VARCHAR)
SELECT year FROM table_name_95 WHERE extra = "800 m" AND tournament = "european indoor championships" AND result = "2nd"
Which driver had a grid of 2?
CREATE TABLE table_name_63 (driver VARCHAR,grid VARCHAR)
SELECT driver FROM table_name_63 WHERE grid = 2
Suggested edits with review time.
CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE Tags (Id number,Tag...
SELECT pt.Name, p.Id AS "post_link", 'site://suggested-edits/' + CAST(se.Id AS TEXT) AS "Suggested edit", ROUND(CAST((JULIANDAY(COALESCE(ApprovalDate, RejectionDate)) - JULIANDAY(se.CreationDate)) * 86400.0 AS INT) / 86400., 2) AS "Review time (days)" FROM SuggestedEdits AS se INNER JOIN Posts AS p ON se.PostId = p.Id ...
Who was the producer for the film directed by 1997?
CREATE TABLE table_40917 ("Title" text,"Director" text,"Producer" text,"Production Cost" text,"Singapore Gross" text)
SELECT "Producer" FROM table_40917 WHERE "Director" = '1997'
provide the number of patients who have angioedema primary disease.
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 WHERE demographic.diagnosis = "ANGIOEDEMA"
What is the rank when the elevation is 1,628, and Col (m) is larger than 0?
CREATE TABLE table_63490 ("Rank" real,"Peak" text,"Country" text,"Island" text,"Elevation (m)" real,"Col (m)" real)
SELECT COUNT("Rank") FROM table_63490 WHERE "Elevation (m)" = '1,628' AND "Col (m)" > '0'
Number of questions by country.
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 COUNT(*) FROM Posts WHERE OwnerUserId IN (SELECT Id FROM Users WHERE NOT Location IS NULL)
Provide the number of patients who had other closed [endoscopic] biopsy of biliary duct or sphincter of oddi and were born before 2060.
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2060" AND procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi"
What is the name of episode 2 for garfield when episode 1 is 'suburban jungle'?
CREATE TABLE table_22409 ("Episode" text,"Garfield Episode 1" text,"U.S. Acres Episode" text,"Garfield Episode 2" text,"Original Airdate" text)
SELECT "Garfield Episode 2" FROM table_22409 WHERE "Garfield Episode 1" = 'Suburban Jungle'
What cargo was contained in a ship size of aframax?
CREATE TABLE table_name_40 (cargo VARCHAR,ship_size VARCHAR)
SELECT cargo FROM table_name_40 WHERE ship_size = "aframax"
Return the name of each physician and the number of patients he or she treats by a pie chart.
CREATE TABLE Patient (SSN INTEGER,Name VARCHAR(30),Address VARCHAR(30),Phone VARCHAR(30),InsuranceID INTEGER,PCP INTEGER)CREATE TABLE Block (BlockFloor INTEGER,BlockCode INTEGER)CREATE TABLE Medication (Code INTEGER,Name VARCHAR(30),Brand VARCHAR(30),Description VARCHAR(30))CREATE TABLE Physician (EmployeeID INTEGER,Na...
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID
Name the team for pick more than 30 and position of c with round more than 4
CREATE TABLE table_54784 ("Round" real,"Pick" real,"Player" text,"Position" text,"Nationality" text,"Team" text,"College" text)
SELECT "Team" FROM table_54784 WHERE "Pick" > '30' AND "Position" = 'c' AND "Round" > '4'
Name the frequency with on-air ID of 1way fm
CREATE TABLE table_name_18 (frequency VARCHAR,on_air_id VARCHAR)
SELECT frequency FROM table_name_18 WHERE on_air_id = "1way fm"
count the number of patients whose admission year is less than 2167 and lab test name is reticulocyte count, automated?
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2167" AND lab.label = "Reticulocyte Count, Automated"
What is the name of the episode that had 2.02 million u.s. viewers?
CREATE TABLE table_30064 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text)
SELECT "Title" FROM table_30064 WHERE "U.S. viewers (million)" = '2.02'
How many times has the points total for the afc cup competion been 289?
CREATE TABLE table_1065 ("Pos" real,"Member Association" text,"Points (total 500)" real,"Clubs" real,"Group stage" real,"Play-off" real,"AFC Cup" real)
SELECT COUNT("AFC Cup") FROM table_1065 WHERE "Points (total 500)" = '289'
List the names of all the distinct customers who bought a keyboard.
CREATE TABLE order_items (order_id VARCHAR,product_id VARCHAR)CREATE TABLE customers (customer_name VARCHAR,customer_id VARCHAR)CREATE TABLE customer_orders (customer_id VARCHAR,order_id VARCHAR)CREATE TABLE products (product_id VARCHAR,product_name VARCHAR)
SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id JOIN products AS T4 ON T3.product_id = T4.product_id WHERE T4.product_name = "keyboard"
What was the score when the opposition was West Coast in Wanganui?
CREATE TABLE table_29090 ("Round #" text,"Home Team" text,"Win/Loss" text,"Score" text,"Opposition" text,"Location" text)
SELECT "Score" FROM table_29090 WHERE "Opposition" = 'West Coast' AND "Location" = 'Wanganui'
When was the game that had 58,025 people in attendance?
CREATE TABLE table_name_26 (date VARCHAR,attendance VARCHAR)
SELECT date FROM table_name_26 WHERE attendance = "58,025"
All questions with exactly two specified tags and no accepted answer.
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAu...
SELECT Id AS "post_link", CreationDate, Score, Tags FROM Posts WHERE Tags IN ('<' + '##tag1:string##' + '><' + '##tag2:string##' + '>', '<' + '##tag2:string##' + '><' + '##tag1:string##' + '>') AND AcceptedAnswerId IS NULL ORDER BY CreationDate DESC
What is the Position of the Level 3 winner from Saint Kitts and Nevis?
CREATE TABLE table_5328 ("Season" text,"Level" real,"Position" text,"Nationality" text,"Apps" real,"Goals" real)
SELECT "Position" FROM table_5328 WHERE "Level" = '3' AND "Nationality" = 'saint kitts and nevis'
Which country has a Col (m) of 1374?
CREATE TABLE table_66240 ("Peak" text,"Country" text,"Elevation (m)" real,"Prominence (m)" real,"Col (m)" real)
SELECT "Country" FROM table_66240 WHERE "Col (m)" = '1374'
How much Total has a Silver smaller than 0?
CREATE TABLE table_name_38 (total VARCHAR,silver INTEGER)
SELECT COUNT(total) FROM table_name_38 WHERE silver < 0
What date has 11 as the tie no.?
CREATE TABLE table_name_48 (date VARCHAR,tie_no VARCHAR)
SELECT date FROM table_name_48 WHERE tie_no = "11"
I want the attendance which has a result of l 49 21
CREATE TABLE table_name_12 (attendance VARCHAR,result VARCHAR)
SELECT attendance FROM table_name_12 WHERE result = "l 49–21"
How in prothrombin affected by glanzmann's thrombasthenia.
CREATE TABLE table_1226250_1 (prothrombin_time VARCHAR,condition VARCHAR)
SELECT prothrombin_time FROM table_1226250_1 WHERE condition = "Glanzmann's thrombasthenia"
calculate the minimum age of male patients who were of black/african american ethnic background.
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 lab (subject_id text,hadm_id text,itemid text,charttime te...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "BLACK/AFRICAN AMERICAN"
What are all the different first names of the drivers who are in position as standing and won?
CREATE TABLE laptimes (raceid number,driverid number,lap number,position number,time text,milliseconds number)CREATE TABLE constructorstandings (constructorstandingsid number,raceid number,constructorid number,points number,position number,positiontext text,wins number)CREATE TABLE pitstops (raceid number,driverid numb...
SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1
How many different locations does each school have?
CREATE TABLE employee (emp_num number,emp_lname text,emp_fname text,emp_initial text,emp_jobcode text,emp_hiredate time,emp_dob time)CREATE TABLE class (class_code text,crs_code text,class_section text,class_time text,class_room text,prof_num number)CREATE TABLE department (dept_code text,dept_name text,school_code tex...
SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code
What is URA Index scale?
CREATE TABLE table_53616 ("Subframe #" real,"Page #" text,"Name" text,"Word #" real,"Bits" text,"Scale" text,"Signed" text)
SELECT "Scale" FROM table_53616 WHERE "Name" = 'ura index'
Which department has a small of 11370?
CREATE TABLE table_24219 ("Department" text,"Micro (10ha)" real,"Small (100ha)" real,"Medium (500ha)" real,"Big (>500ha)" real,"Total" real)
SELECT "Department" FROM table_24219 WHERE "Small (100ha)" = '11370'
how many patients whose diagnoses long title is chronic obstructive asthma, unspecified and lab test category is hematology?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Chronic obstructive asthma, unspecified" AND lab."CATEGORY" = "Hematology"
A line chart for what are the number of the years of film market estimation for the market of Japan, ordered by year descending?
CREATE TABLE film_market_estimation (Estimation_ID int,Low_Estimate real,High_Estimate real,Film_ID int,Type text,Market_ID int,Year int)CREATE TABLE film (Film_ID int,Title text,Studio text,Director text,Gross_in_dollar int)CREATE TABLE market (Market_ID int,Country text,Number_cities int)
SELECT Year, COUNT(Year) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = "Japan" ORDER BY T1.Year DESC
What GERB has an 11% Attack?
CREATE TABLE table_6491 ("Source" text,"Date" text,"GERB" text,"Attack" text,"Blue Coalition" text)
SELECT "GERB" FROM table_6491 WHERE "Attack" = '11%'
Calculate the average duration of hospital stay of the patients who had COPD exacerbation as their primary disease
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 AVG(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "COPD EXACERBATION"
Name the minumim first elected for alvin bush
CREATE TABLE table_18491 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT MIN("First elected") FROM table_18491 WHERE "Incumbent" = 'Alvin Bush'
Most Number of Famous Questions.
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 'https://stackoverflow.com/questions/' + CAST(questions.Id AS TEXT), questions.Score, questions.ViewCount FROM Posts AS questions JOIN Posts AS answers ON answers.ParentId = questions.Id JOIN Users AS u ON u.Id = answers.OwnerUserId WHERE u.Id = 575376 AND questions.PostTypeId = 1 AND (questions.ViewCount > 3000...
What is the smallest frequency (kHz) that is in the location of Longview?
CREATE TABLE table_name_61 (frequency__khz_ INTEGER,licensed_location VARCHAR)
SELECT MIN(frequency__khz_) FROM table_name_61 WHERE licensed_location = "longview"
Tell me the lowest avg for 6 yards and rec more than 1
CREATE TABLE table_name_16 (avg INTEGER,yards VARCHAR,rec VARCHAR)
SELECT MIN(avg) FROM table_name_16 WHERE yards = 6 AND rec > 1
What is the stadium where the attendance was 75,406?
CREATE TABLE table_19945 ("#" real,"Season" real,"Bowl game" text,"Result" text,"Opponent" text,"Stadium" text,"Location" text,"Attendance" text)
SELECT "Stadium" FROM table_19945 WHERE "Attendance" = '75,406'
count the numbers of patients who were prescribed latanoprost 0.005% ophth. soln. within 2 months after having been diagnosed with swelling of limb since 2103.
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,discht...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'swelling of limb')...
What was the winning time in the year when the odds of the winner were 2.94?
CREATE TABLE table_24544 ("Year" real,"Horse" text,"Driver" text,"Trainer" text,"Country of owner" text,"Odds of winner" text,"Winning time (km rate)" text)
SELECT "Winning time (km rate)" FROM table_24544 WHERE "Odds of winner" = '2.94'
what is the identifier when the power is 22500 watts?
CREATE TABLE table_name_17 (identifier VARCHAR,power VARCHAR)
SELECT identifier FROM table_name_17 WHERE power = "22500 watts"