instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is the name of race that has a winning driver of Stirling moss and a Circuit of oulton park?
CREATE TABLE table_name_23 (race_name VARCHAR,winning_driver VARCHAR,circuit VARCHAR)
SELECT race_name FROM table_name_23 WHERE winning_driver = "stirling moss" AND circuit = "oulton park"
How tall are contestants whose home province is La Rioja?
CREATE TABLE table_26098 ("Province" text,"Contestant" text,"Age" real,"Height (in)" text,"Height (mt)" text,"Hometown" text)
SELECT "Height (in)" FROM table_26098 WHERE "Province" = 'La Rioja'
What is 2nd Party, when Election is '1865'?
CREATE TABLE table_name_82 (election VARCHAR)
SELECT 2 AS nd_party FROM table_name_82 WHERE election = "1865"
How many season are shown for the 2nd position?
CREATE TABLE table_27631002_1 (season VARCHAR,position VARCHAR)
SELECT COUNT(season) FROM table_27631002_1 WHERE position = "2nd"
Find the name and category of the most expensive product.
CREATE TABLE products (product_name VARCHAR,product_category_code VARCHAR,product_price VARCHAR)
SELECT product_name, product_category_code FROM products ORDER BY product_price DESC LIMIT 1
What is the HDTV when the Package/Option is sky famiglia, and a Television service of boomerang +1?
CREATE TABLE table_75895 ("Television service" text,"Country" text,"Language" text,"Content" text,"HDTV" text,"Package/Option" text)
SELECT "HDTV" FROM table_75895 WHERE "Package/Option" = 'sky famiglia' AND "Television service" = 'boomerang +1'
Which professors are not teaching classes with labs ?
CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE requirement (requirement_id int,requirement var...
SELECT DISTINCT instructor.name FROM instructor, course, course_offering, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course_offering.offering_id = offering_instructor.offering_id AND instructor.instructor_id = offering_instructor.instructor_id AND NOT instr...
A bar chart shows the distribution of All_Games and Team_ID , could you display by the x-axis in desc?
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_Games, Team_ID FROM basketball_match ORDER BY All_Games DESC
How many series premieres did the season 'All-stars' have?
CREATE TABLE table_25659 ("Season" text,"Episodes" real,"Series premiere" text,"Series finale" text,"Winning couple" text,"Winning profit (AUD)" text,"Host(s)" text,"Judges" text)
SELECT COUNT("Series premiere") FROM table_25659 WHERE "Season" = 'All-Stars'
Show the number of documents for different budget type code in a pie chart.
CREATE TABLE Accounts (Account_ID INTEGER,Statement_ID INTEGER,Account_Details VARCHAR(255))CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR(15),Budget_Type_Description VARCHAR(255))CREATE TABLE Documents_with_Expenses (Document_ID INTEGER,Budget_Type_Code CHAR(15),Document_Details VARCHAR(255))CREATE TABLE Ref_Doc...
SELECT T1.Budget_Type_Code, COUNT(T1.Budget_Type_Code) FROM Documents_with_Expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_Code = T2.Budget_Type_Code GROUP BY T1.Budget_Type_Code
since 2 years ago, what were the top four most frequently prescribed drugs for patients with age 40s?
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.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-2 year') GR...
Community Edits Count Rank by User.
CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,U...
WITH RankedUsers AS (SELECT RANK() OVER (ORDER BY COUNT(DISTINCT ph.PostId) DESC) AS Rank, ph.UserId, COUNT(DISTINCT ph.PostId) AS EditCount FROM PostHistory AS ph JOIN Posts AS p ON ph.PostId = p.Id AND ph.UserId != p.OwnerUserId WHERE PostHistoryTypeId IN (4, 5) GROUP BY ph.UserId) SELECT Rank, UserId AS "user_link",...
Total view counts of all closed questions.
CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)...
SELECT SUM(CAST(ViewCount AS INT)) FROM Posts WHERE PostTypeId = 1 AND (Posts.CreationDate BETWEEN '2013-01-01' AND '2017-12-31')
give me the number of patients whose primary disease is s/p fall and lab test fluid is cerebrospinal fluid (csf)?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "S/P FALL" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
among patients who were prescribed dakins 1/2 strength, what were the four most commonly prescribed drugs at the same time, in this year?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'dakins 1/2 strength' AND DATETIME(prescriptions.startdate, 'start...
What are the class requirements for my Other ?
CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id
Name the most male life expectancy for pakistan
CREATE TABLE table_29260 ("Overall rank" real,"Country" text,"Overall life expectancy" real,"Male life expectancy" real,"Male rank" real,"Female life expectancy" real,"Female rank" real)
SELECT MAX("Male life expectancy") FROM table_29260 WHERE "Country" = 'Pakistan'
What is Position, when Pick is 7?
CREATE TABLE table_43589 ("Round" real,"Pick" text,"Player" text,"Position" text,"Nationality" text,"School/Club Team" text)
SELECT "Position" FROM table_43589 WHERE "Pick" = '7'
how many patients whose marital status is married and item id is 50820?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.itemid = "50820"
how many patients of black/cape verdean ethnicity stayed in hospital for more than 9 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 WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay > "9"
What is the highest Isolation (km) when the elevation was smaller than 1320, and a Municipality of hinn ya?
CREATE TABLE table_67724 ("Peak" text,"Elevation (m)" real,"Prominence (m)" real,"Isolation (km)" real,"Municipality" text,"County" text)
SELECT MAX("Isolation (km)") FROM table_67724 WHERE "Elevation (m)" < '1320' AND "Municipality" = 'hinnøya'
What is the total number of Round, when Position is 'D', and when Player is 'Andrew Campbell'?
CREATE TABLE table_name_94 (round VARCHAR,position VARCHAR,player VARCHAR)
SELECT COUNT(round) FROM table_name_94 WHERE position = "d" AND player = "andrew campbell"
How many districts had an depravity level of 27.7
CREATE TABLE table_13618358_1 (district VARCHAR,income_poverty_f VARCHAR)
SELECT COUNT(district) FROM table_13618358_1 WHERE income_poverty_f = "27.7"
what is the variation of patient 29540's heart rate measured at 2101-04-21 16:00:00 compared to the value measured at 2101-04-21 15:00:00?
CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text...
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 = 29540)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'h...
What is the Record for April 22?
CREATE TABLE table_46591 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Record" FROM table_46591 WHERE "Date" = 'april 22'
Which mixed doubles happened later than 2011?
CREATE TABLE table_name_2 (mixed_doubles VARCHAR,year INTEGER)
SELECT mixed_doubles FROM table_name_2 WHERE year > 2011
how long was his professional career ?
CREATE TABLE table_204_399 (id number,"outcome" text,"no." number,"year" number,"championship" text,"opponent in the final" text,"score" text)
SELECT MAX("year") - MIN("year") FROM table_204_399
What is the result when the nominee(s) of janine sherman?
CREATE TABLE table_name_57 (result VARCHAR,nominee_s_ VARCHAR)
SELECT result FROM table_name_57 WHERE nominee_s_ = "janine sherman"
What stadium has a final score of 26 21?
CREATE TABLE table_name_8 (stadium VARCHAR,final_score VARCHAR)
SELECT stadium FROM table_name_8 WHERE final_score = "26–21"
What is the number of divorced patients who had a free calcium lab test done?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Free Calcium"
What is the smallest population with an Area (km ) of 1115.4?
CREATE TABLE table_name_72 (population INTEGER,area__km²_ VARCHAR)
SELECT MIN(population) FROM table_name_72 WHERE area__km²_ = 1115.4
Which Institution has a Mascot of broncbusters?
CREATE TABLE table_name_43 (institution VARCHAR,mascot VARCHAR)
SELECT institution FROM table_name_43 WHERE mascot = "broncbusters"
What is the location of 11 April 2013 and Mexico Home team?
CREATE TABLE table_43149 ("Date" text,"Tournament" text,"Location" text,"Home team" text,"Score" text,"Away team" text)
SELECT "Location" FROM table_43149 WHERE "Home team" = 'mexico' AND "Date" = '11 april 2013'
what is average age of patients whose primary disease is sepsis and age is greater than or equal to 72?
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 AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "SEPSIS" AND demographic.age >= "72"
Which player went to Pittsburg State
CREATE TABLE table_15353123_1 (player VARCHAR,college VARCHAR)
SELECT player FROM table_15353123_1 WHERE college = "Pittsburg State"
count the number of patients whose death status is 1 and age is less than 70?
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.expire_flag = "1" AND demographic.age < "70"
Which nationality has left wing as the position and college/junior/team is portland winterhawks (whl)?
CREATE TABLE table_4126 ("Pick" text,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT "Nationality" FROM table_4126 WHERE "Position" = 'Left Wing' AND "College/junior/club team" = 'Portland Winterhawks (WHL)'
may i have a listing of flights from MINNEAPOLIS to LONG BEACH CALIFORNIA on tuesday
CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE code_description (code varchar,description text)CREATE TABLE flight_leg (flight_id int,leg_number int,l...
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, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LONG BEACH' AND date_day.day_number = 22 AND date_day.month_number...
What is the earliest year that had the Legend of Zelda: Twilight Princess game?
CREATE TABLE table_name_90 (year INTEGER,game VARCHAR)
SELECT MIN(year) FROM table_name_90 WHERE game = "the legend of zelda: twilight princess"
How many movies did ' Ronald Reagan ' act in ?
CREATE TABLE genre (gid int,genre text)CREATE TABLE copyright (id int,msid int,cid int)CREATE TABLE directed_by (id int,msid int,did int)CREATE TABLE cast (id int,msid int,aid int,role text)CREATE TABLE movie (mid int,title text,release_year int,title_aka text,budget text)CREATE TABLE producer (pid int,gender text,name...
SELECT COUNT(DISTINCT (movie.title)) FROM actor, cast, movie WHERE actor.name = 'Ronald Reagan' AND cast.aid = actor.aid AND movie.mid = cast.msid
What was Home team Footscray's score?
CREATE TABLE table_11252 ("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_11252 WHERE "Home team" = 'footscray'
count the numbers of patients who died after having been diagnosed with prim pulm hypertension during the same hospital visit since 2103.
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 admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_id FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FRO...
how many patients passed away within 2 months after they were diagnosed with sec mal neo brain/spine this year?
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,ro...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di...
Who was the opponent with the time 3:59?
CREATE TABLE table_name_52 (opponent VARCHAR,time VARCHAR)
SELECT opponent FROM table_name_52 WHERE time = "3:59"
Which Result has an Attendance of bye?
CREATE TABLE table_48901 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT "Result" FROM table_48901 WHERE "Attendance" = 'bye'
okay for now i would like information on a flight on 4 27 from PITTSBURGH to ATLANTA leaving early in the morning about 800 o'clock
CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE code_description (code varchar,description text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE fare_basis (fare_basis_code text,bookin...
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 ((((flight.departure_time <= 830 AND flight.departure_time >= 730) AND (flight.departure_time BETWEEN 0 AND 800)) AND date_day.day_number = 27 AN...
show me the flights from DENVER to PHILADELPHIA
CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)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 city (city_code varchar...
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE...
What is the lowest number of laps obtained by driver Nick Heidfeld?
CREATE TABLE table_11110 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT MIN("Laps") FROM table_11110 WHERE "Driver" = 'nick heidfeld'
what is average age of patients whose ethnicity is black/african american and age is greater than or equal to 41?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.age >= "41"
What is the netflix code where the series and episode are 4-11?
CREATE TABLE table_15187735_4 (netflix VARCHAR,series_ep VARCHAR)
SELECT netflix FROM table_15187735_4 WHERE series_ep = "4-11"
Which Qual 1 has a Qual 2 of 59.822?
CREATE TABLE table_65375 ("Name" text,"Team" text,"Qual 1" text,"Qual 2" text,"Best" text)
SELECT "Qual 1" FROM table_65375 WHERE "Qual 2" = '59.822'
What is the total react number with a time less than 20.05 and a lane less than 6?
CREATE TABLE table_63690 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"React" real,"Time" real)
SELECT COUNT("React") FROM table_63690 WHERE "Time" < '20.05' AND "Lane" < '6'
What was Freddie Starr, who entered on Day 1, known for?
CREATE TABLE table_6102 ("Celebrity" text,"Known for" text,"Entered" text,"Exited" text,"Finished" text)
SELECT "Known for" FROM table_6102 WHERE "Entered" = 'day 1' AND "Celebrity" = 'freddie starr'
patient 51858 has made an admission since 2104?
CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREA...
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 51858 AND STRFTIME('%y', admissions.admittime) >= '2104'
Stack bar chart of the number of local authority vs services based on local authority, and order Y-axis from low to high order.
CREATE TABLE train (id int,train_number int,name text,origin text,destination text,time text,interval text)CREATE TABLE station (id int,network_name text,services text,local_authority text)CREATE TABLE weekly_weather (station_id int,day_of_week text,high_temperature int,low_temperature int,precipitation real,wind_speed...
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY services, local_authority ORDER BY COUNT(local_authority)
What is the arena in Borgarnes?
CREATE TABLE table_34169 ("Team" text,"City,Region" text,"Arena" text,"Colours" text,"Head coach" text)
SELECT "Arena" FROM table_34169 WHERE "City, Region" = 'borgarnes'
How many episodes have a premier date of july 24, 2006
CREATE TABLE table_73281 ("Season" real,"Episode" real,"Episode Summary" text,"Premier date" text,"External Link" text,"Coach" text)
SELECT COUNT("External Link") FROM table_73281 WHERE "Premier date" = 'July 24, 2006'
What is the most silver medals?
CREATE TABLE table_1305623_18 (silver_medals INTEGER)
SELECT MAX(silver_medals) FROM table_1305623_18
Who won the Women's doubles the year that there was no competition in the Men's doubles and Arthur Chatschatourow won the Men's singles?
CREATE TABLE table_34277 ("Year" text,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text)
SELECT "Women's doubles" FROM table_34277 WHERE "Men's doubles" = 'no competition' AND "Men's singles" = 'arthur chatschatourow'
count the number of times patient 18677 received sodium bicarb on the first intensive care unit visit.
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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 cost (row_id number,subject_id number,hadm_id number,event_type text,eve...
SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18677) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND inputevents_cv.itemid IN (SELE...
Q0.3.1 - Questions per year - all-time.
CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat...
SELECT YEAR(CreationDate) AS "year", COUNT(1) AS questions, SUM(CASE WHEN AnswerCount > 0 THEN 1 ELSE 0 END) AS questions_with_answer, SUM(CASE WHEN NOT AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS questions_with_accepted_answer FROM Posts WHERE PostTypeId = 1 AND NOT OwnerUserId IS NULL AND YEAR(CreationDate) BETWEE...
How many points did the Weslake v12 get in 1966?
CREATE TABLE table_70125 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT MAX("Points") FROM table_70125 WHERE "Engine" = 'weslake v12' AND "Year" < '1966'
What is the result of round R3?
CREATE TABLE table_name_34 (result VARCHAR,round VARCHAR)
SELECT result FROM table_name_34 WHERE round = "r3"
How many records have black knights points as 17?
CREATE TABLE table_24117 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Black Knights points" real,"Opponents" real,"Record" text)
SELECT COUNT("Record") FROM table_24117 WHERE "Black Knights points" = '17'
What is the lowest Top-25 that has 3 Events and Wins greater than 0?
CREATE TABLE table_76032 ("Tournament" text,"Wins" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT MIN("Top-25") FROM table_76032 WHERE "Events" = '3' AND "Wins" > '0'
Name the votes given for michael russo, genevy dimitrion , manny ortega
CREATE TABLE table_1855841_1 (votes_given VARCHAR,running_with__in_team_ VARCHAR)
SELECT votes_given FROM table_1855841_1 WHERE running_with__in_team_ = "Michael Russo, Genevy Dimitrion , Manny Ortega"
What are all of the dates in the country of Canada?
CREATE TABLE table_20002 ("Year" text,"Dates" text,"Champion" text,"Country" text,"Score" text,"Tournament location" text,"Purse ($)" real,"Winners share ($)" real)
SELECT "Dates" FROM table_20002 WHERE "Country" = 'Canada'
who are the writers of the episode that had 3.07 millions of North American spectators?
CREATE TABLE table_24696 ("No." real,"#" 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_24696 WHERE "U.S. viewers (million)" = '3.07'
What is the lowest total that has a rank less than 8, a silver greater than 6, and 20 as the bronze?
CREATE TABLE table_63026 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MIN("Total") FROM table_63026 WHERE "Rank" < '8' AND "Silver" > '6' AND "Bronze" = '20'
What is the change in % of the country's population since 1993 in the Lambayeque region?
CREATE TABLE table_28629 ("Region" text,"Population" real,"% of countrys population" text,"Change in population since 1993" real,"Change in % of countrys population since 1993" text)
SELECT "Change in % of countrys population since 1993" FROM table_28629 WHERE "Region" = 'Lambayeque'
Give me a line chart about the number of competitions held in each year, could you rank by the X in ascending?
CREATE TABLE farm (Farm_ID int,Year int,Total_Horses real,Working_Horses real,Total_Cattle real,Oxen real,Bulls real,Cows real,Pigs real,Sheep_and_Goats real)CREATE TABLE farm_competition (Competition_ID int,Year int,Theme text,Host_city_ID int,Hosts text)CREATE TABLE competition_record (Competition_ID int,Farm_ID int,...
SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID ORDER BY Year
how many patients received non-invasive testing for dvt after vasopressors - norepinephrine <= 0.1 micrograms/kg/min in 2102 in the same hospital visit?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname tex...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vasopressors - norepinephrine <= 0.1 micrograms/kg/min' AND STRFTIME('%y'...
What draft pick number did Kentucky get?
CREATE TABLE table_3222 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text)
SELECT MIN("Pick #") FROM table_3222 WHERE "College" = 'Kentucky'
calculate the four year survival probability of the patients who were prescribed clopidogrel bisulfate after having been diagnosed with kidney laceration-open.
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_items (row_id number,itemid number,label text,linksto text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
Which team has far rabat as the team 1?
CREATE TABLE table_name_64 (team_2 VARCHAR,team_1 VARCHAR)
SELECT team_2 FROM table_name_64 WHERE team_1 = "far rabat"
Posts that could be marked as 'not an answer' to help get the Marshal badge. targeting answers from users with not a lot of rep. I hate the use of `body like`, so please feel free to edit this. It was just quick n dirty! The Marshal badge is: 'Achieved a flag weight of 749 by reviewing and flagging appropriately :
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREA...
SELECT p.Id AS "post_link", p.Body, p.CreationDate FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE PostTypeId = 2 AND (Body LIKE '%how can%' OR Body LIKE '%same problem%' OR Body LIKE '%thank%' OR Body LIKE '%please%' OR Body LIKE '%plz%' OR Body LIKE '%pls%') AND u.Reputation < 100 AND p.Score < 1 ...
What is the away team score for the match at 6:00 PM and an away team of Hawthorn?
CREATE TABLE table_9576 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Crowd" real,"Date" text,"Time" text)
SELECT "Away team score" FROM table_9576 WHERE "Time" = '6:00 pm' AND "Away team" = 'hawthorn'
what were the four most commonly ordered procedures for patients who had already been diagnosed with s/p aneurysm resection/repair during the same month since 2103?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientu...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 's/p aneurysm resection/repair' AND STRFT...
What's the l1 cache of the model with sspec number sl2z3, sl28q (mya0)?
CREATE TABLE table_26560 ("Model number" text,"Frequency" text,"L1 Cache" text,"FSB" text,"Mult." text,"Voltage" text,"TDP" text,"Socket" text,"Release date" text,"Part number(s)" text,"sSpec number" text)
SELECT "L1 Cache" FROM table_26560 WHERE "sSpec number" = 'SL2Z3, SL28Q (myA0)'
Which High points have a Score of w 110-81?
CREATE TABLE table_name_49 (high_points VARCHAR,score VARCHAR)
SELECT high_points FROM table_name_49 WHERE score = "w 110-81"
what is last height of patient 005-4471 on the current hospital encounter?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemsta...
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4471' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionheight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
Number of image posts without default alt text per owner.
CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId ...
SELECT OwnerUserId AS "user_link", COUNT(*) AS NumPosts FROM Posts WHERE Body LIKE '%<img%' AND NOT Body LIKE '%alt text%' AND NOT Body LIKE '%enter image description here%' GROUP BY OwnerUserId ORDER BY COUNT(*) DESC
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time, show Y-axis in ascending order.
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(DEPARTMENT_ID)
Are there any super easy classes I can take so I fulfill my ULCS requirement ?
CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester in...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co...
herat has a population of 1,182,000 , can you list their languages
CREATE TABLE table_204_704 (id number,"province" text,"map #" number,"iso 3166-2:af" text,"centers" text,"population" number,"area (km2)" number,"language" text,"notes" text,"u.n. region" text)
SELECT "language" FROM table_204_704 WHERE "province" = 'herat'
what is the gpu model when the frequency is 3.4 ghz and the sspec number is sr00b(d2)?
CREATE TABLE table_name_8 (gpu_model VARCHAR,frequency VARCHAR,sspec_number VARCHAR)
SELECT gpu_model FROM table_name_8 WHERE frequency = "3.4 ghz" AND sspec_number = "sr00b(d2)"
Running total of initial votes vs time in an election.
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,C...
SELECT b.Date, SUM(COUNT(b.Date)) OVER (ORDER BY b.Date) AS running FROM Badges AS b WHERE b.Name = 'Constituent' AND b.Date BETWEEN '##ElectionYear##-01-01' AND '##ElectionYear##-12-31' GROUP BY b.Date ORDER BY b.Date
what is minimum days of hospital stay of patients whose admission type is urgent?
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 MIN(demographic.days_stay) FROM demographic WHERE demographic.admission_type = "URGENT"
What is the most effective extraction method in terms of pesticide residues detection?
CREATE TABLE resultsdata15 (sample_pk number,commod text,commtype text,lab text,pestcode text,testclass text,concen number,lod number,conunit text,confmethod text,confmethod2 text,annotate text,quantitate text,mean text,extract text,determin text)CREATE TABLE sampledata15 (sample_pk number,state text,year text,month te...
SELECT extract FROM resultsdata15 GROUP BY extract ORDER BY COUNT(*) DESC LIMIT 1
what is the number of galaxies in the pisces constellation ?
CREATE TABLE table_203_569 (id number,"designation" text,"classification" text,"constellation" text,"apparent magnitude" number)
SELECT COUNT("designation") FROM table_203_569 WHERE "constellation" = 'pisces'
What is the sum of the season with 8 clubs and shanghai as the runners-up?
CREATE TABLE table_name_63 (season INTEGER,number_of_clubs VARCHAR,runners_up VARCHAR)
SELECT SUM(season) FROM table_name_63 WHERE number_of_clubs = 8 AND runners_up = "shanghai"
What is the average Gold, when Nation is Yugoslavia, and when Silver is greater than 0?
CREATE TABLE table_name_28 (gold INTEGER,nation VARCHAR,silver VARCHAR)
SELECT AVG(gold) FROM table_name_28 WHERE nation = "yugoslavia" AND silver > 0
What is the lowest number of bids in the Missouri Valley conference?
CREATE TABLE table_33088 ("Conference" text,"# of Bids" real,"Record" text,"Win %" real,"Round of 32" real,"Sweet Sixteen" real,"Elite Eight" real,"Final Four" real,"Championship Game" real)
SELECT MIN("# of Bids") FROM table_33088 WHERE "Conference" = 'missouri valley'
How many totals had more than 4 bronze?
CREATE TABLE table_39846 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT SUM("Total") FROM table_39846 WHERE "Bronze" > '4'
How many letters were given to the organization with a founding date of 1997-12-12?
CREATE TABLE table_2538117_12 (letters VARCHAR,founding_date VARCHAR)
SELECT COUNT(letters) FROM table_2538117_12 WHERE founding_date = "1997-12-12"
Which award has the highest player's salary?
CREATE TABLE player (player_id text,birth_year text,birth_month text,birth_day text,birth_country text,birth_state text,birth_city text,death_year text,death_month text,death_day text,death_country text,death_state text,death_city text,name_first text,name_last text,name_given text,weight text)CREATE TABLE hall_of_fame...
SELECT award_id FROM player_award AS T1 JOIN salary AS T2 ON T1.player_id = T2.player_id GROUP BY T1.award_id ORDER BY AVG(T2.salary) DESC LIMIT 1
What is the earliest game with a position of Re and a smaller number than 95?
CREATE TABLE table_38681 ("Position" text,"Number" real,"Name" text,"Height" text,"Weight" text,"Class" text,"Hometown" text,"Games\u2191" real)
SELECT MIN("Games\u2191") FROM table_38681 WHERE "Position" = 're' AND "Number" < '95'
On what surface did they play the match in the week of October 21?
CREATE TABLE table_44688 ("Tournament" text,"Surface" text,"Week" text,"Winner and score" text,"Finalist" text,"Semifinalists" text)
SELECT "Surface" FROM table_44688 WHERE "Week" = 'october 21'
What is the phonetic realisation if the phonemic value is /v/ and the without niqqud is as initial letter: ?
CREATE TABLE table_name_12 (phonetic_realisation VARCHAR,phonemic_value VARCHAR,without_niqqud VARCHAR)
SELECT phonetic_realisation FROM table_name_12 WHERE phonemic_value = "/v/" AND without_niqqud = "as initial letter: ו"
How many Points have Drivers of adri n vall s, and a Year larger than 2006?
CREATE TABLE table_52732 ("Year" real,"Team name" text,"Drivers" text,"Races" real,"Wins" real,"Poles" real,"FLaps" real,"Points" real,"D.C." text,"T.C." text)
SELECT AVG("Points") FROM table_52732 WHERE "Drivers" = 'adrián vallés' AND "Year" > '2006'