instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What was Canada's skip?
CREATE TABLE table_34913 ("Country" text,"Skip" text,"Third" text,"Second" text,"Lead" text)
SELECT "Skip" FROM table_34913 WHERE "Country" = 'canada'
What was 2002, when 2008 was, 'career statistics'?
CREATE TABLE table_name_6 (Id VARCHAR)
SELECT 2002 FROM table_name_6 WHERE 2008 = "career statistics"
How many seats does leader Raymond McCartney have?
CREATE TABLE table_45638 ("Leader" text,"Party" text,"Leader's Seat" text,"Number of Seats" real,"Leader since" text)
SELECT SUM("Number of Seats") FROM table_45638 WHERE "Leader" = 'raymond mccartney'
Name when north canton joined
CREATE TABLE table_28741 ("School" text,"Nickname" text,"Location" text,"Colors" text,"Join Date" real)
SELECT "Join Date" FROM table_28741 WHERE "Location" = 'North Canton'
Which Bats have a First of josh, and Throws of r, and a Surname of cakebread?
CREATE TABLE table_name_90 (bats VARCHAR,surname VARCHAR,first VARCHAR,throws VARCHAR)
SELECT bats FROM table_name_90 WHERE first = "josh" AND throws = "r" AND surname = "cakebread"
what country has more aircraft listed than any other ?
CREATE TABLE table_204_710 (id number,"model" text,"origin" text,"type" text,"versions" text,"in service" text,"notes" text)
SELECT "origin" FROM table_204_710 GROUP BY "origin" ORDER BY COUNT(*) DESC LIMIT 1
What is the name of the team from Derbyshire county?
CREATE TABLE table_18461635_1 (team VARCHAR,county VARCHAR)
SELECT team FROM table_18461635_1 WHERE county = "Derbyshire"
Downvoted questions with all-downvoted answers.
CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Users...
WITH Raw AS (SELECT Q.Id, MIN(Q.Score) AS QScore, COUNT(*) AS AnswerNo, COUNT(CASE WHEN A.Score < 0 THEN 1 ELSE NULL END) AS NegAnswerNo FROM Posts AS Q, Posts AS A WHERE Q.Score < 0 AND A.ParentId = Q.Id AND Q.AcceptedAnswerId IS NULL AND NOT Q.ClosedDate IS NULL GROUP BY Q.Id) SELECT Id AS "post_link", QScore, Answer...
What is the sum of Asian or Amerindian (%), when Black (%) is 9,7, and when White (%) is greater than 45,7?
CREATE TABLE table_42937 ("State" text,"White (%)" real,"Brown (%)" real,"Black (%)" real,"Asian or Amerindian (%)" real)
SELECT SUM("Asian or Amerindian (%)") FROM table_42937 WHERE "Black (%)" = '9,7' AND "White (%)" > '45,7'
What is the date for the mount panorama circuit?
CREATE TABLE table_28953 ("Rd." text,"Circuit" text,"City / State" text,"Date" text,"Championship" text,"Challenge" text,"Production" text)
SELECT "Date" FROM table_28953 WHERE "Circuit" = 'Mount Panorama Circuit'
What is Season, when Goals is less than 6, and when Team is 'Tarbiat Yazd'?
CREATE TABLE table_79117 ("Season" text,"Team" text,"Country" text,"Division" real,"Goals" real)
SELECT "Season" FROM table_79117 WHERE "Goals" < '6' AND "Team" = 'tarbiat yazd'
What are the names of all songs in English?
CREATE TABLE genre (g_name text,rating text,most_popular_in text)CREATE TABLE artist (artist_name text,country text,gender text,preferred_genre text)CREATE TABLE files (f_id number,artist_name text,file_size text,duration text,formats text)CREATE TABLE song (song_name text,artist_name text,country text,f_id number,genr...
SELECT song_name FROM song WHERE languages = "english"
A bar chart for returning the number of the claim start date for the claims whose claimed amount is no more than the average, and rank from high to low by the y axis.
CREATE TABLE Claims (Claim_ID INTEGER,Policy_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settled DATE,Amount_Claimed INTEGER,Amount_Settled INTEGER)CREATE TABLE Customer_Policies (Policy_ID INTEGER,Customer_ID INTEGER,Policy_Type_Code CHAR(15),Start_Date DATE,End_Date DATE)CREATE TABLE Settlements (Settlement_ID INTEGER...
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims) ORDER BY COUNT(Date_Claim_Made) DESC
Away result of 1 1, and a Round of 1r, and a Season of 1967-68 involves what club?
CREATE TABLE table_75508 ("Season" text,"Competition" text,"Round" text,"Club" text,"Home result" text,"Away result" text)
SELECT "Club" FROM table_75508 WHERE "Away result" = '1–1' AND "Round" = '1r' AND "Season" = '1967-68'
What is the average of seasons for 10th place finishes?
CREATE TABLE table_58427 ("Season" real,"Level" text,"Division" text,"Administration" text,"Position" text)
SELECT AVG("Season") FROM table_58427 WHERE "Position" = '10th'
What was the venue when the away team scored 17.21 (123)?
CREATE TABLE table_52492 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_52492 WHERE "Away team score" = '17.21 (123)'
What is the least lane number that Natalie Coughlin was in when she was ranked greater than 1?
CREATE TABLE table_name_75 (lane INTEGER,name VARCHAR,rank VARCHAR)
SELECT MIN(lane) FROM table_name_75 WHERE name = "natalie coughlin" AND rank > 1
stack exchange big with accepted answers.
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 PostLinks (Id number,CreationDate time,PostId number,RelatedPos...
SELECT COUNT(1) FROM (SELECT Id, AcceptedAnswerId FROM Posts WHERE AcceptedAnswerId > 0 AND ViewCount > 1000) AS Posts JOIN Posts AS Answers ON Posts.AcceptedAnswerId = Answers.Id
how many times were the candidates thomas h. hubbard (dr) 51.5% simeon ford (f) 48.4%?
CREATE TABLE table_28903 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text,"Candidates" text)
SELECT COUNT("Party") FROM table_28903 WHERE "Candidates" = 'Thomas H. Hubbard (DR) 51.5% Simeon Ford (F) 48.4%'
Name the total number of winnings for 1995
CREATE TABLE table_20990 ("Year" real,"Starts" real,"Wins" real,"Top 5" real,"Top 10" real,"Poles" real,"Avg. Start" text,"Avg. Finish" text,"Winnings" text,"Position" text,"Team(s)" text)
SELECT COUNT("Winnings") FROM table_20990 WHERE "Year" = '1995'
Who is the player with a 76-67-71=214 score?
CREATE TABLE table_14869 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Player" FROM table_14869 WHERE "Score" = '76-67-71=214'
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 phone_number and manager_id , and rank Y-axis in descending order please.
CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))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 decima...
SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID DESC
What is the High rebounds with a Series with 4 2?
CREATE TABLE table_name_13 (high_rebounds VARCHAR,series VARCHAR)
SELECT high_rebounds FROM table_name_13 WHERE series = "4–2"
Top users from Yekaterinburg, Russia.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PostT...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%ekaterinburg%' OR UPPER(Location) LIKE '%EKATERINBURG%' OR Location LIKE '%ekaterinburg%' AND Reputation >= 1000 ORDER BY Reputation DESC
Show the number of customer cards.
CREATE TABLE financial_transactions (transaction_id number,previous_transaction_id number,account_id number,card_id number,transaction_type text,transaction_date time,transaction_amount number,transaction_comment text,other_transaction_details text)CREATE TABLE customers_cards (card_id number,customer_id number,card_ty...
SELECT COUNT(*) FROM customers_cards
Which grid has a time/retired of +3.9 secs in less than 96 laps?
CREATE TABLE table_name_42 (grid INTEGER,time_retired VARCHAR,laps VARCHAR)
SELECT AVG(grid) FROM table_name_42 WHERE time_retired = "+3.9 secs" AND laps < 96
Which year opened is located in west mifflin, pennsylvania?
CREATE TABLE table_63769 ("Coaster Name" text,"Park" text,"Location" text,"Track" text,"Builder" text,"Year Opened" text)
SELECT "Year Opened" FROM table_63769 WHERE "Location" = 'west mifflin, pennsylvania'
What is the Hanyu Pinyin with an area of 400?
CREATE TABLE table_name_94 (hanyu_pinyin VARCHAR,area__km²_ VARCHAR)
SELECT hanyu_pinyin FROM table_name_94 WHERE area__km²_ = "400"
for patients who were prescribed with sodium chloride 0.9 % syringe : 10 ml syringe until 2 years ago, what are the top three most frequent medications that followed afterwards in the same hospital visit?
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'sodium chloride ...
What's the most overall when the executive appointments were 28 and the background was smaller than 37?
CREATE TABLE table_66580 ("Seq." text,"Name" text,"Background" real,"Party Leadership" real,"Communication Ability" real,"Relations with Congress" real,"Court Appointments" real,"Handling of Economy" real,"Luck" real,"Ability to Compromise" real,"Willing to take Risks" real,"Executive Appointments" real,"Overall Abilit...
SELECT MAX("Overall") FROM table_66580 WHERE "Executive Appointments" = '28' AND "Background" < '37'
What is the 1987 value of the 1994 atp masters series?
CREATE TABLE table_name_45 (Id VARCHAR)
SELECT 1987 FROM table_name_45 WHERE 1994 = "atp masters series"
How many sources are there for south africa?
CREATE TABLE table_4203 ("Country / region" text,"Channel" text,"Series premiere" text,"Title in country" text,"Source(s)" text,"Airing?" text)
SELECT COUNT("Source(s)") FROM table_4203 WHERE "Country / region" = 'South Africa'
give me the number of patients whose admission location is clinic referral/premature and procedure icd9 code is 3892?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.icd9_code = "3892"
Tag wikis with old external http:// links.
CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,Cre...
SELECT DISTINCT Tags.Id, Tags.TagName, 'site://tags/' + Tags.TagName + '/info|Url' AS Url, LENGTH(Posts.Body) FROM Tags LEFT JOIN Posts ON Posts.Id = Tags.WikiPostId OR Posts.Id = Tags.ExcerptPostId WHERE (LOWER(Posts.Body) LIKE '%http://github.%' OR LOWER(Posts.Body) LIKE '%http://wikipedia.%' OR LOWER(Posts.Body) LIK...
Calculate the average age of emergency type hospital admission patients who have aortic insufficiency re-do sternotomy aortic valve replacement as their primary disease.
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 AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT "
Which city did kpnz-tv provide coverage for?
CREATE TABLE table_73764 ("Branding" text,"Callsign" text,"Channel" text,"Power (kW)" text,"Coverage" text)
SELECT "Coverage" FROM table_73764 WHERE "Callsign" = 'KPNZ-TV'
What was the score of the player who played against Wong Choong Hann in the Dutch Open?
CREATE TABLE table_name_47 (score VARCHAR,tournament VARCHAR,opponent VARCHAR)
SELECT score FROM table_name_47 WHERE tournament = "dutch open" AND opponent = "wong choong hann"
What is the average number of laps that has a Time/Retired of +1 lap, a Driver of olivier panis, and a Grid larger than 4?
CREATE TABLE table_78406 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT AVG("Laps") FROM table_78406 WHERE "Time/Retired" = '+1 lap' AND "Driver" = 'olivier panis' AND "Grid" > '4'
Which UK Base has an airborne unit of Pathfinders?
CREATE TABLE table_55333 ("Serial" real,"Airborne Unit" text,"Troop carrier Group" text,"# of C-47s" real,"UK Base" text,"Drop Zone" text,"Drop Zone Time" real)
SELECT "UK Base" FROM table_55333 WHERE "Airborne Unit" = 'pathfinders'
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, return a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time.
CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0)...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
how many hours has passed since the time patient 021-95970 was admitted to the icu?
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '021-95970' AND patient.unitdischargetime IS NULL
Name the stadium with host team of san diego chargers and final score of 23-45
CREATE TABLE table_name_46 (stadium VARCHAR,host_team VARCHAR,final_score VARCHAR)
SELECT stadium FROM table_name_46 WHERE host_team = "san diego chargers" AND final_score = "23-45"
tell me the maximum hospital cost that involves phosphate how much does it cost?
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,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,ce...
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 lab.patientunitstayid FROM lab WHERE lab.labname = 'phosphate')) GROUP BY cost.patienthealthsystemstayid) AS t1
in which year were the least amount of jamaicans granted british citizenship ?
CREATE TABLE table_203_467 (id number,"year" number,"numer of jamaicans\ngranted british\ncitizenship" number,"naturalisation\nby residence" number,"naturalisation\nby marriage" number,"registration\nof a minor child" number,"registration\nby other means" number)
SELECT "year" FROM table_203_467 ORDER BY "numer of jamaicans\ngranted british\ncitizenship" LIMIT 1
What driver has a Time/Retired of 2:16:38.0?
CREATE TABLE table_name_19 (driver VARCHAR,time_retired VARCHAR)
SELECT driver FROM table_name_19 WHERE time_retired = "2:16:38.0"
What is the result of the World Race Walking Cup tournament played before the year 2010?
CREATE TABLE table_name_20 (result VARCHAR,year VARCHAR,tournament VARCHAR)
SELECT result FROM table_name_20 WHERE year > 2010 AND tournament = "world race walking cup"
What was the outcome of the Tournament in Buenos Aires?
CREATE TABLE table_32833 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponent" text,"Score" text)
SELECT "Outcome" FROM table_32833 WHERE "Tournament" = 'buenos aires'
how many patients whose insurance is self pay and procedure long title is replacement of tube or enterostomy device of small intestine?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Self Pay" AND procedures.long_title = "Replacement of tube or enterostomy device of small intestine"
For those employees who did not have any job in the past, return a line chart about the change of department_id over hire_date .
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 employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),E...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
how many years after 1999 did merge records release their next album ?
CREATE TABLE table_203_77 (id number,"album title" text,"format" text,"year" number,"original label" text,"chart positions" text)
SELECT (SELECT MIN("year") FROM table_203_77 WHERE "year" > 1999) - 1999
what's the position with college being usc
CREATE TABLE table_14655985_1 (position VARCHAR,college VARCHAR)
SELECT position FROM table_14655985_1 WHERE college = "USC"
For all employees who have the letters D or S in their first name, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday, I want to rank by the total number in desc.
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_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGE...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(EMPLOYEE_ID) DESC
Which Time has a Year larger than 1985, and a Place smaller than 2, and an Athlete of riochy sekiya?
CREATE TABLE table_50614 ("Athlete" text,"Time" text,"Country" text,"Year" real,"Place" real)
SELECT "Time" FROM table_50614 WHERE "Year" > '1985' AND "Place" < '2' AND "Athlete" = 'riochy sekiya'
What is Score, when Date is May 7, 2006?
CREATE TABLE table_name_65 (score VARCHAR,date VARCHAR)
SELECT score FROM table_name_65 WHERE date = "may 7, 2006"
how many international tourism arrivals in 2010 -lrb- x1000 -rrb- did mexico have ?
CREATE TABLE table_203_54 (id number,"selected\nlatin american\ncountries" text,"internl.\ntourism\narrivals\n2010\n(x 1000)" number,"internl.\ntourism\nreceipts.\n2010\n(usd\n(x1000)" number,"average\nreceipt\nper visitor\n2009\n(usd/turista)" number,"tourist\narrivals\nper\n1000 inhab\n(estimated)\n2007" number,"rece...
SELECT "internl.\ntourism\narrivals\n2010\n(x 1000)" FROM table_203_54 WHERE "selected\nlatin american\ncountries" = 'mexico'
Tell me the least amount of democratic colation
CREATE TABLE table_1215 ("Municipality" text,"League of Communists" real,"Peoples Party" real,"Union of Reform Forces" real,"Democratic Coalition" real,"DSSP" real,"Total seats" real)
SELECT MIN("Democratic Coalition") FROM table_1215
who won more gold medals than the united states ?
CREATE TABLE table_203_812 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "nation" FROM table_203_812 WHERE "gold" > (SELECT "gold" FROM table_203_812 WHERE "nation" = 'united states')
Tell me the total number of pick for university of portland
CREATE TABLE table_name_5 (pick__number VARCHAR,affiliation VARCHAR)
SELECT COUNT(pick__number) FROM table_name_5 WHERE affiliation = "university of portland"
Which parish has a church named Vangsnes Kyrkje?
CREATE TABLE table_name_44 (parish__prestegjeld_ VARCHAR,church_name VARCHAR)
SELECT parish__prestegjeld_ FROM table_name_44 WHERE church_name = "vangsnes kyrkje"
On what date is there a match lower than 14 with a ground of H and the opponent Aston Villa under 18s?
CREATE TABLE table_name_11 (date VARCHAR,opponent VARCHAR,match VARCHAR,ground VARCHAR)
SELECT date FROM table_name_11 WHERE match < 14 AND ground = "h" AND opponent = "aston villa under 18s"
how many times is fine gael listed for gain ?
CREATE TABLE table_203_81 (id number,"date" text,"constituency" text,"gain" text,"loss" text,"note" text)
SELECT COUNT(*) FROM table_203_81 WHERE "gain" = 'fine gael'
The MDE requirement can be fulfilled with which easiest class ?
CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE area (course_id int,area varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program_requirement (program_id int...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
What place was Gary Player after two rounds?
CREATE TABLE table_44544 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Place" FROM table_44544 WHERE "Player" = 'gary player'
until 2100, how many patients were admitted to the hospital?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 nu...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE STRFTIME('%y', patient.hospitaladmittime) <= '2100'
Name of byron geis, and a Weight smaller than 195 involves what average number?
CREATE TABLE table_name_63 (number INTEGER,name VARCHAR,weight VARCHAR)
SELECT AVG(number) FROM table_name_63 WHERE name = "byron geis" AND weight < 195
what flights go from BOSTON to PITTSBURGH after 600 next tuesday
CREATE TABLE month (month_number int,month_name text)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed...
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 = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
does punia have more or less villages than godara ?
CREATE TABLE table_203_713 (id number,"s.no." number,"name of kingdom" text,"name of king" text,"no. of villages" number,"capital" text,"names of districts" text)
SELECT (SELECT "no. of villages" FROM table_203_713 WHERE "name of kingdom" = 'punia') > (SELECT "no. of villages" FROM table_203_713 WHERE "name of kingdom" = 'godara')
Calculate the number of patients with a blood fluid lab test who were diagnosed with mechanical complication of colostomy and enterostomy.
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Colosty/enter comp-mech" AND lab.fluid = "Blood"
Top 20 users from Noida.
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,R...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%noida' OR UPPER(Location) LIKE '%NOIDA' ORDER BY Reputation DESC LIMIT 20
How many countries got 796.7 points?
CREATE TABLE table_66 ("Rank" real,"Member Association" text,"Points" text,"Group stage" real,"Play-off" real,"AFC Cup" real)
SELECT COUNT("Rank") FROM table_66 WHERE "Points" = '796.7'
what is the number of patients whose primary disease is brain mass;intracranial hemorrhage and lab test abnormal status is abnormal?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.flag = "abnormal"
What is the average Year when the Competition was friendly, and a Club of everton?
CREATE TABLE table_41201 ("Year" real,"Competition" text,"Club" text,"Nation" text,"Result" text)
SELECT AVG("Year") FROM table_41201 WHERE "Competition" = 'friendly' AND "Club" = 'everton'
What is the price of 150 mbps downstread?
CREATE TABLE table_44727 ("Internet Plan" text,"Downstream" text,"Upstream" text,"Bandwidth Included" text,"Price" text)
SELECT "Price" FROM table_44727 WHERE "Downstream" = '150 mbps'
how any were gained as the chan
CREATE TABLE table_72493 ("City" text,"Station" text,"Year acquired" real,"Primary programming source" text,"Other programming sources" text,"Current status" text)
SELECT COUNT("Year acquired") FROM table_72493 WHERE "Station" = 'CHAN'
How large is the Boreal Shield in km2?
CREATE TABLE table_20142 ("Ecozone" text,"Area (km\u00b2)" real,"Percentage of total area" text,"Percentage of land area" text,"Percentage protected" text)
SELECT COUNT("Area (km\u00b2)") FROM table_20142 WHERE "Ecozone" = 'Boreal Shield'
Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks.
CREATE TABLE phone_market (market_id number,phone_id text,num_of_stock number)CREATE TABLE market (market_id number,district text,num_of_employees number,num_of_shops number,ranking number)CREATE TABLE phone (name text,phone_id number,memory_in_g number,carrier text,price number)
SELECT T2.name FROM phone_market AS T1 JOIN phone AS T2 ON T1.phone_id = T2.phone_id GROUP BY T2.name HAVING SUM(T1.num_of_stock) >= 2000 ORDER BY SUM(T1.num_of_stock) DESC
How many jewish have a muslim less than 36,041, a total less than 161,042, a year after 2006, with a druze greater than 2,534?
CREATE TABLE table_35406 ("Year" real,"Jewish" real,"Muslim" real,"Christian" real,"Druze" real,"Total" real)
SELECT SUM("Jewish") FROM table_35406 WHERE "Muslim" < '36,041' AND "Total" < '161,042' AND "Year" > '2006' AND "Druze" > '2,534'
when did patient 016-1459 last receive an atrial flutter - 1:1 conduction diagnosis during their first hospital encounter?
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid...
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-1459' AND NOT patient.hospitaldischargetime IS NULL ORDER BY ...
What is Streak, when Heat Points is '101', and when Game is '16'?
CREATE TABLE table_76800 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Heat points" real,"Opponents" real,"Record" text,"Streak" text)
SELECT "Streak" FROM table_76800 WHERE "Heat points" = '101' AND "Game" = '16'
what number of prescriptions of 0.9%nacl 1,000 ml were issued since 6 years ago?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitsta...
SELECT COUNT(*) FROM medication WHERE medication.drugname = '0.9%nacl 1,000 ml' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-6 year')
what's the preliminaries where evening gown is 8.988
CREATE TABLE table_12094609_1 (preliminaries VARCHAR,evening_gown VARCHAR)
SELECT preliminaries FROM table_12094609_1 WHERE evening_gown = "8.988"
name the only team they had a losing record against .
CREATE TABLE table_203_506 (id number,"opponent" text,"played" number,"won" number,"lost" number,"drawn" number,"% won overall" text)
SELECT "opponent" FROM table_203_506 ORDER BY "lost" DESC LIMIT 1
What Binibining Pilipinas-International has a Year larger than 1990, and a Binibining Pilipinas-Universe of maria lourdes gonzalez?
CREATE TABLE table_58705 ("Year" real,"Binibining Pilipinas-Universe" text,"Binibining Pilipinas-International" text,"Miss Maja Pilipinas" text,"Binibining Pilipinas-Tourism" text,"First runner-up" text,"Second runner-up" text)
SELECT "Binibining Pilipinas-International" FROM table_58705 WHERE "Year" > '1990' AND "Binibining Pilipinas-Universe" = 'maria lourdes gonzalez'
What is the resident state for the president elected in 1864?
CREATE TABLE table_11585 ("Name" text,"Election Year" real,"Party" text,"Birth State" text,"Resident State" text)
SELECT "Resident State" FROM table_11585 WHERE "Election Year" = '1864'
What is the highest number of laps completed by driver Joe Nemechek?
CREATE TABLE table_name_3 (laps INTEGER,driver VARCHAR)
SELECT MAX(laps) FROM table_name_3 WHERE driver = "joe nemechek"
US next wednesday from CLEVELAND to MIAMI
CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI' AND date_day.day_number = 23 AND date_day.month_number = 4 AND da...
What is the GDP (nominal) for Uzbekistan?
CREATE TABLE table_11780179_1 (gdp__nominal_ VARCHAR,country VARCHAR)
SELECT gdp__nominal_ FROM table_11780179_1 WHERE country = "Uzbekistan"
What player is from canterbury (ushs)?
CREATE TABLE table_name_67 (player VARCHAR,college_junior_club_team VARCHAR)
SELECT player FROM table_name_67 WHERE college_junior_club_team = "canterbury (ushs)"
Who was the commentator when the spokesperson was michael aspel?
CREATE TABLE table_65774 ("Voting order" real,"Country" text,"Spokespersons" text,"Commentator" text,"Broadcaster" text)
SELECT "Commentator" FROM table_65774 WHERE "Spokespersons" = 'michael aspel'
which year had the most stamps issued ?
CREATE TABLE table_203_153 (id number,"stamp issue date" text,"stamp set" text,"#cards" text,"card set ref" text,"qty. issued" number)
SELECT "stamp issue date" FROM table_203_153 GROUP BY "stamp issue date" ORDER BY SUM("qty. issued") DESC LIMIT 1
what's the leading scorer where home is sacramento kings
CREATE TABLE table_17352 ("#" real,"Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" text,"Record" text,"Streak" text)
SELECT "Leading scorer" FROM table_17352 WHERE "Home" = 'Sacramento Kings'
what are the hospitals admission times of patient 008-186 last year?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweigh...
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '008-186' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
Draw a bar chart about the distribution of All_Home and the average of School_ID , and group by attribute All_Home, and I want to list Y-axis in desc order please.
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 All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(School_ID) DESC
How many directors were there for the film with the original title of The Moises Padilla Story?
CREATE TABLE table_17919342_1 (director VARCHAR,original_title VARCHAR)
SELECT COUNT(director) FROM table_17919342_1 WHERE original_title = "The Moises Padilla Story"
what is the highest longitude for county mountrail and the water (sqmi) is less than 0.075?
CREATE TABLE table_name_38 (longitude INTEGER,county VARCHAR,water__sqmi_ VARCHAR)
SELECT MAX(longitude) FROM table_name_38 WHERE county = "mountrail" AND water__sqmi_ < 0.075
What country has a time of 6:49.28?
CREATE TABLE table_62949 ("Rank" real,"Rowers" text,"Country" text,"Time" text,"Notes" text)
SELECT "Country" FROM table_62949 WHERE "Time" = '6:49.28'
What's the version of AutoCAD Architectural Desktop 3?
CREATE TABLE table_19329117_1 (version VARCHAR,official_name VARCHAR)
SELECT version FROM table_19329117_1 WHERE official_name = "AutoCAD Architectural Desktop 3"
Tell me the pole winner of may 12
CREATE TABLE table_74484 ("Date" text,"Track" text,"Event Name" text,"Pole Winner" text,"Race Winner" text)
SELECT "Pole Winner" FROM table_74484 WHERE "Date" = 'may 12'
What is the score on 22 january 2008?
CREATE TABLE table_58448 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text)
SELECT "Score" FROM table_58448 WHERE "Date" = '22 january 2008'
These techs should you learn. Estimates, which technologies will be most synergic to your most well known technologies in the next DayDelta days. Use your network-wide account id, not your site account id! The result is 10-base logarithmic!
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId num...
WITH TagScores AS (SELECT PostTags.TagId, COUNT(*) AS Count FROM Posts, PostTags, Votes WHERE Posts.ParentId = PostTags.PostId AND Votes.PostId = Posts.Id AND Posts.OwnerUserId = @UserId AND Votes.VoteTypeId = 2 GROUP BY PostTags.TagId) SELECT * FROM TagScores, Tags WHERE Tags.Id = TagScores.TagId