instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What was the July 2013 population estimate of the location which had a population density larger than 14.1?
CREATE TABLE table_33540 ("Rank" real,"Name" text,"Population (2011 Census)" real,"Percent of national population" text,"% growth (2006\u201311)" text,"Land area (km\u00b2)" real,"Population density (/km 2)" real,"House of Commons seats" real,"House of Commons seats (%)" text,"2013 population (July est.)" real)
SELECT COUNT("2013 population (July est.)") FROM table_33540 WHERE "Population density (/km 2 )" > '14.1'
which tournament is the last one of the year ?
CREATE TABLE table_203_444 (id number,"week" number,"start date" text,"type" text,"tournament" text,"surface" text,"town" text,"country" text,"continent" text,"prize money" text)
SELECT "tournament" FROM table_203_444 ORDER BY id DESC LIMIT 1
What is the record for November 26, 1961?
CREATE TABLE table_21898 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" real)
SELECT "Record" FROM table_21898 WHERE "Date" = 'November 26, 1961'
What is the Nationality for the university of wisconsin (wcha), and a Player of bob lundeen?
CREATE TABLE table_name_30 (nationality VARCHAR,college_junior_club_team VARCHAR,player VARCHAR)
SELECT nationality FROM table_name_30 WHERE college_junior_club_team = "university of wisconsin (wcha)" AND player = "bob lundeen"
how many patients were staying in 50 wards in 2105?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE 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...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 50 AND STRFTIME('%y', transfers.intime) = '2105')
Who was the opponent when 48,121 people attended?
CREATE TABLE table_name_49 (opponent VARCHAR,attendance VARCHAR)
SELECT opponent FROM table_name_49 WHERE attendance = "48,121"
Before noon , what all upper level electives are being offered ?
CREATE TABLE area (course_id int,area varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)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_fe...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.end_time <= '12:00:00' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semest...
What is the team of Essendon's score in the game where they were the home team?
CREATE TABLE table_name_92 (home_team VARCHAR)
SELECT home_team AS score FROM table_name_92 WHERE home_team = "essendon"
What is the lowest gold that has a silver less than 2, Zimbabwe as the nation, and a bronze less than 1?
CREATE TABLE table_name_34 (gold INTEGER,bronze VARCHAR,silver VARCHAR,nation VARCHAR)
SELECT MIN(gold) FROM table_name_34 WHERE silver < 2 AND nation = "zimbabwe" AND bronze < 1
provide the number of patients who had other body fluid lab test and were hospitalized for more than 2 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 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 tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "2" AND lab.fluid = "Other Body Fluid"
What is the highest bronze for less than 2 total trophies?
CREATE TABLE table_63226 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MAX("Bronze") FROM table_63226 WHERE "Total" < '2'
what is previous to complete series 10 ?
CREATE TABLE table_203_461 (id number,"dvd title" text,"discs" number,"year" text,"no. of ep." number,"dvd release\nregion 2" text,"dvd release\nregion 4" text)
SELECT "dvd title" FROM table_203_461 WHERE id = (SELECT id FROM table_203_461 WHERE "dvd title" = 'complete series 10') - 1
What are the average scores of contestants whose home state is Pennsylvania?
CREATE TABLE table_16390001_2 (average VARCHAR,country VARCHAR)
SELECT average FROM table_16390001_2 WHERE country = "Pennsylvania"
What frame size corresponds the selection with a max fps of 120, a width of 2048, and height of 1024?
CREATE TABLE table_name_74 (frame_size VARCHAR,height VARCHAR,max_fps VARCHAR,width VARCHAR)
SELECT frame_size FROM table_name_74 WHERE max_fps = 120 AND width = 2048 AND height = 1024
Questions where answer was accepted before a bounty was started.
CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text...
SELECT p.Id AS "post_link", p.AcceptedAnswerId, bs.CreationDate, ac.CreationDate, p.CreationDate, url = 'site://posts/' + CAST(p.Id AS TEXT) + '/revisions', url = 'site://posts/' + CAST(p.Id AS TEXT) + '/timeline' FROM Posts AS p INNER JOIN Votes AS bs ON (p.Id = bs.PostId AND bs.VoteTypeId = 8) LEFT JOIN Votes AS ac O...
How many votes were there on November 10?
CREATE TABLE table_5560 ("Election" text,"Date" text,"Mayor" text,"Ward seats" text,"Votes" text)
SELECT "Votes" FROM table_5560 WHERE "Date" = 'november 10'
when patient 002-20631 came to the hospital for the first time via the operating room?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number...
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '002-20631' AND patient.hospitaladmitsource = 'operating room' ORDER BY patient.hospitaladmittime LIMIT 1
What is listed as the Elector with the Title of Deacon of S. Maria in Domnica?
CREATE TABLE table_71580 ("Elector" text,"Order" text,"Title" text,"Elevated" text,"Elevator" text)
SELECT "Elector" FROM table_71580 WHERE "Title" = 'deacon of s. maria in domnica'
Which team drafted Joakim Persson?
CREATE TABLE table_30556 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT "NHL team" FROM table_30556 WHERE "Player" = 'Joakim Persson'
What is the boiler provider for Bhel, India's TG Set provider?
CREATE TABLE table_30662 ("Stage" text,"Unit Number" real,"Installed Capacity (MW)" text,"Date of Commissioning" text,"Status" text,"TG set Provider" text,"Boiler Provider" text)
SELECT "Boiler Provider" FROM table_30662 WHERE "TG set Provider" = 'BHEL, India'
I wan the date of vacancy for departure of resigned and outgoing manager of gordon wylde
CREATE TABLE table_56403 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text)
SELECT "Date of vacancy" FROM table_56403 WHERE "Manner of departure" = 'resigned' AND "Outgoing manager" = 'gordon wylde'
What is the branding of the callsign DWCI-TV?
CREATE TABLE table_73875 ("Branding" text,"Callsign" text,"Ch. #" text,"Station Type" text,"Power kW (ERP)" text,"Location (Transmitter Site)" text)
SELECT "Branding" FROM table_73875 WHERE "Callsign" = 'DWCI-TV'
Who was the Radio Edit Version remixed by?
CREATE TABLE table_name_70 (remixed_by VARCHAR,version VARCHAR)
SELECT remixed_by FROM table_name_70 WHERE version = "radio edit"
get all activity in past timeframe.
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE CloseAsOf...
SELECT Posts.Id AS post_id, Posts.CreationDate FROM Posts
List all upper-level class that are 1 credits .
CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE area (course_id int,area varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE jobs (job_id int,job_title v...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 1 AND program_course.category LIKE 'ULCS'
Which Assist/pass has a Score of 1-0,a Competition of 2010 concacaf world cup qualifying group stage?
CREATE TABLE table_name_14 (assist_pass VARCHAR,score VARCHAR,competition VARCHAR)
SELECT assist_pass FROM table_name_14 WHERE score = "1-0" AND competition = "2010 concacaf world cup qualifying – group stage"
What is the average total pld with 45 points in 2005-06, and more than 52 points in 2006-07?
CREATE TABLE table_78723 ("Team" text,"2004\u201305 Pts" text,"2005\u201306 Pts" text,"2006\u201307 Pts" real,"Total Pts" real,"Total Pld" real)
SELECT AVG("Total Pld") FROM table_78723 WHERE "2005\u201306 Pts" = '45' AND "2006\u201307 Pts" > '52'
What are the average byes that are greater than 1479, wins greater than 5 and 0 draws?
CREATE TABLE table_name_5 (byes INTEGER,draws VARCHAR,against VARCHAR,wins VARCHAR)
SELECT AVG(byes) FROM table_name_5 WHERE against > 1479 AND wins > 5 AND draws < 0
If the Season is later than 2008 and Races is 11, what ate the Points?
CREATE TABLE table_45243 ("Season" real,"Series" text,"Team" text,"Races" text,"Wins" text,"Poles" text,"F/Laps" text,"Podiums" text,"Points" text,"Position" text)
SELECT "Points" FROM table_45243 WHERE "Races" = '11' AND "Season" > '2008'
Who was the opponent when the round was more than 2?
CREATE TABLE table_name_30 (opponent VARCHAR,round INTEGER)
SELECT opponent FROM table_name_30 WHERE round > 2
Name the number of location for 22-1
CREATE TABLE table_25474 ("Date" text,"Location" text,"Opponent" text,"Irish Points" real,"Opp. Points" real,"Record" text)
SELECT COUNT("Location") FROM table_25474 WHERE "Record" = '22-1'
For all employees who have the letters D or S in their first name, visualize a scatter chart about the correlation between salary and department_id .
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(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN...
SELECT SALARY, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
Name the 1:25 for 7 august 2005 being 19 november 2001
CREATE TABLE table_26482 ("World record" text,"Olimpiada Ivanova (RUS)" text,"1:25:41" text,"Helsinki,Finland" text,"7 August 2005" text)
SELECT "1:25:41" FROM table_26482 WHERE "7 August 2005" = '19 November 2001'
How many millions of people in the US saw the episode number 226?
CREATE TABLE table_25930 ("No." real,"#" real,"Original airdate" text,"Performer 1" text,"Performer 2" text,"Performer 3" text,"Performer 4" text,"U.S. viewers (millions)" text)
SELECT "U.S. viewers (millions)" FROM table_25930 WHERE "No." = '226'
Which Prothrombin time has a Platelet count of unaffected, and a Bleeding time of unaffected, and a Partial thromboplastin time of normal or mildly prolonged?
CREATE TABLE table_name_28 (prothrombin_time VARCHAR,partial_thromboplastin_time VARCHAR,platelet_count VARCHAR,bleeding_time VARCHAR)
SELECT prothrombin_time FROM table_name_28 WHERE platelet_count = "unaffected" AND bleeding_time = "unaffected" AND partial_thromboplastin_time = "normal or mildly prolonged"
what is average age of patients whose death status is 0 and admission year is greater than or equal to 2121?
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 text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.admityear >= "2121"
How many gold are a rank 1 and larger than 16?
CREATE TABLE table_name_56 (gold VARCHAR,rank VARCHAR,total VARCHAR)
SELECT COUNT(gold) FROM table_name_56 WHERE rank = "1" AND total > 16
what are the methods of consumption of carvedilol 3.125 mg tab?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,d...
SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'carvedilol 3.125 mg tab'
How many of lost have 11 as the points, and a drawn greater than 1?
CREATE TABLE table_6359 ("Games" real,"Drawn" real,"Lost" real,"Points difference" text,"Points" real)
SELECT COUNT("Lost") FROM table_6359 WHERE "Points" = '11' AND "Drawn" > '1'
Which text has simplified characters of ?
CREATE TABLE table_7573 ("Date (CE)" text,"Text" text,"Simplified characters" text,"Traditional characters" text,"Pinyin" text,"Wade-Giles" text,"Literal meaning" text)
SELECT "Text" FROM table_7573 WHERE "Simplified characters" = '心猿 … 意马'
Are there any courses required prior to taking IOE 333 ?
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 student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,en...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
What is the age of the contestant from Reno, NV?
CREATE TABLE table_36048 ("State" text,"Name" text,"Hometown" text,"Age 1" real,"Talent" text)
SELECT "Age 1" FROM table_36048 WHERE "Hometown" = 'reno, nv'
What game number is the Washington team.
CREATE TABLE table_27713583_6 (game VARCHAR,team VARCHAR)
SELECT COUNT(game) FROM table_27713583_6 WHERE team = "Washington"
Kill 11.04 crap questions with Fire. Unanswered 11.04 questions sorted by score and time
CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)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 PostTypes (Id number,Na...
SELECT P.Id AS "post_link", P.CreationDate, P.Score FROM Posts AS P, PostTags AS PT, Tags AS T WHERE (T.Id = PT.TagId AND P.Id = PT.PostId) AND T.TagName = '11.04' AND AcceptedAnswerId IS NULL ORDER BY P.Score, P.CreationDate DESC
How many entries are there for founded when the location was springfield, ohio?
CREATE TABLE table_73628 ("Institution" text,"Location" text,"Team Name" text,"Founded" real,"Affiliation" text,"Enrollment" real,"Year Joined" real)
SELECT COUNT("Founded") FROM table_73628 WHERE "Location" = 'Springfield, Ohio'
Namethe team for feb 27, 1996
CREATE TABLE table_1594772_2 (team__a_ VARCHAR,match_date VARCHAR)
SELECT team__a_ FROM table_1594772_2 WHERE match_date = "Feb 27, 1996"
Which league has 12 goals?
CREATE TABLE table_10143 ("Season" text,"Club" text,"League" text,"Apps" real,"Goals" real)
SELECT "League" FROM table_10143 WHERE "Goals" = '12'
Which English has German of leben?
CREATE TABLE table_59084 ("German" text,"Low German" text,"Plautdietsch" text,"Dutch" text,"English" text)
SELECT "English" FROM table_59084 WHERE "German" = 'leben'
What campus opened in 1970?
CREATE TABLE table_62927 ("Campus" text,"Year opened" text,"Students" text,"Size" text,"Location" text)
SELECT "Campus" FROM table_62927 WHERE "Year opened" = '1970'
What Opponent has the Attendance of 14,029?
CREATE TABLE table_name_77 (opponent VARCHAR,attendance VARCHAR)
SELECT opponent FROM table_name_77 WHERE attendance = "14,029"
Who did he play on a hard surface?
CREATE TABLE table_8450 ("Outcome" text,"Date" real,"Tournament" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text)
SELECT "Opponents" FROM table_8450 WHERE "Surface" = 'hard'
How many performers are 29 that made it to the semi finals?
CREATE TABLE table_28180840_15 (semifinal__week_ VARCHAR,age_s_ VARCHAR)
SELECT semifinal__week_ FROM table_28180840_15 WHERE age_s_ = "29"
Who is the visitor of the game on March 7?
CREATE TABLE table_name_48 (visitor VARCHAR,date VARCHAR)
SELECT visitor FROM table_name_48 WHERE date = "march 7"
what is the part number(s) when l2 cache is 512 kb, release date is june 2001 and sSpec number is sl5lv, sl5pu, sl6bw, sl6jm?
CREATE TABLE table_name_71 (part_number_s_ VARCHAR,sspec_number VARCHAR,l2_cache VARCHAR,release_date VARCHAR)
SELECT part_number_s_ FROM table_name_71 WHERE l2_cache = "512 kb" AND release_date = "june 2001" AND sspec_number = "sl5lv, sl5pu, sl6bw, sl6jm"
Who was awarded mountains classification when Alessandro petacchi won?
CREATE TABLE table_27758 ("Stage" real,"Winner" text,"General classification" text,"Points classification" text,"Mountains classification" text,"Combination Classification" text,"Team classification" text)
SELECT "Mountains classification" FROM table_27758 WHERE "Winner" = 'Alessandro Petacchi'
Which time/retired has a qual of 144.02?
CREATE TABLE table_58505 ("Grid" real,"Driver" text,"Constructor" text,"Qual" real,"Rank" real,"Laps" real,"Time/Retired" text)
SELECT "Time/Retired" FROM table_58505 WHERE "Qual" = '144.02'
What party was the winning one in the elections in the California 30 district?
CREATE TABLE table_1341663_6 (party VARCHAR,district VARCHAR)
SELECT party FROM table_1341663_6 WHERE district = "California 30"
What is the total grid number that has 14 laps and a time of +29.483?
CREATE TABLE table_name_6 (grid VARCHAR,laps VARCHAR,time VARCHAR)
SELECT COUNT(grid) FROM table_name_6 WHERE laps = 14 AND time = "+29.483"
Where is the nationality of Arg Esp moving to?
CREATE TABLE table_58970 ("Nat." text,"Name" text,"Moving to" text,"Type" text,"Transfer window" text)
SELECT "Moving to" FROM table_58970 WHERE "Nat." = 'arg esp'
what are the five most frequently given procedures for patients with an age of 20s since 2 years ago?
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 diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE transfers (row_id number,subject_id number,hadm_id n...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
Which VIETNAMESE has a CHINESE of / b r m du ?
CREATE TABLE table_6770 ("SANSKRT" text,"CHINESE" text,"VIETNAMESE" text,"JAPANESE" text,"KOREAN" text)
SELECT "VIETNAMESE" FROM table_6770 WHERE "CHINESE" = '不如密多 / bùrúmìduō'
what airlines have nonstop early afternoon flights from BOSTON to DENVER
CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE food_servi...
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_...
Find the list of attribute data types possessed by more than 3 attribute definitions.
CREATE TABLE catalog_structure (catalog_level_number number,catalog_id number,catalog_level_name text)CREATE TABLE attribute_definitions (attribute_id number,attribute_name text,attribute_data_type text)CREATE TABLE catalog_contents_additional_attributes (catalog_entry_id number,catalog_level_number number,attribute_id...
SELECT attribute_data_type FROM attribute_definitions GROUP BY attribute_data_type HAVING COUNT(*) > 3
Would there be a 285 lab ?
CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)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...
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 285
give me the number of patients whose diagnoses short title is asthma nos w (ac) exac 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Asthma NOS w (ac) exac" AND lab.fluid = "Urine"
What is the pa when the skip is fran ois gagn ?
CREATE TABLE table_3505 ("Locale" text,"Skip" text,"W" real,"L" real,"PF" real,"PA" real,"Ends Won" real,"Ends Lost" real,"Blank Ends" real,"Stolen Ends" real,"Shot Pct." real)
SELECT "PA" FROM table_3505 WHERE "Skip" = 'François Gagné'
what is maximum age of patients whose ethnicity is white - russian and days of hospital stay is 29?
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 MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.days_stay = "29"
What is the Report on November 15, 2000?
CREATE TABLE table_65000 ("Date" text,"Venue" text,"Score" text,"Comp" text,"Report" text)
SELECT "Report" FROM table_65000 WHERE "Date" = 'november 15, 2000'
What was score of the game when the record was 72-74?
CREATE TABLE table_69073 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text)
SELECT "Score" FROM table_69073 WHERE "Record" = '72-74'
list the top three most frequent diagnoses that a patient was diagnosed with in the same month after receiving vaccination nec in 2104.
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 chartevents (row_id number,subject_id number,hadm_id number,icustay_id numbe...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
How much gold received by nation of uzbekistan (uzb)?
CREATE TABLE table_42232 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MAX("Gold") FROM table_42232 WHERE "Nation" = 'uzbekistan (uzb)'
What is the high amount of points on February 11?
CREATE TABLE table_21513 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High points" FROM table_21513 WHERE "Date" = 'February 11'
The nll participate in what sport?
CREATE TABLE table_69157 ("Club" text,"Sport" text,"Began play" text,"League" text,"Venue" text)
SELECT "Sport" FROM table_69157 WHERE "League" = 'nll'
What is the manufacturer, found under the Built column, that made locomotives with a Fuel/Trans of diesel-electric?
CREATE TABLE table_name_22 (built VARCHAR,fuel__trans VARCHAR)
SELECT built FROM table_name_22 WHERE fuel__trans = "diesel-electric"
What are the famous title of the artists associated with volumes with more than 2 weeks on top?
CREATE TABLE volume (volume_id number,volume_issue text,issue_date text,weeks_on_top number,song text,artist_id number)CREATE TABLE music_festival (id number,music_festival text,date_of_ceremony text,category text,volume number,result text)CREATE TABLE artist (artist_id number,artist text,age number,famous_title text,f...
SELECT T1.famous_title FROM artist AS T1 JOIN volume AS T2 ON T1.artist_id = T2.artist_id WHERE T2.weeks_on_top > 2
What is your favorite data analysis cartoon?.
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)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 PostTags (PostId number,TagId number)CREATE TABLE...
SELECT * FROM Comments WHERE PostId = 423
What is the state and enrollment of the colleges where have any students who got accepted in the tryout decision Plot them as bar chart, show by the bars in descending.
CREATE TABLE Player (pID numeric(5,0),pName varchar(20),yCard varchar(3),HS numeric(5,0))CREATE TABLE College (cName varchar(20),state varchar(2),enr numeric(5,0))CREATE TABLE Tryout (pID numeric(5,0),cName varchar(20),pPos varchar(8),decision varchar(3))
SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY state DESC
Which series episode has a Netflix episode of S03E16?
CREATE TABLE table_36077 ("Series Ep." text,"Episode" real,"Netflix" text,"Segment A" text,"Segment B" text,"Segment C" text,"Segment D" text)
SELECT "Series Ep." FROM table_36077 WHERE "Netflix" = 's03e16'
How many Points have an Opponent of @ los angeles kings and a Game larger than 4?
CREATE TABLE table_name_89 (points INTEGER,opponent VARCHAR,game VARCHAR)
SELECT AVG(points) FROM table_name_89 WHERE opponent = "@ los angeles kings" AND game > 4
Show the transaction type and the number of transactions by a bar chart, could you sort x-axis from low to high order?
CREATE TABLE Customers_Cards (card_id INTEGER,customer_id INTEGER,card_type_code VARCHAR(15),card_number VARCHAR(80),date_valid_from DATETIME,date_valid_to DATETIME,other_card_details VARCHAR(255))CREATE TABLE Financial_Transactions (transaction_id INTEGER,previous_transaction_id INTEGER,account_id INTEGER,card_id INTE...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type
when was the last time that patient 017-45919 had maximum chloride value on this hospital visit?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult nu...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-45919' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'chloride'...
what is the number of away games ?
CREATE TABLE table_204_38 (id number,"date" text,"opponent#" text,"rank#" text,"site" text,"result" text)
SELECT COUNT(*) FROM table_204_38 WHERE "opponent#" = 'away'
Posts with only sql or sql-server.
CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount...
SELECT PostId AS "post_link", COUNT(t1.Id), COUNT(t3.Id) FROM PostTags AS pt LEFT OUTER JOIN Tags AS t1 ON TagId = t1.Id AND t1.TagName IN ('sql', 'sql-server') LEFT OUTER JOIN Tags AS t3 ON TagId = t3.Id AND t3.TagName NOT IN ('sql', 'sql-server') WHERE PostId = 20284725 GROUP BY PostId
how many times was the candidates dan mica (d) 55.3% bill james (r) 44.7%?
CREATE TABLE table_1341663_10 (incumbent VARCHAR,candidates VARCHAR)
SELECT COUNT(incumbent) FROM table_1341663_10 WHERE candidates = "Dan Mica (D) 55.3% Bill James (R) 44.7%"
For the names and the players of clubs, count the names by names in a bar chart, list from high to low by the x-axis.
CREATE TABLE competition_result (Competition_ID int,Club_ID_1 int,Club_ID_2 int,Score text)CREATE TABLE player (Player_ID int,name text,Position text,Club_ID int,Apps real,Tries real,Goals text,Points real)CREATE TABLE competition (Competition_ID int,Year real,Competition_type text,Country text)CREATE TABLE club (Club_...
SELECT T1.name, COUNT(T1.name) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID GROUP BY T1.name ORDER BY T1.name DESC
How are people using the 'Leaving a half-answer as a comment' comment?.
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 PostId AS "post_link", * FROM Comments WHERE Text LIKE '%Leaving a half-answer as a comment%'
What is the average high temperature for each day of week Plot them as bar chart, I want to sort in ascending by the Y-axis.
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,low_temperature int,precipitation real,wind_speed_mph int)CREATE TABLE station (id int,network_name text,services text,local_author...
SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY AVG(high_temperature)
What is the Nation with less than 1 silver, and the total is 1, and bronze is less than 0?
CREATE TABLE table_name_81 (nation VARCHAR,bronze VARCHAR,silver VARCHAR,total VARCHAR)
SELECT nation FROM table_name_81 WHERE silver < 1 AND total = 1 AND bronze = 0
What is the total of Played where the Goals For is higher than 60, the Lost is 8, and the Position is less than 1?
CREATE TABLE table_44270 ("Position" real,"Team" text,"Played" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Difference" text,"Points 1" text)
SELECT SUM("Played") FROM table_44270 WHERE "Goals For" > '60' AND "Lost" = '8' AND "Position" < '1'
List all GT4 Cup winners played on the Spa-Francorchamps Report.
CREATE TABLE table_31470 ("Event" real,"Circuit" text,"GT3 Pro Cup Winner" text,"GT3 Pro / Am Cup Winner" text,"GT3 Citation Cup Winner" text,"GT4 Cup Winner" text)
SELECT "GT4 Cup Winner" FROM table_31470 WHERE "Circuit" = 'Spa-Francorchamps Report'
What were the Oct. temperatures for the city that had Nov. temperatures of 51/30?
CREATE TABLE table_40629 ("City" text,"Jan." text,"Feb." text,"Mar." text,"Apr." text,"May." text,"Jun." text,"Jul." text,"Aug." text,"Sep." text,"Oct." text,"Nov." text,"Dec." text)
SELECT "Oct." FROM table_40629 WHERE "Nov." = '51/30'
Give me a pie to show the average of weight from different sex.
CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real)CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex
in 2105 was patient 50065 prescribed quinidine sulfate?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod 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)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 50065) AND prescriptions.drug = 'quinidine sulfate' AND STRFTIME('%y', prescriptions.startdate) = '2105'
give me the number of patients whose diagnoses short title is retention urine nos?
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 text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Retention urine NOS"
What is the height of the player from Gulfport, MS?
CREATE TABLE table_23928 ("Name" text,"#" real,"Height" text,"Weight" real,"Position" text,"Year" text,"Home Town" text,"High School" text)
SELECT "Height" FROM table_23928 WHERE "Home Town" = 'Gulfport, MS'
What is Result, when Date is 2003?
CREATE TABLE table_name_80 (result VARCHAR,date VARCHAR)
SELECT result FROM table_name_80 WHERE date = "2003"
the total number of medals won by australia was how many ?
CREATE TABLE table_203_707 (id number,"rank" number,"npc" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "total" FROM table_203_707 WHERE "npc" = 'australia'
what are the three most commonly ordered drugs since 2103 for patients 50s?
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 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 50 AND 59) AND STRFTIME('%y', medication.drugstarttime) >= '2103' GROUP BY medication.drugn...
Lorne Henning has the lowest pick# of?
CREATE TABLE table_19539 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT MIN("Pick #") FROM table_19539
In what time period was the Cessna 208 built?
CREATE TABLE table_name_2 (period VARCHAR,model VARCHAR)
SELECT period FROM table_name_2 WHERE model = "cessna 208"