instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is the nickname of the team whose 2013/2014 enrollment is 436?
CREATE TABLE table_18304058_2 (nickname_s_ VARCHAR,enrollment__2013_14_ VARCHAR)
SELECT nickname_s_ FROM table_18304058_2 WHERE enrollment__2013_14_ = 436
Name the route for 170.8km distance
CREATE TABLE table_name_14 (route VARCHAR,distance VARCHAR)
SELECT route FROM table_name_14 WHERE distance = "170.8km"
during their current hospital encounter, patient 013-33898 has been allergic to any substance?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid numb...
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-33898' AND patient.hospitaldischargetime IS NULL))
Find the names of all procedures which cost more than 1000 but which physician John Wen was not trained in?
CREATE TABLE procedures (name VARCHAR,cost INTEGER)CREATE TABLE physician (employeeid VARCHAR,name VARCHAR)CREATE TABLE trained_in (physician VARCHAR,treatment VARCHAR)
SELECT name FROM procedures WHERE cost > 1000 EXCEPT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = "John Wen"
What's the average bronze with a total number of medals being 1, with more than 0 silvers?
CREATE TABLE table_name_25 (bronze INTEGER,total VARCHAR,silver VARCHAR)
SELECT AVG(bronze) FROM table_name_25 WHERE total = 1 AND silver > 0
When was the historic place listed that's in canyon county?
CREATE TABLE table_44964 ("Name" text,"Built" text,"Listed" text,"Location" text,"County" text)
SELECT "Listed" FROM table_44964 WHERE "County" = 'canyon'
Name the goals for daniel sanchez
CREATE TABLE table_26951 ("Name" text,"Position" text,"Period" text,"Appearances\u00b9" real,"Goals\u00b9" real,"Nationality\u00b2" text)
SELECT "Goals\u00b9" FROM table_26951 WHERE "Name" = 'Daniel Sanchez'
Name the area president when the area name is south america south
CREATE TABLE table_name_44 (area_president__quorum_ VARCHAR,area_name VARCHAR)
SELECT area_president__quorum_ FROM table_name_44 WHERE area_name = "south america south"
provide the admission location of tracy farmer.
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 demographic.admission_location FROM demographic WHERE demographic.name = "Tracy Farmer"
Name the year for les portes tournantes
CREATE TABLE table_17025328_1 (year__ceremony_ VARCHAR,original_title VARCHAR)
SELECT year__ceremony_ FROM table_17025328_1 WHERE original_title = "Les portes tournantes"
Tag names / wikis / excerpts containing certain words.
CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Com...
SELECT t.TagName, 'Tag', '' FROM Tags AS t WHERE t.TagName LIKE '%' + '##query:string##' + '%' COLLATE sql_latin1_general_cp1_ci_ai UNION ALL SELECT t.TagName, 'Excerpt', p.Body FROM Tags AS t INNER JOIN Posts AS p ON p.Id = t.ExcerptPostId WHERE p.Body LIKE '%' + '##query:string##' + '%' COLLATE sql_latin1_general_cp1...
What Republican District had Incumbent First Elected in 2000 then Re-elected?
CREATE TABLE table_name_90 (district VARCHAR,first_elected VARCHAR,party VARCHAR,results VARCHAR)
SELECT district FROM table_name_90 WHERE party = "republican" AND results = "re-elected" AND first_elected = 2000
how many patients stayed in hospital for more than 7 days and were diagnosed with suicidal ideation?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "7" AND diagnoses.long_title = "Suicidal ideation"
WHich Home is on 14 december 2002?
CREATE TABLE table_name_18 (home VARCHAR,date VARCHAR)
SELECT home FROM table_name_18 WHERE date = "14 december 2002"
Where was the Rally HQ for Round 1?
CREATE TABLE table_name_9 (rally_hq VARCHAR,round VARCHAR)
SELECT rally_hq FROM table_name_9 WHERE round = 1
i need information on a flight from BOSTON to DENVER
CREATE TABLE code_description (code varchar,description text)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)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 te...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER'...
count the number of patients whose diagnoses short title is status-post ptca and drug route is dialys?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Status-post ptca" AND prescriptions.route = "DIALYS"
Show the correlation between statement id and account detail in a scatter chart.
CREATE TABLE Documents_with_Expenses (Document_ID INTEGER,Budget_Type_Code CHAR(15),Document_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_Description VARCHAR(255),Other_Details VARCHAR(255))CREA...
SELECT T1.Statement_ID, T1.Account_Details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID
What are the movies related to nuclear weapons
CREATE TABLE classification (id int,msid int,gid int)CREATE TABLE keyword (id int,keyword text)CREATE TABLE genre (gid int,genre text)CREATE TABLE tags (id int,msid int,kid int)CREATE TABLE actor (aid int,gender text,name text,nationality text,birth_city text,birth_year int)CREATE TABLE tv_series (sid int,title text,re...
SELECT movie.title FROM keyword, movie, tags WHERE keyword.keyword = 'nuclear weapons' AND tags.kid = keyword.id AND tags.msid = movie.mid
Which Visitor has a Record of 9 12 5?
CREATE TABLE table_name_71 (visitor VARCHAR,record VARCHAR)
SELECT visitor FROM table_name_71 WHERE record = "9–12–5"
What is the original title of season number 3?
CREATE TABLE table_1481865_1 (title__original_ VARCHAR,number_of_season VARCHAR)
SELECT title__original_ FROM table_1481865_1 WHERE number_of_season = 3
What is the title of Buena Vista Pictures?
CREATE TABLE table_name_4 (title VARCHAR,studio VARCHAR)
SELECT title FROM table_name_4 WHERE studio = "buena vista pictures"
Specify the maximum age of patients who were admitted to the hospital in or after the year 2187 and stayed for 34 days
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 MAX(demographic.age) FROM demographic WHERE demographic.days_stay = "34" AND demographic.admityear >= "2187"
What is the To Par score for the player from France?
CREATE TABLE table_name_99 (to_par VARCHAR,country VARCHAR)
SELECT to_par FROM table_name_99 WHERE country = "france"
how many patients whose death status is 0 and procedure short title is aortocor bypas-2 cor art?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Aortocor bypas-2 cor art"
Which Winner has a Last 16 of 400?
CREATE TABLE table_name_4 (winner VARCHAR,last_16 VARCHAR)
SELECT winner FROM table_name_4 WHERE last_16 = "£400"
For days had a minimum dew point smaller than any day in zip code 94107, show the total number of such days using a bar chart.
CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_...
SELECT date, COUNT(date) FROM weather WHERE min_dew_point_f < (SELECT MIN(min_dew_point_f) FROM weather WHERE zip_code = 94107) GROUP BY date
Total question views by user reputation.
CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostHistoryTypes...
WITH ViewTotals AS (SELECT u.Reputation, SUM(CAST(p.ViewCount AS INT)) AS ViewCount FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 1 GROUP BY u.Reputation) SELECT v1.Reputation * 100.0 / @MaxReputation, SUM(v2.ViewCount) * 100.0 / @TotalViews FROM ViewTotals AS v1 INNER JOIN ViewTota...
What is the number when against is rajasthan royals?
CREATE TABLE table_25603 ("No." real,"Season" real,"Bowler" text,"Batsmen" text,"For" text,"Against" text,"Ground" text,"Scorecard" text)
SELECT MAX("No.") FROM table_25603 WHERE "Against" = 'Rajasthan Royals'
What is the number of podiums for the races of 13/15?
CREATE TABLE table_33642 ("Season" real,"Series Name" text,"Champion" text,"Races \u2020" text,"Pole Positions" text,"Wins" text,"Podiums" text,"Fastest Laps" text,"Points" text,"Margin (pts)" text)
SELECT "Podiums" FROM table_33642 WHERE "Races \u2020" = '13/15'
Tell me the pole position for graham hill the fastest lap and winning driver of him on 30 may
CREATE TABLE table_name_43 (pole_position VARCHAR,date VARCHAR,fastest_lap VARCHAR,winning_driver VARCHAR)
SELECT pole_position FROM table_name_43 WHERE fastest_lap = "graham hill" AND winning_driver = "graham hill" AND date = "30 may"
What was the value in 2008 when 2012 was 1R, 2010 was A, and 2005 was A?
CREATE TABLE table_71528 ("Tournament" text,"2001" text,"2002" text,"2003" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text)
SELECT "2008" FROM table_71528 WHERE "2012" = '1r' AND "2010" = 'a' AND "2005" = 'a'
Drawn smaller than 24, and a Lost smaller than 17, and a Win % smaller than 31.25 had how many total number of matches?
CREATE TABLE table_name_5 (matches VARCHAR,win__percentage VARCHAR,drawn VARCHAR,lost VARCHAR)
SELECT COUNT(matches) FROM table_name_5 WHERE drawn < 24 AND lost < 17 AND win__percentage < 31.25
What is the constructor when the Q1 order is 4?
CREATE TABLE table_1706942_1 (constructor VARCHAR,q1_order VARCHAR)
SELECT constructor FROM table_1706942_1 WHERE q1_order = 4
give me a good arabic on buchanan in san francisco ?
CREATE TABLE restaurant (id int,name varchar,food_type varchar,city_name varchar,rating "decimal)CREATE TABLE geographic (city_name varchar,county varchar,region varchar)CREATE TABLE location (restaurant_id int,house_number int,street_name varchar,city_name varchar)
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
What is the lowest Laps, when Rider is Sylvain Guintoli, and when Grid is less than 16?
CREATE TABLE table_name_68 (laps INTEGER,rider VARCHAR,grid VARCHAR)
SELECT MIN(laps) FROM table_name_68 WHERE rider = "sylvain guintoli" AND grid < 16
suspected ( cultures drawn and antibiotic given ) or confirmed ( via culture results ) infection
CREATE TABLE table_train_31 ("id" int,"allergy_to_insulin" bool,"active_infection" bool,"periodic_paralysis" bool,"receiving_continuous_intravenous_inotropic_support" bool,"age" float,"NOUSE" float)
SELECT * FROM table_train_31 WHERE active_infection = 1
what is the date when the attendance is more than 45,218, week is higher than 9 and result is w 17-10?
CREATE TABLE table_13491 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT "Date" FROM table_13491 WHERE "Attendance" > '45,218' AND "Week" > '9' AND "Result" = 'w 17-10'
what is the minimum hospital cost that involves the procedure known as stress ulcer prophylaxis - ranitidine since 2 years ago?
CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim...
SELECT MIN(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 treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'stress ulcer prophylaxis - ranitidine')) AND...
provide the number of patients whose admission type is newborn and admission location is trsf within this facility?
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 WHERE demographic.admission_type = "NEWBORN" AND demographic.admission_location = "TRSF WITHIN THIS FACILITY"
What is the lowest Total that has a Gold larger than 0, Silver smaller than 4, Sport of football, and a Bronze larger than 1?
CREATE TABLE table_55761 ("Sport" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MIN("Total") FROM table_55761 WHERE "Gold" > '0' AND "Silver" < '4' AND "Sport" = 'football' AND "Bronze" > '1'
What's the moving of the Esp with a transfer and named De La Red?
CREATE TABLE table_name_53 (moving_from VARCHAR,name VARCHAR,type VARCHAR,nat VARCHAR)
SELECT moving_from FROM table_name_53 WHERE type = "transfer" AND nat = "esp" AND name = "de la red"
what were the four most frequent drugs that were prescribed in the same month to the valve replacement >= 7 days female patient with age 60 or above after having been diagnosed with valve replacement >= 7 days, until 2104?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,ob...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valve replacement >= 7 days' AND STRFTIME('%y', di...
give me the length of stay of patient 28484 during his last stay in the icu.
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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 te...
SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28484) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1
For what country does the golfer play who has a score of 72-65=137?
CREATE TABLE table_60342 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Country" FROM table_60342 WHERE "Score" = '72-65=137'
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 first_name and manager_id , and order by the FIRST_NAME in descending.
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 FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC
What week has an attended smaller than 62,723 on October 22, 1961?
CREATE TABLE table_33120 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT AVG("Week") FROM table_33120 WHERE "Attendance" < '62,723' AND "Date" = 'october 22, 1961'
What is the hometown of the player which has a height of 6-0?
CREATE TABLE table_name_31 (hometown VARCHAR,height VARCHAR)
SELECT hometown FROM table_name_31 WHERE height = "6-0"
What is the score of the match with a 4-0 result?
CREATE TABLE table_name_39 (score VARCHAR,result VARCHAR)
SELECT score FROM table_name_39 WHERE result = "4-0"
What is the total number of losses where the byes were greater than 0?
CREATE TABLE table_name_36 (losses VARCHAR,byes INTEGER)
SELECT COUNT(losses) FROM table_name_36 WHERE byes > 0
What was the Result on Week 3?
CREATE TABLE table_34367 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Game Site" text,"Attendance" real)
SELECT "Result" FROM table_34367 WHERE "Week" = '3'
WHICH Venue IS after 1992 with a Score of 1 0 and a Winners of us chaouia?
CREATE TABLE table_name_93 (venue VARCHAR,winners VARCHAR,year VARCHAR,score VARCHAR)
SELECT venue FROM table_name_93 WHERE year > 1992 AND score = "1 – 0" AND winners = "us chaouia"
What are the artist/groups that released only one CD?
CREATE TABLE torrents (groupname text,totalsnatched number,artist text,groupyear number,releasetype text,groupid number,id number)CREATE TABLE tags (index number,id number,tag text)
SELECT artist FROM torrents GROUP BY artist HAVING COUNT(*) = 1
how many patients are below 41 years of age and tested with joint fluid in lab?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.fluid = "Joint Fluid"
In what position was the driver who won $60,000?
CREATE TABLE table_73745 ("Position" real,"Driver" text,"Points" real,"Winnings" text,"Series" text)
SELECT MIN("Position") FROM table_73745 WHERE "Winnings" = '$60,000'
What try bonus has 18 as the played of and 204 as the points?
CREATE TABLE table_37844 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text)
SELECT "Try bonus" FROM table_37844 WHERE "Played" = '18' AND "Points for" = '204'
when was the first time since 2102 that patient 52598 was discharged from the hospital?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)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 numbe...
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 52598 AND STRFTIME('%y', admissions.dischtime) >= '2102' ORDER BY admissions.dischtime LIMIT 1
Which player was drafted by the Minnesota North Stars?
CREATE TABLE table_2679061_4 (player VARCHAR,nhl_team VARCHAR)
SELECT player FROM table_2679061_4 WHERE nhl_team = "Minnesota North Stars"
What are the different software platforms for devices, and how many devices have each, sort in desc by the total number.
CREATE TABLE shop (Shop_ID int,Shop_Name text,Location text,Open_Date text,Open_Year int)CREATE TABLE device (Device_ID int,Device text,Carrier text,Package_Version text,Applications text,Software_Platform text)CREATE TABLE stock (Shop_ID int,Device_ID int,Quantity int)
SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC
In 1983, what was the RAtt?
CREATE TABLE table_name_85 (ratt VARCHAR,year VARCHAR)
SELECT ratt FROM table_name_85 WHERE year = "1983"
What E score has the T score of 8 and a number smaller than 22.95?
CREATE TABLE table_name_66 (e_score INTEGER,t_score VARCHAR,total VARCHAR)
SELECT MIN(e_score) FROM table_name_66 WHERE t_score = 8 AND total < 22.95
What is the Record for April 13?
CREATE TABLE table_name_14 (record VARCHAR,date VARCHAR)
SELECT record FROM table_name_14 WHERE date = "april 13"
Who was the driver of the vehicle having class of CM22 and navigator of Macneall?
CREATE TABLE table_65052 ("Driver" text,"Navigator" text,"Vehicle" text,"Class" text,"Capacity" real,"Total Time" text,"Margin" text)
SELECT "Driver" FROM table_65052 WHERE "Class" = 'cm22' AND "Navigator" = 'macneall'
How many opponents were there when the record was 6-0?
CREATE TABLE table_24204 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Cowboys points" real,"Opponents" real,"Record" text)
SELECT "Date" FROM table_24204 WHERE "Record" = '6-0'
Who is the Winner, when the City is Berlin?
CREATE TABLE table_15410 ("Date" text,"City" text,"Event" text,"Winner" text,"Prize" text)
SELECT "Winner" FROM table_15410 WHERE "City" = 'berlin'
Show birthdates of the professors in charge of ACCT-211 and bin the date by year interval in a line chart, could you sort X in ascending order please?
CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12),EMP_INITIAL varchar(1),EMP_JOBCODE varchar(5),EMP_HIREDATE datetime,EMP_DOB datetime)CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CODE varchar(8),EMP_NUM int,DEPT_ADDRESS varchar(20),DEPT_EXTENSION varchar(4))C...
SELECT EMP_DOB, COUNT(EMP_DOB) FROM EMPLOYEE AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = "ACCT-211" ORDER BY EMP_DOB
Which Comments has a Length Over All of 4.5m?
CREATE TABLE table_name_56 (comments VARCHAR,length_over_all VARCHAR)
SELECT comments FROM table_name_56 WHERE length_over_all = "4.5m"
Who was the finalist when the MVP was Romain Sato?
CREATE TABLE table_19651669_1 (finalist VARCHAR,mvp VARCHAR)
SELECT finalist FROM table_19651669_1 WHERE mvp = "Romain Sato"
What is the # listed when the score is 70-69-69-70=278?
CREATE TABLE table_74286 ("#" text,"Player" text,"Country" text,"Score" text,"To par" text,"Winnings ($)" real,"After" real,"Before" real)
SELECT "#" FROM table_74286 WHERE "Score" = '70-69-69-70=278'
how many tribunals penanced at least 100 people ?
CREATE TABLE table_203_303 (id number,"tribunal" text,"number of autos da fe" number,"executions in persona" number,"executions in effigie" number,"penanced" number,"total" number)
SELECT COUNT("tribunal") FROM table_203_303 WHERE "penanced" >= 100
i would like to leave thursday morning from INDIANAPOLIS to TORONTO
CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE time_interval (per...
SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 24 AND DATE_DAYalias0.month_number = 5 AND DATE_DAYalias0.year = 1991)) AND to...
Top 100 italian users on StackOverflow.
CREATE TABLE PostTags (PostId number,TagId number)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 t...
SELECT Id AS "user_link", DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Ital%' ORDER BY Reputation DESC LIMIT 100
Manager of art griggs had what lowest year?
CREATE TABLE table_35653 ("Year" real,"League" text,"Class" text,"Record" text,"Finish" text,"Manager" text,"Playoffs" text)
SELECT MIN("Year") FROM table_35653 WHERE "Manager" = 'art griggs'
What is the average PI GP of the player from round 5 with a pick # larger than 151?
CREATE TABLE table_57106 ("Rd #" real,"Pick #" real,"Player" text,"Team (League)" text,"Reg GP" real,"Pl GP" real)
SELECT AVG("Pl GP") FROM table_57106 WHERE "Rd #" = '5' AND "Pick #" > '151'
Which Results have a Category of the best new actor in lead role(female)?
CREATE TABLE table_name_32 (results VARCHAR,category VARCHAR)
SELECT results FROM table_name_32 WHERE category = "best new actor in lead role(female)"
what is admission location and diagnoses icd9 code of subject id 2560?
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 demographic.admission_location, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2560"
Which car won the 1.4litre to 1.8litre award in 2001?
CREATE TABLE table_name_17 (category VARCHAR)
SELECT 2001 FROM table_name_17 WHERE category = "1.4litre to 1.8litre"
Count the number of courses without prerequisites.
CREATE TABLE takes (id text,course_id text,sec_id text,semester text,year number,grade text)CREATE TABLE classroom (building text,room_number text,capacity number)CREATE TABLE teaches (id text,course_id text,sec_id text,semester text,year number)CREATE TABLE time_slot (time_slot_id text,day text,start_hr number,start_m...
SELECT COUNT(*) FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)
What is the Termination of Mission with a Title of Ambassador Extraordinary and Plenipotentiary with a Representative of Reynold E. Carlson?
CREATE TABLE table_15167 ("Representative" text,"Title" text,"Presentation of Credentials" text,"Termination of Mission" text,"Appointed by" text)
SELECT "Termination of Mission" FROM table_15167 WHERE "Title" = 'ambassador extraordinary and plenipotentiary' AND "Representative" = 'reynold e. carlson'
What was the highest amount of runs for more than 5 matches?
CREATE TABLE table_49859 ("Player" text,"Team" text,"Matches" real,"Innings" real,"Runs" real,"Average" real,"Highest Score" text,"100s" real)
SELECT MAX("Runs") FROM table_49859 WHERE "Matches" > '5'
What was the date of the game when St. Louis was the visiting team?
CREATE TABLE table_name_17 (date VARCHAR,visitor VARCHAR)
SELECT date FROM table_name_17 WHERE visitor = "st. louis"
Name the engine when points are 0 and chassis is kuzma indy roadster for 1954
CREATE TABLE table_68670 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT "Engine" FROM table_68670 WHERE "Points" = '0' AND "Chassis" = 'kuzma indy roadster' AND "Year" = '1954'
What is the maximum length in meters for the bridges and what are the architects' names?
CREATE TABLE mill (architect_id number,id number,location text,name text,type text,built_year number,notes text)CREATE TABLE bridge (architect_id number,id number,name text,location text,length_meters number,length_feet number)CREATE TABLE architect (id text,name text,nationality text,gender text)
SELECT MAX(T1.length_meters), T2.name FROM bridge AS T1 JOIN architect AS T2 ON T1.architect_id = T2.id
What was segment C when segment D was fluorescent tubes?
CREATE TABLE table_19890 ("Series Ep." text,"Episode" real,"Netflix" text,"Segment A" text,"Segment B" text,"Segment C" text,"Segment D" text)
SELECT "Segment C" FROM table_19890 WHERE "Segment D" = 'Fluorescent Tubes'
When has a Result of 0 2 and a Opponent of aberdeen?
CREATE TABLE table_6189 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" text)
SELECT "Date" FROM table_6189 WHERE "Result" = '0–2' AND "Opponent" = 'aberdeen'
In what year was ' Kevin Spacey ' born ?
CREATE TABLE producer (pid int,gender text,name text,nationality text,birth_city text,birth_year int)CREATE TABLE director (did int,gender text,name text,nationality text,birth_city text,birth_year int)CREATE TABLE tv_series (sid int,title text,release_year int,num_of_seasons int,num_of_episodes int,title_aka text,budg...
SELECT birth_year FROM writer WHERE name = 'Kevin Spacey'
how many patients whose admission type is emergency and diagnoses long title is unspecified pleural effusion?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Unspecified pleural effusion"
How many races were there when Sigachev had 38 points?
CREATE TABLE table_27671 ("Season" real,"Series" text,"Team Name" text,"Races" real,"Wins" real,"Points" text,"Final Placing" text)
SELECT MIN("Races") FROM table_27671 WHERE "Points" = '38'
count the number of times patient 017-73567 had received an mechanical ventilation until 2104.
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean num...
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-73567')) AND treatment.treatmentname = 'mechanical ventilation' AND STRFTIME...
Find Stack Overflow Users in Vologda (with user links).
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE VoteTypes (Id number,Name...
None
how many patients born before the year 1846 followed the catholic religion?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "CATHOLIC" AND demographic.dob_year < "1846"
What are the names of the chairs of festivals, sorted in ascending order of the year held?
CREATE TABLE festival_detail (Chair_Name VARCHAR,YEAR VARCHAR)
SELECT Chair_Name FROM festival_detail ORDER BY YEAR
What was the attendance for week 2?
CREATE TABLE table_76803 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT "Attendance" FROM table_76803 WHERE "Week" = '2'
For those records from the products and each product's manufacturer, show me about the distribution of name and manufacturer , and group by attribute founder in a bar chart.
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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name
For those records from the products and each product's manufacturer, find name and the sum of manufacturer , and group by attribute name, and visualize them by a bar chart, sort y-axis from high to low order.
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer DESC
What is the arabs when the annual population growth rate is 1.7%?
CREATE TABLE table_28193 ("Metropolitan ring" text,"Localities" real,"Total" real,"Jews and others 1" real,"Thereof: Jews" real,"Arabs" real,"Population density (per km\u00b2)" text,"Annual Population growth rate" text)
SELECT "Arabs" FROM table_28193 WHERE "Annual Population growth rate" = '1.7%'
what is the maximum total cost for the hospital involving a procedure called nasogastric tube - with suction this year?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid ...
SELECT MAX(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 treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'nasogastric tube - with suction')) AND DATET...
Which Tied has Matches of 1, and a Lost of 0, and a Team of durham?
CREATE TABLE table_name_95 (tied VARCHAR,team VARCHAR,matches VARCHAR,lost VARCHAR)
SELECT tied FROM table_name_95 WHERE matches = "1" AND lost = "0" AND team = "durham"
WHAT IS THE AVERAGE SQUAD NUMBER WITH MARTIN SMITH, AND LEAGUE GOALS LESS THAN 17?
CREATE TABLE table_name_8 (squad_no INTEGER,name VARCHAR,league_goals VARCHAR)
SELECT AVG(squad_no) FROM table_name_8 WHERE name = "martin smith" AND league_goals < 17
who was the voice actor when the species is hedgehog?
CREATE TABLE table_28825 ("Name" text,"Jewel" text,"Species" text,"Gender" text,"Jewel Power" text,"Attribute" text,"Birthday" text,"Media Debut" text,"Voice actor" text)
SELECT "Voice actor" FROM table_28825 WHERE "Species" = 'Hedgehog'