instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What year was the player with the height 2.04 born?
CREATE TABLE table_12962773_12 (year_born INTEGER,height VARCHAR)
SELECT MIN(year_born) FROM table_12962773_12 WHERE height = "2.04"
What number pick was the player with the hometown school of concordia college?
CREATE TABLE table_name_96 (pick VARCHAR,hometown_school VARCHAR)
SELECT pick FROM table_name_96 WHERE hometown_school = "concordia college"
Which rank has a more than 0 silver, 4 bronze, and a total smaller than 10?
CREATE TABLE table_name_34 (rank INTEGER,total VARCHAR,silver VARCHAR,bronze VARCHAR)
SELECT SUM(rank) FROM table_name_34 WHERE silver > 0 AND bronze = 4 AND total < 10
Which FCC info has an ERP W of 100 watts?
CREATE TABLE table_75667 ("Call sign" text,"Frequency MHz" text,"City of license" text,"ERP W" text,"FCC info" text)
SELECT "FCC info" FROM table_75667 WHERE "ERP W" = '100 watts'
What position does the saint louis player play?
CREATE TABLE table_name_39 (position VARCHAR,college VARCHAR)
SELECT position FROM table_name_39 WHERE college = "saint louis"
Name the total points for 2
CREATE TABLE table_27496841_3 (total_points VARCHAR,place VARCHAR)
SELECT total_points FROM table_27496841_3 WHERE place = 2
What medal was awarded in the men's freestyle 52 kg?
CREATE TABLE table_35155 ("Medal" text,"Name" text,"Games" text,"Sport" text,"Event" text)
SELECT "Medal" FROM table_35155 WHERE "Event" = 'men''s freestyle 52 kg'
When the away team was geelong, what was the away team score?
CREATE TABLE table_10951 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team score" FROM table_10951 WHERE "Away team" = 'geelong'
Name the number of events for 3031
CREATE TABLE table_26589 ("#" real,"Player" text,"Country" text,"Points" real,"Reset points" real,"Events" real)
SELECT COUNT("Events") FROM table_26589 WHERE "Points" = '3031'
for how long did the patient id 8323 remain admitted in hospital? also specify death status
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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "8323"
Which venue had an opponent of Sunderland and a result of a 1-1 draw?
CREATE TABLE table_63248 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real)
SELECT "Venue" FROM table_63248 WHERE "Opponent" = 'sunderland' AND "Result" = '1-1'
name the player for number 5
CREATE TABLE table_26229 ("No" real,"Player" text,"Height (m)" text,"Height (f)" text,"Position" text,"Year born" real,"Current Club" text)
SELECT "Player" FROM table_26229 WHERE "No" = '5'
What is the country of Palmers Shipbuilding and Iron Company?
CREATE TABLE table_13011 ("Country" text,"Builder" text,"Location" text,"Ship" text,"Class / type" text)
SELECT "Country" FROM table_13011 WHERE "Builder" = 'palmers shipbuilding and iron company'
What is the Pick # with an Overall of 19?
CREATE TABLE table_36615 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT MAX("Pick #") FROM table_36615 WHERE "Overall" = '19'
Who is the perpetrator in Bait Al-Aqari?
CREATE TABLE table_12652 ("Perpetrator" text,"Year" text,"Location" text,"Country" text,"Killed" text)
SELECT "Perpetrator" FROM table_12652 WHERE "Location" = 'bait al-aqari'
What's the Uni# of Timms, who has bats of R?
CREATE TABLE table_name_22 (uni_number VARCHAR,bats VARCHAR,surname VARCHAR)
SELECT uni_number FROM table_name_22 WHERE bats = "r" AND surname = "timms"
What is Score, when Place is 'T8', and when Player is 'Orville Moody'?
CREATE TABLE table_name_40 (score VARCHAR,place VARCHAR,player VARCHAR)
SELECT score FROM table_name_40 WHERE place = "t8" AND player = "orville moody"
What are the descriptions for the aircrafts, and count them by a bar chart
CREATE TABLE airport_aircraft (ID int,Airport_ID int,Aircraft_ID int)CREATE TABLE pilot (Pilot_Id int(11),Name varchar(50),Age int(11))CREATE TABLE match (Round real,Location text,Country text,Date text,Fastest_Qualifying text,Winning_Pilot text,Winning_Aircraft text)CREATE TABLE airport (Airport_ID int,Airport_Name te...
SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description
What is the Name with an Opened (closing date if defunct) of 1995 and has a Length of miles (m), in Illinois?
CREATE TABLE table_35745 ("Name" text,"Location" text,"State" text,"Opened (closing date if defunct)" text,"Surface" text,"Length" text)
SELECT "Name" FROM table_35745 WHERE "Opened (closing date if defunct)" = '1995' AND "Length" = 'miles (m)' AND "State" = 'illinois'
Find the number of patients who were transferred within this facility and were born before the year 2150.
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 text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "2150"
Name the nation when bronze is less than 4 and the total is more than 4
CREATE TABLE table_name_46 (nation VARCHAR,total VARCHAR,bronze VARCHAR)
SELECT nation FROM table_name_46 WHERE total > 4 AND bronze < 4
On what date was Mike Jackson a handler at the Indianapolis Boat, Sport & Travel Show?
CREATE TABLE table_51074 ("Date" text,"Distance" text,"Handler" text,"Event" text,"Location" text)
SELECT "Date" FROM table_51074 WHERE "Handler" = 'mike jackson' AND "Event" = 'indianapolis boat, sport & travel show'
For the Venue of western oval, what's the Away team playing?
CREATE TABLE table_54575 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team" FROM table_54575 WHERE "Venue" = 'western oval'
what are the top four common diagnoses that patients were diagnosed with within the same hospital visit after having been diagnosed with thrombocytopenia - alcohol-related since 2105?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,...
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'throm...
Name the number of direction for debrecen
CREATE TABLE table_23211 ("Further Cities" text,"County,Oblast or State" text,"Country" text,"Distance" text,"Direction" text)
SELECT COUNT("Direction") FROM table_23211 WHERE "Further Cities" = 'Debrecen'
when does the train departuring at 11.35 arrive
CREATE TABLE table_18333678_2 (arrival VARCHAR,departure VARCHAR)
SELECT arrival FROM table_18333678_2 WHERE departure = "11.35"
what is the minimum stage where mountains classification is aitor osa and aitor gonz lez won?
CREATE TABLE table_19858 ("Stage" real,"Winner" text,"General classification" text,"Points classification" text,"Mountains classification" text,"Combination classification" text,"Team classification" text)
SELECT MIN("Stage") FROM table_19858 WHERE "Mountains classification" = 'Aitor Osa' AND "Winner" = 'Aitor González'
What was the time of the games that took place at the cassell coliseum blacksburg, va?
CREATE TABLE table_74398 ("Date" text,"Time" text,"ACC Team" text,"Big Ten Team" text,"Location" text,"Television" text,"Attendance" real,"Winner" text,"Challenge Leader" text)
SELECT "Time" FROM table_74398 WHERE "Location" = 'Cassell Coliseum • Blacksburg, VA'
Who was the writer in the episode directed by Jesse Peretz?
CREATE TABLE table_3683 ("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 "Written by" FROM table_3683 WHERE "Directed by" = 'Jesse Peretz'
What time span is listed under years for the 96th congres?
CREATE TABLE table_4022 ("Representative" text,"Party" text,"Years" text,"Congress" text,"District Home" text,"Occupation" text,"Electoral history" text)
SELECT "Years" FROM table_4022 WHERE "Congress" = '96th'
compared to last measured on the first hospital visit is chloride of patient 97121 less than second to last measured on the first hospital visit?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)C...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97121 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ...
how many patients stayed in hospital for more than 34 days and were procedured with icd9 code 3931?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "34" AND procedures.icd9_code = "3931"
Take the average of the school enrollment.
CREATE TABLE school_details (school_id number,nickname text,colors text,league text,class text,division text)CREATE TABLE school (school_id number,school text,location text,enrollment number,founded number,denomination text,boys_or_girls text,day_or_boarding text,year_entered_competition number,school_colors text)CREAT...
SELECT AVG(enrollment) FROM school
what was patient 025-44495's first sputum, tracheal specimen microbiology test time since 09/2105.
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 microlab (microlabid number,patientunitstayid number,culturesite text,organism text,cultu...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, tracheal specime...
Which home team played against the away team Carlton?
CREATE TABLE table_56902 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team" FROM table_56902 WHERE "Away team" = 'carlton'
What TV network is the series aistr em aired on?
CREATE TABLE table_name_21 (tv_network_s_ VARCHAR,alternate_title_translation VARCHAR)
SELECT tv_network_s_ FROM table_name_21 WHERE alternate_title_translation = "aistrų žemė"
what is november 3 when june 10-11 is june 10, 1964?
CREATE TABLE table_25355392_2 (november_3 VARCHAR,june_10_11 VARCHAR)
SELECT november_3 FROM table_25355392_2 WHERE june_10_11 = "June 10, 1964"
when did patient 027-149724 get for the last time a lab test since 29 months ago?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE allergy (allergyid number,patientunits...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-149724')) AND DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-29 mont...
What is the title for the Korean progran on KBS2?
CREATE TABLE table_47993 ("Year" real,"Network" text,"Title" text,"Notes" text,"Language" text)
SELECT "Title" FROM table_47993 WHERE "Language" = 'korean' AND "Network" = 'kbs2'
Who is the professional partner of celebrity ma gorzata foremniak with a season less than 7, an average greater than 34.66, and a rank less than 10?
CREATE TABLE table_name_52 (professional_partner VARCHAR,celebrity VARCHAR,rank VARCHAR,season VARCHAR,average VARCHAR)
SELECT professional_partner FROM table_name_52 WHERE season < 7 AND average > 34.66 AND rank < 10 AND celebrity = "małgorzata foremniak"
Bin the hire date of employees into the day of week interval and count them for visualizing a bar chart, and rank in asc by the total number.
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 job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE regions (REGIO...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees ORDER BY COUNT(HIRE_DATE)
Which Result has a Score of 4-1, and a Competition of world cup qualifying?
CREATE TABLE table_34793 ("Date" text,"Result" text,"Score" text,"Brazil scorers" text,"Competition" text)
SELECT "Result" FROM table_34793 WHERE "Score" = '4-1' AND "Competition" = 'world cup qualifying'
now i need flight information leaving ATLANTA and arriving in BALTIMORE in the afternoon
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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTI...
What was the To par of Jack Nicklaus?
CREATE TABLE table_45304 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" text)
SELECT "To par" FROM table_45304 WHERE "Player" = 'jack nicklaus'
what is the most draw when the competition is soviet league and dynamo is more than 34?
CREATE TABLE table_name_19 (draw INTEGER,competition VARCHAR,dynamo VARCHAR)
SELECT MAX(draw) FROM table_name_19 WHERE competition = "soviet league" AND dynamo > 34
COunt the Founded which has a Venue of villa park?
CREATE TABLE table_8187 ("Club" text,"Sport" text,"Founded" real,"League" text,"Venue" text)
SELECT SUM("Founded") FROM table_8187 WHERE "Venue" = 'villa park'
In Ghent in 2011, what was the rank-qualifying value when the score-qualifying value was 14.850
CREATE TABLE table_26681728_1 (rank_qualifying INTEGER,score_qualifying VARCHAR,location VARCHAR,year VARCHAR)
SELECT MAX(rank_qualifying) FROM table_26681728_1 WHERE location = "Ghent" AND year = 2011 AND score_qualifying = "14.850"
Find the details for all chip models.
CREATE TABLE screen_mode (graphics_mode number,char_cells text,pixels text,hardware_colours number,used_kb number,map text,type text)CREATE TABLE phone (company_name text,hardware_model_name text,accreditation_type text,accreditation_level text,date text,chip_model text,screen_mode text)CREATE TABLE chip_model (model_n...
SELECT * FROM chip_model
Show the number of documents created in each day and bin document date by weekday with a bar chart, and I want to show by the the number of document date in ascending please.
CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CREATE TABLE Accounts (Account_ID INTEGER,Statement_ID INTEGER,Account_Details VARCHAR(255))CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR(15),Budget_Type_Description VARCHAR(255))CR...
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code ORDER BY COUNT(Document_Date)
what is the number of patients whose days of hospital stay is greater than 15 and diagnoses short title is respiratory distress syn?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "15" AND diagnoses.short_title = "Respiratory distress syn"
How many million U.S. viewers watched episode number 6 in the series?
CREATE TABLE table_25668962_1 (us_viewers__million_ VARCHAR,no_in_series VARCHAR)
SELECT us_viewers__million_ FROM table_25668962_1 WHERE no_in_series = 6
Which Game is the highest one that has High rebounds of pau gasol (11)?
CREATE TABLE table_name_12 (game INTEGER,high_rebounds VARCHAR)
SELECT MAX(game) FROM table_name_12 WHERE high_rebounds = "pau gasol (11)"
What was the second qualification time with a first qualification time of 1:02.813?
CREATE TABLE table_name_29 (qual_2 VARCHAR,qual_1 VARCHAR)
SELECT qual_2 FROM table_name_29 WHERE qual_1 = "1:02.813"
What position was the player who was drafted by the Washington Capitals?
CREATE TABLE table_2850912_10 (position VARCHAR,nhl_team VARCHAR)
SELECT position FROM table_2850912_10 WHERE nhl_team = "Washington Capitals"
For those employees who was hired before 2002-06-21, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and I want to sort by the y-axis in desc.
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 jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE departments (DEPARTMENT_ID decima...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC
Name the literature for pradit prasarttong
CREATE TABLE table_67645 ("Year" real,"Literature" text,"Music" text,"Film" text,"Performing arts" text)
SELECT "Literature" FROM table_67645 WHERE "Performing arts" = 'pradit prasarttong'
What is the years coached by the person with a win percentage of 0.667 and 380 losses?
CREATE TABLE table_34993 ("Name" text,"Years" text,"Seasons" real,"Lost" real,"Pct." real)
SELECT "Years" FROM table_34993 WHERE "Pct." = '0.667' AND "Lost" = '380'
which project had greatest number of platforms ?
CREATE TABLE table_204_398 (id number,"title" text,"year" number,"publisher" text,"developer" text,"platforms" text)
SELECT "title" FROM table_204_398 ORDER BY "platforms" DESC LIMIT 1
provide the number of patients whose insurance is government and procedure icd9 code is 92?
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 lab (subject_id text,hadm_id text,itemid text,charttime te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.icd9_code = "92"
What is College of Ohio State's pick number with an overall lower than 145?
CREATE TABLE table_name_42 (pick__number VARCHAR,overall VARCHAR,college VARCHAR)
SELECT pick__number FROM table_name_42 WHERE overall < 145 AND college = "ohio state"
What was the date when the opponent was Sheffield Scimitars and the venue was Home?
CREATE TABLE table_name_4 (date VARCHAR,opponent VARCHAR,venue VARCHAR)
SELECT date FROM table_name_4 WHERE opponent = "sheffield scimitars" AND venue = "home"
Which Rank has a Silver of 1, and a Gold of 0, and a Nation of austria?
CREATE TABLE table_65989 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT "Rank" FROM table_65989 WHERE "Silver" = '1' AND "Gold" = '0' AND "Nation" = 'austria'
What is the highest amount of points for rank 95?
CREATE TABLE table_name_49 (highest_point VARCHAR,rank VARCHAR)
SELECT highest_point FROM table_name_49 WHERE rank = 95
Show the customer name, customer address city, date from, and date to for each customer address history.
CREATE TABLE order_items (order_item_id number,order_id number,product_id number,order_quantity text)CREATE TABLE customers (customer_id number,payment_method_code text,customer_number text,customer_name text,customer_address text,customer_phone text,customer_email text)CREATE TABLE customer_address_history (customer_i...
SELECT T2.customer_name, T3.city, T1.date_from, T1.date_to FROM customer_address_history AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id JOIN addresses AS T3 ON T1.address_id = T3.address_id
What is the maximum t20 on green lane?
CREATE TABLE table_1176371_1 (t20_matches INTEGER,name_of_ground VARCHAR)
SELECT MAX(t20_matches) FROM table_1176371_1 WHERE name_of_ground = "Green Lane"
Most questions with upvoted self-answers.
CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModera...
SELECT q.OwnerUserId AS "user_link", COUNT(DISTINCT q.Id) AS "count" FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId WHERE q.OwnerUserId = a.OwnerUserId AND a.Score > 0 GROUP BY q.OwnerUserId ORDER BY 'count' DESC
What is the largest number of episodes for a 1989 season dvd release?
CREATE TABLE table_1753 ("DVD Title" text,"No. of Discs" real,"Year" text,"No. of Episodes" real,"Region 1" text,"Region 2" text,"Region 4" text)
SELECT MAX("No. of Episodes") FROM table_1753 WHERE "Year" = '1989'
How many millions of U.S. viewers watched the episode titled 'New Beginnings'?
CREATE TABLE table_30683 ("No. in series" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (million)" text)
SELECT "U.S. viewers (million)" FROM table_30683 WHERE "Title" = 'New Beginnings'
Bar chart, the-axis is the state, and the Y axis is each state's the smallest enrollment.
CREATE TABLE College (cName varchar(20),state varchar(2),enr numeric(5,0))CREATE TABLE Player (pID numeric(5,0),pName varchar(20),yCard varchar(3),HS numeric(5,0))CREATE TABLE Tryout (pID numeric(5,0),cName varchar(20),pPos varchar(8),decision varchar(3))
SELECT state, MIN(enr) FROM College GROUP BY state
When dwhr-tv is the call sign how many station types are there?
CREATE TABLE table_23394920_1 (station_type VARCHAR,callsign VARCHAR)
SELECT COUNT(station_type) FROM table_23394920_1 WHERE callsign = "DWHR-TV"
What is the average Wins, when Points is less than '19'?
CREATE TABLE table_name_32 (wins INTEGER,points INTEGER)
SELECT AVG(wins) FROM table_name_32 WHERE points < 19
how many mayors were in office for a total of 9 years ?
CREATE TABLE table_201_10 (id number,"#" number,"name" text,"office" text,"political party" text,"occupation" text)
SELECT COUNT("name") FROM table_201_10 WHERE "office" - "office" = 9
Who got the loss for the game ending in a record of 55-41?
CREATE TABLE table_name_74 (loss VARCHAR,record VARCHAR)
SELECT loss FROM table_name_74 WHERE record = "55-41"
Which venue has 1st as the result?
CREATE TABLE table_name_45 (venue VARCHAR,result VARCHAR)
SELECT venue FROM table_name_45 WHERE result = "1st"
What was the average year for a coin that had a mintage smaller than 10,000?
CREATE TABLE table_name_13 (year INTEGER,mintage INTEGER)
SELECT AVG(year) FROM table_name_13 WHERE mintage < 10 OFFSET 000
Name the south american rank for venezuela
CREATE TABLE table_2249087_1 (south_american_rank INTEGER,nation VARCHAR)
SELECT MIN(south_american_rank) FROM table_2249087_1 WHERE nation = "Venezuela"
Show me about the distribution of All_Road and All_Games_Percent in a bar chart, and I want to show by the names in desc 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_Road, All_Games_Percent FROM basketball_match ORDER BY All_Road DESC
For the game on 13 December 1975 with Halifax Town as the away team what was the score?
CREATE TABLE table_name_4 (score VARCHAR,date VARCHAR,away_team VARCHAR)
SELECT score FROM table_name_4 WHERE date = "13 december 1975" AND away_team = "halifax town"
what flight goes from DENVER to BALTIMORE FIRST class on UA arriving on 5 7
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 airline (airline_code varchar,airline_name text,note text)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE air...
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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare AS FARE_0, fare AS FARE_1, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, fare_b...
What is the lowest number of participants in 2010 when there were 0 participants in 2012?
CREATE TABLE table_7828 ("Country" text,"2010" real,"2011" real,"2012" real,"2013" real)
SELECT MIN("2010") FROM table_7828 WHERE "2012" < '0'
When was the date of appointment for the manager replacing Wim Jansen?
CREATE TABLE table_20539 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text)
SELECT "Date of appointment" FROM table_20539 WHERE "Outgoing manager" = 'Wim Jansen'
What was Barreto's song choice when the theme was samba?
CREATE TABLE table_27614571_1 (song_choice VARCHAR,theme VARCHAR)
SELECT song_choice FROM table_27614571_1 WHERE theme = "Samba"
Give me a histogram for what are the total number of credits offered by each department?, could you rank by the names from low to high?
CREATE TABLE CLASS (CLASS_CODE varchar(5),CRS_CODE varchar(10),CLASS_SECTION varchar(2),CLASS_TIME varchar(20),CLASS_ROOM varchar(8),PROF_NUM int)CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CODE varchar(8),EMP_NUM int,DEPT_ADDRESS varchar(20),DEPT_EXTENSION varchar(4))CREATE TABLE ENROLL...
SELECT DEPT_CODE, SUM(T1.CRS_CREDIT) FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE ORDER BY DEPT_CODE
What was the max points you when when you place 9th?
CREATE TABLE table_1653 ("Season" text,"Series" text,"Team Name" text,"Races" real,"Poles" real,"Wins" real,"Points" real,"Final Placing" text)
SELECT MAX("Points") FROM table_1653 WHERE "Final Placing" = '9th'
What was the finish for Lanny Wadkins of the United States?
CREATE TABLE table_59667 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text)
SELECT "Finish" FROM table_59667 WHERE "Country" = 'united states' AND "Player" = 'lanny wadkins'
List the scores of all games when Miami were listed as the first Semi finalist
CREATE TABLE table_72167 ("Year" real,"Champion" text,"Score" text,"Runner-Up" text,"Location" text,"Semi-Finalist #1" text,"Semi-Finalist #2" text)
SELECT "Score" FROM table_72167 WHERE "Semi-Finalist #1" = 'Miami'
What category was the nominated in after 2008?
CREATE TABLE table_name_31 (category VARCHAR,outcome VARCHAR,year VARCHAR)
SELECT category FROM table_name_31 WHERE outcome = "nominated" AND year > 2008
what are the number of patients who had received a open reduct mandible fx procedure since 3 years ago?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,discht...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'open reduct mandible fx') AND DATETIME(procedures_ic...
How many times does November 3rd occur when January 15, 1991 does?
CREATE TABLE table_27465 ("June 10-11" text,"March 27-29" text,"January 15-16" text,"November 3" text,"August 21-22" text)
SELECT COUNT("November 3") FROM table_27465 WHERE "January 15-16" = 'January 15, 1991'
Which date has a week larger than 14?
CREATE TABLE table_31800 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Venue" text,"Attendance" text)
SELECT "Date" FROM table_31800 WHERE "Week" > '14'
count the number of times patient 006-76924 has had an urinary catheter output: indwelling/continuous ure output since 12/02/2100.
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage tex...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-76924')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce...
What is the overall number of the player from Utah with a pick # higher than 7?
CREATE TABLE table_name_54 (overall INTEGER,college VARCHAR,pick__number VARCHAR)
SELECT SUM(overall) FROM table_name_54 WHERE college = "utah" AND pick__number < 7
What is the score for the Dec 11 game?
CREATE TABLE table_name_83 (score VARCHAR,december VARCHAR)
SELECT score FROM table_name_83 WHERE december = 11
What is the total when bronze has a silver larger than 2?
CREATE TABLE table_6350 ("Country" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Bronze") FROM table_6350 WHERE "Silver" > '2'
How many seasons have a production code of 204?
CREATE TABLE table_16581695_3 (no_in_season VARCHAR,production_code VARCHAR)
SELECT COUNT(no_in_season) FROM table_16581695_3 WHERE production_code = 204
What is Petersville's census ranking?
CREATE TABLE table_21378 ("Official Name" text,"Status" text,"Area km 2" text,"Population" real,"Census Ranking" text)
SELECT "Census Ranking" FROM table_21378 WHERE "Official Name" = 'Petersville'
Which Club or province has a caps larger than 15 and has Chris Cusiter playing for them?
CREATE TABLE table_37217 ("Player" text,"Position" text,"Date of Birth (Age)" text,"Caps" real,"Club/province" text)
SELECT "Club/province" FROM table_37217 WHERE "Caps" > '15' AND "Player" = 'chris cusiter'
Which Byes have an Against larger than 1018, and a Wimmera FL of horsham diggers?
CREATE TABLE table_65614 ("Wimmera FL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real)
SELECT MIN("Byes") FROM table_65614 WHERE "Against" > '1018' AND "Wimmera FL" = 'horsham diggers'
how many tons does the te class displace ?
CREATE TABLE table_203_764 (id number,"name" text,"date" number,"nation" text,"displacement" text,"speed" text,"number" number,"notes" text)
SELECT "displacement" FROM table_203_764 WHERE "name" = 'te-class'
When the Home team score was 15.18 (108), what's the lowest Crowd turnout?
CREATE TABLE table_77874 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT MIN("Crowd") FROM table_77874 WHERE "Home team score" = '15.18 (108)'