instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
How man 'other' millions of smartphones were shipped when 181.1 million total were shipped?
CREATE TABLE table_14260687_3 (other VARCHAR,total VARCHAR)
SELECT COUNT(other) FROM table_14260687_3 WHERE total = "181.1"
What is the evening gown score where the interview score is 9.22 and the preliminaries are larger than 9.057?
CREATE TABLE table_52888 ("Country" text,"Preliminaries" real,"Interview" real,"Swimsuit" real,"Evening Gown" real,"Average" real)
SELECT SUM("Evening Gown") FROM table_52888 WHERE "Interview" = '9.22' AND "Preliminaries" > '9.057'
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, a bar chart shows the distribution of job_id and the average of manager_id , and group by attribute job_id, and could you display by the Y-axis in descending?
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE job_history (...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) DESC
What is the game with the team indiana?
CREATE TABLE table_3881 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Game" FROM table_3881 WHERE "Team" = 'Indiana'
where was the match held immediately before 2014 's at guizhou olympic stadium ?
CREATE TABLE table_204_770 (id number,"season" number,"date" text,"jia-a/csl winner" text,"result" text,"fa cup winner" text,"scorers" text,"stadium" text)
SELECT "stadium" FROM table_204_770 WHERE "season" < 2014 ORDER BY "season" DESC LIMIT 1
Which Opponent has a Score of 3 6, 5 7?
CREATE TABLE table_38576 ("Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Opponent" FROM table_38576 WHERE "Score" = '3–6, 5–7'
What is the result for the champions jeonju kcc egis with runners-up seoul samsung thunders after 2007?
CREATE TABLE table_name_39 (result VARCHAR,champions VARCHAR,year VARCHAR,runners_up VARCHAR)
SELECT result FROM table_name_39 WHERE year > 2007 AND runners_up = "seoul samsung thunders" AND champions = "jeonju kcc egis"
get me patient 015-80402's daily average weight until 3 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 AVG(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-80402') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY STRFTIME('...
In which city is Hayman Hall (Tom Gola Arena) located?
CREATE TABLE table_name_84 (city VARCHAR,venue VARCHAR)
SELECT city FROM table_name_84 WHERE venue = "hayman hall (tom gola arena)"
Which Player has a Round larger than 5, and a School/Club Team of bethune-cookman?
CREATE TABLE table_37422 ("Round" real,"Pick" real,"Player" text,"Position" text,"School/Club Team" text)
SELECT "Player" FROM table_37422 WHERE "Round" > '5' AND "School/Club Team" = 'bethune-cookman'
among patients who had open and other replacement of aortic valve with tissue graft, how many of them were unmarried?
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 procedures (subject_id text,hadm_id te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.long_title = "Open and other replacement of aortic valve with tissue graft"
which district has the earliest date that a successor was seated ?
CREATE TABLE table_203_400 (id number,"district" text,"vacator" text,"reason for change" text,"successor" text,"date successor\nseated" text)
SELECT "district" FROM table_203_400 ORDER BY "date successor\nseated" LIMIT 1
how much clopidogrel is prescribed the first time in 06/this year to patient 72364?
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 admissions (row_id number,subject_id number,hadm_id number,admitt...
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72364) AND prescriptions.drug = 'clopidogrel' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRF...
What was the result for Rank 2 on December 6, 1969?
CREATE TABLE table_12756 ("Date" text,"Opponent#" text,"Rank#" text,"Result" text,"Attendance" text)
SELECT "Result" FROM table_12756 WHERE "Rank#" = '2' AND "Date" = 'december 6, 1969'
What is the sum of losses when draws are larger than 0?
CREATE TABLE table_12445 ("Mininera DFL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real)
SELECT COUNT("Losses") FROM table_12445 WHERE "Draws" > '0'
What college had a LB in the draft?
CREATE TABLE table_10812403_4 (college VARCHAR,position VARCHAR)
SELECT college FROM table_10812403_4 WHERE position = "LB"
what is discharge location of subject id 2560?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT demographic.discharge_location FROM demographic WHERE demographic.subject_id = "2560"
What is the position when the points 1 is 61?
CREATE TABLE table_name_40 (position INTEGER,points_1 VARCHAR)
SELECT SUM(position) FROM table_name_40 WHERE points_1 = "61"
what nonstop flights between ATLANTA and WASHINGTON leave ATLANTA after 1800 o'clock pm
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 code_description (code varc...
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND flight.departure_time > 1800 AND flight.to_airport = AIRPORT_SERVICE_1.a...
Please show the trend about the number of days with max temperature reaches 80 change over dates, order x axis from high to low order.
CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f INTEGER,max_dew_point_f INTEGER,mean_dew_point_f INTEGER,min_dew_point_f INTEGER,max_humidity INTEGER,mean_humidity INTEGER,min_humidity INTEGER,max_sea_level_pressure_inches NUMERIC,mean_sea_level_pressure_inches NUM...
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 GROUP BY date ORDER BY date DESC
Which Diameter has a Thickness of 1.3mm?
CREATE TABLE table_name_93 (diameter VARCHAR,thickness VARCHAR)
SELECT diameter FROM table_name_93 WHERE thickness = "1.3mm"
How many times is the ends lost 49?
CREATE TABLE table_3504 ("Locale" text,"Skip" text,"W" real,"L" real,"PF" real,"PA" real,"Ends Won" real,"Ends Lost" real,"Blank Ends" real,"Stolen Ends" real,"Shot Pct." real)
SELECT COUNT("L") FROM table_3504 WHERE "Ends Lost" = '49'
Which grid is the highest and has a time/retired of +0.3?
CREATE TABLE table_name_11 (grid INTEGER,time_retired VARCHAR)
SELECT MAX(grid) FROM table_name_11 WHERE time_retired = "+0.3"
What is the away side score when footscray is the home side?
CREATE TABLE table_name_38 (away_team VARCHAR,home_team VARCHAR)
SELECT away_team AS score FROM table_name_38 WHERE home_team = "footscray"
who is the incumbent with candidates being tom ridge (r) 80.9% joylyn blackwell (d) 19.1%
CREATE TABLE table_18251 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "Incumbent" FROM table_18251 WHERE "Candidates" = 'Tom Ridge (R) 80.9% Joylyn Blackwell (D) 19.1%'
Name the catalog number for am/pm callanetics
CREATE TABLE table_27303975_2 (catalog_number VARCHAR,title VARCHAR)
SELECT catalog_number FROM table_27303975_2 WHERE title = "AM/PM Callanetics"
What is the largest frequency owned by multicultural broadcasting with a Format of vietnamese?
CREATE TABLE table_name_40 (frequency INTEGER,status VARCHAR,format VARCHAR)
SELECT MAX(frequency) FROM table_name_40 WHERE status = "owned by multicultural broadcasting" AND format = "vietnamese"
What did the home team at Brunswick Street Oval score?
CREATE TABLE table_name_89 (home_team VARCHAR,venue VARCHAR)
SELECT home_team AS score FROM table_name_89 WHERE venue = "brunswick street oval"
What is the average number of events of PGA Championship tournaments with a top-5 less than 0?
CREATE TABLE table_14786 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT AVG("Events") FROM table_14786 WHERE "Top-10" = '0' AND "Tournament" = 'pga championship' AND "Top-5" < '0'
i want to fly from BOSTON to BALTIMORE
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_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flig...
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 = 'BALTIMO...
What is the name of the subject who ran in the general election for Queen Anne's County State's Attorney?
CREATE TABLE table_name_63 (subject VARCHAR,election VARCHAR,office VARCHAR)
SELECT subject FROM table_name_63 WHERE election = "general" AND office = "queen anne's county state's attorney"
Name the total number of record for 61
CREATE TABLE table_29832 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT COUNT("Record") FROM table_29832 WHERE "Game" = '61'
was the sao2 of patient 017-24595 normal since 121 days ago?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid num...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-24595')) AND vitalperiodic.sao2 BETWEEN sao2_lower AND sao2_uppe...
what is diagnoses icd9 code of subject name kelly gallardo?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Kelly Gallardo"
What was the surface when he played with John Alexander?
CREATE TABLE table_26309085_1 (surface VARCHAR,partner VARCHAR)
SELECT surface FROM table_26309085_1 WHERE partner = "John Alexander"
What is the average value of Overall, when Round is greater than 11, and when Pick is greater than 10?
CREATE TABLE table_44765 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT AVG("Overall") FROM table_44765 WHERE "Round" > '11' AND "Pick" > '10'
number of teams above 9 medals
CREATE TABLE table_203_466 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT COUNT("nation") FROM table_203_466 WHERE "total" > 9
Who is the home captain of the match that resulted [[|]] by 151 runs?
CREATE TABLE table_50883 ("Date" text,"Home captain" text,"Away captain" text,"Venue" text,"Result" text)
SELECT "Home captain" FROM table_50883 WHERE "Result" = '[[|]] by 151 runs'
What is the Format of the release with Catalog number 2508668?
CREATE TABLE table_63845 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text)
SELECT "Format" FROM table_63845 WHERE "Catalog" = '2508668'
Name the most attendance
CREATE TABLE table_20631 ("#" real,"Date" text,"at/vs." text,"Opponent" text,"Score" text,"Attendance" real,"Record" text)
SELECT MAX("Attendance") FROM table_20631
What was the lowest attendance for the game that had a time of 3:31 and was before game 7?
CREATE TABLE table_46572 ("Game" real,"Date" text,"Location" text,"Time" text,"Attendance" real)
SELECT MIN("Attendance") FROM table_46572 WHERE "Time" = '3:31' AND "Game" < '7'
Which Position has a Competition of european race walking cup?
CREATE TABLE table_name_32 (position VARCHAR,competition VARCHAR)
SELECT position FROM table_name_32 WHERE competition = "european race walking cup"
For upper Arlington, what was the median household income?
CREATE TABLE table_22318 ("Rank" real,"Place" text,"County" text,"Per Capita Income" text,"Median House- hold Income" text,"Population" real,"Number of Households" real)
SELECT "Median House- hold Income" FROM table_22318 WHERE "Place" = 'Upper Arlington'
how many patients since 2105 were diagnosed with diabetes mellitus during the same month after the first diagnosis with stroke - ischemic stroke?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresul...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diabetes mellitus' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1 JOIN (SELECT patient.uniquep...
What is the FSB of the model with part number lf80537gf0411m?
CREATE TABLE table_11602313_4 (fsb VARCHAR,part_number_s_ VARCHAR)
SELECT fsb FROM table_11602313_4 WHERE part_number_s_ = "LF80537GF0411M"
count the number of patients whose drug route is left eye?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "LEFT EYE"
How many players named victor h nescu played?
CREATE TABLE table_24431264_16 (points VARCHAR,player VARCHAR)
SELECT COUNT(points) AS won FROM table_24431264_16 WHERE player = "Victor Hănescu"
What is the current map designation of the feature which was named for discovery rupes?
CREATE TABLE table_name_63 (current_map VARCHAR,namesake VARCHAR)
SELECT current_map FROM table_name_63 WHERE namesake = "discovery rupes"
What is the number of contestants who are aged exactly 18?
CREATE TABLE table_25461827_2 (contestant VARCHAR,age VARCHAR)
SELECT COUNT(contestant) FROM table_25461827_2 WHERE age = 18
what was the last time patient 025-50213 got prescribed a drug on the current hospital visit?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labname text,...
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 = '025-50213' AND patient.hospitaldischargetime IS NULL)) ORDER B...
how many hours is it been since patient 031-13920's last procedure during the current hospital visit?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin te...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-13920...
Name the least podiums for 9th position
CREATE TABLE table_25375093_1 (podiums INTEGER,position VARCHAR)
SELECT MIN(podiums) FROM table_25375093_1 WHERE position = "9th"
give me the number of patients whose days of hospital stay is greater than 2 and lab test fluid is blood?
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "2" AND lab.fluid = "Blood"
Questions by users with high rep (above 20K).
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 FlagTypes (Id number,Name text,Description text)CREATE TABLE Re...
SELECT Users.Id AS "user_link", Posts.Id AS "post_link", Posts.LastEditDate FROM Users INNER JOIN Posts ON Users.Id = OwnerUserId WHERE Reputation >= 20000 AND PostTypeId = 2 ORDER BY 'lasteditdate' DESC LIMIT 50
Histogram of how many answers people give.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE ...
SELECT sel.n AS "#answers", COUNT(*) AS "occurence" FROM (SELECT COUNT(*) AS "n" FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 2 AND p.ClosedDate IS NULL GROUP BY u.Id) AS sel GROUP BY sel.n ORDER BY sel.n
What is every reason for change for the date of successors installation is March 16, 1960?
CREATE TABLE table_24493 ("State (class)" text,"Vacator" text,"Reason for change" text,"Successor" text,"Date of successors formal installation" text)
SELECT "Reason for change" FROM table_24493 WHERE "Date of successors formal installation" = 'March 16, 1960'
What was the amount of laps for the vehicle manufactured by honda with a grid of 9?
CREATE TABLE table_name_34 (laps VARCHAR,manufacturer VARCHAR,grid VARCHAR)
SELECT laps FROM table_name_34 WHERE manufacturer = "honda" AND grid = "9"
what output did patient 31300 last have until 06/14/2105?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31300)) AND STRFTIME('%y-%m-%d', outputeve...
Can you tell me the sum of Loss that has the Gain of 2646?
CREATE TABLE table_48411 ("Name" text,"Gain" real,"Loss" real,"Long" real,"Avg/g" real)
SELECT SUM("Loss") FROM table_48411 WHERE "Gain" = '2646'
What is the seat percentage when vote percentage is 2.4% (-8.3)?
CREATE TABLE table_name_73 (seat_percentage VARCHAR,vote_percentage VARCHAR)
SELECT seat_percentage FROM table_name_73 WHERE vote_percentage = "2.4% (-8.3)"
What College/Junior/Club Team (League) from Canada has a round smaller than 3?
CREATE TABLE table_36990 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team (League)" text)
SELECT "College/Junior/Club Team (League)" FROM table_36990 WHERE "Nationality" = 'canada' AND "Round" < '3'
What is the most common prerequisite this semester ?
CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_prerequisite (...
SELECT COUNT(DISTINCT course_prerequisite.course_id), course.department, course.name, course.number FROM course, course_offering, course_prerequisite, semester WHERE course.course_id = course_offering.course_id AND course.course_id = course_prerequisite.pre_course_id AND course.department = 'EECS' AND semester.semester...
Hadoop trends (# questions per month).
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 DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
Which patients have lora2i?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "LORA2I"
what is the first ward id patient 009-5801 got until 3 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 patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5801') AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY patient.unitadmittime LIMIT 1
For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, and order by the x axis from high to low please.
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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),DEPARTME...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC
How much money does the player with a 68-67-69-71=275 score have?
CREATE TABLE table_name_62 (money___£__ VARCHAR,score VARCHAR)
SELECT money___£__ FROM table_name_62 WHERE score = 68 - 67 - 69 - 71 = 275
on april 29, what was the attendance?
CREATE TABLE table_name_68 (attendance INTEGER,date VARCHAR)
SELECT SUM(attendance) FROM table_name_68 WHERE date = "april 29"
List the name of technicians whose team is not 'NYY', and count them by a bar chart
CREATE TABLE machine (Machine_ID int,Making_Year int,Class text,Team text,Machine_series text,value_points real,quality_rank int)CREATE TABLE technician (technician_id real,Name text,Team text,Starting_Year real,Age int)CREATE TABLE repair (repair_ID int,name text,Launch_Date text,Notes text)CREATE TABLE repair_assignm...
SELECT Name, COUNT(Name) FROM technician WHERE Team <> "NYY" GROUP BY Name
what is the average place when lost is more than 12?
CREATE TABLE table_67721 ("Place" real,"Team" text,"Played" real,"Draw" real,"Lost" real,"Goals Scored" real,"Goals Conceded" real,"Points" real)
SELECT AVG("Place") FROM table_67721 WHERE "Lost" > '12'
how many teams are there in total ?
CREATE TABLE table_204_256 (id number,"position" number,"club" text,"played" number,"points" number,"wins" number,"draws" number,"losses" number,"goals for" number,"goals against" number,"goal difference" number)
SELECT COUNT("club") FROM table_204_256
What is the region 2 for the complete fifth series?
CREATE TABLE table_1337525_1 (region_2 VARCHAR,complete_series VARCHAR)
SELECT region_2 FROM table_1337525_1 WHERE complete_series = "The Complete Fifth Series"
Name the popultion density being manthai west
CREATE TABLE table_24574438_1 (population_density___km_2__ VARCHAR,ds_division VARCHAR)
SELECT population_density___km_2__ FROM table_24574438_1 WHERE ds_division = "Manthai West"
how many days have elapsed since patient 022-6959's last benadryl prescription in their current hospital encounter?
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 intakeoutput (intakeoutputid number,patientuni...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '022-695...
find the number of patients whose drug code is dapt500i and lab test fluid is ascites.
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 text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "DAPT500I" AND lab.fluid = "Ascites"
Where was the game played that was on Sunday, May 27?
CREATE TABLE table_24786958_2 (game_site VARCHAR,date VARCHAR)
SELECT game_site FROM table_24786958_2 WHERE date = "Sunday, May 27"
What's the earliest year that had a category of best supporting actress at the asian film awards?
CREATE TABLE table_55134 ("Year" real,"Award" text,"Category" text,"Nominated work" text,"Result" text)
SELECT MIN("Year") FROM table_55134 WHERE "Category" = 'best supporting actress' AND "Award" = 'asian film awards'
how many days have elapsed since patient 016-18575 has had his first stress ulcer prophylaxis - famotidine in the current hospital encounter?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname te...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18575'...
What is the highest crowd at windy hill?
CREATE TABLE table_name_51 (crowd INTEGER,venue VARCHAR)
SELECT MAX(crowd) FROM table_name_51 WHERE venue = "windy hill"
What is the highest number in attendance against the game at Kansas City Chiefs?
CREATE TABLE table_name_47 (attendance INTEGER,opponent VARCHAR)
SELECT MAX(attendance) FROM table_name_47 WHERE opponent = "at kansas city chiefs"
what is the lowest price fare from ATLANTA to SAN FRANCISCO on flight DL 82 and DL 139
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 date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE flight_s...
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 AS FLIGHT_0, flight AS FLIGHT_1, flight_fare, flight_leg WHERE ((FLIGHT_1.flight_number = 139 OR FLIGHT_1.flight_number = 82) AND CITY_1.city_code = AIRPORT_SERVICE_...
Visualize a bar chart for simply displaying the email address of the employee and the corresponding salary, and order in desc by the X please.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPART...
SELECT EMAIL, SALARY FROM employees ORDER BY EMAIL DESC
List the maximum scores of the team Boston Red Stockings when the team won in postseason?
CREATE TABLE postseason (wins INTEGER,team_id_winner VARCHAR)CREATE TABLE team (team_id_br VARCHAR,name VARCHAR)
SELECT MAX(T1.wins) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'
Which Visitor has a Decision of osgood, and a Date of february 15?
CREATE TABLE table_49082 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text)
SELECT "Visitor" FROM table_49082 WHERE "Decision" = 'osgood' AND "Date" = 'february 15'
How many musical guests and songs were in episodes with a production code k0519?
CREATE TABLE table_17267 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Musical guest and song" text,"Original air date" text,"Production code" text)
SELECT COUNT("Musical guest and song") FROM table_17267 WHERE "Production code" = 'K0519'
i'd like a flight on 7 9 from ORLANDO to KANSAS CITY in the afternoon
CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_...
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 = 'KANSAS CITY' AND date_day.day_number = 9 AND date_day.month_number = 7 A...
A pie chart for what are the number of the names of the technicians that are assigned to repair machines with more point values than 70?
CREATE TABLE machine (Machine_ID int,Making_Year int,Class text,Team text,Machine_series text,value_points real,quality_rank int)CREATE TABLE repair (repair_ID int,name text,Launch_Date text,Notes text)CREATE TABLE technician (technician_id real,Name text,Team text,Starting_Year real,Age int)CREATE TABLE repair_assignm...
SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70 GROUP BY Name
how many schools were established before 1955 ?
CREATE TABLE table_203_416 (id number,"school name" text,"city" text,"grades" text,"establishment" number,"charter" text)
SELECT COUNT("school name") FROM table_203_416 WHERE "establishment" < 1955
please list all airline flights between DENVER and BOSTON
CREATE TABLE month (month_number int,month_name text)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON'...
What was Olazabal's winning score in the event in which Phillip Price finished 2nd?
CREATE TABLE table_36805 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text)
SELECT "Winning score" FROM table_36805 WHERE "Runner(s)-up" = 'phillip price'
there have been at most how many starters in a breeders cup juvenile field ?
CREATE TABLE table_204_62 (id number,"year" number,"winner" text,"second" text,"third" text,"starters" number)
SELECT MAX("starters") FROM table_204_62
What is the density of San Sebasti n?
CREATE TABLE table_53122 ("City district" text,"Area km\u00b2" text,"Population 2007 census(hab)" text,"Housing (2007)" text,"Density (hab/km\u00b2)" text,"Elevation msl" text)
SELECT "Density (hab/km\u00b2)" FROM table_53122 WHERE "City district" = 'san sebastián'
What is the earliest year that has fewer than 3852.1 cows and 3900.1 working horses?
CREATE TABLE table_60641 ("Year" real,"Total Horses" real,"Working Horses" text,"Total Cattle" real,"Oxen" real,"Bulls" text,"Cows" real,"Pigs" real,"Sheep and Goats" real)
SELECT MIN("Year") FROM table_60641 WHERE "Working Horses" = '3900.1' AND "Cows" < '3852.1'
What is the part 3 entry that has a part 4 entry of giboran?
CREATE TABLE table_47018 ("Class" text,"Part 1" text,"Part 2" text,"Part 3" text,"Part 4" text,"Verb meaning" text)
SELECT "Part 3" FROM table_47018 WHERE "Part 4" = 'giboran'
Which opponents have an Attendance larger than 61,000, and a Result F A of 3 2?
CREATE TABLE table_54026 ("Date" text,"Opponents" text,"H / A" text,"Result F\u2013A" text,"Attendance" real,"Group position" text)
SELECT "Opponents" FROM table_54026 WHERE "Attendance" > '61,000' AND "Result F\u2013A" = '3–2'
a solid organ or bone marrow transplant patients.
CREATE TABLE table_train_14 ("id" int,"bone_marrow_transplant" bool,"pregnancy_or_lactation" bool,"organ_transplantation" bool,"advanced_pulmonary_fibrosis" bool,"cardiopulmonary_resuscitation" bool,"myocardial_infarction" bool,"NOUSE" float)
SELECT * FROM table_train_14 WHERE organ_transplantation = 1 OR bone_marrow_transplant = 1
what episode had the most viewers ?
CREATE TABLE table_204_449 (id number,"no" number,"episode" text,"title" text,"original airdate" text,"viewers" number,"nightly\nrank" number)
SELECT "title" FROM table_204_449 ORDER BY "viewers" DESC LIMIT 1
list flights leaving DALLAS on saturday and arriving in SAN FRANCISCO before 1600
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 flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE airport (airport_code va...
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 ((date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <...
In what city is the Don Valley Stadium located?
CREATE TABLE table_33516 ("Date" text,"Result" text,"Score" text,"Stadium" text,"City" text,"Crowd" real)
SELECT "City" FROM table_33516 WHERE "Stadium" = 'don valley stadium'
What's the season number of the episode titled 'Quitters'?
CREATE TABLE table_660 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (million)" text)
SELECT MIN("No. in season") FROM table_660 WHERE "Title" = 'Quitters'