instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is the lowest for top-25 with events smaller than 42 in a U.S. Open with a top-10 smaller than 5?
CREATE TABLE table_76055 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT MIN("Top-25") FROM table_76055 WHERE "Events" < '42' AND "Tournament" = 'u.s. open' AND "Top-10" < '5'
List the first and last name for players who participated in all star game in 1998.
CREATE TABLE fielding_postseason (player_id text,year number,team_id text,league_id text,round text,pos text,g number,gs number,inn_outs number,po number,a number,e number,dp number,tp number,pb number,sb number,cs number)CREATE TABLE team_half (year number,league_id text,team_id text,half number,div_id text,div_win te...
SELECT name_first, name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id WHERE year = 1998
What is the record loss of R. Springer?
CREATE TABLE table_name_75 (record VARCHAR,loss VARCHAR)
SELECT record FROM table_name_75 WHERE loss = "r. springer"
Bar chart x axis nominee y axis the total number
CREATE TABLE musical (Musical_ID int,Name text,Year int,Award text,Category text,Nominee text,Result text)CREATE TABLE actor (Actor_ID int,Name text,Musical_ID int,Character text,Duration text,age int)
SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee
Whati s the format for the catalogno of st 491?
CREATE TABLE table_name_26 (format VARCHAR,catalogno VARCHAR)
SELECT format FROM table_name_26 WHERE catalogno = "st 491"
Name the tourism receipts 2003 for colombia
CREATE TABLE table_22412 ("Country" text,"Tourist arrivals (2011) (Millions)" text,"Tourism receipts (2011) (Millions of US$)" real,"Tourism receipts (2011) (US$ per arrival)" real,"Tourism receipts (2011) (US$ per capita)" real,"Tourism receipts (2003) (as % of GDP)" text,"Tourism receipts (2003) (as % of exports)" te...
SELECT "Tourism receipts (2003) (as % of GDP)" FROM table_22412 WHERE "Country" = 'Colombia'
What's the content offered by the package number 204?
CREATE TABLE table_15887683_3 (content VARCHAR,n° VARCHAR)
SELECT content FROM table_15887683_3 WHERE n° = 204
What was the rating for the episode that had 5.90 million viewers?
CREATE TABLE table_23730973_5 (rating VARCHAR,viewers__millions_ VARCHAR)
SELECT rating FROM table_23730973_5 WHERE viewers__millions_ = "5.90"
can you list all flights departing from TORONTO and landing in SAN DIEGO with a stopover in DENVER
CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_speed int,range_miles int,pressurized varchar)CREATE TABLE airport_service (city_code ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND CITY_2....
Who had the decision with boston at home?
CREATE TABLE table_53000 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text)
SELECT "Decision" FROM table_53000 WHERE "Home" = 'boston'
What date is associated with the label Village Records?
CREATE TABLE table_name_88 (date VARCHAR,label VARCHAR)
SELECT date FROM table_name_88 WHERE label = "village records"
How many incumbents were elected in the 1926 election?
CREATE TABLE table_772 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT COUNT("Incumbent") FROM table_772 WHERE "First elected" = '1926'
What is the total number of 3rd placed teams when the host is University of Manitoba, Winnipeg, Manitoba?
CREATE TABLE table_22794 ("Year" real,"Host" text,"1st Place" text,"2nd Place" text,"3rd Place" text,"4th Place" text,"5th Place" text)
SELECT COUNT("3rd Place") FROM table_22794 WHERE "Host" = 'University of Manitoba, Winnipeg, Manitoba'
What is Score, when Player is 'Vijay Singh'?
CREATE TABLE table_62114 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Score" FROM table_62114 WHERE "Player" = 'vijay singh'
which driver came after giancarlo fisichella ?
CREATE TABLE table_203_76 (id number,"pos" text,"no" number,"driver" text,"constructor" text,"laps" number,"time/retired" text,"grid" number,"points" number)
SELECT "driver" FROM table_203_76 WHERE "pos" = (SELECT "pos" FROM table_203_76 WHERE "driver" = 'giancarlo fisichella') + 1
how many male patients have diagnoses icd9 code 1418?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "1418"
Tell me the average year for rank more than 3 and 28 floors
CREATE TABLE table_name_84 (year INTEGER,rank VARCHAR,floors VARCHAR)
SELECT AVG(year) FROM table_name_84 WHERE rank > 3 AND floors = 28
how many people withdrew before the 5th stage ?
CREATE TABLE table_204_530 (id number,"type" text,"stage" number,"cyclist" text,"team" text,"reason" text)
SELECT COUNT("type") FROM table_204_530 WHERE "stage" < 5
What is the average tries for less than 117 points and less than 48 tries against?
CREATE TABLE table_name_90 (tries_for INTEGER,points_for VARCHAR,tries_against VARCHAR)
SELECT AVG(tries_for) FROM table_name_90 WHERE points_for < 117 AND tries_against < 48
What was the value for 2004 European with less than 7.5 in general 2001, less than 6.4 in 2009 European, and less than 1.5 in general 2013 with 4.3 in 2008 general?
CREATE TABLE table_76156 ("1996 general" real,"1999 European" real,"2001 general" real,"2004 European" real,"2006 general" real,"2008 general" real,"2009 European" real,"2013 general" real)
SELECT "2004 European" FROM table_76156 WHERE "2001 general" < '7.5' AND "2009 European" < '6.4' AND "2013 general" < '1.5' AND "2008 general" = '4.3'
Which team has a long of 67?
CREATE TABLE table_51794 ("Year" text,"Team" text,"Comp" text,"Long" text,"Rate" text,"RAtt" text,"RYds" text,"RAvg" text)
SELECT "Team" FROM table_51794 WHERE "Long" = '67'
what team had the 1:44.027 qual 2?
CREATE TABLE table_name_82 (team VARCHAR,qual_2 VARCHAR)
SELECT team FROM table_name_82 WHERE qual_2 = "1:44.027"
Who has a Team classification of la vie claire, a stage of 20, a General classification of greg lemond?
CREATE TABLE table_name_80 (winner VARCHAR,stage VARCHAR,team_classification VARCHAR,general_classification VARCHAR)
SELECT winner FROM table_name_80 WHERE team_classification = "la vie claire" AND general_classification = "greg lemond" AND stage = "20"
count the number of patients whose gender is f and age is less than 64?
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 text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.age < "64"
What round was matt roth drafted?
CREATE TABLE table_name_82 (round VARCHAR,player VARCHAR)
SELECT COUNT(round) FROM table_name_82 WHERE player = "matt roth"
What did the home team score at MCG?
CREATE TABLE table_11839 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team score" FROM table_11839 WHERE "Venue" = 'mcg'
how many patients are admitted under elective type and are of hispanic or latino ethnicity?
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 WHERE demographic.admission_type = "ELECTIVE" AND demographic.ethnicity = "HISPANIC OR LATINO"
How many acres burned in fires in California each year between 2000 and 2005?
CREATE TABLE fires (fire_year number,discovery_date number,discovery_doy number,discovery_time text,stat_cause_code number,stat_cause_descr text,cont_date text,cont_doy text,cont_time text,fire_size number,fire_size_class text,latitude number,longitude number,owner_code number,owner_descr text,state text,county text,fi...
SELECT SUM(fire_size), fire_year FROM fires WHERE state = "CA" AND fire_year BETWEEN 2000 AND 2005 GROUP BY fire_year
Bar graph to show the total number from different team, and could you show in ascending by the y-axis please?
CREATE TABLE Elimination (Elimination_ID text,Wrestler_ID text,Team text,Eliminated_By text,Elimination_Move text,Time text)CREATE TABLE wrestler (Wrestler_ID int,Name text,Reign text,Days_held text,Location text,Event text)
SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY COUNT(*)
calculate the number of patients with personality disorder nos who had a hospital stay for more than 5 days.
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 > "5" AND diagnoses.short_title = "Personality disorder NOS"
when was the first time that patient 005-16601 got a chest tube #1: output until 10/11/2104?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,c...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-16601')) AND intakeoutput.cellpath LIKE '%output%...
If the amount of rebounds is 0, what is the maximum minutes?
CREATE TABLE table_25984 ("Player" text,"Games Played" real,"Minutes" real,"Field Goals" real,"Three Pointers" real,"Free Throws" real,"Rebounds" real,"Assists" real,"Blocks" real,"Steals" real,"Points" real)
SELECT MAX("Minutes") FROM table_25984 WHERE "Rebounds" = '0'
What is Quantity Made, when Year Made is '4-4-0 oooo american'?
CREATE TABLE table_44050 ("Class" text,"Wheel arrangement" text,"Manufacturer" text,"Year made" text,"Quantity made" text,"Quantity preserved" text)
SELECT "Quantity made" FROM table_44050 WHERE "Year made" = '4-4-0 — oooo — american'
Who was the winner in the 2008 season?
CREATE TABLE table_name_53 (winner VARCHAR,season VARCHAR)
SELECT winner FROM table_name_53 WHERE season = 2008
On what Date was the Attendance 63,546?
CREATE TABLE table_62019 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Attendance" text)
SELECT "Date" FROM table_62019 WHERE "Attendance" = '63,546'
What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check, and count them by a bar chart, order by the y axis from low to high.
CREATE TABLE Customers (customer_id INTEGER,coupon_id INTEGER,good_or_bad_customer VARCHAR(4),first_name VARCHAR(80),last_name VARCHAR(80),gender_mf VARCHAR(1),date_became_customer DATETIME,date_last_hire DATETIME)CREATE TABLE Discount_Coupons (coupon_id INTEGER,date_issued DATETIME,coupon_amount DECIMAL(19,4))CREATE T...
SELECT payment_date, COUNT(payment_date) FROM Payments WHERE amount_paid > 300 OR payment_type_code = 'Check' ORDER BY COUNT(payment_date)
What is the title rank of actor pauline moran?
CREATE TABLE table_name_93 (title_rank VARCHAR,actor VARCHAR)
SELECT title_rank FROM table_name_93 WHERE actor = "pauline moran"
What is Jockey, when Time is 1:15.89?
CREATE TABLE table_48159 ("Year" real,"Winner" text,"Jockey" text,"Trainer" text,"Owner" text,"Time" text)
SELECT "Jockey" FROM table_48159 WHERE "Time" = '1:15.89'
Let the shortest duration as bar chart's X-axis and the most poorly rated song for each genre as the Y, could you list in asc by the total number?
CREATE TABLE song (song_name varchar2(50),artist_name varchar2(50),country varchar2(20),f_id number(10),genre_is varchar2(20),rating number(10),languages varchar2(20),releasedate Date,resolution number(10))CREATE TABLE artist (artist_name varchar2(50),country varchar2(20),gender varchar2(20),preferred_genre varchar2(50...
SELECT MIN(T1.duration), MIN(T2.rating) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY MIN(T1.duration) ORDER BY MIN(T2.rating)
Show the average of id from each nationality, I want to display in ascending by the Y.
CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te...
SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY AVG(ID)
What winning team has a losing pitcher of Juan Dominguez?
CREATE TABLE table_name_31 (winning_team VARCHAR,losing_pitcher VARCHAR)
SELECT winning_team FROM table_name_31 WHERE losing_pitcher = "juan dominguez"
n-th percentile score on accepted answers.
CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time...
WITH AcceptedAnswersScores AS (SELECT a.Score FROM Posts AS a INNER JOIN Posts AS q ON q.AcceptedAnswerId = a.Id WHERE a.PostTypeId = 2), Percentiles AS (SELECT perc = PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY Score) OVER () FROM AcceptedAnswersScores) SELECT AVG(CAST(perc AS FLOAT)) FROM Percentiles
How many total laps for the driver with Winnings of $116,033, and a Car # smaller than 18?
CREATE TABLE table_name_53 (laps VARCHAR,winnings VARCHAR,car__number VARCHAR)
SELECT COUNT(laps) FROM table_name_53 WHERE winnings = "$116,033" AND car__number < 18
What was the score of the game where the adelaide 36ers were the home team?
CREATE TABLE table_name_39 (score VARCHAR,home_team VARCHAR)
SELECT score FROM table_name_39 WHERE home_team = "adelaide 36ers"
Who had a to par of +2 and a score of 78-69-68=215?
CREATE TABLE table_name_22 (player VARCHAR,to_par VARCHAR,score VARCHAR)
SELECT player FROM table_name_22 WHERE to_par = "+2" AND score = 78 - 69 - 68 = 215
Which car won the same award in 2001 that the toyota 1nz-fxe hybrid prius won in 1999?
CREATE TABLE table_name_76 (Id VARCHAR)
SELECT 2001 FROM table_name_76 WHERE 1999 = "toyota 1nz-fxe hybrid prius"
count services by services, and split by local authorities with a stacked bar chart.
CREATE TABLE route (train_id int,station_id int)CREATE TABLE weekly_weather (station_id int,day_of_week text,high_temperature int,low_temperature int,precipitation real,wind_speed_mph int)CREATE TABLE station (id int,network_name text,services text,local_authority text)CREATE TABLE train (id int,train_number int,name t...
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY services, local_authority
What is the Arrival time of the Patna Junction Station?
CREATE TABLE table_name_62 (arrival VARCHAR,station_name VARCHAR)
SELECT arrival FROM table_name_62 WHERE station_name = "patna junction"
what difference in the weight of patient 2518 last measured on the current hospital visit compared to the value second to last measured on the current hospital visit?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)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 chartevents (row_id ...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2518 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM ...
how do i get from PITTSBURGH airport to downtown PITTSBURGH
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 code_description (code varchar,description text)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE date...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_code = airport_service.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_name = 'PITTSBURGH' AND ground_servic...
What was the score of the game with a decision of Peeters and a record of 29 3 11?
CREATE TABLE table_name_25 (score VARCHAR,decision VARCHAR,record VARCHAR)
SELECT score FROM table_name_25 WHERE decision = "peeters" AND record = "29–3–11"
A pie chart shows the proportion of All_Home and the sum of school id.
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, SUM(School_ID) FROM basketball_match GROUP BY All_Home
Visualize a bar chart about the number of winery of the wines whose price is bigger than 100, sort bars from high to low order please.
CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT)CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT)CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT)
SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Winery ORDER BY Winery DESC
Which team completed 10 races?
CREATE TABLE table_name_92 (team_name VARCHAR,races VARCHAR)
SELECT team_name FROM table_name_92 WHERE races = 10
What is the highest number a guard from brophy college prep wore?
CREATE TABLE table_30916 ("Name" text,"#" real,"Position" text,"Height" text,"Weight (lb.)" real,"Year" text,"Hometown" text,"Previous School" text)
SELECT MAX("#") FROM table_30916 WHERE "Position" = 'Guard' AND "Previous School" = 'Brophy College Prep'
Which cities' temperature in March is lower than that in July or higher than that in Oct?
CREATE TABLE temperature (city_id number,jan number,feb number,mar number,apr number,jun number,jul number,aug number,sep number,oct number,nov number,dec number)CREATE TABLE city (city_id number,city text,hanzi text,hanyu_pinyin text,regional_population number,gdp number)CREATE TABLE hosting_city (year number,match_id...
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.mar < T2.jul OR T2.mar > T2.oct
What was the U.S birthstone in the 15th-20th century when in 2013 it was amethyst?
CREATE TABLE table_name_34 (us__2013_ VARCHAR)
SELECT 15 AS th__20th_century FROM table_name_34 WHERE us__2013_ = "amethyst"
Where is the player with a pick smaller than 12 and a college of UV from?
CREATE TABLE table_54450 ("Pick" real,"Player" text,"Country of origin*" text,"PBA team" text,"College" text)
SELECT "Country of origin*" FROM table_54450 WHERE "Pick" < '12' AND "College" = 'uv'
Which player had 6 assists?
CREATE TABLE table_25353861_5 (player VARCHAR,assists VARCHAR)
SELECT player FROM table_25353861_5 WHERE assists = 6
Name the date for cleveland
CREATE TABLE table_74171 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Date" FROM table_74171 WHERE "Team" = 'Cleveland'
What 2011 GDP (PPP) billions of USD does Israel have?
CREATE TABLE table_25042 ("Rank MidEast" real,"Rank Asia" real,"Rank World" real,"Country" text,"2011 GDP (PPP) billions of USD" text)
SELECT "2011 GDP (PPP) billions of USD" FROM table_25042 WHERE "Country" = 'Israel'
may i see all the flights from WASHINGTON to SAN FRANCISCO please
CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE flight_stop (flight...
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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN...
Which Location has a Time of time?
CREATE TABLE table_name_89 (location VARCHAR)
SELECT location FROM table_name_89 WHERE "time" = "time"
On what date was the attendance of the crowd 78,431?
CREATE TABLE table_name_54 (date VARCHAR,attendance VARCHAR)
SELECT date FROM table_name_54 WHERE attendance = "78,431"
tell me the cost for a therapeutic antibacterials - cephalosporin?
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 DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'therapeutic antibacterials - cephalosporin')
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the sum of employee_id over the hire_date bin hire_date by time, and sort in ascending by the total number.
CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0)...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(EMPLOYEE_ID)
For each director, return the highest rating among all of their movies and the value of that rating, group by title in a scatter, and Ignore movies whose director is NULL.
CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)
SELECT stars, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY title
What is the qual 1 with a 1:09.567 best?
CREATE TABLE table_44321 ("Name" text,"Team" text,"Qual 1" text,"Qual 2" text,"Best" text)
SELECT "Qual 1" FROM table_44321 WHERE "Best" = '1:09.567'
in 2002 , how many people in the serbian banat were either slovaks or romanians ?
CREATE TABLE table_203_163 (id number,"year" number,"total" number,"serbs" text,"hungarians" text,"germans" text,"romanians" text,"slovaks" text)
SELECT "slovaks" + "romanians" FROM table_203_163 WHERE "year" = 2002
Show the names of products and the number of events they are in.
CREATE TABLE Products (Product_Name VARCHAR,Product_ID VARCHAR)CREATE TABLE Products_in_Events (Product_ID VARCHAR)
SELECT T1.Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name
How many goals did the club from Hawthorn score in the 1971 season?
CREATE TABLE table_66790 ("Rank" text,"Goals" text,"Player" text,"Club" text,"Season" text)
SELECT "Goals" FROM table_66790 WHERE "Club" = 'hawthorn' AND "Season" = '1971'
Find the name and flag of ships that are not steered by any captain with Midshipman rank.
CREATE TABLE ship (ship_id number,name text,type text,built_year number,class text,flag text)CREATE TABLE captain (captain_id number,name text,ship_id number,age text,class text,rank text)
SELECT name, flag FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')
What is Date, when High Rebounds is 'Yao Ming (10)'?
CREATE TABLE table_49213 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Date" FROM table_49213 WHERE "High rebounds" = 'yao ming (10)'
who was the pilot for the north american x-15 ?
CREATE TABLE table_203_688 (id number,"category" text,"speed\n(km/h)" number,"speed\n(mph)" number,"vehicle" text,"pilot" text,"date" text)
SELECT "pilot" FROM table_203_688 WHERE "vehicle" = 'north american x-15'
What is the average position with an against value less than 11?
CREATE TABLE table_name_76 (position INTEGER,against INTEGER)
SELECT AVG(position) FROM table_name_76 WHERE against < 11
How many patients were admitted to the hospital before the year 2194 who have undergone the procedure angiocardiography of right heart structures.
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)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 tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2194" AND procedures.long_title = "Angiocardiography of right heart structures"
are there more or less than 8 properties ?
CREATE TABLE table_204_229 (id number,"property" text,"test method" text,"units" text,"4275" text,"4301" text,"4435" text,"4630" text,"4645" text)
SELECT (SELECT COUNT("property") FROM table_204_229) > 8
What is the lowest Bronze, when Gold is less than 0?
CREATE TABLE table_name_58 (bronze INTEGER,gold INTEGER)
SELECT MIN(bronze) FROM table_name_58 WHERE gold < 0
how many hospital visits have patient 002-56853 done since 2 years ago?
CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim...
SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '002-56853' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-2 year')
What catalog came out after 2000?
CREATE TABLE table_name_23 (catalog VARCHAR,year INTEGER)
SELECT catalog FROM table_name_23 WHERE year > 2000
What was the result F-A for round 5?
CREATE TABLE table_8223 ("Date" text,"Round" text,"Opponents" text,"H / A" text,"Result F \u2013 A" text,"Attendance" real)
SELECT "Result F \u2013 A" FROM table_8223 WHERE "Round" = 'round 5'
provide the number of patients whose admission type is newborn and year of birth is less than 2065?
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,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 t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.dob_year < "2065"
Find the policy types more than 4 customers use. Show their type code.
CREATE TABLE first_notification_of_loss (fnol_id number,customer_id number,policy_id number,service_id number)CREATE TABLE available_policies (policy_id number,policy_type_code text,customer_phone text)CREATE TABLE services (service_id number,service_name text)CREATE TABLE customers_policies (customer_id number,policy_...
SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING COUNT(*) > 4
Income poverty f smaller than 13.6, and a Mining b of 1, and a Structural poverty g smaller than 7.8, so what is the total number of agriculture?
CREATE TABLE table_name_10 (agri_culture_b VARCHAR,structural_poverty_g VARCHAR,income_poverty_f VARCHAR,mining_b VARCHAR)
SELECT COUNT(agri_culture_b) FROM table_name_10 WHERE income_poverty_f < 13.6 AND mining_b = 1 AND structural_poverty_g < 7.8
what is the political affiliation of the texas 12 district
CREATE TABLE table_18426 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "Party" FROM table_18426 WHERE "District" = 'Texas 12'
What's the mean of the $70-80k ones that have 2.80%?
CREATE TABLE table_60534 ("Data" text,"Headcount" real,"Percent of total" text,"Less than $25,000" text,"$25,000 to $40,000" text,"$40,000 to $50,000" text,"$50,000 to $60,000" text,"$60,000 to $70,000" text,"$70,000 to $80,000" text,"More than $80,000" text,"Mean" text)
SELECT "Mean" FROM table_60534 WHERE "$70,000 to $80,000" = '2.80%'
How many field goals were made by someone playing position of right end?
CREATE TABLE table_14342592_5 (field_goals VARCHAR,position VARCHAR)
SELECT COUNT(field_goals) FROM table_14342592_5 WHERE position = "Right end"
What home team has a score of 2 1, when the away team was Telford United?
CREATE TABLE table_62189 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Home team" FROM table_62189 WHERE "Score" = '2–1' AND "Away team" = 'telford united'
For those employees who was hired before 2002-06-21, give me the trend about manager_id over hire_date , I want to rank x-axis in asc order.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))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 (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLO...
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE
Which of the radio stations has the organization of ente p blico radio televisi n madrid (eprtvm)?
CREATE TABLE table_23143607_1 (radio_stations VARCHAR,organization VARCHAR)
SELECT radio_stations FROM table_23143607_1 WHERE organization = "Ente Público Radio Televisión Madrid (EPRTVM)"
give me the number of patients whose ethnicity is black/cape verdean and primary disease is s/p fall?
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 WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "S/P FALL"
Return the names and ids of customers who have TN in their address Show bar chart, show by the X in asc.
CREATE TABLE Addresses (address_id INTEGER,address_details VARCHAR(255))CREATE TABLE Customer_Addresses (customer_id INTEGER,address_id INTEGER,date_from DATETIME,date_to DATETIME)CREATE TABLE Product_Suppliers (product_id INTEGER,supplier_id INTEGER,date_supplied_from DATETIME,date_supplied_to DATETIME,total_amount_pu...
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_name
How many joined the Warriors?
CREATE TABLE table_28498 ("Institution" text,"Location" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" real,"Nickname" text)
SELECT COUNT("Joined") FROM table_28498 WHERE "Nickname" = 'Warriors'
What is the shortest Time for David Neville when his React time was greater than 0.183?
CREATE TABLE table_14209 ("Rank" real,"Lane" real,"Athlete" text,"Nationality" text,"Time" real,"React" real)
SELECT MIN("Time") FROM table_14209 WHERE "React" > '0.183' AND "Athlete" = 'david neville'
Which Season has 0 Podiums, 1 Race, and 0 Points?
CREATE TABLE table_name_77 (season VARCHAR,points VARCHAR,podiums VARCHAR,races VARCHAR)
SELECT season FROM table_name_77 WHERE podiums = "0" AND races = "1" AND points = "0"
What Chassis does Reg Parnell drive?
CREATE TABLE table_name_51 (chassis VARCHAR,driver VARCHAR)
SELECT chassis FROM table_name_51 WHERE driver = "reg parnell"
list the four most common diagnoses that a patient was diagnosed with within 2 months after being diagnosed with brain tumor since 6 years ago.
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight nu...
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'brain tumor' AND DATETIME(diagnosis.diag...
Who was the home team at VFL Park?
CREATE TABLE table_name_22 (home_team VARCHAR,venue VARCHAR)
SELECT home_team FROM table_name_22 WHERE venue = "vfl park"
Show all party names and the number of members in each party by a pie chart.
CREATE TABLE party_events (Event_ID int,Event_Name text,Party_ID int,Member_in_charge_ID int)CREATE TABLE region (Region_ID int,Region_name text,Date text,Label text,Format text,Catalogue text)CREATE TABLE party (Party_ID int,Minister text,Took_office text,Left_office text,Region_ID int,Party_name text)CREATE TABLE mem...
SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID
What is the relationship between ACC_Percent and All_Games_Percent , and group by attribute All_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_Percent, All_Games_Percent FROM basketball_match GROUP BY All_Road