instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
In regardless to upper-level classes , who teaches them ?
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 DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN program_...
What horse did not start and had a total of over 16.16?
CREATE TABLE table_52539 ("Rider" text,"Horse" text,"Faults" text,"Round 1 + 2A + 2B + 3A Points" text,"Total" real)
SELECT "Horse" FROM table_52539 WHERE "Faults" = 'did not start' AND "Total" > '16.16'
tell me, what was the top five most common procedures of patients in the 30s since 1 year ago?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patie...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-1 yea...
What Valley Vista has a Willow Canyon of 2169?
CREATE TABLE table_57849 ("Information" text,"Dysart" text,"Shadow Ridge" text,"Valley Vista" text,"Willow Canyon" text)
SELECT "Valley Vista" FROM table_57849 WHERE "Willow Canyon" = '2169'
how many people had died after being diagnosed with ventltr assoc pneumonia during the same hospital encounter in 2103?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,chartti...
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...
What is the date made that has an associated fleet number of 4?
CREATE TABLE table_name_99 (date_made VARCHAR,fleet_numbers VARCHAR)
SELECT date_made FROM table_name_99 WHERE fleet_numbers = "4"
Name the married filing separately for single of $0 $8,350
CREATE TABLE table_54817 ("Marginal Ordinary Income Tax Rate" text,"Single" text,"Married Filing Jointly or Qualified Widow(er)" text,"Married Filing Separately" text,"Head of Household" text)
SELECT "Married Filing Separately" FROM table_54817 WHERE "Single" = '$0–$8,350'
list the number of patients with congestive heart failure.
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.diagnosis = "CONGESTIVE HEART FAILURE"
Who was the subject of the bronze sculpture who was a colonist and soldier in Ville Marie, New France?
CREATE TABLE table_2375 ("Title/Subject" text,"Public Office" text,"Artist" text,"Date Painted/Created" text,"Medium" text)
SELECT "Title/Subject" FROM table_2375 WHERE "Medium" = 'Bronze' AND "Public Office" = 'colonist and soldier in Ville Marie, New France'
what release types are captured in this data set?
CREATE TABLE torrents (groupname text,totalsnatched number,artist text,groupyear number,releasetype text,groupid number,id number)CREATE TABLE tags (index number,id number,tag text)
SELECT DISTINCT releasetype FROM torrents
Frequency (MHz) that has a Type of primary, and a Call letters of ktbb-fm has what total number?
CREATE TABLE table_name_52 (frequency__mhz_ VARCHAR,type VARCHAR,call_letters VARCHAR)
SELECT COUNT(frequency__mhz_) FROM table_name_52 WHERE type = "primary" AND call_letters = "ktbb-fm"
What is the team they played on november 25?
CREATE TABLE table_29824 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Team" FROM table_29824 WHERE "Date" = 'November 25'
What is overall rank when viewers are at 6.59 million?
CREATE TABLE table_2261 ("Episode Number" real,"Episode" text,"Rating" text,"Share" real,"Rating/Share (18-49)" text,"Viewers (millions)" text,"Rank (Timeslot)" text,"Rank (Overall)" text)
SELECT "Rank (Overall)" FROM table_2261 WHERE "Viewers (millions)" = '6.59'
What was the film Falling up nominated for?
CREATE TABLE table_16000 ("Nomination" text,"Actors Name" text,"Film Name" text,"Director" text,"Country" text)
SELECT "Nomination" FROM table_16000 WHERE "Film Name" = 'Falling Up'
Who played Men's singles in 2007?
CREATE TABLE table_15620 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text)
SELECT "Men's singles" FROM table_15620 WHERE "Year" = '2007'
What countries are the female artists who sung in the language Bangla from, and count them by a bar chart, list in desc by the X-axis.
CREATE TABLE genre (g_name varchar2(20),rating varchar2(10),most_popular_in varchar2(50))CREATE TABLE files (f_id number(10),artist_name varchar2(50),file_size varchar2(20),duration varchar2(20),formats varchar2(20))CREATE TABLE artist (artist_name varchar2(50),country varchar2(20),gender varchar2(20),preferred_genre v...
SELECT T1.country, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.languages = "bangla" GROUP BY T1.country ORDER BY T1.country DESC
Final that has a Date of january 10, 2004 had what opponent?
CREATE TABLE table_5134 ("Date" text,"Tournament" text,"Surface" text,"Opponent in the Final" text,"Score" text)
SELECT "Opponent in the Final" FROM table_5134 WHERE "Date" = 'january 10, 2004'
What round was a loss with a record of 12-3?
CREATE TABLE table_name_22 (round VARCHAR,res VARCHAR,record VARCHAR)
SELECT round FROM table_name_22 WHERE res = "loss" AND record = "12-3"
What is the sum of carries associated with 80 points and fewer than 16 touchdowns?
CREATE TABLE table_80420 ("Year" text,"Carries" real,"Rushing Yards" real,"Average" real,"Touchdowns" real,"Points" real)
SELECT SUM("Carries") FROM table_80420 WHERE "Points" = '80' AND "Touchdowns" < '16'
what number of patients having expired in or before the year 2180 underwent the procedure for local excision of lesion or tissue of bone, scapula, clavicle, and thorax [ribs and sternum]?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2180.0" AND procedures.long_title = "Local excision of lesion or tissue of bone, scapula, clavicle, and thorax [ribs and sternum]"
what was the drug patient 016-27397 had been prescribed two times this month?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,ob...
SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016...
What is the production code that was written by matt robinson?
CREATE TABLE table_3994 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real)
SELECT "Production code" FROM table_3994 WHERE "Written by" = 'Matt Robinson'
Before ARCH 201 what are the essential courses that I should take ?
CREATE TABLE semester (semester_id int,semester varchar,year int)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 ...
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'ARCH' AND number = 201
I want the average bronze for total of 19 and silver of 8 with rank of 31
CREATE TABLE table_31960 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT AVG("Bronze") FROM table_31960 WHERE "Total" = '19' AND "Silver" = '8' AND "Rank" = '31'
Which parts have more than 2 faults? Show the part name and id.
CREATE TABLE asset_parts (asset_id number,part_id number)CREATE TABLE staff (staff_id number,staff_name text,gender text,other_staff_details text)CREATE TABLE skills (skill_id number,skill_code text,skill_description text)CREATE TABLE skills_required_to_fix (part_fault_id number,skill_id number)CREATE TABLE third_party...
SELECT T1.part_name, T1.part_id FROM parts AS T1 JOIN part_faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_id HAVING COUNT(*) > 2
tell me the test that was last given to patient 29410 in 11/2102?
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 icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outt...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29410) AND STRFTIME('%y-%m', labevents.charttime) = '2102-11' ORDER BY labevents.charttime DESC LIMIT 1)
Name the position for delaware
CREATE TABLE table_2508633_6 (position VARCHAR,college VARCHAR)
SELECT position FROM table_2508633_6 WHERE college = "Delaware"
How much First elected has a Result of re-elected, and a Party of republican, and a District of illinois 4?
CREATE TABLE table_name_76 (first_elected VARCHAR,district VARCHAR,result VARCHAR,party VARCHAR)
SELECT COUNT(first_elected) FROM table_name_76 WHERE result = "re-elected" AND party = "republican" AND district = "illinois 4"
What is the number of professors for different school Plot them as bar chart, sort from high to low by the the total number .
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 SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY COUNT(*) DESC
When 0,4, or 8 mb is the nupowr 117 what is the sonnet?
CREATE TABLE table_3002894_4 (sonnet VARCHAR,nupowr_117 VARCHAR)
SELECT sonnet FROM table_3002894_4 WHERE nupowr_117 = "0,4, or 8 MB"
Which Against has Wins of 11, and Losses smaller than 7?
CREATE TABLE table_name_97 (against INTEGER,wins VARCHAR,losses VARCHAR)
SELECT AVG(against) FROM table_name_97 WHERE wins = 11 AND losses < 7
Name the runs conceded where overs bowled is 53
CREATE TABLE table_15700367_2 (runs_conceded VARCHAR,overs_bowled VARCHAR)
SELECT COUNT(runs_conceded) FROM table_15700367_2 WHERE overs_bowled = "53"
How many high rebounds are in series 3-3?
CREATE TABLE table_25465 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text)
SELECT COUNT("High rebounds") FROM table_25465 WHERE "Series" = '3-3'
Who was the away team that played Northampton Town at home with a tie number of replay?
CREATE TABLE table_58943 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Attendance" text)
SELECT "Away team" FROM table_58943 WHERE "Tie no" = 'replay' AND "Home team" = 'northampton town'
who was the successor for district ohio 15th?
CREATE TABLE table_20876 ("District" text,"Vacator" text,"Reason for change" text,"Successor" text,"Date successor seated" text)
SELECT "Successor" FROM table_20876 WHERE "District" = 'Ohio 15th'
how long did the last place swimmer take to swim the 100 meter butterfly ?
CREATE TABLE table_204_3 (id number,"rank" number,"name" text,"nationality" text,"time" number)
SELECT "time" FROM table_204_3 ORDER BY "rank" DESC LIMIT 1
What was the number of athletes for the 7th edition?
CREATE TABLE table_73993 ("Edition" text,"Year" real,"Host city" text,"Host country" text,"Date" text,"No. of athletes" text,"Nations" real)
SELECT "No. of athletes" FROM table_73993 WHERE "Edition" = '7th'
Date of 1 october 2003 had what attendance?
CREATE TABLE table_69704 ("Date" text,"Opponents" text,"Result F\u2013A" text,"Attendance" real,"Group position" text)
SELECT "Attendance" FROM table_69704 WHERE "Date" = '1 october 2003'
when was the last time the respiratory rate of patient 27409 was less than 19.0, on the first intensive care unit visit?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,charget...
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27409) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (...
Searching for community wiki answers with multiple editors. http://meta.stackexchange.com/questions/257018/searching-for-community-wiki-answers-with-multiple-editors
CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmoun...
SELECT p.Id AS "post_link", ph.UserId AS "user_link", u.Reputation, ph.CreationDate FROM Posts AS p INNER JOIN PostHistory AS ph ON ph.PostId = p.Id INNER JOIN Users AS u ON ph.UserId = u.Id WHERE NOT CommunityOwnedDate IS NULL AND ph.PostHistoryTypeId IN (4, 5, 6) AND u.Reputation < 2000 AND ph.UserId > -1 AND ph.Id =...
select distinct tags from posts.
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 t.Id, t.TagName, COUNT(DISTINCT OwnerUserId) AS cnt FROM PostTags AS pt LEFT JOIN (SELECT Id, OwnerUserId FROM Posts WHERE YEAR(CreationDate) = 2018 OR YEAR(CreationDate) = 2017 OR YEAR(CreationDate) = 2016 OR YEAR(CreationDate) = 2015 OR YEAR(CreationDate) = 2014 AND NOT Tags IS NULL) AS p ON pt.PostId = p.Id L...
was patient 015-23047 excreting any emesis in 12/this year?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweigh...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu...
In which city is Hayman Hall (Tom Gola Arena) located?
CREATE TABLE table_32393 ("Region" text,"Host" text,"Venue" text,"City" text,"State" text)
SELECT "City" FROM table_32393 WHERE "Venue" = 'hayman hall (tom gola arena)'
Which Venue has Against of 25?
CREATE TABLE table_62535 ("Opposing Teams" text,"Against" real,"Date" text,"Venue" text,"Status" text)
SELECT "Venue" FROM table_62535 WHERE "Against" = '25'
what is average age of patients whose admission type is emergency and primary disease is posterior communicating aneurysm/sda?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA"
What is the Status with an Author that is woodruff?
CREATE TABLE table_39807 ("Name" text,"Novelty" text,"Status" text,"Authors" text,"Location" text)
SELECT "Status" FROM table_39807 WHERE "Authors" = 'woodruff'
What is the temperature rating of the intermediate temperature classification?
CREATE TABLE table_name_1 (temperature_rating VARCHAR,temperature_classification VARCHAR)
SELECT temperature_rating FROM table_name_1 WHERE temperature_classification = "intermediate"
Round 3 with a round 4 of 50?
CREATE TABLE table_9260 ("City" text,"Round 1" real,"Round 2" text,"Round 3" text,"Round 4" text)
SELECT "Round 3" FROM table_9260 WHERE "Round 4" = '50'
Which leader has been a leader since 2007?
CREATE TABLE table_45637 ("Leader" text,"Party" text,"Leader's Seat" text,"Number of Seats" real,"Leader since" text)
SELECT "Leader" FROM table_45637 WHERE "Leader since" = '2007'
What Tries against that have a Points against of 95 and Tries for larger than 20?
CREATE TABLE table_41017 ("Team" text,"Tries for" real,"Tries against" real,"Try diff" text,"Points for" real,"Points against" real,"Points diff" text)
SELECT SUM("Tries against") FROM table_41017 WHERE "Points against" = '95' AND "Tries for" > '20'
Who's the actor for the Archers having a character of Martha Woodford?
CREATE TABLE table_64915 ("Actor" text,"Character" text,"Soap Opera" text,"Years" text,"Duration" text)
SELECT "Actor" FROM table_64915 WHERE "Soap Opera" = 'the archers' AND "Character" = 'martha woodford'
when was the first time that patient 29410 was prescribed trazodone hcl and ns until 21 months ago at the same time?
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 chartevents (row_id number,subject_id number,hadm_id number,ic...
SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'ns' AND admissions.subject_id = 29410 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-21 month')) AS t1 JOIN (S...
how many patients diagnosed with heart valve replacement by transplant left against medical advice?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND diagnoses.long_title = "Heart valve replaced by transplant"
What track has a catalogue of 47-9465?
CREATE TABLE table_name_21 (track INTEGER,catalogue VARCHAR)
SELECT SUM(track) FROM table_name_21 WHERE catalogue = "47-9465"
How many flights for each origin city? Return a pie chart.
CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),departure_date date,arrival_date date,price number(7,2),aid number(9,0))CREATE TABLE employee (eid number(9,0),name varchar2(30),salary number(10,2))CREATE TABLE certificate (eid number(9,0),aid number(9,0))CREATE TA...
SELECT origin, COUNT(origin) FROM flight GROUP BY origin
How many appearances did the flamengo player who was with flamengo during the years 1989 1993 1996 1998 2004 2005 have?
CREATE TABLE table_8115 ("Name" text,"Nationality" text,"Position" text,"Flamengo career" text,"Appearances" real,"Goals" real)
SELECT MAX("Appearances") FROM table_8115 WHERE "Flamengo career" = '1989–1993 1996–1998 2004–2005'
For those employees who did not have any job in the past, give me the comparison about the sum of salary over the hire_date bin hire_date by weekday, and rank sum salary in ascending order.
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_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE cou...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY)
Name the tournament for april 3, 2005
CREATE TABLE table_name_79 (tournament VARCHAR,date VARCHAR)
SELECT tournament FROM table_name_79 WHERE date = "april 3, 2005"
What is Ma ana es para siempre of impreuna pentru totdeauna from Monday to Friday?
CREATE TABLE table_name_34 (monday_to_friday VARCHAR,mañana_es_para_siempre VARCHAR)
SELECT monday_to_friday FROM table_name_34 WHERE mañana_es_para_siempre = "impreuna pentru totdeauna"
What is the wins average when 17 games were lost?
CREATE TABLE table_name_83 (wins INTEGER,losses VARCHAR)
SELECT AVG(wins) FROM table_name_83 WHERE losses = 17
What is the names for the medalist in the sport of canoeing?
CREATE TABLE table_72041 ("Medal" text,"Name" text,"Games" text,"Sport" text,"Event" text)
SELECT "Name" FROM table_72041 WHERE "Sport" = 'canoeing'
What is the most points when the entrant was Jaguar racing earlier than 2001?
CREATE TABLE table_68989 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT MAX("Points") FROM table_68989 WHERE "Entrant" = 'jaguar racing' AND "Year" < '2001'
What is the name of the home stadium of Brisbane Lions?
CREATE TABLE table_name_93 (ground VARCHAR,home_team VARCHAR)
SELECT ground FROM table_name_93 WHERE home_team = "brisbane lions"
What competition was held earlier than 2007 and has 7434 in the notes field?
CREATE TABLE table_name_47 (competition VARCHAR,year VARCHAR,notes VARCHAR)
SELECT competition FROM table_name_47 WHERE year < 2007 AND notes = "7434"
What is the average?
CREATE TABLE table_16502 ("Team" text,"Stadium" text,"Capacity" real,"Highest" real,"Lowest" real,"Average" real)
SELECT MIN("Average") FROM table_16502
Unanswered questions with a tag favorited by users with a badge in that tag.
CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number...
SELECT p.Id AS "post_link", p.Score, p.CommentCount, p.CreationDate FROM Posts AS p, Badges AS b, Votes AS v WHERE b.Name = '##tag##' AND v.VoteTypeId = 5 AND v.PostId = p.Id AND v.UserId = b.UserId AND p.Tags LIKE '%##tag##%' AND p.AnswerCount = 0 AND p.ClosedDate IS NULL GROUP BY p.Id, p.Score, p.CommentCount, p.Crea...
What was the away teams score at Princes Park?
CREATE TABLE table_32725 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team score" FROM table_32725 WHERE "Venue" = 'princes park'
List the grape, winery and year of the wines whose price is bigger than 100 ordered by year.
CREATE TABLE WINE (Grape VARCHAR,Winery VARCHAR,YEAR VARCHAR,Price INTEGER)
SELECT Grape, Winery, YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR
how did patient 71091 last visit since 2105 to the hospital?
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 admissions.admission_type FROM admissions WHERE admissions.subject_id = 71091 AND STRFTIME('%y', admissions.admittime) >= '2105' ORDER BY admissions.admittime DESC LIMIT 1
What was the home team score for the Richmond away team?
CREATE TABLE table_74607 ("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_74607 WHERE "Away team" = 'richmond'
Name the date of st albans city for result of drew 0-0
CREATE TABLE table_name_73 (date VARCHAR,opponent VARCHAR,result VARCHAR)
SELECT date FROM table_name_73 WHERE opponent = "st albans city" AND result = "drew 0-0"
when did patient 017-49538 receive his/her first prescription for potassium chloride crys er 20 meq po tbcr on their first hospital visit?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-49538' AND NOT patient.hospitaldischargetime IS NULL ORDER...
What is the position of the song that was eliminated on 11 november?
CREATE TABLE table_23585197_3 (position INTEGER,date_eliminated VARCHAR)
SELECT MAX(position) FROM table_23585197_3 WHERE date_eliminated = "11 November"
on how many dates was the outcome the same as on 1 august 2011
CREATE TABLE table_204_868 (id number,"outcome" text,"no." number,"date" text,"tournament" text,"surface" text,"opponent" text,"score" text)
SELECT COUNT("date") FROM table_204_868 WHERE "date" <> '1 august 2011' AND "outcome" = (SELECT "outcome" FROM table_204_868 WHERE "date" = '1 august 2011')
What is the date for the release with a catalogue number of WARPCDD333?
CREATE TABLE table_6505 ("Country/Region" text,"Date" text,"Label" text,"Format" text,"Catalogue number" text)
SELECT "Date" FROM table_6505 WHERE "Catalogue number" = 'warpcdd333'
What is the average capacity that has rod laver arena as the stadium?
CREATE TABLE table_name_97 (capacity INTEGER,stadium VARCHAR)
SELECT AVG(capacity) FROM table_name_97 WHERE stadium = "rod laver arena"
how many newborn type admissions were before the year 2155?
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 demographic (subject_id text,hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.admityear < "2155"
Bar chart x axis date of transaction y axis mean share count, and could you list by the Y in asc?
CREATE TABLE Transactions_Lots (transaction_id INTEGER,lot_id INTEGER)CREATE TABLE Ref_Transaction_Types (transaction_type_code VARCHAR(10),transaction_type_description VARCHAR(80))CREATE TABLE Transactions (transaction_id INTEGER,investor_id INTEGER,transaction_type_code VARCHAR(10),date_of_transaction DATETIME,amount...
SELECT date_of_transaction, AVG(share_count) FROM Transactions ORDER BY AVG(share_count)
What is Player, when Years With Spurs is 1988-95?
CREATE TABLE table_name_7 (player VARCHAR,years_with_spurs VARCHAR)
SELECT player FROM table_name_7 WHERE years_with_spurs = "1988-95"
How much 2012 has a 2011 smaller than 26,452, and a 2009 larger than 3.38, and a 2008 smaller than 90.3?
CREATE TABLE table_13403 ("2012" real,"2011" real,"2010" real,"2009" real,"2008" real)
SELECT COUNT("2012") FROM table_13403 WHERE "2011" < '26,452' AND "2009" > '3.38' AND "2008" < '90.3'
What are the salaries in National League?
CREATE TABLE salary (year number,team_id text,league_id text,player_id text,salary number)CREATE TABLE player_award_vote (award_id text,year number,league_id text,player_id text,points_won number,points_max number,votes_first text)CREATE TABLE player (player_id text,birth_year text,birth_month text,birth_day text,birth...
SELECT salary FROM salary WHERE league_id = "NL"
give me the number of patients whose admission type is emergency and lab test name is cd3 cells, percent?
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,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "CD3 Cells, Percent"
What is the number of patients who were ordered an albumin body fluid lab test and stayed in hospital for more than 13 days?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "13" AND lab.label = "Albumin, Body Fluid"
Show different occupations along with the number of players in each occupation.
CREATE TABLE coach (coach_id number,coach_name text,gender text,club_id number,rank number)CREATE TABLE club (club_id number,club_name text,region text,start_year number)CREATE TABLE player_coach (player_id number,coach_id number,starting_year number)CREATE TABLE player (player_id number,sponsor_name text,player_name t...
SELECT occupation, COUNT(*) FROM player GROUP BY occupation
Top SO Users from Bangladesh.
CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,Deletion...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%bangladesh%' OR LOWER(Location) LIKE '%bd' ORDER BY Reputation DESC
What opponent has a week less than 12, with November 25, 1965 as the date?
CREATE TABLE table_66078 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT "Opponent" FROM table_66078 WHERE "Week" < '12' AND "Date" = 'november 25, 1965'
What will be offered in the way of intelligent systems in Winter or Fall 2017 ?
CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE course (course_id int,name varchar,departm...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%intel...
What score has 3-7 as the record?
CREATE TABLE table_name_46 (score VARCHAR,record VARCHAR)
SELECT score FROM table_name_46 WHERE record = "3-7"
When the VFL played Brunswick Street Oval what was the home team score?
CREATE TABLE table_4544 ("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_4544 WHERE "Venue" = 'brunswick street oval'
Which treasurer has a President of sebastian ihler?
CREATE TABLE table_55251 ("Year" text,"President" text,"Vice President" text,"Gen.-Secretary" text,"Treasurer" text)
SELECT "Treasurer" FROM table_55251 WHERE "President" = 'sebastian ihler'
Provide me the number of patients diagnosed with other chronic nonalcoholic liver disease who have a prescription for famotidine.
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Chronic liver dis NEC" AND prescriptions.drug = "Famotidine"
what is the name of the drug that has been prescribed two times in the current hospital encounter to patient 14467?
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 labevents (row_id number,subject_id number,hadm_id number,item...
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467 AND admissions.dischtime IS NULL) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 = 2
When 6 is the rank what is the time for Tuesday August 25th?
CREATE TABLE table_2881 ("Rank" real,"Rider" text,"Mon 24 Aug" text,"Tues 25 Aug" text,"Wed 26 Aug" text,"Thurs 27 Aug" text,"Fri 28 Aug" text,"Sat 29 Aug" text)
SELECT "Tues 25 Aug" FROM table_2881 WHERE "Rank" = '6'
What team has a pick larger than 30, when the college is saginaw valley state?
CREATE TABLE table_63735 ("Pick" real,"Team" text,"Player" text,"Position" text,"College" text)
SELECT "Team" FROM table_63735 WHERE "Pick" > '30' AND "College" = 'saginaw valley state'
count the number of patients who were prescribed iso-osmotic dextrose in the same month after being diagnosed with diastolc hrt failure nos since 2101.
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE icustays (row_id nu...
SELECT COUNT(DISTINCT t1.subject_id) 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_diagnoses.short_title = 'diastolc hrt failu...
On what Surface was the match with a Score of 3-6, 1-6 played?
CREATE TABLE table_name_99 (surface VARCHAR,score VARCHAR)
SELECT surface FROM table_name_99 WHERE score = "3-6, 1-6"
there were years where he had 0 goals but was year did he have the most goals ?
CREATE TABLE table_203_34 (id number,"season" text,"appearance" number,"interchange" number,"tries" number,"goals" number,"f/g" number,"points" number)
SELECT "season" FROM table_203_34 ORDER BY "goals" DESC LIMIT 1
What is the Max Aggregate bandwidth with a HyperTransport of 2?
CREATE TABLE table_name_17 (max_aggregate_bandwidth__bi_directional_ VARCHAR,hypertransport_version VARCHAR)
SELECT max_aggregate_bandwidth__bi_directional_ FROM table_name_17 WHERE hypertransport_version = 2
What question should I accept answeres to?.
CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE Comments (Id number,PostId number,Score number,...
SELECT q.Id AS "post_link", q.Tags, q.Score, q.AnswerCount, q.ViewCount, DATEDIFF(day, q.CreationDate, CURRENT_TIMESTAMP()) AS age FROM Posts AS q WHERE q.OwnerUserId = @UserId AND q.AcceptedAnswerId IS NULL AND q.PostTypeId = 1 AND q.Score > 0 AND q.AnswerCount > 0 AND q.ViewCount > 0 ORDER BY (LOG(q.Score) * @ScoreWe...
What is the number for De Vries?
CREATE TABLE table_17743 ("No." real,"P" text,"Name" text,"Country" text,"Age" real,"Loan Club" text,"Started" text,"Ended" text,"Start Source" text,"End Source" text)
SELECT MIN("No.") FROM table_17743 WHERE "Name" = 'de Vries'