instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Creation date for a Tag.
CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescript...
WITH oldestPost AS (SELECT t.Id, MIN(q.CreationDate) AS "oldest_post" FROM Tags AS t LEFT JOIN PostTags AS pt ON t.Id = pt.TagId INNER JOIN Posts AS q ON q.Id = pt.PostId WHERE t.TagName = '##TargTagName:string##' GROUP BY t.Id), foo AS (SELECT 1 AS bar) SELECT * FROM oldestPost AS op, foo
When was the Monza circuit?
CREATE TABLE table_31632 ("Name" text,"Circuit" text,"Date" text,"Winning drivers" text,"Winning constructor" text,"Report" text)
SELECT "Date" FROM table_31632 WHERE "Circuit" = 'monza'
which UA flights go through DENVER
CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,sta...
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.stop_airport = airport_service.airport_code AND flight.airline_code = 'UA' AND flight.flight_id = flight_stop.flight_id
Show me about the correlation between Team_ID and All_Games_Percent , and group by attribute All_Neutral in a scatter chart.
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 Team_ID, All_Games_Percent FROM basketball_match GROUP BY All_Neutral
count the number of patients who have been given the procedure for a systemic antibiotics - penicillins two or more times since 2102.
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab (microlabid number,patientuni...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'systemic antibiotics - penicillins' AND STRFTIME('%y', treatment.treatmenttime) >= '2102') GROUP BY patien...
Name the singer for bruce forsyth
CREATE TABLE table_29135051_2 (singer_s_ VARCHAR,guest_s_ VARCHAR)
SELECT singer_s_ FROM table_29135051_2 WHERE guest_s_ = "Bruce Forsyth"
give me the flights from BALTIMORE to PITTSBURGH
CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE ...
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITT...
What was the margin of victory when runner-up was K. J. Choi?
CREATE TABLE table_3132 ("No." real,"Date" text,"Tournament" text,"Winning score" text,"To par" text,"Margin of victory" text,"Runner(s)-up" text)
SELECT "Margin of victory" FROM table_3132 WHERE "Runner(s)-up" = 'K. J. Choi'
What is the nationality of the player on the Jazz from 1974-79?
CREATE TABLE table_name_73 (nationality VARCHAR,years_for_jazz VARCHAR)
SELECT nationality FROM table_name_73 WHERE years_for_jazz = "1974-79"
until 3 years ago, what was the daily average weight of patient 10539?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icus...
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 = 10539)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admi...
What was the final of the New England Patriots game?
CREATE TABLE table_33562 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Kickoff" text,"Attendance" text)
SELECT "Result" FROM table_33562 WHERE "Opponent" = 'new england patriots'
Users with the most rep-gaining answer acceptances.
CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,Deletion...
SELECT u.Id AS "user_link", u.Reputation, (SELECT COUNT(*) FROM Posts AS q WHERE q.OwnerUserId = u.Id AND q.PostTypeId = 1) AS "All Questions", (SELECT COUNT(*) FROM Votes AS v INNER JOIN Posts AS a ON a.Id = v.PostId INNER JOIN Posts AS q ON q.Id = a.ParentId WHERE q.OwnerUserId = u.Id AND v.VoteTypeId = 1 AND q.Owner...
What is the result for the event that lasted 2:20?
CREATE TABLE table_66331 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Res." FROM table_66331 WHERE "Time" = '2:20'
count the number of patients whose procedure icd9 code is 41?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "41"
How many places featured the DXCL Callsign?
CREATE TABLE table_527 ("Branding" text,"Callsign" text,"Frequency" text,"Power (kW)" text,"Location" text)
SELECT COUNT("Location") FROM table_527 WHERE "Callsign" = 'DXCL'
how many patients are diagnosed with icd9 code v1582 and suggested the main drug type?
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 procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "V1582" AND prescriptions.drug_type = "MAIN"
evidence of active, clinically significant and unstable gastrointestinal, renal, hepatic, endocrine or cardiovascular system disease.
CREATE TABLE table_train_131 ("id" int,"thyroid_disease" bool,"pulmonary_disease" bool,"right_bundle_branch_block" bool,"allergy_to_piperidine_derivatives" bool,"obstructive_pulmonary_disease" bool,"inflammatory_bowel_disease" bool,"renal_disease" bool,"hepatic_disease" bool,"cardiovascular_disease" bool,"duodenal_ulce...
SELECT * FROM table_train_131 WHERE gastrointestinal_disease = 1 OR renal_disease = 1 OR hepatic_disease = 1 OR endocrine_disease = 1 OR cardiovascular_disease = 1
What's the lowest Col ranked less than 6 with an Island of Moloka i?
CREATE TABLE table_name_96 (col__m_ INTEGER,island VARCHAR,rank VARCHAR)
SELECT MIN(col__m_) FROM table_name_96 WHERE island = "island of molokaʻi" AND rank < 6
What was the date of the game for the Wrexham away team?
CREATE TABLE table_name_17 (date VARCHAR,away_team VARCHAR)
SELECT date FROM table_name_17 WHERE away_team = "wrexham"
What is the title of the episode with the original air date of 28 September 1969?
CREATE TABLE table_1439096_1 (title VARCHAR,original_air_date__atv_ VARCHAR)
SELECT title FROM table_1439096_1 WHERE original_air_date__atv_ = "28 September 1969"
did they win or lose to iowa ?
CREATE TABLE table_204_180 (id number,"date" text,"opponent#" text,"rank#" text,"site" text,"result" text,"attendance" number)
SELECT "result" FROM table_204_180 WHERE "opponent#" = 'iowa'
what is admission location and diagnoses short title of subject id 3623?
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 diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
SELECT demographic.admission_location, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "3623"
give me the number of english speaking patients who had alkaline phosphatase lab test.
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.language = "ENGL" AND lab.label = "Alkaline Phosphatase"
What is the week 12 opponent for the year that had a week 3 opponent of South Florida (3-0)?
CREATE TABLE table_38965 ("Week 2 Sept 7" text,"Week 3 Sept 14" text,"Week 4 Sept 21" text,"Week 5 Sept 28" text,"Week 6 Oct 5" text,"Week 7 Oct 12" text,"Week 10 Nov 2" text,"Week 12 Nov 16" text,"Week 14 Nov 30" text,"Week 15 Dec 7" text,"Week 16 (Final) Jan 9" text)
SELECT "Week 12 Nov 16" FROM table_38965 WHERE "Week 3 Sept 14" = 'south florida (3-0)'
Find the name of the instructors who taught C Programming course before.
CREATE TABLE student (id text,name text,dept_name text,tot_cred number)CREATE TABLE teaches (id text,course_id text,sec_id text,semester text,year number)CREATE TABLE classroom (building text,room_number text,capacity number)CREATE TABLE instructor (id text,name text,dept_name text,salary number)CREATE TABLE course (co...
SELECT T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.id = T2.id JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.title = 'C Programming'
How many dominant religions are in ala?
CREATE TABLE table_73818 ("Settlement" text,"Cyrillic Name Other Names" text,"Type" text,"Population (2011)" real,"Largest ethnic group (2002)" text,"Dominant religion (2002)" text)
SELECT COUNT("Dominant religion (2002)") FROM table_73818 WHERE "Settlement" = 'Đala'
Name the number of former wnba team for 2
CREATE TABLE table_1655 ("Pick" real,"Player" text,"Nationality" text,"New WNBA Team" text,"Former WNBA Team" text,"College/Country/Team" text)
SELECT COUNT("Former WNBA Team") FROM table_1655 WHERE "Pick" = '2'
in BOS is there ground transportation between airport and downtown
CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE month (month_number int,month_name text)CREATE TABLE airline (airline_code varchar,airline_name text,no...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'BOSTON' AND ground_service.airpor...
What is the shooting preference of Matthew Myers, acquired in 2010?
CREATE TABLE table_name_99 (shoots VARCHAR,acquired VARCHAR,player VARCHAR)
SELECT shoots FROM table_name_99 WHERE acquired = 2010 AND player = "matthew myers"
Revival badge progress for user for specific tag.
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 a.Id AS "post_link", a.Score, a.CreationDate FROM Posts AS a WHERE a.PostTypeId = 2 AND EXISTS(SELECT * FROM Posts AS q WHERE q.Id = a.ParentId AND q.PostTypeId = 1 AND a.CreationDate > q.CreationDate + 30 AND Tags LIKE '%<' + LOWER(@tag) + '>%') ORDER BY a.Score DESC LIMIT 1000
what airlines fly from TORONTO to SAN DIEGO
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 fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,seaso...
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n...
Buscar Usuarios por Pa s y Reputaci n.
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE Review...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%##NombrePais##%') ORDER BY Reputation DESC
What is the total number of times points were listed when the distance was 41.05 metres?
CREATE TABLE table_26454128_9 (points VARCHAR,distance__metres_ VARCHAR)
SELECT COUNT(points) FROM table_26454128_9 WHERE distance__metres_ = "41.05"
Which Country has a 2009 larger than 527,180, and a Worldwide ranking of 666?
CREATE TABLE table_13246 ("Country" text,"Airport" text,"City" text,"2009" real,"Change (09/08)" text,"Worldwide ranking" text)
SELECT "Country" FROM table_13246 WHERE "2009" > '527,180' AND "Worldwide ranking" = '666'
when is the last time patient 85700 has been prescribed medicine this month?
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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 diagnoses_icd (row_id n...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85700) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY prescriptions.startdate DESC LIMIT 1
tell me the minimum age of patients with death status as 0 and discharge location as disc-tran cancer chldrn h.
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H"
Please use a bar chart to show the total amount of payment by each payment method code.
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 Claims (Claim_ID INTEGER,Policy_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settled DATE,Amount_Claimed INTEGER,Amount_Settle...
SELECT Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code
Which Away Team has a Tie no of replay and a Home Team of Chesterfield?
CREATE TABLE table_name_55 (away_team VARCHAR,tie_no VARCHAR,home_team VARCHAR)
SELECT away_team FROM table_name_55 WHERE tie_no = "replay" AND home_team = "chesterfield"
Show the number of male and female assistant professors with a bar chart, list y axis in ascending order.
CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),Rank VARCHAR(15),Sex VARCHAR(1),Phone INTEGER,Room VARCHAR(5),Building VARCHAR(13))CREATE TABLE Faculty_Participates_in (FacID INTEGER,actid INTEGER)CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),...
SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex ORDER BY COUNT(*)
What is the largest pick# for Greg Harris?
CREATE TABLE table_75178 ("Pick #" real,"Round" text,"Player" text,"Position" text,"College" text)
SELECT MAX("Pick #") FROM table_75178 WHERE "Player" = 'greg harris'
what is the earliest BREAKFAST flight from PHILADELPHIA to FORT WORTH
CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,c...
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, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'FORT WORTH' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND foo...
How many bronze medals has a total less than 3 with a silver less than 1 and gold more than 1?
CREATE TABLE table_name_66 (bronze INTEGER,gold VARCHAR,total VARCHAR,silver VARCHAR)
SELECT AVG(bronze) FROM table_name_66 WHERE total < 3 AND silver < 1 AND gold > 1
How many customers use each payment method, and display by the y axis in descending.
CREATE TABLE Customers (customer_id INTEGER,payment_method_code VARCHAR(10),customer_code VARCHAR(20),customer_name VARCHAR(80),customer_address VARCHAR(255),customer_phone VARCHAR(80),customer_email VARCHAR(80))CREATE TABLE Product_Suppliers (product_id INTEGER,supplier_id INTEGER,date_supplied_from DATETIME,date_supp...
SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code ORDER BY COUNT(*) DESC
Name the Result on october 15, 1995?
CREATE TABLE table_40641 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT "Result" FROM table_40641 WHERE "Date" = 'october 15, 1995'
Who was the game played against on 2004-02-28 at Skytteholms IP?
CREATE TABLE table_name_84 (opponents VARCHAR,venue VARCHAR,date VARCHAR)
SELECT opponents FROM table_name_84 WHERE venue = "skytteholms ip" AND date = "2004-02-28"
On what day was the order with invoice number 10 placed?
CREATE TABLE order_items (order_item_id number,product_id number,order_id number,order_item_status text,order_item_details text)CREATE TABLE shipments (shipment_id number,order_id number,invoice_number number,shipment_tracking_number text,shipment_date time,other_shipment_details text)CREATE TABLE orders (order_id numb...
SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10
I want the average Laps for grid of 9
CREATE TABLE table_name_74 (laps INTEGER,grid VARCHAR)
SELECT AVG(laps) FROM table_name_74 WHERE grid = 9
among patients who received other skin & subq i & d since 2105, what are the top four most common procedures that followed afterwards in the same month?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi...
Where is the University of North Carolina at Greensboro located?
CREATE TABLE table_27726 ("Institution" text,"Location" text,"Nickname" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" real,"Left" real,"Current Conference" text)
SELECT "Location" FROM table_27726 WHERE "Institution" = 'University of North Carolina at Greensboro'
how many games were attended by at least 60,000 people ?
CREATE TABLE table_204_443 (id number,"week" number,"date" text,"opponent" text,"result" text,"game site" text,"attendance" number,"bye" text)
SELECT COUNT(*) FROM table_204_443 WHERE "attendance" >= 60000
What is ids of the songs whose resolution is higher than the average resolution of songs in modern genre?
CREATE TABLE song (f_id VARCHAR,resolution INTEGER,genre_is VARCHAR)
SELECT f_id FROM song WHERE resolution > (SELECT AVG(resolution) FROM song WHERE genre_is = "modern")
Which Total population (2005 estimate) has a Total population (2010 census) of 3,626,119?
CREATE TABLE table_9331 ("Province" text,"Area (km 2)" real,"Total population (2000 census)" text,"Total population (2005 estimate)" real,"Total population (2010 census)" real)
SELECT AVG("Total population (2005 estimate)") FROM table_9331 WHERE "Total population (2010 census)" = '3,626,119'
In Pakistan, what was the total freshwater withdrawal (km 3 /yr) where the agricultural use (m 3 /p/yr)(in %) was 1029(96%)?
CREATE TABLE table_20406 ("Country" text,"Total Freshwater Withdrawal (km 3 /yr)" text,"Per Capita Withdrawal (m 3 /p/yr)" real,"Domestic Use (m 3 /p/yr)(in %)" text,"Industrial Use (m 3 /p/yr)(in %)" text,"Agricultural Use (m 3 /p/yr)(in %)" text)
SELECT "Total Freshwater Withdrawal (km 3 /yr)" FROM table_20406 WHERE "Agricultural Use (m 3 /p/yr)(in %)" = '1029(96%)'
what college has the top enrollment ?
CREATE TABLE table_203_610 (id number,"institution" text,"location" text,"nickname" text,"founded" number,"historical affiliation" text,"enrollment" number,"primary conference" text)
SELECT "institution" FROM table_203_610 ORDER BY "enrollment" DESC LIMIT 1
What is the least common media type in all tracks?
CREATE TABLE MEDIATYPE (Name VARCHAR,MediaTypeId VARCHAR)CREATE TABLE TRACK (MediaTypeId VARCHAR)
SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) LIMIT 1
What is the score of the home game for the Cavaliers where Lebron James (46) was the lead scorer?
CREATE TABLE table_name_60 (score VARCHAR,home VARCHAR,leading_scorer VARCHAR)
SELECT score FROM table_name_60 WHERE home = "cavaliers" AND leading_scorer = "lebron james (46)"
What is the most wins for a position with more than 30 played and a goal difference of 11?
CREATE TABLE table_name_46 (wins INTEGER,goal_difference VARCHAR,played VARCHAR)
SELECT MAX(wins) FROM table_name_46 WHERE goal_difference = 11 AND played > 30
What horse did not start and had a total of over 16.16?
CREATE TABLE table_name_10 (horse VARCHAR,faults VARCHAR,total VARCHAR)
SELECT horse FROM table_name_10 WHERE faults = "did not start" AND total > 16.16
how many patients whose primary disease is sepsis and lab test fluid is urine?
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 demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "SEPSIS" AND lab.fluid = "Urine"
La persona que publique una respuesta con la mayor puntuaci n..
CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDa...
SELECT p.OwnerUserId, p.Id, parent.Title, p.Score FROM Posts AS p JOIN Posts AS parent ON parent.Id = p.ParentId JOIN PostTags AS t ON t.PostId = parent.Id WHERE t.TagId = 175 AND p.PostTypeId = 2 AND p.CreationDate >= '2019-01-01' AND p.CreationDate < '2019-02-01' ORDER BY p.Score DESC
what flights are available from PITTSBURGH to BOSTON on saturday
CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE days (days_code varchar,day_name varchar)CREATE...
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 = 'BOSTON' AND date_day.day_number = 26 AND date_day.month_number = 7 AND da...
What film did ian mackinnon direct that was in the short film 2007 prix uip category?
CREATE TABLE table_name_55 (film VARCHAR,category VARCHAR,director_s_ VARCHAR)
SELECT film FROM table_name_55 WHERE category = "short film 2007 prix uip" AND director_s_ = "ian mackinnon"
Show the number of customers for different customer last name in a bar chart, could you sort x-axis in ascending order?
CREATE TABLE Customers (customer_id INTEGER,customer_first_name VARCHAR(20),customer_last_name VARCHAR(20),customer_address VARCHAR(255),customer_phone VARCHAR(255),customer_email VARCHAR(255),other_customer_details VARCHAR(255))CREATE TABLE Financial_Transactions (transaction_id INTEGER,previous_transaction_id INTEGER...
SELECT customer_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY customer_last_name
Who had the high assists against detroit?
CREATE TABLE table_29769 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High assists" FROM table_29769 WHERE "Team" = 'Detroit'
What's the highest game found when the record is 2-1?
CREATE TABLE table_name_10 (game INTEGER,record VARCHAR)
SELECT MAX(game) FROM table_name_10 WHERE record = "2-1"
What is the lowest Division, when Goals is less than 5, and when Season is '2002-03'?
CREATE TABLE table_name_15 (division INTEGER,goals VARCHAR,season VARCHAR)
SELECT MIN(division) FROM table_name_15 WHERE goals < 5 AND season = "2002-03"
Avg rep for 10 users with most 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 AVG(Reputation) FROM Users WHERE Id IN (SELECT OwnerUserId FROM Posts WHERE PostTypeId = 2 AND OwnerUserId > 0 GROUP BY OwnerUserId ORDER BY COUNT(*) DESC LIMIT 10)
What is the total number of Podiums, when Position is '2nd', when Wins is less than 6, and when Poles is greater than 0?
CREATE TABLE table_44139 ("Season" real,"Wins" real,"Poles" real,"Podiums" real,"Position" text)
SELECT COUNT("Podiums") FROM table_44139 WHERE "Position" = '2nd' AND "Wins" < '6' AND "Poles" > '0'
what is drug name and drug route of drug code nyst500t?
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 prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "NYST500T"
What is the shortest length of a track in Norway that has a maximum grade of 15% and a vertical drop less than 122.22 m?
CREATE TABLE table_name_72 (length__m_ INTEGER,country VARCHAR,maximum_grade___percentage_ VARCHAR,vertical_drop__m_ VARCHAR)
SELECT MIN(length__m_) FROM table_name_72 WHERE maximum_grade___percentage_ = "15" AND vertical_drop__m_ < 122.22 AND country = "norway"
Which competition had a final position/round of 2?
CREATE TABLE table_53596 ("Competition" text,"Current position / round" text,"Final position / round" text,"First match" text,"Last match" text)
SELECT "Competition" FROM table_53596 WHERE "Final position / round" = '2'
What is the tournament on Apr 6?
CREATE TABLE table_name_13 (tournament VARCHAR,date VARCHAR)
SELECT tournament FROM table_name_13 WHERE date = "apr 6"
what is the date of birth and admission time of patient name fernando wontor?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT demographic.dob, demographic.admittime FROM demographic WHERE demographic.name = "Fernando Wontor"
Tell me the highest league goals with total goals less than 1 and FA cups more than 0
CREATE TABLE table_51508 ("Squad No." real,"Name" text,"Position" text,"League Apps" text,"League Goals" real,"FA Cup Apps" text,"FA Cup Goals" real,"League Cup Apps" text,"League Cup Goals" real,"FLT Apps" text,"FLT Goals" real,"Total Apps" text,"Total Goals" real)
SELECT MAX("League Goals") FROM table_51508 WHERE "Total Goals" < '1' AND "FA Cup Goals" > '0'
what 's the lowest round trip fare from DENVER to PITTSBURGH
CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_speed int,range_miles int,pressurized varchar)CREATE TABLE dual_carrier (main_airline ...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare 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_...
What is the sum of Overall, when Pick is greater than 5, when Round is less than 11, and when Name is 'Tom Barrington'?
CREATE TABLE table_77073 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT SUM("Overall") FROM table_77073 WHERE "Pick" > '5' AND "Round" < '11' AND "Name" = 'tom barrington'
Who has coauthored with Luke S Zettlemoyer ?
CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE field (fieldid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE keyphra...
SELECT DISTINCT AUTHOR_1.authorid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Luke S Zettlemoyer' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid
What is Kyunghyun Cho 's latest paper ?
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.paperid FROM author, paper, writes WHERE author.authorname = 'Kyunghyun Cho' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year DESC
What was the surface for Adrian Ungur as an opponent?
CREATE TABLE table_6378 ("Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Surface" FROM table_6378 WHERE "Opponent" = 'adrian ungur'
What is the score of the floor when the position is less than 21, and less than 81.2 total, and the pommel horse score is 13.925?
CREATE TABLE table_name_1 (floor VARCHAR,pommel_horse VARCHAR,position VARCHAR,total VARCHAR)
SELECT floor FROM table_name_1 WHERE position < 21 AND total < 81.2 AND pommel_horse = "13.925"
Display a pie chart for what are the different classes of races, and how many races correspond to each?
CREATE TABLE track (Track_ID int,Name text,Location text,Seating real,Year_Opened real)CREATE TABLE race (Race_ID int,Name text,Class text,Date text,Track_ID text)
SELECT Class, COUNT(*) FROM race GROUP BY Class
Which Location has a result of L 31-52?
CREATE TABLE table_name_67 (location VARCHAR,result VARCHAR)
SELECT location FROM table_name_67 WHERE result = "l 31-52"
was there a urea nitrogen lab test performed on patient 15945 in 12/2105?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE labevents (row_id number,subject_id number,hadm_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...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'urea nitrogen') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15945) AND STRFTIME('%y-%m', labevents.charttime) = '2105-12'
What was the vote % of Heather and Matt?
CREATE TABLE table_3548 ("Rank" real,"Couple" text,"Judges" real,"Public" real,"Total" real,"Vote percentage" text,"Result" text)
SELECT "Vote percentage" FROM table_3548 WHERE "Couple" = 'Heather and Matt'
What was the original air date of the episode titled 'Beaver's Pigeons
CREATE TABLE table_20805 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text)
SELECT "Original air date" FROM table_20805 WHERE "Title" = 'Beaver''s Pigeons'
how many patients whose insurance is government and diagnoses long title is alzheimer's 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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.long_title = "Alzheimer's disease"
what is discharge location and primary disease of subject id 26285?
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 procedures (subject_id text,hadm_id text,icd9_code text,sho...
SELECT demographic.discharge_location, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "26285"
What is the average sales of the journals that have an editor whose work type is 'Photo'?
CREATE TABLE journal_committee (journal_ID VARCHAR,work_type VARCHAR)CREATE TABLE journal (sales INTEGER,journal_ID VARCHAR)
SELECT AVG(T1.sales) FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID WHERE T2.work_type = 'Photo'
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time.
CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
Visualize the name and their component amounts with a bar chart for all furnitures that have more than 10 components, sort from high to low by the total number please.
CREATE TABLE manufacturer (Manufacturer_ID int,Open_Year real,Name text,Num_of_Factories int,Num_of_Shops int)CREATE TABLE furniture (Furniture_ID int,Name text,Num_of_Component int,Market_Rate real)CREATE TABLE furniture_manufacte (Manufacturer_ID int,Furniture_ID int,Price_in_Dollar real)
SELECT Name, Num_of_Component FROM furniture WHERE Num_of_Component > 10 ORDER BY Num_of_Component DESC
Which Fuel has an Output of ps (kw; hp) @6000 rpm?
CREATE TABLE table_name_50 (fuel VARCHAR,output VARCHAR)
SELECT fuel FROM table_name_50 WHERE output = "ps (kw; hp) @6000 rpm"
Name the average 2008 for beijing and 2005 more than 2
CREATE TABLE table_name_21 (year VARCHAR)
SELECT AVG(2008) FROM table_name_21 WHERE year = "beijing" AND 2005 > 2
What was the time for the match with away team Mutual Team B?
CREATE TABLE table_name_28 (time VARCHAR,away_team VARCHAR)
SELECT time FROM table_name_28 WHERE away_team = "mutual team b"
Who was their opponent in game 4?
CREATE TABLE table_79595 ("Game" text,"Date" text,"Opponent" text,"Score" text,"Location Attendance" text,"Record" text)
SELECT "Opponent" FROM table_79595 WHERE "Game" = '4'
Find All_Road and School_ID , and visualize them by a bar chart.
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_Road, School_ID FROM basketball_match
What school placed 4th when Oklahoma State University (black) took 3rd place?
CREATE TABLE table_16883 ("Year" real,"Location" text,"1st Place" text,"2nd Place" text,"3rd Place" text,"4th Place" text,"5th Place" text)
SELECT "4th Place" FROM table_16883 WHERE "3rd Place" = 'Oklahoma State University (Black)'
What is the note section for the role with a language of hindi and a title of miley naa miley hum?
CREATE TABLE table_name_30 (notes VARCHAR,language VARCHAR,title VARCHAR)
SELECT notes FROM table_name_30 WHERE language = "hindi" AND title = "miley naa miley hum"
How many districts had crib damage of 1,164.50?
CREATE TABLE table_20403667_2 (district VARCHAR,crop_damaged__in_lakh_inr__ VARCHAR)
SELECT COUNT(district) FROM table_20403667_2 WHERE crop_damaged__in_lakh_inr__ = "1,164.50"
What was the first prize for the FTOPS XIII series with more than 5,291 entrants?
CREATE TABLE table_35462 ("Series" text,"Date" text,"Entrants" real,"Winner" text,"First Prize" text)
SELECT "First Prize" FROM table_35462 WHERE "Entrants" > '5,291' AND "Series" = 'ftops xiii'
For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarter and the average of code , and group by attribute headquarter, sort x-axis from low to high order.
CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter