instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
which patients had cardiopulmonary resuscitation, not otherwise specified?
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 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 procedures.long_title = "Cardiopulmonary resuscitation, not otherwise specified"
Which win has 38.67% wins?
CREATE TABLE table_name_71 (wins VARCHAR,win__percentage VARCHAR)
SELECT wins FROM table_name_71 WHERE win__percentage = "38.67%"
Find the founded year of the newest non public school.
CREATE TABLE university (founded VARCHAR,affiliation VARCHAR)
SELECT founded FROM university WHERE affiliation <> 'Public' ORDER BY founded DESC LIMIT 1
What is the division for the year 2006?
CREATE TABLE table_978 ("Year" real,"Team Name" text,"Division" text,"League" text,"Regular Season" text,"Playoffs" text,"Open Cup" text)
SELECT "Division" FROM table_978 WHERE "Year" = '2006'
Which church was built in 1600?
CREATE TABLE table_name_38 (church_name VARCHAR,year_built VARCHAR)
SELECT church_name FROM table_name_38 WHERE year_built = 1600
Return a histogram on what is the average high temperature for each day of week?
CREATE TABLE route (train_id int,station_id int)CREATE TABLE station (id int,network_name text,services text,local_authority text)CREATE TABLE train (id int,train_number int,name text,origin text,destination text,time text,interval text)CREATE TABLE weekly_weather (station_id int,day_of_week text,high_temperature int,l...
SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week
Which mixed doubles happened later than 2011?
CREATE TABLE table_79918 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text)
SELECT "Mixed doubles" FROM table_79918 WHERE "Year" > '2011'
How many seats in 2006 has a % 1997 rating of 38.9?
CREATE TABLE table_2418 ("Political parties" text,"% 2006" text,"Seats 2006" real,"% 2001" text,"Seats 2001" real,"% 1997" text)
SELECT COUNT("Seats 2006") FROM table_2418 WHERE "% 1997" = '38.9'
Name the total number of viewers for audience share in timeslot for 10.2%
CREATE TABLE table_73151 ("#" real,"Episode" text,"UK air date" text,"Timeslot" text,"Viewers (millions)" text,"Audience share in timeslot" text)
SELECT COUNT("Viewers (millions)") FROM table_73151 WHERE "Audience share in timeslot" = '10.2%'
Which Points 1 has Drawn of 5, and a Goal Difference of +58, and a Lost larger than 4?
CREATE TABLE table_name_36 (points_1 INTEGER,lost VARCHAR,drawn VARCHAR,goal_difference VARCHAR)
SELECT MAX(points_1) FROM table_name_36 WHERE drawn = 5 AND goal_difference = "+58" AND lost > 4
give me the number of patients whose death status is 0 and procedure long title is circumcision?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Circumcision"
What was the score for series 2 3?
CREATE TABLE table_29790 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text)
SELECT "Score" FROM table_29790 WHERE "Series" = '2–3'
GraphQL StackOverflow posts over time.
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)...
SELECT CONCAT(TIME_TO_STR(CreationDate, '%Y'), ' ', TIME_TO_STR(CreationDate, '%m')) AS dt, COUNT(1) AS num_serverless_mentions FROM Posts WHERE Title LIKE '%graphql%' GROUP BY CONCAT(TIME_TO_STR(CreationDate, '%Y'), ' ', TIME_TO_STR(CreationDate, '%m'))
What year(s) did Mike Weir win player of the year?
CREATE TABLE table_name_45 (year_s__won VARCHAR,player VARCHAR)
SELECT year_s__won FROM table_name_45 WHERE player = "mike weir"
what is the released when the series is sorted 6y/ai?
CREATE TABLE table_47443 ("Series Sorted" text,"Title" text,"Doctor" text,"Featuring" text,"Released" text)
SELECT "Released" FROM table_47443 WHERE "Series Sorted" = '6y/ai'
what are all the regular season where year is 2011
CREATE TABLE table_1046454_1 (regular_season VARCHAR,year VARCHAR)
SELECT regular_season FROM table_1046454_1 WHERE year = 2011
How many ranks by average when Keiron & Brianne are the couple?
CREATE TABLE table_28643 ("Rank by average" real,"Place" real,"Couple" text,"Total points" text,"Number of dances" real,"Average" text)
SELECT COUNT("Rank by average") FROM table_28643 WHERE "Couple" = 'Keiron & Brianne'
For those records from the products and each product's manufacturer, give me the comparison about the sum of code over the headquarter , and group by attribute headquarter, and sort in descending by the bar.
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 T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter DESC
When 7.08 is the amount of viewers what is the air date?
CREATE TABLE table_24781886_3 (air_date VARCHAR,viewers VARCHAR)
SELECT air_date FROM table_24781886_3 WHERE viewers = "7.08"
give me the latest NW flight from MILWAUKEE to TACOMA tomorrow
CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)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 city (city_code varchar,city_name varchar,state_code varc...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TACOMA' AND date_day.day_number = 20 AND date_day.month_number = 1 AND ...
What's the top year with the Chassis ats hs1?
CREATE TABLE table_14877 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT MAX("Year") FROM table_14877 WHERE "Chassis" = 'ats hs1'
what are the genders of patient 002-56853?
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 patient.gender FROM patient WHERE patient.uniquepid = '002-56853'
What is the gross capacity where the reactor is ABWR type?
CREATE TABLE table_name_54 (gross_capacity VARCHAR,reactor_type VARCHAR)
SELECT gross_capacity FROM table_name_54 WHERE reactor_type = "abwr"
What was the original title of Run for Money?
CREATE TABLE table_18162883_1 (original_title VARCHAR,film_title_used_in_nomination VARCHAR)
SELECT original_title FROM table_18162883_1 WHERE film_title_used_in_nomination = "Run for Money"
How many sacks have 72 as the solo and a TTkl less than 112?
CREATE TABLE table_68109 ("Year" text,"Team" text,"TTkl" real,"Solo" real,"Sacks" real,"Pass Def" real)
SELECT COUNT("Sacks") FROM table_68109 WHERE "Solo" = '72' AND "TTkl" < '112'
what was the new medication of patient 83038 today compared to that of the patient yesterday?
CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses_icd (row_id nu...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83038) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE...
I want the total number of gross tonnage when entered service was 1903
CREATE TABLE table_55501 ("Ship's name" text,"Entered service" text,"Ended service" text,"Gross Tonnage" real,"Type of Vessel" text)
SELECT COUNT("Gross Tonnage") FROM table_55501 WHERE "Entered service" = '1903'
What is the title of the prerequisite class of International Finance course?
CREATE TABLE prereq (course_id text,prereq_id text)CREATE TABLE teaches (id text,course_id text,sec_id text,semester text,year number)CREATE TABLE section (course_id text,sec_id text,semester text,year number,building text,room_number text,time_slot_id text)CREATE TABLE course (course_id text,title text,dept_name text,...
SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'International Finance')
Name the viewers for production code being 3x6706
CREATE TABLE table_24933 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text)
SELECT "U.S. viewers (million)" FROM table_24933 WHERE "Production code" = '3X6706'
What type of ride is Rameses Revenge?
CREATE TABLE table_name_59 (type VARCHAR,ride_name VARCHAR)
SELECT type FROM table_name_59 WHERE ride_name = "rameses revenge"
Which Name has an Overall of 235?
CREATE TABLE table_name_78 (name VARCHAR,overall VARCHAR)
SELECT name FROM table_name_78 WHERE overall = 235
What is the hot 100 reaction in week of top 13 for Kanye West?
CREATE TABLE table_52338 ("Week" text,"Performer(s)" text,"Hot 100 Reaction" text,"Hot Digital Songs Reaction" text,"Notes" text)
SELECT "Hot 100 Reaction" FROM table_52338 WHERE "Week" = 'top 13' AND "Performer(s)" = 'kanye west'
What's the total number of points for grace dunne with a draw over 5?
CREATE TABLE table_name_93 (points VARCHAR,artist VARCHAR,draw VARCHAR)
SELECT COUNT(points) FROM table_name_93 WHERE artist = "grace dunne" AND draw > 5
Who wrote the episode that 2.93 million viewers?
CREATE TABLE table_30221 ("Series #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text)
SELECT "Written by" FROM table_30221 WHERE "U.S. viewers (million)" = '2.93'
What is the total number of goals that have games under 11, debut round over 15, and age of 20 years, 71 days?
CREATE TABLE table_45733 ("Name" text,"Club" text,"Age at debut" text,"Debut round" real,"Games (2008)" real,"Goals (2008)" real)
SELECT COUNT("Goals (2008)") FROM table_45733 WHERE "Games (2008)" < '11' AND "Debut round" > '15' AND "Age at debut" = '20 years, 71 days'
Name the number of poles for fastest laps being 6
CREATE TABLE table_29378 ("Season" real,"Series" text,"Team" text,"Starts" real,"Wins" real,"Podiums" real,"Poles" real,"Fastest Laps" real,"Points" text,"Place" text)
SELECT COUNT("Poles") FROM table_29378 WHERE "Fastest Laps" = '6'
what's the first value of the arterial bp [diastolic] of patient 4269?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spe...
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 = 4269)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial b...
did mitsuo kamata have more than 40 total points ?
CREATE TABLE table_203_456 (id number,"player" text,"-1967" text,"3.3" text,"3.31" text,"4.04" text,"10.14" text,"1968" text,"total" text)
SELECT (SELECT "total" FROM table_203_456 WHERE "player" = 'mitsuo kamata') > 40
in the CHE department , are any of the courses I 've taken among the hardest ?
CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varch...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'CHE' AND program_course.workload = (SELECT MAX(P...
Show me a bar chart for how many stadiums does each country have?, could you display x axis in descending order?
CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te...
SELECT Country, COUNT(*) FROM stadium GROUP BY Country ORDER BY Country DESC
What is the other that has 20.80% as the firefox?
CREATE TABLE table_79301 ("Period" text,"Internet Explorer" text,"Firefox" text,"Chrome" text,"Safari" text,"Opera" text,"Other" text)
SELECT "Other" FROM table_79301 WHERE "Firefox" = '20.80%'
return me the number of papers by ' H. V. Jagadish ' on VLDB conference after 2000 .
CREATE TABLE conference (cid int,homepage varchar,name varchar)CREATE TABLE author (aid int,homepage varchar,name varchar,oid int)CREATE TABLE writes (aid int,pid int)CREATE TABLE cite (cited int,citing int)CREATE TABLE publication (abstract varchar,cid int,citation_num int,jid int,pid int,reference_num int,title varch...
SELECT COUNT(DISTINCT (publication.title)) FROM author, conference, publication, writes WHERE author.name = 'H. V. Jagadish' AND conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.year > 2000 AND writes.aid = author.aid AND writes.pid = publication.pid
Which event is in round 1 with a record at 5-1?
CREATE TABLE table_6345 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Event" FROM table_6345 WHERE "Round" = '1' AND "Record" = '5-1'
what is maximum age of patients whose days of hospital stay is 20 and year of death is less than 2131?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.days_stay = "20" AND demographic.dod_year < "2131.0"
Name the most kirdistan list for diyala
CREATE TABLE table_26848 ("Governorate" text,"Kurdistan Democratic Party" real,"Patriotic Union of Kurdistan" real,"Total Kurdistan List" real,"Total Governorate Seats" real)
SELECT MAX("Total Kurdistan List") FROM table_26848 WHERE "Governorate" = 'Diyala'
How many original titles were listed as 'If the Sun Never Returns'?
CREATE TABLE table_22034853_1 (original_title VARCHAR,film_title_used_in_nomination VARCHAR)
SELECT COUNT(original_title) FROM table_22034853_1 WHERE film_title_used_in_nomination = "If the Sun Never Returns"
how many patients whose diagnoses long title is other second degree atrioventricular block and drug route is oral?
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Other second degree atrioventricular block" AND prescriptions.route = "ORAL"
What was the result in week 14?
CREATE TABLE table_9615 ("Week" real,"Date" text,"Opponent" text,"Stadium" text,"Result" text,"Record" text,"Streak" text,"Attendance" real)
SELECT "Result" FROM table_9615 WHERE "Week" = '14'
What are the elimination moves of wrestlers whose team is 'Team Orton'?
CREATE TABLE Elimination (Elimination_Move VARCHAR,Team VARCHAR)
SELECT Elimination_Move FROM Elimination WHERE Team = "Team Orton"
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the amount of hire_date bin hire_date by weekday, and sort how many hire date in ascending order.
CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COUNT(HIRE_DATE)
What is the sum of the people in attendance when there was a Loss of clement (5 7)?
CREATE TABLE table_name_83 (attendance INTEGER,loss VARCHAR)
SELECT SUM(attendance) FROM table_name_83 WHERE loss = "clement (5–7)"
What was the swimsuit score for the one who had a semifinal average of 8.759 (5)?
CREATE TABLE table_16323766_3 (swimsuit VARCHAR,semifinal_average VARCHAR)
SELECT swimsuit FROM table_16323766_3 WHERE semifinal_average = "8.759 (5)"
Popularity of Camera Brands by Time.
CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,Com...
SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS m, TagName, COUNT(*) FROM PostTags AS pt JOIN Posts AS q ON q.Id = pt.PostId JOIN Tags AS t ON t.Id = pt.TagId WHERE TagName IN ('pentax', 'sony', 'canon', 'nikon', 'fujifilm', 'olympus', 'panasonic', 'sigma') AND q.CreationDate < DATEADD(month, DATEDIFF(mon...
What was the score of the Home team that played against Carlton's Away game?
CREATE TABLE table_name_3 (home_team VARCHAR,away_team VARCHAR)
SELECT home_team AS score FROM table_name_3 WHERE away_team = "carlton"
What is the Date of the Everton Away game?
CREATE TABLE table_name_95 (date VARCHAR,away_team VARCHAR)
SELECT date FROM table_name_95 WHERE away_team = "everton"
What was on at 8:30 when dancing with the stars: the results was on at 9:30?
CREATE TABLE table_41948 ("8:00" text,"8:30" text,"9:00" text,"9:30" text,"10:00" text)
SELECT "8:30" FROM table_41948 WHERE "9:00" = 'dancing with the stars: the results'
count the number of patients whose gender is f and primary disease is aortic valve insuffiency\aortic valve replacement /sda?
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 demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA"
How many millions of viewers were there for the episode with a run time of 18:00?
CREATE TABLE table_1601935_1 (viewers__in_millions_ VARCHAR,run_time VARCHAR)
SELECT viewers__in_millions_ FROM table_1601935_1 WHERE run_time = "18:00"
What is the total number of Losses that Melton had when they had fewer Draws than 0?
CREATE TABLE table_40775 ("Ballarat FL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real)
SELECT SUM("Losses") FROM table_40775 WHERE "Ballarat FL" = 'melton' AND "Draws" < '0'
Give me a histogram for how many drama workshop groups are there in each city? Return both the city and the count, display from low to high by the X-axis.
CREATE TABLE Bookings (Booking_ID INTEGER,Customer_ID INTEGER,Workshop_Group_ID VARCHAR(100),Status_Code CHAR(15),Store_ID INTEGER,Order_Date DATETIME,Planned_Delivery_Date DATETIME,Actual_Delivery_Date DATETIME,Other_Order_Details VARCHAR(255))CREATE TABLE Ref_Payment_Methods (payment_method_code CHAR(10),payment_meth...
SELECT City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town ORDER BY City_Town
What is the accrediation for united tribes technical college?
CREATE TABLE table_2330 ("School" text,"Location(s)" text,"Control" text,"Type" text,"Enrollment (fall 2010)" real,"Founded" real,"Accreditation" text)
SELECT "Accreditation" FROM table_2330 WHERE "School" = 'United Tribes Technical College'
how many world championships has he been in ?
CREATE TABLE table_203_429 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text)
SELECT COUNT(*) FROM table_203_429 WHERE "competition" = 'world championships'
what are the locations that joined in 2008
CREATE TABLE table_16988 ("Institution" text,"Location" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" text,"Nickname" text)
SELECT "Location" FROM table_16988 WHERE "Joined" = '2008'
what is the number of patients whose insurance is medicaid and primary disease is bradycardia?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.diagnosis = "BRADYCARDIA"
Count the number of customers recorded.
CREATE TABLE marketing_regions (marketing_region_code text,marketing_region_name text,marketing_region_descriptrion text,other_details text)CREATE TABLE bookings_services (order_id number,product_id number)CREATE TABLE drama_workshop_groups (workshop_group_id number,address_id number,currency_code text,marketing_region...
SELECT COUNT(*) FROM customers
What is the role code with the largest number of employees?
CREATE TABLE Employees (role_code VARCHAR)
SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1
i would like to fly from BOSTON to OAKLAND what airlines fly from BOSTON to OAKLAND
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 airline.airline_code FROM airline, 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na...
For each player, what are their name, season, and country that they belong to?
CREATE TABLE team (team_id number,name text)CREATE TABLE country (country_id number,country_name text,capital text,official_native_language text)CREATE TABLE match_season (season number,player text,position text,country number,team number,draft_pick_number number,draft_class text,college text)CREATE TABLE player (playe...
SELECT T2.season, T2.player, T1.country_name FROM country AS T1 JOIN match_season AS T2 ON T1.country_id = T2.country
When did the VFL pay at Victoria Park?
CREATE TABLE table_33589 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_33589 WHERE "Venue" = 'victoria park'
how many games has kansas state and depaul played against each other
CREATE TABLE table_20286 ("Kansas State vs." text,"Games played" real,"Overall Record" text,"Last 5 Meetings" text,"Last 10 Meetings" text,"Current Streak" text,"Last Meeting" text)
SELECT COUNT("Games played") FROM table_20286 WHERE "Kansas State vs." = 'DePaul'
Most Upvotes for CSS in a given Location. Wanted to know who the serious players are in my city for various tags. Should turn TagName into an Input as well...
CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE FlagTypes (Id number,Name text,Description text)C...
SELECT DisplayName, Reputation, TagName, Age, WebsiteUrl, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 INNER JOIN Users ON Posts.OwnerUserId = Users.Id WHERE LOWER(Locatio...
What place is listed in the 2002-2003 season for the City of Aveiro?
CREATE TABLE table_62639 ("Club" text,"Head Coach" text,"City" text,"Stadium" text,"2002-2003 season" text)
SELECT "2002-2003 season" FROM table_62639 WHERE "City" = 'aveiro'
Who was the match against when on a clay surface during round 2r?
CREATE TABLE table_name_19 (against VARCHAR,round VARCHAR,surface VARCHAR)
SELECT against FROM table_name_19 WHERE round = "2r" AND surface = "clay"
how many hours have elapsed since patient 027-188709 last received procedure during this hospital encounter?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,obs...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-18870...
What was the date of the game at MCG?
CREATE TABLE table_name_85 (date VARCHAR,venue VARCHAR)
SELECT date FROM table_name_85 WHERE venue = "mcg"
What is the least amount of wins when against is 1314?
CREATE TABLE table_65701 ("Club" text,"Wins" real,"Losses" real,"Draws" real,"Against" real)
SELECT MIN("Wins") FROM table_65701 WHERE "Against" = '1314'
How many Heats have a Name of miguel molina?
CREATE TABLE table_64278 ("Heat" real,"Lane" real,"Name" text,"Nationality" text,"Time" text)
SELECT COUNT("Heat") FROM table_64278 WHERE "Name" = 'miguel molina'
Show different parties of people along with the number of people in each party Plot them as bar chart, display by the names in descending.
CREATE TABLE debate_people (Debate_ID int,Affirmative int,Negative int,If_Affirmative_Win bool)CREATE TABLE people (People_ID int,District text,Name text,Party text,Age int)CREATE TABLE debate (Debate_ID int,Date text,Venue text,Num_of_Audience int)
SELECT Party, COUNT(*) FROM people GROUP BY Party ORDER BY Party DESC
What are the names of students who have taken the prerequisite for the course International Finance?
CREATE TABLE classroom (building text,room_number text,capacity number)CREATE TABLE teaches (id text,course_id text,sec_id text,semester text,year number)CREATE TABLE prereq (course_id text,prereq_id text)CREATE TABLE section (course_id text,sec_id text,semester text,year number,building text,room_number text,time_slot...
SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE T2.course_id IN (SELECT T4.prereq_id FROM course AS T3 JOIN prereq AS T4 ON T3.course_id = T4.course_id WHERE T3.title = 'International Finance')
Top 100 users in Chennai.
CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHos...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%chennai%' OR UPPER(Location) LIKE '%CHENNAI' ORDER BY Reputation DESC LIMIT 1000
how many remittances in 2010 for nigeria?
CREATE TABLE table_31134 ("Country" text,"Remittances 2008" text,"Remittances 2009" text,"Remittances 2010" text,"Remittances 2011" text)
SELECT "Remittances 2010" FROM table_31134 WHERE "Country" = 'Nigeria'
diagnosis of lewy body dementia or mild cognitive impairment
CREATE TABLE table_train_88 ("id" int,"mini_mental_state_examination_mmse" int,"mild_cognitive_impairment" bool,"body_weight" float,"renal_disease" bool,"memantine" bool,"rivastigmine" bool,"lewy_body_dementia" bool,"NOUSE" float)
SELECT * FROM table_train_88 WHERE lewy_body_dementia = 1 OR mild_cognitive_impairment = 1
What is English Translation, when Lyricist(s) is 'Giorgos Moukidis', and when Original Album is 'Ena (New Edition)
CREATE TABLE table_60616 ("English translation" text,"Original album" text,"Lyricist(s)" text,"Composer(s)" text,"Time" text)
SELECT "English translation" FROM table_60616 WHERE "Lyricist(s)" = 'giorgos moukidis' AND "Original album" = 'ena (new edition)'
show me the heart rate change in patient 4401 last measured on the current intensive care unit visit compared to the first value measured on the current intensive care unit visit?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE procedures_icd...
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 = 4401) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_it...
what's the name of the drug that was first prescribed to patient 3229 in 12/2105?
CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREA...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3229) AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-12' ORDER BY prescriptions.startdate LIMIT 1
Is AEROSP 416 required for anything ?
CREATE TABLE area (course_id int,area varchar)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE program (program_id int,name varchar,college varc...
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'AEROSP' AND COURSE_0.number = 416 AND COURSE_1.course_id = course_prerequisite.course_id
Find the id and local authority of the station whose maximum precipitation is higher than 50.
CREATE TABLE station (id VARCHAR,local_authority VARCHAR)CREATE TABLE weekly_weather (station_id VARCHAR,precipitation INTEGER)
SELECT t2.id, t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id HAVING MAX(t1.precipitation) > 50
what is minimum age of patients whose admission type is emergency and days of hospital stay is 0?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.days_stay = "0"
Bar chart x axis all games y axis acc_percent, I want to order from high to low by the Y-axis.
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_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT All_Games, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC
What is the format of the album Pacific Ocean Blue in 1991?
CREATE TABLE table_61432 ("Artist" text,"Album" text,"Country" text,"Year" real,"Catalog #" text,"Format" text)
SELECT "Format" FROM table_61432 WHERE "Album" = 'pacific ocean blue' AND "Year" = '1991'
when was patient 027-61708 given a procedure for the first time during the current hospital encounter?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE microlab (microlabi...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-61708' AND patient.hospitaldischargetime IS NULL)) ORDER BY t...
For each account type, find the average account balance of customers with credit score lower than 50 Show bar chart, and display by the bars in desc please.
CREATE TABLE bank (branch_ID int,bname varchar(20),no_of_customers int,city varchar(10),state varchar(20))CREATE TABLE loan (loan_ID varchar(3),loan_type varchar(15),cust_ID varchar(3),branch_ID varchar(3),amount int)CREATE TABLE customer (cust_ID varchar(3),cust_name varchar(20),acc_type char(1),acc_bal int,no_of_loan...
SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY acc_type DESC
When did the no. 23 show originally air?
CREATE TABLE table_10718984_2 (original_air_date VARCHAR,no_in_season VARCHAR)
SELECT original_air_date FROM table_10718984_2 WHERE no_in_season = 23
What was the 2011 gross revenue for the venue that had a gross revenue of $156,315 in 1982?
CREATE TABLE table_name_6 (gross_revenue__2011_ VARCHAR,gross_revenue__1982_ VARCHAR)
SELECT gross_revenue__2011_ FROM table_name_6 WHERE gross_revenue__1982_ = "$156,315"
provide the number of patients whose primary disease is s/p fall and lab test fluid is urine?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "S/P FALL" AND lab.fluid = "Urine"
What was the score on a clay surface on May 29, 2006?
CREATE TABLE table_name_5 (score VARCHAR,surface VARCHAR,date VARCHAR)
SELECT score FROM table_name_5 WHERE surface = "clay" AND date = "may 29, 2006"
the top played position according to this chart .
CREATE TABLE table_204_783 (id number,"position" text,"player" text,"free agency\ntag" text,"date signed" text,"2013 team" text)
SELECT "position" FROM table_204_783 GROUP BY "position" ORDER BY COUNT(*) DESC LIMIT 1
For those records from the products and each product's manufacturer, give me the comparison about code over the name , and group by attribute headquarter, and show names from high to low order 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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC
what is the years for the displacement 4.0l (242cid)?
CREATE TABLE table_51253 ("Years" text,"Displacement" text,"Engine" text,"Power" text,"Torque" text)
SELECT "Years" FROM table_51253 WHERE "Displacement" = '4.0l (242cid)'
What is the average total medals Egypt, who has less than 2 gold, has?
CREATE TABLE table_name_67 (total INTEGER,nation VARCHAR,gold VARCHAR)
SELECT AVG(total) FROM table_name_67 WHERE nation = "egypt" AND gold < 2