instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What round has a position of F/C from Iowa College?
CREATE TABLE table_54013 ("Round" text,"Pick" text,"Player" text,"Position" text,"Nationality" text,"Team" text,"College" text)
SELECT "Round" FROM table_54013 WHERE "Position" = 'f/c' AND "College" = 'iowa'
When does week 11 start?
CREATE TABLE table_32555 ("Week" text,"Date" text,"Location" text,"Opponent" text,"Result" text)
SELECT "Date" FROM table_32555 WHERE "Week" = '11'
Which tournament had a score of 6 4, 4 6, 7 5?
CREATE TABLE table_55259 ("Date" text,"Tournament" text,"Surface" text,"Opponent in the final" text,"Score" text)
SELECT "Tournament" FROM table_55259 WHERE "Score" = '6–4, 4–6, 7–5'
Result F A of 5 0 had what group position?
CREATE TABLE table_69701 ("Date" text,"Opponents" text,"Result F\u2013A" text,"Attendance" real,"Group position" text)
SELECT "Group position" FROM table_69701 WHERE "Result F\u2013A" = '5–0'
What is the sum of the area in km with a population of 110 in 2011?
CREATE TABLE table_name_59 (area__km_2__ INTEGER,population__2011_ VARCHAR)
SELECT SUM(area__km_2__) FROM table_name_59 WHERE population__2011_ = 110
What shows for 3:30 pm when 2:00 pm is local programs?
CREATE TABLE table_58834 ("7:00 am" text,"9:00 am" text,"10:00 am" text,"11:00 am" text,"noon" text,"12:30 pm" text,"1:00 pm" text,"1:30 pm" text,"2:00 pm" text,"2:30 pm" text,"3:30 pm" text,"4:30 pm" text,"5:00 pm" text,"6:30 pm" text)
SELECT "6:30 pm" FROM table_58834 WHERE "2:00 pm" = 'local programs'
What was the highest attendance against Real Juventud?
CREATE TABLE table_44916 ("Date" text,"Home" text,"Score" text,"Away" text,"Attendance" real)
SELECT MAX("Attendance") FROM table_44916 WHERE "Away" = 'real juventud'
What is the rank of the region with an area larger than 41,526, a density greater than 345, and a population larger than 48,456,369?
CREATE TABLE table_68906 ("Rank" real,"Country/Region" text,"Population" real,"Area (km 2)" real,"Density (Pop. per km 2)" real)
SELECT COUNT("Rank") FROM table_68906 WHERE "Area (km 2 )" > '41,526' AND "Density (Pop. per km 2 )" > '345' AND "Population" > '48,456,369'
For each phone, show its names and total number of stocks Visualize by bar chart, and rank by the bars in desc please.
CREATE TABLE phone_market (Market_ID int,Phone_ID text,Num_of_stock int)CREATE TABLE phone (Name text,Phone_ID int,Memory_in_G int,Carrier text,Price real)CREATE TABLE market (Market_ID int,District text,Num_of_employees int,Num_of_shops real,Ranking int)
SELECT Name, SUM(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name ORDER BY Name DESC
What shows as the First US Tour Cast when the Original Broadway Cast was Sarah Bolt?
CREATE TABLE table_name_16 (first_us_tour_cast VARCHAR,original_broadway_cast VARCHAR)
SELECT first_us_tour_cast FROM table_name_16 WHERE original_broadway_cast = "sarah bolt"
count the number of patients who received physical therapy consult within 2 months after being diagnosed until 2103 with atelectasis/collapse.
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'atelectasis/collapse' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2103') AS t1 JOIN (SELECT patient.uniq...
For those records from the products and each product's manufacturer, find name and the sum of revenue , and group by attribute name, and visualize them by a bar chart, I want to sort Y-axis in asc order.
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 T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T2.Revenue
find the name of the program that was launched most recently.
CREATE TABLE channel (channel_id number,name text,owner text,share_in_percent number,rating_in_percent number)CREATE TABLE broadcast (channel_id number,program_id number,time_of_day text)CREATE TABLE program (program_id number,name text,origin text,launch number,owner text)CREATE TABLE broadcast_share (channel_id numbe...
SELECT name FROM program ORDER BY launch DESC LIMIT 1
Name the womens singles for raina tzvetkova petya nedelcheva
CREATE TABLE table_19662 ("Year" real,"Mens singles" text,"Womens singles" text,"Mens doubles" text,"Womens doubles" text,"Mixed doubles" text)
SELECT "Womens singles" FROM table_19662 WHERE "Womens doubles" = 'Raina Tzvetkova Petya Nedelcheva'
Find first undeleted question on a site.
CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE Comments (Id number,PostId number,Score number,...
SELECT MIN(Id) AS "post_link" FROM Posts
how long was manisha dey 's jump ?
CREATE TABLE table_204_910 (id number,"rank" number,"name" text,"nationality" text,"result" number,"notes" text)
SELECT "result" FROM table_204_910 WHERE "name" = 'manisha dey'
Which place has United States as the country and Craig Wood as the player?
CREATE TABLE table_name_88 (place VARCHAR,country VARCHAR,player VARCHAR)
SELECT place FROM table_name_88 WHERE country = "united states" AND player = "craig wood"
Which Opponent has a Record of 65-95?
CREATE TABLE table_name_12 (opponent VARCHAR,record VARCHAR)
SELECT opponent FROM table_name_12 WHERE record = "65-95"
What is the greatest position when the points are less than 21, and the played greater than 14?
CREATE TABLE table_42171 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text)
SELECT MAX("Position") FROM table_42171 WHERE "Points" < '21' AND "Played" > '14'
Name the lg for ermengol
CREATE TABLE table_19018191_5 (l_g VARCHAR,player VARCHAR)
SELECT l_g FROM table_19018191_5 WHERE player = "Ermengol"
Which college did the player who went to the Boston Patriots go to?
CREATE TABLE table_62996 ("Pick" real,"Team" text,"Player" text,"Position" text,"College" text)
SELECT "College" FROM table_62996 WHERE "Team" = 'boston patriots'
In the game where the home team is collingwood, what is the score of the away team?
CREATE TABLE table_11888 ("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_11888 WHERE "Home team" = 'collingwood'
count the number of patients whose year of death is less than or equal to 2148 and procedure long title is other percutaneous procedures on biliary tract?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2148.0" AND procedures.long_title = "Other percutaneous procedures on biliary tract"
What is the fleet size of the airline which has a callsign of cool red?
CREATE TABLE table_1290 ("Airline" text,"ICAO" text,"IATA" text,"Callsign" text,"Commenced operations" real,"Fleet size" real,"Headquarters" text)
SELECT MIN("Fleet size") FROM table_1290 WHERE "Callsign" = 'COOL RED'
Name the team that has a song writer named larry spokes.
CREATE TABLE table_30431 ("Club name" text,"Name of team song" text,"Basis for team song" text,"First used as team song" text,"Writer/composer" text)
SELECT "Club name" FROM table_30431 WHERE "Writer/composer" = 'Larry Spokes'
bmi 20 _ 30 kg / m2
CREATE TABLE table_train_256 ("id" int,"mini_mental_state_examination_mmse" int,"language" string,"mild_cognitive_impairment" bool,"moca_score" int,"dementia" bool,"body_mass_index_bmi" float,"age" float,"NOUSE" float)
SELECT * FROM table_train_256 WHERE body_mass_index_bmi >= 20 AND body_mass_index_bmi <= 30
which player has the highest number of goals ?
CREATE TABLE table_204_421 (id number,"name" text,"nationality" text,"position" text,"spartak career" text,"appearances" number,"goals" number)
SELECT "name" FROM table_204_421 ORDER BY "goals" DESC LIMIT 1
What are the most viewed questions for a given multiple tags with time range?.
CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostHistory (Id number,Po...
SELECT TOP(100) AS ViewCount, Score, Tags, Id AS "post_link" FROM Posts WHERE Id IN (SELECT PostId FROM PostTags WHERE TagId IN ((SELECT Id FROM Tags WHERE TagName IN (@TagString1, @TagString2)))) AND CreationDate > GETDATE() - '##Days##' AND CreationDate < GETDATE() - '##Olddays##' ORDER BY ViewCount DESC
How many platinum points were awarded when 6 gold points were awarded?
CREATE TABLE table_11254821_2 (points_awarded__platinum_ INTEGER,points_awarded__gold_ VARCHAR)
SELECT MAX(points_awarded__platinum_) FROM table_11254821_2 WHERE points_awarded__gold_ = 6
What tournament has q2 as the 2004?
CREATE TABLE table_41499 ("Tournament" text,"2004" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text)
SELECT "Tournament" FROM table_41499 WHERE "2004" = 'q2'
Show me about the distribution of ACC_Regular_Season and All_Games_Percent in a bar chart, and could you order in desc by the names 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 ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY ACC_Regular_Season DESC
What is the rank of the player with less than 34 points?
CREATE TABLE table_name_95 (rank INTEGER,points INTEGER)
SELECT SUM(rank) FROM table_name_95 WHERE points < 34
What was the Opponent in the game with a Result of L 24 14?
CREATE TABLE table_name_38 (opponent VARCHAR,result VARCHAR)
SELECT opponent FROM table_name_38 WHERE result = "l 24–14"
Are there any courses I should take prior to taking MATSCIE 693 that would help me ?
CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE area (course_id int,area varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,tota...
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'MATSCIE' AND number = 693
What was the round of 16 result for felipe saucedo?
CREATE TABLE table_31179 ("Athlete" text,"Event" text,"Elimination Poule" text,"Round of 16" text,"Quarterfinals" text,"Semifinals" text,"Final" text)
SELECT "Round of 16" FROM table_31179 WHERE "Athlete" = 'Felipe Saucedo'
How many voting records do we have?
CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE voting_record (stuid number,registration_date text,election_cycle text,president_vote number,vice_president_vote number,secretary_vote number,treasurer_vote number,class_president_vote nu...
SELECT COUNT(*) FROM voting_record
What was the surface of the game that resulted in a final score of 6-1 7-5?
CREATE TABLE table_name_90 (surface VARCHAR,score VARCHAR)
SELECT surface FROM table_name_90 WHERE score = "6-1 7-5"
How many meters tall is Ulrike Wolful?
CREATE TABLE table_23495048_2 (height__mtr_ VARCHAR,contestant VARCHAR)
SELECT height__mtr_ FROM table_23495048_2 WHERE contestant = "Ulrike Wolful"
What is the biggest week with an opponent of washington redskins?
CREATE TABLE table_name_18 (week INTEGER,opponent VARCHAR)
SELECT MAX(week) FROM table_name_18 WHERE opponent = "washington redskins"
how many years did boston college win with john kelley as coach ?
CREATE TABLE table_203_13 (id number,"year" number,"champion" text,"score" text,"runner-up" text,"coach" text)
SELECT COUNT("year") FROM table_203_13 WHERE "champion" = 'boston college' AND "coach" = 'john "snooks" kelley'
Who was the opponent at the League Cup competition with a score of 3-1?
CREATE TABLE table_name_91 (opponents VARCHAR,competition VARCHAR,score VARCHAR)
SELECT opponents FROM table_name_91 WHERE competition = "league cup" AND score = "3-1"
what is the number of patients whose age is less than 31 and drug name is sodium fluoride (dental gel)?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "31" AND prescriptions.drug = "Sodium Fluoride (Dental Gel)"
What is the year founded for the team Dinos?
CREATE TABLE table_74148 ("Institution" text,"Team" text,"City" text,"Province" text,"Founded" real,"Affiliation" text,"Enrollment" real,"Endowment" text,"Football stadium" text,"Capacity" real)
SELECT MAX("Founded") FROM table_74148 WHERE "Team" = 'Dinos'
when was the last time on the first icu visit patient 24547 was measured for a arterial bp [diastolic] that was greater than 66.0?
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 cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)C...
SELECT chartevents.charttime 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 = 24547) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (...
For all course_name from courses table, group by the course name and count them with a bar chart, and display Y-axis from high to low order.
CREATE TABLE Candidates (candidate_id INTEGER,candidate_details VARCHAR(255))CREATE TABLE Courses (course_id VARCHAR(100),course_name VARCHAR(120),course_description VARCHAR(255),other_details VARCHAR(255))CREATE TABLE Candidate_Assessments (candidate_id INTEGER,qualification CHAR(15),assessment_date DATETIME,asessment...
SELECT course_name, COUNT(course_name) FROM Courses GROUP BY course_name ORDER BY COUNT(course_name) DESC
What was the Last Samurai role?
CREATE TABLE table_name_70 (role VARCHAR,film VARCHAR)
SELECT role FROM table_name_70 WHERE film = "the last samurai"
What is the total amount of settlement made for all the settlements?
CREATE TABLE Settlements (Amount_Settled INTEGER)
SELECT SUM(Amount_Settled) FROM Settlements
give me the number of patients whose gender is f?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F"
What is the average for silver when bronze is less than 1, and gold is more than 0?
CREATE TABLE table_75067 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT AVG("Silver") FROM table_75067 WHERE "Bronze" < '1' AND "Gold" > '0'
Who is the head coach of the team located in Mudgeeraba?
CREATE TABLE table_10445 ("Team" text,"Head Coach" text,"President" text,"Home Ground" text,"Location" text)
SELECT "Head Coach" FROM table_10445 WHERE "Location" = 'mudgeeraba'
how many patients whose age is less than 85 and days of hospital stay is greater than 27?
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.age < "85" AND demographic.days_stay > "27"
patient 006-50099 was prescribed furosemide 80 mg po tabs until 13 months ago?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid num...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-50099')) AND medication.drugname = 'furosemide 80 mg po tabs' AND DATE...
For all games with calgary as home, what is the average number of attendees?
CREATE TABLE table_71901 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text)
SELECT AVG("Attendance") FROM table_71901 WHERE "Home" = 'calgary'
what does restriction AP/80 mean
CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flig...
SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/80'
Who is the winning driver of Penske Racing, and what was Rick Mears' pole position?
CREATE TABLE table_name_30 (winning_driver VARCHAR,winning_team VARCHAR,pole_position VARCHAR)
SELECT winning_driver FROM table_name_30 WHERE winning_team = "penske racing" AND pole_position = "rick mears"
what exactly was the name of the drug that patient 61591 was prescribed during the same hospital visit after receiving a aortocor bypas-1 cor art procedure in 05/2105?
CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_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 icustays (row_id number,subject_id number,hadm_id number,icustay...
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 61591 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce...
how long did spokane take to finish the race ?
CREATE TABLE table_204_330 (id number,"finished" text,"horse" text,"jockey" text,"trainer" text,"owner" text,"time / behind" text)
SELECT "time / behind" FROM table_204_330 WHERE "horse" = 'spokane'
Which Combined elapsed time has a Skipper of stephen wilkins?
CREATE TABLE table_name_17 (combined_elapsed_time VARCHAR,skipper VARCHAR)
SELECT combined_elapsed_time FROM table_name_17 WHERE skipper = "stephen wilkins"
What are the order dates of orders with price higher than 1000?
CREATE TABLE Customer_Orders (Order_Date VARCHAR,Order_ID VARCHAR)CREATE TABLE ORDER_ITEMS (Order_ID VARCHAR,Product_ID VARCHAR)CREATE TABLE Products (Product_ID VARCHAR,Product_price INTEGER)
SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_price > 1000
what is the number of patients with abnormal lab tests born before the year 2097?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2097" AND lab.flag = "abnormal"
What was the team's record on November 12?
CREATE TABLE table_67990 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Record" FROM table_67990 WHERE "Date" = 'november 12'
how many of the patients treated with tizanidine had a hospital stay of more than 13 days?
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 diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "13" AND prescriptions.drug = "Tizanidine"
How many patients do each physician take care of? List their names and number of patients they take care of Show bar chart, sort in asc by the x axis.
CREATE TABLE Nurse (EmployeeID INTEGER,Name VARCHAR(30),Position VARCHAR(30),Registered BOOLEAN,SSN INTEGER)CREATE TABLE Procedures (Code INTEGER,Name VARCHAR(30),Cost REAL)CREATE TABLE Appointment (AppointmentID INTEGER,Patient INTEGER,PrepNurse INTEGER,Physician INTEGER,Start DATETIME,End DATETIME,ExaminationRoom TEX...
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY T1.Name
How many bronzes are there for the total nation with 112 silver and a total of 72?
CREATE TABLE table_name_39 (bronze INTEGER,silver VARCHAR,nation VARCHAR)
SELECT AVG(bronze) FROM table_name_39 WHERE "total" > 72 AND nation = "total" AND silver < 112
When mixed doubles is danny bawa chrisnanta debby susanto what is the boys singles?
CREATE TABLE table_14319023_2 (boys_singles VARCHAR,mixed_doubles VARCHAR)
SELECT boys_singles FROM table_14319023_2 WHERE mixed_doubles = "Danny Bawa Chrisnanta Debby Susanto"
What was the home team score in the game where the away team scored 11.8 (74)?
CREATE TABLE table_55832 ("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_55832 WHERE "Away team score" = '11.8 (74)'
What were the lowest amount of points for season 1994?
CREATE TABLE table_name_33 (points INTEGER,season VARCHAR)
SELECT MIN(points) FROM table_name_33 WHERE season = "1994"
What is the to par of Al Mengert of the United States?
CREATE TABLE table_48745 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "To par" FROM table_48745 WHERE "Country" = 'united states' AND "Player" = 'al mengert'
for patient id 74032, specify the diagnosis and icd9 code.
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 diagnoses.short_title, procedures.icd9_code FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "74032"
What is the name of the shield winner in which the mls cup winner and mls supporters shield runner up is Chivas usa?
CREATE TABLE table_16471 ("Season" real,"MLS Cup Winner" text,"MLS Cup Runner-Up" text,"MLS Supporters Shield Winner" text,"MLS Supporters Shield Runner-Up" text)
SELECT "MLS Cup Winner" FROM table_16471 WHERE "MLS Supporters Shield Runner-Up" = 'Chivas USA'
What is the score for 2004?
CREATE TABLE table_name_69 (score VARCHAR,year VARCHAR)
SELECT score FROM table_name_69 WHERE year = 2004
What are the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa, and count them by a bar chart
CREATE TABLE film (film_id SMALLINT UNSIGNED,title VARCHAR(255),description TEXT,release_year YEAR,language_id TINYINT UNSIGNED,original_language_id TINYINT UNSIGNED,rental_duration TINYINT UNSIGNED,rental_rate DECIMAL(4,2),length SMALLINT UNSIGNED,replacement_cost DECIMAL(5,2),rating any,special_features any,last_upda...
SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa'
how many players played running back where status is made 53-man roster at start of 2009 season
CREATE TABLE table_23990 ("Round" real,"Pick #" real,"Player" text,"Position" text,"Height" text,"Weight" text,"College" text,"Status" text)
SELECT COUNT("Player") FROM table_23990 WHERE "Status" = 'Made 53-man roster at start of 2009 season' AND "Position" = 'Running back'
how many of the widowed patients were aged below 47?
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 MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.age >= "47"
How many totals have a rank greater than 4, czech Republic as the nation, and a bronze greater than 0?
CREATE TABLE table_41448 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT SUM("Total") FROM table_41448 WHERE "Rank" > '4' AND "Nation" = 'czech republic' AND "Bronze" > '0'
What is Left Office, when Party is 'UDC', and when Took Office is '11 June 2001'?
CREATE TABLE table_47620 ("Portfolio" text,"Minister" text,"Took office" text,"Left office" text,"Party" text)
SELECT "Left office" FROM table_47620 WHERE "Party" = 'udc' AND "Took office" = '11 june 2001'
On the date of june 7 what was the score?
CREATE TABLE table_name_31 (record VARCHAR,date VARCHAR)
SELECT record FROM table_name_31 WHERE date = "june 7"
What is the minimum number of opponents?
CREATE TABLE table_18847692_2 (opponents INTEGER)
SELECT MIN(opponents) FROM table_18847692_2
Count questions with answers never accepted by a user..
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREA...
SELECT COUNT(*) FROM Posts INNER JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Users.Id = '##UserId##' AND Posts.PostTypeId = 1 AND Posts.AnswerCount > 0 AND Posts.ClosedDate IS NULL AND Posts.AcceptedAnswerId IS NULL
Give me the comparison about the sum of Weight over the Sex , and group by attribute Sex by a bar chart, show names in descending order.
CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real)CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)
SELECT Sex, SUM(Weight) FROM people GROUP BY Sex ORDER BY Sex DESC
list the top three most common outputs in 2101?
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 t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) = '2101' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 3
how many times has vasopressors - dopamine 5-15 micrograms/kg/min procedure been done?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text...
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'vasopressors - dopamine 5-15 micrograms/kg/min'
what is the top five most frequent diagnoses for the patients 50s in 2101?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientu...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND STRFTIME('%y', diagnosis.diagnosistime) = '2101' GROUP BY diagnosis.d...
Which Semi finalists had a Week of may 15?
CREATE TABLE table_9726 ("Tournament" text,"Surface" text,"Week" text,"Winner" text,"Finalist" text,"Semi finalists" text)
SELECT "Semi finalists" FROM table_9726 WHERE "Week" = 'may 15'
What 1935 has 4 as a 1953?
CREATE TABLE table_40817 ("1935" text,"1936" text,"1937" text,"1938" text,"1939" text,"1940" text,"1941" text,"1943" text,"1945" text,"1946" text,"1947" text,"1948" text,"1949" text,"1950" text,"1951" text,"1952" text,"1953" text)
SELECT "1935" FROM table_40817 WHERE "1953" = '4'
What line has Junction of Huntly NIMT
CREATE TABLE table_60942 ("Line Name" text,"Date Closed" text,"NIMT Junction" text,"Terminus" text,"Length" text)
SELECT "Line Name" FROM table_60942 WHERE "NIMT Junction" = 'huntly'
Which year had a position of 9?
CREATE TABLE table_name_45 (year VARCHAR,position VARCHAR)
SELECT year FROM table_name_45 WHERE position = "9"
Count the number of patients who were admitted to the hospital before the year 2157 and have diagnosis short title as intermediate coronary syndrome
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.admityear < "2157" AND diagnoses.short_title = "Intermed coronary synd"
What are the clean and jerk score of the body builder with the highest total score?
CREATE TABLE people (people_id number,name text,height number,weight number,birth_date text,birth_place text)CREATE TABLE body_builder (body_builder_id number,people_id number,snatch number,clean_jerk number,total number)
SELECT clean_jerk FROM body_builder ORDER BY total DESC LIMIT 1
what's the country/region with seasons and winners being season 1, 2012: demetra malalan
CREATE TABLE table_13779832_1 (country_region VARCHAR,seasons_and_winners VARCHAR)
SELECT country_region FROM table_13779832_1 WHERE seasons_and_winners = "Season 1, 2012: Demetra Malalan"
What is the most recent year with a finish in 2nd position?
CREATE TABLE table_49030 ("Season" real,"Level" text,"Division" text,"Administration" text,"Position" text)
SELECT MAX("Season") FROM table_49030 WHERE "Position" = '2nd'
what is the number of patients whose drug name is esmolol?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Esmolol"
Opponent of chicago bulls had what location?
CREATE TABLE table_name_83 (location VARCHAR,opponent VARCHAR)
SELECT location FROM table_name_83 WHERE opponent = "chicago bulls"
On what date was the record 21-25?
CREATE TABLE table_11408 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT "Date" FROM table_11408 WHERE "Record" = '21-25'
For those products with a price between 60 and 120, find name and price , and visualize them by a bar chart, and sort in ascending by the X-axis please.
CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)
SELECT Name, Price FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name
How many losses does Cross Keys RFC have?
CREATE TABLE table_1530 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Points difference" text,"Points" text)
SELECT COUNT("Lost") FROM table_1530 WHERE "Club" = 'Cross Keys RFC'
Name the position for british columbia
CREATE TABLE table_28059992_2 (position VARCHAR,college VARCHAR)
SELECT position FROM table_28059992_2 WHERE college = "British Columbia"
What is the average First Downs for december 4?
CREATE TABLE table_42603 ("Week" real,"Date" text,"Result" text,"Record" text,"Opponent" text,"Points For" real,"Points Against" real,"First Downs" real,"Attendance" real)
SELECT AVG("First Downs") FROM table_42603 WHERE "Date" = 'december 4'
provide the health insurance and patients name for patient id 2560.
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.name, demographic.insurance FROM demographic WHERE demographic.subject_id = "2560"
Attrition: Reputation>10K Last post < 2012.
CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Post...
SELECT u.DisplayName, u.Reputation, u.LastAccessDate, p.LastPost FROM Users AS u INNER JOIN (SELECT OwnerUserId, MAX(CreationDate) AS LastPost FROM Posts WHERE CreationDate < '2012-01-01' GROUP BY OwnerUserId) AS p ON u.Id = p.OwnerUserId WHERE Reputation > 10000 AND u.LastAccessDate < '2012-01-01' ORDER BY Reputation ...