instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Community Owned posts by User.
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views num...
SELECT Posts.Id AS "post_link", Posts.Title, Posts.AnswerCount, Posts.CommunityOwnedDate FROM Posts WHERE Posts.OwnerUserId = @UserId AND Posts.CommunityOwnedDate > 0 ORDER BY Posts.CommunityOwnedDate DESC
Bar chart x axis customer last name y axis how many customer last name, could you list from high to low by the X-axis?
CREATE TABLE Accounts (account_id INTEGER,customer_id INTEGER,account_name VARCHAR(50),other_account_details VARCHAR(255))CREATE TABLE Financial_Transactions (transaction_id INTEGER,previous_transaction_id INTEGER,account_id INTEGER,card_id INTEGER,transaction_type VARCHAR(15),transaction_date DATETIME,transaction_amou...
SELECT customer_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY customer_last_name DESC
How many starters are there at right tackle?
CREATE TABLE table_3284 ("Player" text,"Position" text,"Starter" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real)
SELECT COUNT("Starter") FROM table_3284 WHERE "Position" = 'Right tackle'
Name the most female life expectancy for djibouti
CREATE TABLE table_29258 ("Overall rank" real,"Country" text,"Overall life expectancy" real,"Male life expectancy" real,"Male rank" real,"Female life expectancy" real,"Female rank" real)
SELECT MAX("Female life expectancy") FROM table_29258 WHERE "Country" = 'Djibouti'
Find the person who has exactly one friend.
CREATE TABLE PersonFriend (name VARCHAR)
SELECT name FROM PersonFriend GROUP BY name HAVING COUNT(*) = 1
What is the ICAO for the airport in Ningbo?
CREATE TABLE table_name_54 (icao VARCHAR,city VARCHAR)
SELECT icao FROM table_name_54 WHERE city = "ningbo"
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the sum of revenue , and group by attribute founder, and I want to sort in ascending by the names.
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 Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
Name the position for european competitions of eurocup regular season
CREATE TABLE table_14899 ("Season" text,"Tier" text,"League" text,"Pos." text,"Postseason" text,"Cup competitions" text,"European competitions" text)
SELECT "Pos." FROM table_14899 WHERE "European competitions" = 'eurocup regular season'
What is the pba team for the player who went to santo tomas college?
CREATE TABLE table_name_50 (pba_team VARCHAR,college VARCHAR)
SELECT pba_team FROM table_name_50 WHERE college = "santo tomas"
What tournament had a 1 point margin of victory?
CREATE TABLE table_9532 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text)
SELECT "Tournament" FROM table_9532 WHERE "Margin of victory" = '1 point'
how many touchdowns did anthony hines and boo williams have altogether ?
CREATE TABLE table_203_8 (id number,"player" text,"rec." number,"yards" number,"avg." number,"td's" number,"long" number)
SELECT SUM("td's") FROM table_203_8 WHERE "player" IN ('anthony hines', 'boo williams')
Which year has a Round of 17?
CREATE TABLE table_name_2 (year VARCHAR,round VARCHAR)
SELECT year FROM table_name_2 WHERE round = "17"
What percentage of voters chose McCain in the county where 2.1% of voters voted third party?
CREATE TABLE table_20278716_2 (mccain__percentage VARCHAR,others__percentage VARCHAR)
SELECT mccain__percentage FROM table_20278716_2 WHERE others__percentage = "2.1%"
when did patient 005-87465 receive ondansetron prescription first during this month?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE lab (labi...
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 = '005-87465')) AND medication.drugname = 'ondansetron' AND DATET...
Who is the opponent of player phil graham?
CREATE TABLE table_name_72 (opponent VARCHAR,player VARCHAR)
SELECT opponent FROM table_name_72 WHERE player = "phil graham"
Name the try bonus for lost being 11 and losing bonus is 6
CREATE TABLE table_17941032_3 (try_bonus VARCHAR,lost VARCHAR,losing_bonus VARCHAR)
SELECT try_bonus FROM table_17941032_3 WHERE lost = "11" AND losing_bonus = "6"
What is the race 12 hours in length?
CREATE TABLE table_name_20 (race VARCHAR,length VARCHAR)
SELECT race FROM table_name_20 WHERE length = "12 hours"
Draw a bar chart about the distribution of ACC_Road and the amount of ACC_Road , and group by attribute ACC_Road.
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 ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road
Which money has a Country of united states, and a Place of t6?
CREATE TABLE table_50258 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real)
SELECT AVG("Money ( $ )") FROM table_50258 WHERE "Country" = 'united states' AND "Place" = 't6'
What was the maximum attendance when Chicago is the visiting team?
CREATE TABLE table_9841 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text)
SELECT MAX("Attendance") FROM table_9841 WHERE "Visitor" = 'chicago'
What is the school code of the accounting department?
CREATE TABLE professor (emp_num number,dept_code text,prof_office text,prof_extension text,prof_high_degree text)CREATE TABLE department (dept_code text,dept_name text,school_code text,emp_num number,dept_address text,dept_extension text)CREATE TABLE enroll (class_code text,stu_num number,enroll_grade text)CREATE TABLE...
SELECT school_code FROM department WHERE dept_name = "Accounting"
What is the average tries for less than 117 points and less than 48 tries against?
CREATE TABLE table_13973 ("Team" text,"Tries for" real,"Tries against" real,"Try diff" text,"Points for" real,"Points against" real,"Points diff" text)
SELECT AVG("Tries for") FROM table_13973 WHERE "Points for" < '117' AND "Tries against" < '48'
how many patients whose insurance is government and procedure long title is colonoscopy?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Colonoscopy"
What was the result of 10/18/1947?
CREATE TABLE table_48490 ("Date" text,"Opponent#" text,"Site" text,"Result" text,"Attendance" text)
SELECT "Result" FROM table_48490 WHERE "Date" = '10/18/1947'
what is the code of each location and the number of documents in that location?, display in desc by the X.
CREATE TABLE Employees (Employee_ID INTEGER,Role_Code CHAR(15),Employee_Name VARCHAR(255),Gender_MFU CHAR(1),Date_of_Birth DATETIME,Other_Details VARCHAR(255))CREATE TABLE All_Documents (Document_ID INTEGER,Date_Stored DATETIME,Document_Type_Code CHAR(15),Document_Name CHAR(255),Document_Description CHAR(255),Other_Det...
SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_Code DESC
what is death status and procedure short title of subject id 26285?
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.expire_flag, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "26285"
What is the end when moving from is listed as cary clarets?
CREATE TABLE table_17634290_7 (ends VARCHAR,moving_from VARCHAR)
SELECT ends FROM table_17634290_7 WHERE moving_from = "Cary Clarets"
the richmond kickers future made the national semifinals only once . what year was it ?
CREATE TABLE table_204_676 (id number,"year" number,"division" number,"league" text,"regular season" text,"playoffs" text,"open cup" text)
SELECT "year" FROM table_204_676 WHERE "playoffs" = 'national semifinals'
Give me a bar chart to show the proportion of each type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21', order by the X-axis in descending.
CREATE TABLE Residents_Services (resident_id INTEGER,service_id INTEGER,date_moved_in DATETIME,property_id INTEGER,date_requested DATETIME,date_provided DATETIME,other_details VARCHAR(255))CREATE TABLE Organizations (organization_id INTEGER,parent_organization_id INTEGER,organization_details VARCHAR(255))CREATE TABLE C...
SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21' GROUP BY Type_of_Thing_Code ORDER BY Type_of_Thing_Code DESC
When the venue was punt road oval, what was the Home teams score?
CREATE TABLE table_name_74 (home_team VARCHAR,venue VARCHAR)
SELECT home_team AS score FROM table_name_74 WHERE venue = "punt road oval"
How many times the number of adults and kids staying in a room reached the maximum capacity of the room?
CREATE TABLE reservations (code number,room text,checkin text,checkout text,rate number,lastname text,firstname text,adults number,kids number)CREATE TABLE rooms (roomid text,roomname text,beds number,bedtype text,maxoccupancy number,baseprice number,decor text)
SELECT COUNT(*) FROM reservations AS T1 JOIN rooms AS T2 ON T1.room = T2.roomid WHERE T2.maxoccupancy = T1.adults + T1.kids
Users from Poland by Reputation.
CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE Users (Id number,Re...
SELECT Reputation, DisplayName, Location FROM Users WHERE LOWER(Location) LIKE '%poland%' ORDER BY Reputation DESC
display all the flights from BALTIMORE to DALLAS which leave after 1600
CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name 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, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.departure_time > 1600 AND flight.to_airport = AIRPORT_SERVICE_1.airpor...
Which competition has a Goal of deacon 8/8 and a Score of 32-14?
CREATE TABLE table_58218 ("Date" text,"Competition" text,"Venue" text,"Result" text,"Score" text,"Goals" text)
SELECT "Competition" FROM table_58218 WHERE "Goals" = 'deacon 8/8' AND "Score" = '32-14'
What is the average Total for the United States with a To par more than 6 and 1996 was won?
CREATE TABLE table_14482 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real)
SELECT AVG("Total") FROM table_14482 WHERE "Country" = 'united states' AND "To par" > '6' AND "Year(s) won" = '1996'
What is the highest Total, when Season is '1996-97', and when Second is less than 33?
CREATE TABLE table_61391 ("Season" text,"Premier" real,"First" real,"Second" real,"Total" real)
SELECT MAX("Total") FROM table_61391 WHERE "Season" = '1996-97' AND "Second" < '33'
What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check
CREATE TABLE payments (payment_id number,booking_id number,customer_id number,payment_type_code text,amount_paid_in_full_yn text,payment_date time,amount_due number,amount_paid number)CREATE TABLE bookings (booking_id number,customer_id number,booking_status_code text,returned_damaged_yn text,booking_start_date time,bo...
SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check'
who finished next after kaitlin sandeno ?
CREATE TABLE table_204_902 (id number,"rank" number,"name" text,"nationality" text,"time" text,"notes" text)
SELECT "name" FROM table_204_902 WHERE "rank" = (SELECT "rank" FROM table_204_902 WHERE "name" = 'kaitlin sandeno') + 1
what is the four, the most frequent input event in 2102?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_items (row_id numbe...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) = '2102' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 4)
What is the nationality of the player from Drexel who had a pick larger than 183?
CREATE TABLE table_75085 ("Round" real,"Pick" real,"Player" text,"Nationality" text,"School/Club Team" text)
SELECT "Nationality" FROM table_75085 WHERE "Pick" > '183' AND "School/Club Team" = 'drexel'
give me the difference between patient 006-122567's total input and the total output on 07/11/2101?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsy...
SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-122567')) AND intakeoutput.cellpath ...
How many assists did Delisha Milton-Jones make?
CREATE TABLE table_19722664_5 (assists VARCHAR,player VARCHAR)
SELECT assists FROM table_19722664_5 WHERE player = "DeLisha Milton-Jones"
What is the fewest number of wickets recorded?
CREATE TABLE table_27922491_20 (wickets INTEGER)
SELECT MIN(wickets) FROM table_27922491_20
Who was the sponsor on April 22, 2004?
CREATE TABLE table_56608 ("Congress" text,"Bill number" text,"Date introduced" text,"Sponsor" text,"# of cosponsors" real)
SELECT "Sponsor" FROM table_56608 WHERE "Date introduced" = 'april 22, 2004'
What is the sum of capacity of cinemas open for each year? Return a line chart, could you display from low to high by the x axis please?
CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price float)CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Location text)CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_cod...
SELECT Openning_year, SUM(Capacity) FROM cinema ORDER BY Openning_year
What's the D 42 when D 46 is majority ?
CREATE TABLE table_54080 ("D 39 \u221a" text,"D 40 \u221a" text,"D 41 \u221a" text,"D 42 \u221a" text,"D 43 \u221a" text,"D 44 \u221a" text,"D 45 \u221a" text,"D 46 \u221a" text,"D 47 \u221a" text,"D 48 \u221a" text)
SELECT "D 42 \u221a" FROM table_54080 WHERE "D 46 \u221a" = 'majority→'
What is the Artist of the Song with a Place of withdrawn?
CREATE TABLE table_63022 ("Artist" text,"Song" text,"Lyrics (l) / Music (m)" text,"Votes" text,"Place" text)
SELECT "Artist" FROM table_63022 WHERE "Place" = 'withdrawn'
What 8 -credit course are there ?
CREATE TABLE area (course_id int,area varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time...
SELECT DISTINCT name, number FROM course WHERE credits = 8 AND department = 'EECS'
Which Body Width/mm has a Lead Pitch/mm smaller than 0.55, and a Part Number of tsop48?
CREATE TABLE table_name_63 (body_width_mm INTEGER,lead_pitch_mm VARCHAR,part_number VARCHAR)
SELECT MIN(body_width_mm) FROM table_name_63 WHERE lead_pitch_mm < 0.55 AND part_number = "tsop48"
papers by mayank goel
CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE field (fieldid int)CREATE TABLE author (...
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'mayank goel' AND writes.authorid = author.authorid
What is To Par, when Country is 'Australia'?
CREATE TABLE table_62113 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "To par" FROM table_62113 WHERE "Country" = 'australia'
How many different departments are there?
CREATE TABLE professor (emp_num number,dept_code text,prof_office text,prof_extension text,prof_high_degree text)CREATE TABLE employee (emp_num number,emp_lname text,emp_fname text,emp_initial text,emp_jobcode text,emp_hiredate time,emp_dob time)CREATE TABLE student (stu_num number,stu_lname text,stu_fname text,stu_ini...
SELECT COUNT(DISTINCT dept_name) FROM department
List the first name and last name of customers have the amount of outstanding between 1000 and 3000.
CREATE TABLE Customers (first_name VARCHAR,last_name VARCHAR,amount_outstanding INTEGER)
SELECT first_name, last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000
List the names of all distinct wines that have scores higher than 90.
CREATE TABLE WINE (Name VARCHAR,score INTEGER)
SELECT Name FROM WINE WHERE score > 90
give me a flight from CHARLOTTE to BALTIMORE on tuesday morning
CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE date_day (month_number int,day_numbe...
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 = 22 AND DATE_DAYalias0.month_number = 3 AND DATE_DAYalias0.year = 1991)) AND to...
What is every value for Under-11 when value of under-17 is Salma Nassar?
CREATE TABLE table_26368963_2 (under_11 VARCHAR,under_17 VARCHAR)
SELECT under_11 FROM table_26368963_2 WHERE under_17 = "Salma Nassar"
what is the average water % for mulberry ?
CREATE TABLE table_203_729 (id number,"township" text,"fips" number,"population\ncenter" text,"population" number,"population\ndensity\n/km2 (/sq mi)" text,"land area\nkm2 (sq mi)" text,"water area\nkm2 (sq mi)" text,"water %" text,"geographic coordinates" text)
SELECT "water %" FROM table_203_729 WHERE "township" = 'mulberry'
when did first patient 2238 have the minimum value of fibrinogen, functional in 04/last year?
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 diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE chartevents (row_id number,subject_id number,...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2238) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'fibrinogen, functional') AND DATETIME(labevents.charttime, 'start of year') = DA...
What is FA Cup Goals, when Euro Competitions is 1, and when League Goals is 11?
CREATE TABLE table_name_75 (fa_cup_goals VARCHAR,euro_competitions VARCHAR,league_goals VARCHAR)
SELECT fa_cup_goals FROM table_name_75 WHERE euro_competitions = "1" AND league_goals = "11"
the systemicmean of patient 006-167444 second measured on the first intensive care unit visit was less than the first value measured on the first intensive care unit visit?
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 treatment (treatmentid number,patientunitstayid number,treatmentname text,...
SELECT (SELECT vitalperiodic.systemicmean FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-167444') AND NOT patient.unitdischargetime...
Which conference is in Portland, Oregon?
CREATE TABLE table_name_80 (conference VARCHAR,city VARCHAR)
SELECT conference FROM table_name_80 WHERE city = "portland, oregon"
what's the character with fate being deceased: knife wound
CREATE TABLE table_72161 ("Character" text,"Fate" text,"Actor" text,"First Episode" text,"Final Episode" text,"Duration" text,"Final Episode Count" real)
SELECT "Character" FROM table_72161 WHERE "Fate" = 'Deceased: Knife Wound'
Can you tell me the Week that has the Home Team of detroit, and the Divisional Record of (3-0), and the Overall Record of (5-1), and the Away Team of minnesota?
CREATE TABLE table_42189 ("Week" real,"Home Team" text,"Away Team" text,"Overall Record" text,"Divisional Record" text)
SELECT "Week" FROM table_42189 WHERE "Home Team" = 'detroit' AND "Divisional Record" = '(3-0)' AND "Overall Record" = '(5-1)' AND "Away Team" = 'minnesota'
High scoring posts per month.
CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate tim...
SELECT LAST_DATE_OF_MONTH(CreationDate), COUNT(Id) AS Posts, SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS Questions, SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS Answers FROM Posts WHERE Score >= '##min?50##' GROUP BY LAST_DATE_OF_MONTH(CreationDate) ORDER BY LAST_DATE_OF_MONTH(CreationDate)
What song was 2nd (25,517) in televoting (votes)?
CREATE TABLE table_79339 ("Draw" real,"Singer" text,"Song" text,"Televoting (votes)" text,"Jury" text,"Place" text)
SELECT "Song" FROM table_79339 WHERE "Televoting (votes)" = '2nd (25,517)'
Find the student ID and personal name of the student with at least two enrollments. Plot them as pie chart.
CREATE TABLE Students (student_id INTEGER,date_of_registration DATETIME,date_of_latest_logon DATETIME,login_name VARCHAR(40),password VARCHAR(10),personal_name VARCHAR(40),middle_name VARCHAR(40),family_name VARCHAR(40))CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))CREATE TABLE Course_Authors_and_...
SELECT T2.personal_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id
From what Country is T2 Finish Player Gary Player?
CREATE TABLE table_name_60 (country VARCHAR,finish VARCHAR,player VARCHAR)
SELECT country FROM table_name_60 WHERE finish = "t2" AND player = "gary player"
On what date did ke eaumoku p pa iahiahi leave office?
CREATE TABLE table_name_25 (left_office VARCHAR,name VARCHAR)
SELECT left_office FROM table_name_25 WHERE name = "ke ʻ eaumoku pāpa ʻ iahiahi"
Who was the developer of XCom: Enemy Unknown?
CREATE TABLE table_66448 ("Year" real,"Game" text,"Genre" text,"Platform(s)" text,"Developer(s)" text)
SELECT "Developer(s)" FROM table_66448 WHERE "Game" = 'xcom: enemy unknown'
WHERE filtering with dates and BETWEEN.
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number...
SELECT * FROM dbo.Users WHERE CreationDate BETWEEN '2016/01/01' AND '2016/12/31'
What was the maximum 09-10 i/o best?
CREATE TABLE table_27252 ("Rank" real,"WS Points" real,"Name" text,"Country" text,"09-10 I/O best" real,"09-10 GP/JGP best" real,"09-10 GP/JGP 2nd" real,"09-10 OI best" real,"09-10 OI 2nd" real,"08-09 I/O best" real,"08-09 GP/JGP best" real,"08-09 GP/JGP 2nd" real,"08-09 OI best" real,"08-09 OI 2nd" real)
SELECT MAX("09-10 I/O best") FROM table_27252
What's the average Played for a draw of 5 and more than 43 points?
CREATE TABLE table_61715 ("Pos." real,"Club" text,"Points" real,"Played" real,"Wins" real,"Draw" real,"Lost" real)
SELECT AVG("Played") FROM table_61715 WHERE "Draw" = '5' AND "Points" > '43'
what is the number of patients whose year of birth is less than 2065 and diagnoses short title is malig neo ascend colon?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2065" AND diagnoses.short_title = "Malig neo ascend colon"
How many drawn having more than 9 points?
CREATE TABLE table_name_86 (drawn INTEGER,points INTEGER)
SELECT SUM(drawn) FROM table_name_86 WHERE points > 9
Who was Fourth in the 2008 Telstra Men's Pro Event?
CREATE TABLE table_name_93 (fourth VARCHAR,event VARCHAR)
SELECT fourth FROM table_name_93 WHERE event = "2008 telstra men's pro"
What is the bowling style of chris harris?
CREATE TABLE table_17263 ("No." text,"Player" text,"Date of Birth" text,"Batting Style" text,"Bowling Style" text,"First Class Team" text)
SELECT "Bowling Style" FROM table_17263 WHERE "Player" = 'Chris Harris'
How many episodes did actress Vanessa Ferlito appear in?
CREATE TABLE table_16571 ("Character" text,"Portrayed by" text,"First appearance" text,"Last appearance" text,"Duration" text,"Episodes" text)
SELECT "Episodes" FROM table_16571 WHERE "Portrayed by" = 'Vanessa Ferlito'
What are the names and headquarters of all companies ordered by descending market value?
CREATE TABLE company (company_id number,rank number,company text,headquarters text,main_industry text,sales_billion number,profits_billion number,assets_billion number,market_value number)CREATE TABLE station_company (station_id number,company_id number,rank_of_the_year number)CREATE TABLE gas_station (station_id numbe...
SELECT company, headquarters FROM company ORDER BY market_value DESC
how many competitors were from the soviet union ?
CREATE TABLE table_204_912 (id number,"rank" number,"athlete" text,"country" text,"time" number,"notes" text)
SELECT COUNT("athlete") FROM table_204_912 WHERE "country" = 'soviet union'
In what event is the opponent Joe Nameth?
CREATE TABLE table_name_25 (event VARCHAR,opponent VARCHAR)
SELECT event FROM table_name_25 WHERE opponent = "joe nameth"
For each competition, count the number of matches, and rank in desc by the X-axis.
CREATE TABLE city (City_ID int,City text,Hanzi text,Hanyu_Pinyin text,Regional_Population int,GDP real)CREATE TABLE hosting_city (Year int,Match_ID int,Host_City text)CREATE TABLE temperature (City_ID int,Jan real,Feb real,Mar real,Apr real,Jun real,Jul real,Aug real,Sep real,Oct real,Nov real,Dec real)CREATE TABLE mat...
SELECT Competition, COUNT(*) FROM match GROUP BY Competition ORDER BY Competition DESC
What score did Australia get?
CREATE TABLE table_48047 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real)
SELECT "Score" FROM table_48047 WHERE "Country" = 'australia'
What is the average week with St. Louis Cardinals with less than 80,010 attendance?
CREATE TABLE table_name_99 (week INTEGER,opponent VARCHAR,attendance VARCHAR)
SELECT AVG(week) FROM table_name_99 WHERE opponent = "st. louis cardinals" AND attendance < 80 OFFSET 010
Which tie number had an away team of Arsenal?
CREATE TABLE table_79560 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Tie no" FROM table_79560 WHERE "Away team" = 'arsenal'
who was the trofeo fast team in stage 10?
CREATE TABLE table_78047 ("Stage" text,"Winner" text,"General classification" text,"Points classification" text,"Trofeo Fast Team" text)
SELECT "Trofeo Fast Team" FROM table_78047 WHERE "Stage" = '10'
What is the score when Fulham is the away team?
CREATE TABLE table_47836 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Score" FROM table_47836 WHERE "Away team" = 'fulham'
how much ns was prescribed during this month for the first time to patient 76332?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icus...
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76332) AND prescriptions.drug = 'ns' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY presc...
How many people attended the game when the game was won 4-2?
CREATE TABLE table_name_44 (attendance VARCHAR,result VARCHAR)
SELECT COUNT(attendance) FROM table_name_44 WHERE result = "won 4-2"
What is the total revenue of each manufacturer, sort in ascending by the names.
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 Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY Name
What is the highest number of byes where the losses were 9 and the draws were less than 0?
CREATE TABLE table_name_93 (byes INTEGER,losses VARCHAR,draws VARCHAR)
SELECT MAX(byes) FROM table_name_93 WHERE losses = 9 AND draws < 0
what author is most cited ?
CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE paperdataset (paperid int,dataset...
SELECT DISTINCT author.authorname, COUNT(cite.citingpaperid) FROM author, cite, writes WHERE writes.authorid = author.authorid AND writes.paperid = cite.citedpaperid GROUP BY author.authorname ORDER BY COUNT(cite.citingpaperid) DESC
Which Wind* has a Nationality of united states, and an Athlete of jackie joyner-kersee?
CREATE TABLE table_13118 ("Mark" text,"Wind*" text,"Athlete" text,"Nationality" text,"Venue" text,"Date" text)
SELECT "Wind*" FROM table_13118 WHERE "Nationality" = 'united states' AND "Athlete" = 'jackie joyner-kersee'
What episode has a manual motorcycle transmissions section D?
CREATE TABLE table_name_20 (episode INTEGER,segment_d VARCHAR)
SELECT SUM(episode) FROM table_name_20 WHERE segment_d = "manual motorcycle transmissions"
What was the score when andray blatche , al thornton (20) had the high points?
CREATE TABLE table_29827 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Score" FROM table_29827 WHERE "High points" = 'Andray Blatche , Al Thornton (20)'
what is the least different holders when the country is ireland and giro wins is less than 1?
CREATE TABLE table_65198 ("Rank" text,"Country" text,"Jerseys" real,"Giro wins" real,"Points" real,"Young rider" real,"Most recent cyclist" text,"Most recent date" text,"Different holders" real)
SELECT MIN("Different holders") FROM table_65198 WHERE "Country" = 'ireland' AND "Giro wins" < '1'
What was the result on 27 august 2003?
CREATE TABLE table_name_81 (result VARCHAR,date VARCHAR)
SELECT result FROM table_name_81 WHERE date = "27 august 2003"
What is the lowest December, when Score is '4 - 4'?
CREATE TABLE table_name_66 (december INTEGER,score VARCHAR)
SELECT MIN(december) FROM table_name_66 WHERE score = "4 - 4"
Find the name of organizations whose names contain 'Party'.
CREATE TABLE individuals (individual_id number,individual_first_name text,individual_middle_name text,inidividual_phone text,individual_email text,individual_address text,individual_last_name text)CREATE TABLE party_services (booking_id number,customer_id number,service_id number,service_datetime time,booking_made_date...
SELECT organization_name FROM organizations WHERE organization_name LIKE "%Party%"
Which week was the December 21, 2003 game?
CREATE TABLE table_14135 ("Week" real,"Date" text,"Opponent" text,"Result" text,"TV Time" text,"Attendance" text)
SELECT "Week" FROM table_14135 WHERE "Date" = 'december 21, 2003'
when were patient 20332 first prescribed for aspirin and potassium chl 20 meq / 1000 ml d5 1/2 ns at the same time?
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE microbiologyev...
SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'aspirin' AND admissions.subject_id = 20332) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JO...