instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
how many patients aged below 58 years have hypoxia as their primary disease?
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.diagnosis = "HYPOXIA" AND demographic.age < "58"
which country won the 1994 europeans men 's handball championship 's preliminary round ?
CREATE TABLE table_200_4 (id number,"team" text,"p" number,"w" number,"t" number,"l" number,"gf" number,"ga" number,"gd" number,"pts." number)
SELECT "team" FROM table_200_4 ORDER BY "pts." DESC LIMIT 1
What is the highest series number with 9.17 million US viewers?
CREATE TABLE table_27255755_1 (no_in_series INTEGER,us_viewers__millions_ VARCHAR)
SELECT MAX(no_in_series) FROM table_27255755_1 WHERE us_viewers__millions_ = "9.17"
what is the number of patients whose primary disease is s/p hanging and year of birth is less than 2123?
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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P HANGING" AND demographic.dob_year < "2123"
What series finale has the translation / ?
CREATE TABLE table_42888 ("Country" text,"Telenovela" text,"Translation" text,"Series Premiere" text,"Series Finale" text,"Weekly Schedule" text,"Timeslot" text)
SELECT "Series Finale" FROM table_42888 WHERE "Translation" = 'ოჰ ეს ცრემლები / პარალელური საიდუმლო'
In football league one, what coach was hired as a replacement on 8 October 2007
CREATE TABLE table_28181347_6 (replaced_by VARCHAR,date_of_vacancy VARCHAR)
SELECT replaced_by FROM table_28181347_6 WHERE date_of_vacancy = "8 October 2007"
Who is the winning driver of the race with no race as the winning manufacturer?
CREATE TABLE table_name_66 (winning_driver VARCHAR,winning_manufacturer VARCHAR)
SELECT winning_driver FROM table_name_66 WHERE winning_manufacturer = "no race"
WHAT IS THE WORST SCORE WHEN THE BEST SCORE WAS 8.8 AND AVERAGE WAS LARGER THAN 6.2?
CREATE TABLE table_name_72 (worst_score VARCHAR,best_score VARCHAR,average VARCHAR)
SELECT COUNT(worst_score) FROM table_name_72 WHERE best_score = 8.8 AND average > 6.2
How many professors for each first name? Show me a bar chart, and rank the number of emp fname in desc order please.
CREATE TABLE CLASS (CLASS_CODE varchar(5),CRS_CODE varchar(10),CLASS_SECTION varchar(2),CLASS_TIME varchar(20),CLASS_ROOM varchar(8),PROF_NUM int)CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12),EMP_INITIAL varchar(1),EMP_JOBCODE varchar(5),EMP_HIREDATE datetime,EMP_DOB datetime)CREATE TAB...
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM PROFESSOR AS T1 JOIN EMPLOYEE AS T2 ON T1.EMP_NUM = T2.EMP_NUM GROUP BY EMP_FNAME ORDER BY COUNT(EMP_FNAME) DESC
familial hypercholesterolemia, triglycerides ( tg ) > 400 mg / dl
CREATE TABLE table_dev_42 ("id" int,"gender" string,"depression" bool,"familial_hypercholesterolemia" bool,"microalbuminuria" int,"renal_disease" bool,"diabetic" string,"estimated_glomerular_filtration_rate_egfr" int,"serum_creatinine" float,"fbg" int,"body_mass_index_bmi" float,"triglyceride_tg" float,"a1c" float,"age...
SELECT * FROM table_dev_42 WHERE familial_hypercholesterolemia = 1 OR triglyceride_tg > 400
Who did the high rebounds in the game in which five players (3) did the high assists?
CREATE TABLE table_23312 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location" text,"Record" text)
SELECT "High rebounds" FROM table_23312 WHERE "High assists" = 'Five Players (3)'
Which Qual has Laps smaller than 195, and a Rank of 25?
CREATE TABLE table_13661 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real)
SELECT "Qual" FROM table_13661 WHERE "Laps" < '195' AND "Rank" = '25'
What was the manner of departure for the outgoing manager, giuseppe iachini?
CREATE TABLE table_48246 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text)
SELECT "Manner of departure" FROM table_48246 WHERE "Outgoing manager" = 'giuseppe iachini'
what is the number of times the resect thorac ves w repl was ordered since 2 years ago?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)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)CREATE TABLE chartevents...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'resect thorac ves w repl') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-2 year')
What is the 2010 result of a tournament that is 1R in 2009, Q2 in 2011 and 1R in 2012?
CREATE TABLE table_67903 ("Tournament" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text)
SELECT "2010" FROM table_67903 WHERE "2011" = 'q2' AND "2012" = '1r' AND "2009" = '1r'
which team that drafted players in round four had the longest name ?
CREATE TABLE table_203_676 (id number,"pick #" number,"cfl team" text,"player" text,"position" text,"college" text)
SELECT "cfl team" FROM table_203_676 ORDER BY LENGTH("cfl team") DESC LIMIT 1
what ground transport is available in MINNEAPOLIS
CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_s...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'MINNEAPOLIS' AND ground_service.city_code = city.city_code
what is average age of patients whose admission location is phys referral/normal deli and days of hospital stay is 29?
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 AVG(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.days_stay = "29"
For each file format, return the number of artists who released songs in that format.
CREATE TABLE song (song_name text,artist_name text,country text,f_id number,genre_is text,rating number,languages text,releasedate time,resolution number)CREATE TABLE artist (artist_name text,country text,gender text,preferred_genre text)CREATE TABLE genre (g_name text,rating text,most_popular_in text)CREATE TABLE file...
SELECT COUNT(*), formats FROM files GROUP BY formats
List the number of completion students in each day and bin date of completion by weekday with a bar chart, rank in ascending by the y axis.
CREATE TABLE Student_Tests_Taken (registration_id INTEGER,date_test_taken DATETIME,test_result VARCHAR(255))CREATE TABLE Course_Authors_and_Tutors (author_id INTEGER,author_tutor_ATB VARCHAR(3),login_name VARCHAR(40),password VARCHAR(40),personal_name VARCHAR(80),middle_name VARCHAR(80),family_name VARCHAR(80),gender_m...
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_completion)
Can you tell me the Capacity that has the Position in 2005 of 8?
CREATE TABLE table_77062 ("Team" text,"Location" text,"Venue" text,"Capacity" real,"Position in 2005" text)
SELECT "Capacity" FROM table_77062 WHERE "Position in 2005" = '8'
What season did the Rangers win?
CREATE TABLE table_48206 ("Season" text,"Winner" text,"Score" text,"Runner-up" text,"Venue" text)
SELECT "Season" FROM table_48206 WHERE "Winner" = 'rangers'
What was the result of the election for georgia's 3rd district?
CREATE TABLE table_27487712_1 (result VARCHAR,district VARCHAR)
SELECT result FROM table_27487712_1 WHERE district = "Georgia's 3rd"
What is the total number of pg won of the team with 64 goals conceded and more than 33 goals scored?
CREATE TABLE table_58674 ("Place (Posici\u00f3n)" real,"Team (Equipo)" text,"Played (PJ)" real,"Won (PG)" real,"Draw (PE)" real,"Lost (PP)" real,"Goals Scored (GF)" real,"Goals Conceded (GC)" real,"+/- (Dif.)" real,"Points (Pts.)" real)
SELECT COUNT("Won (PG)") FROM table_58674 WHERE "Goals Conceded (GC)" = '64' AND "Goals Scored (GF)" > '33'
what are the four most commonly ordered procedures for patients who have received vitamin k during the same hospital visit previously since 2100?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,discha...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vitam...
How many Games have a Score of 3 3 ot?
CREATE TABLE table_35354 ("Game" real,"April" real,"Opponent" text,"Score" text,"Record" text,"Points" real)
SELECT COUNT("Game") FROM table_35354 WHERE "Score" = '3–3 ot'
During what years was lvaro p rez the number 2 ranked player?
CREATE TABLE table_15565 ("Rank" real,"Player" text,"Club(s)" text,"Year(s)" text,"U-16 Caps" real)
SELECT "Year(s)" FROM table_15565 WHERE "Rank" = '2' AND "Player" = 'álvaro pérez'
What is 2006/07, when 2011/12 is LQ, and when 2010/11 is LQ?
CREATE TABLE table_76588 ("2006/ 07" text,"2008/ 09" text,"2010/ 11" text,"2011/ 12" text,"2012/ 13" text)
SELECT "2006/ 07" FROM table_76588 WHERE "2011/ 12" = 'lq' AND "2010/ 11" = 'lq'
List the countries that have more than one mountain.
CREATE TABLE mountain (Country VARCHAR)
SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1
what is the maximum total hospital cost, that includes head & neck endarter nec in 2105?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,va...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'head & neck endarter nec')) AND STRFTIME('%y', cost.charg...
What was the score for the game where the home team was Wycombe Wanderers?
CREATE TABLE table_77275 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Attendance" text)
SELECT "Score" FROM table_77275 WHERE "Home team" = 'wycombe wanderers'
what is the name on top of the list ?
CREATE TABLE table_204_866 (id number,"name" text,"lifetime" text,"nationality" text,"notable as" text,"notes" text)
SELECT "name" FROM table_204_866 WHERE id = 1
What is the highest number of people in attendance in the game against the Buffalo Bills in a week later than 14?
CREATE TABLE table_40280 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT MAX("Attendance") FROM table_40280 WHERE "Opponent" = 'buffalo bills' AND "Week" > '14'
provide the number of patients whose gender is m and primary disease is pituitary bleed?
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.gender = "M" AND demographic.diagnosis = "PITUITARY BLEED"
How many citation richard anderson has ?
CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE keyphrase (keyphraseid int,keyphra...
SELECT DISTINCT COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'richard anderson' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
Return a bar chart on how many counties correspond to each police force?, and could you list by the y axis in descending?
CREATE TABLE county_public_safety (County_ID int,Name text,Population int,Police_officers int,Residents_per_officer int,Case_burden int,Crime_rate real,Police_force text,Location text)CREATE TABLE city (City_ID int,County_ID int,Name text,White real,Black real,Amerindian real,Asian real,Multiracial real,Hispanic real)
SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force ORDER BY COUNT(*) DESC
type the attendance for playing with tampa bay buccaneers?
CREATE TABLE table_14656147_2 (attendance VARCHAR,opponent VARCHAR)
SELECT attendance FROM table_14656147_2 WHERE opponent = "Tampa Bay Buccaneers"
when has patient 004-11006 first received a procedure since 2103?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,d...
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 = '004-11006')) AND STRFTIME('%y', treatment.treatmenttime) >= '2103...
How many series are there total?
CREATE TABLE table_2183 ("No. overall" text,"No. in series" real,"Family/families" text,"Location(s)" text,"Original air date" text)
SELECT MAX("No. in series") FROM table_2183
What is the relationship between author_tutor_ATB and gender_mf ?
CREATE TABLE Student_Tests_Taken (registration_id INTEGER,date_test_taken DATETIME,test_result VARCHAR(255))CREATE TABLE Student_Course_Enrolment (registration_id INTEGER,student_id INTEGER,course_id INTEGER,date_of_enrolment DATETIME,date_of_completion DATETIME)CREATE TABLE Courses (course_id INTEGER,author_id INTEGER...
SELECT author_tutor_ATB, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
Which Winning Driver has a Circuit of circuit zandvoort?
CREATE TABLE table_name_43 (winning_driver VARCHAR,circuit VARCHAR)
SELECT winning_driver FROM table_name_43 WHERE circuit = "circuit zandvoort"
i need a flight from PHILADELPHIA to DALLAS next wednesday in the morning
CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,on...
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 = 'DALLAS' AND date_day.day_number = 23 AND date_day.month_number = 4 AND d...
Which engine has a 2435 cm displacement and is named 2.4 (2001-2007)?
CREATE TABLE table_name_84 (engine_code VARCHAR,displacement__cm³_ VARCHAR,model_name VARCHAR)
SELECT engine_code FROM table_name_84 WHERE displacement__cm³_ = 2435 AND model_name = "2.4 (2001-2007)"
what is the total when the league is less than 1?
CREATE TABLE table_name_89 (total VARCHAR,league INTEGER)
SELECT total FROM table_name_89 WHERE league < 1
What is the Revenue per capita for Vermont?
CREATE TABLE table_name_2 (revenue_per_capita VARCHAR,state VARCHAR)
SELECT revenue_per_capita FROM table_name_2 WHERE state = "vermont"
Top users from Ahmedabad, India.
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,Cl...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%ahmedabad, gujarat, india%' OR UPPER(Location) LIKE '%AHMEDABAD, GUJARAT, INDIA%' OR Location LIKE '%Ahmedabad, Gujarat, India%' AND Reputation >= 1000 ORDER BY Reputation DESC
Which conference is in Portland, Oregon?
CREATE TABLE table_75107 ("Conference" text,"Division" text,"Team" text,"City" text,"Home Arena" text)
SELECT "Conference" FROM table_75107 WHERE "City" = 'portland, oregon'
During the Fall and Winter term , how many 300 -level classes are you guys offering ?
CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,heavy_assignments int,respected int,participation int,heavy_reading int,tough_grade...
SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_offering.semester...
any relevant abnormality that would interfere with the efficacy or the safety assessments during study treatment administration.
CREATE TABLE table_train_150 ("id" int,"gender" string,"pregnancy_or_lactation" bool,"hiv_infection" bool,"hepatic_disease" bool,"liver_disease" bool,"abnormality" bool,"triglyceride_tg" float,"NOUSE" float)
SELECT * FROM table_train_150 WHERE abnormality = 1
What many times was the victoria derby raced?
CREATE TABLE table_2985987_2 (date VARCHAR,race VARCHAR)
SELECT COUNT(date) FROM table_2985987_2 WHERE race = "Victoria Derby"
What is Played, when Points Against is '374'?
CREATE TABLE table_61870 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text)
SELECT "Played" FROM table_61870 WHERE "Points against" = '374'
In what game did Miami play Charlotte?
CREATE TABLE table_21504 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT MAX("Game") FROM table_21504 WHERE "Team" = 'Charlotte'
Which candidate lost the election that 770,046 people voted in?
CREATE TABLE table_58016 ("Election" real,"Candidate" text,"Number of votes" text,"Share of votes" text,"Outcome of election" text)
SELECT "Candidate" FROM table_58016 WHERE "Outcome of election" = 'lost' AND "Number of votes" = '770,046'
A bar chart about what are the average ages for male and female students?
CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20))CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20))
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex
What is the lowest height for Rans Brempong?
CREATE TABLE table_name_37 (height INTEGER,player VARCHAR)
SELECT MIN(height) FROM table_name_37 WHERE player = "rans brempong"
What is the country sergio garc a, who has a score of 69-70-67=206, is from?
CREATE TABLE table_66756 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Country" FROM table_66756 WHERE "Score" = '69-70-67=206' AND "Player" = 'sergio garcía'
since 2105 has nitroglycerin, meropenem or metoprolol tartrate been prescribed to patient 76332?
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 procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code tex...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76332) AND prescriptions.drug IN ('nitroglycerin', 'meropenem', 'metoprolol tartrate') AND STRFTIME('%y', prescriptions.startdate) >= '2105'
Top users from Minsk, Belarus.
CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Ta...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%minsk%' OR UPPER(Location) LIKE '%MINSK%' OR Location LIKE '%Minsk%' AND Reputation >= 1000 ORDER BY Reputation DESC
What is the lowest score of all games for match 2?
CREATE TABLE table_26903 ("Team" text,"Slogan" text,"Match1" real,"Match2" real,"Match3" real,"Match4" real,"Match5" real,"Total" real)
SELECT MIN("Match2") FROM table_26903
Province of leinster, and a County of fingal has which irish name?
CREATE TABLE table_name_65 (irish_name VARCHAR,province VARCHAR,county VARCHAR)
SELECT irish_name FROM table_name_65 WHERE province = "leinster" AND county = "fingal"
What were the least points with a Coloni FC88 chassis?
CREATE TABLE table_14792 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT MIN("Points") FROM table_14792 WHERE "Chassis" = 'coloni fc88'
What is the result when the week is greater than 7 and the Houston Oilers were the opponent?
CREATE TABLE table_name_60 (result VARCHAR,week VARCHAR,opponent VARCHAR)
SELECT result FROM table_name_60 WHERE week > 7 AND opponent = "houston oilers"
What is the name where the delivered date is 1839/08?
CREATE TABLE table_name_22 (name VARCHAR,delivered VARCHAR)
SELECT name FROM table_name_22 WHERE delivered = "1839/08"
Who was the team captain of tus koblenz?
CREATE TABLE table_name_11 (team VARCHAR)
SELECT team AS captain FROM table_name_11 WHERE team = "tus koblenz"
Return a bar chart about the distribution of All_Road and All_Games_Percent , order from low to high by the total number.
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_Road, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent
What is the tourism competitiveness in 2011 of venezuela?
CREATE TABLE table_64549 ("Country" text,"Tourist arrivals (2011) (Millions)" real,"Tourism receipts (2011) (Millions of US$)" real,"Tourism receipts (2011) (US$ per arrival)" real,"Tourism receipts (2011) (US$ per capita)" real,"Tourism receipts (2003) (as % of GDP)" text,"Tourism receipts (2003) (as % of exports)" te...
SELECT "Tourism competitiveness (2011) (TTCI)" FROM table_64549 WHERE "Country" = 'venezuela'
For the game played at Windy Hill, who was the away team?
CREATE TABLE table_33380 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team" FROM table_33380 WHERE "Venue" = 'windy hill'
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and revenue , and group by attribute name.
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, T1.Name
What driver achieved a 3:50:12 race time?
CREATE TABLE table_25241 ("Year" text,"Date" text,"Driver" text,"Team" text,"Manufacturer" text,"Laps" text,"Miles (km)" text,"Race Time" text,"Average Speed (mph)" text,"Report" text)
SELECT "Driver" FROM table_25241 WHERE "Race Time" = '3:50:12'
What is the easiest class I can take that will fulfill the ULCS requirement ?
CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varcha...
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...
calculate the amount of 7.7meq naacetate patient 7524 has taken on the last icu visit.
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,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,...
SELECT SUM(inputevents_cv.amount) 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 = 7524) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND inputeve...
What is the average number for goals less than 73?
CREATE TABLE table_42194 ("Name" text,"Career" text,"Apps" real,"Goals" real,"Average" real)
SELECT COUNT("Average") FROM table_42194 WHERE "Goals" < '73'
since 10/11/2104 what was patient 1784's last arterial bp mean?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate t...
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 = 1784)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial b...
What is the average Gold when silver is more than 2, and bronze is more than 1
CREATE TABLE table_name_59 (gold INTEGER,silver VARCHAR,bronze VARCHAR)
SELECT AVG(gold) FROM table_name_59 WHERE silver > 2 AND bronze > 1
Most popular StackOverflow tags until May 2014.
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 num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS "2014Rank", ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsIn2014, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostI...
When was the game that had Sydney Spirit as the away team?
CREATE TABLE table_name_64 (date VARCHAR,away_team VARCHAR)
SELECT date FROM table_name_64 WHERE away_team = "sydney spirit"
What is the highest number played with more than 2 lost for Palmeiras and less than 1 draw?
CREATE TABLE table_name_69 (played INTEGER,drawn VARCHAR,lost VARCHAR,team VARCHAR)
SELECT MAX(played) FROM table_name_69 WHERE lost > 2 AND team = "palmeiras" AND drawn < 1
provide the number of patients whose marital status is single and procedure long title is cardiac mapping?
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 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.marital_status = "SINGLE" AND procedures.long_title = "Cardiac mapping"
What is the Purse on January 3, 2010?
CREATE TABLE table_59686 ("Date" text,"Race" text,"Track" text,"Location" text,"Distance" text,"Surface" text,"Purse" text,"Finish" text)
SELECT "Purse" FROM table_59686 WHERE "Date" = 'january 3, 2010'
Visualize a scatter chart about the correlation between Body_Builder_ID and People_ID .
CREATE TABLE body_builder (Body_Builder_ID int,People_ID int,Snatch real,Clean_Jerk real,Total real)CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Birth_Date text,Birth_Place text)
SELECT Body_Builder_ID, People_ID FROM body_builder
What are the male Bounder books?
CREATE TABLE table_52921 ("Animal Name" text,"Species" text,"Books" text,"TV Series" text,"Gender" text,"TV Seasons" text,"Mate" text,"First Appearance" text,"Last Appearance" text)
SELECT "Books" FROM table_52921 WHERE "Gender" = 'male' AND "Animal Name" = 'bounder'
what were the four most common drugs that were prescribed to patients 20s in the same hospital encounter after being diagnosed with congestive heart failure until 2104?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE medication (medicationid number,patientunitstayi...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'congestive hear...
what is the diagnosis icd9 code and diagnosis short title of subject id 43220?
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.icd9_code, diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "43220"
when did patient 11688 get its last urine microbiology test in 11/last year?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE pati...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11688) AND microbiologyevents.spec_type_desc = 'urine' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of...
which institution has the most enrollment ?
CREATE TABLE table_203_610 (id number,"institution" text,"location" text,"nickname" text,"founded" number,"historical affiliation" text,"enrollment" number,"primary conference" text)
SELECT "institution" FROM table_203_610 ORDER BY "enrollment" DESC LIMIT 1
What is the release price for the GPU frequency of standard power, embedded?
CREATE TABLE table_64274 ("Model number" text,"sSpec number" text,"Cores" text,"Frequency" text,"Turbo" text,"L2 cache" text,"L3 cache" text,"GPU model" text,"GPU frequency" text,"Socket" text,"I/O bus" text,"Release date" text,"Part number(s)" text,"Release price (USD)" text)
SELECT "Release price ( USD )" FROM table_64274 WHERE "GPU frequency" = 'standard power, embedded'
how many titles have at least 5 episodes ?
CREATE TABLE table_204_903 (id number,"title" text,"character" text,"broadcaster" text,"episodes" number,"date" number)
SELECT COUNT("title") FROM table_204_903 WHERE "episodes" >= 5
Top 10 Gold Badges users.
CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)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...
SELECT UserId AS "user_link", COUNT(*) FROM Badges WHERE Name IN ('Copy Editor', 'Electorate', 'Famous Question', 'Fanatic', 'Great Answer', 'Great Question', 'Legendary', 'Marshal', 'Populist', 'Publicist', 'Reversal', 'Stellar Question', 'Steward', 'Unsung Hero') GROUP BY UserId ORDER BY COUNT(*) DESC LIMIT 10
What college did the Rookie of the Year from the Columbus Crew attend?
CREATE TABLE table_15886 ("Season" real,"Player" text,"Position" text,"Nationality" text,"Team" text,"Draft Pick #" text,"Draft Class" text,"College" text)
SELECT "College" FROM table_15886 WHERE "Team" = 'Columbus Crew'
the most films henrick malberg appeared in in one year .
CREATE TABLE table_204_91 (id number,"year" number,"original title" text,"english title" text,"role" text,"notes" text)
SELECT COUNT("original title") FROM table_204_91 GROUP BY "year" ORDER BY COUNT("original title") DESC LIMIT 1
Marty Riessen played as a partner during a match with what kind of surface?
CREATE TABLE table_name_84 (surface VARCHAR,partner VARCHAR)
SELECT surface FROM table_name_84 WHERE partner = "marty riessen"
how many different charts did run make ?
CREATE TABLE table_202_240 (id number,"year" number,"single" text,"chart" text,"position" number)
SELECT COUNT(DISTINCT "chart") FROM table_202_240 WHERE "single" = '"run"'
Show all the activity names and the number of faculty involved in each activity.
CREATE TABLE faculty (facid number,lname text,fname text,rank text,sex text,phone number,room text,building text)CREATE TABLE faculty_participates_in (facid number,actid number)CREATE TABLE activity (actid number,activity_name text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major numbe...
SELECT T1.activity_name, COUNT(*) FROM activity AS T1 JOIN faculty_participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid
Which Played has a Scored larger than 25 and a Position of 1, and Draws smaller than 5?
CREATE TABLE table_name_85 (played INTEGER,draws VARCHAR,scored VARCHAR,position VARCHAR)
SELECT MAX(played) FROM table_name_85 WHERE scored > 25 AND position = 1 AND draws < 5
Which player has a Position of fly-half, and a Caps of 3?
CREATE TABLE table_name_41 (player VARCHAR,position VARCHAR,caps VARCHAR)
SELECT player FROM table_name_41 WHERE position = "fly-half" AND caps = 3
If the winner is Hong Kong 207/6 (47.1 overs), what is the name of the hosting nation?
CREATE TABLE table_25120 ("Details" text,"Host Nation(s)" text,"Final Venue" text,"Winner" text,"Result" text,"Runner-up" text)
SELECT "Host Nation(s)" FROM table_25120 WHERE "Winner" = 'Hong Kong 207/6 (47.1 overs)'
are respiration of patient 027-214052 last measured on the last intensive care unit visit greater than second to last measured on the last intensive care unit visit?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin te...
SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-214052') AND NOT patient.unitdischargetime ...
calculate the duration of patient 010-23252's last hospital stay.
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientun...
SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '010-23252' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1
In Fall 2001 what number of professors will teach ORALSURG 752 ?
CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varchar,has_lab varchar,has_projects varchar,has_exams varchar,num_reviews int,clarity_score i...
SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ORALSURG' AND course.number = 752 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o...
Which patients were ordered a wbc lab test?
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 lab.label = "WBC"