instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
who placed after manjeet kaur ?
CREATE TABLE table_204_937 (id number,"rank" number,"lane" number,"athlete" text,"time" number)
SELECT "athlete" FROM table_204_937 WHERE id = (SELECT id FROM table_204_937 WHERE "athlete" = 'manjeet kaur') + 1
What is the map reference number for Lake Superior with a larger population than 65,216
CREATE TABLE table_13024 ("Rank" real,"Map Reference Number" real,"Census Statistical Area" text,"2007 Population" real,"Lake(s)" text)
SELECT COUNT("Map Reference Number") FROM table_13024 WHERE "Lake(s)" = 'lake superior' AND "2007 Population" > '65,216'
Who played men's doubles when men's singles were played by wong peng soon and Women's singles was played by cecilia samuel, in 1952?
CREATE TABLE table_31625 ("Year" text,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text)
SELECT "Men's doubles" FROM table_31625 WHERE "Men's singles" = 'wong peng soon' AND "Women's singles" = 'cecilia samuel' AND "Year" = '1952'
Am I eligible for ASIAN 594 in Spring semester ?
CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch...
SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
What format does Japan use?
CREATE TABLE table_33163 ("Country" text,"Date" text,"Label" text,"Format" text,"Catalogue" text)
SELECT "Format" FROM table_33163 WHERE "Country" = 'japan'
How many picks did the College of USC wind up getting?
CREATE TABLE table_name_67 (pick__number VARCHAR,college VARCHAR)
SELECT COUNT(pick__number) FROM table_name_67 WHERE college = "usc"
On what date was the match higher than 8 on ground A against Guiseley?
CREATE TABLE table_name_2 (date VARCHAR,opponent VARCHAR,match VARCHAR,ground VARCHAR)
SELECT date FROM table_name_2 WHERE match > 8 AND ground = "a" AND opponent = "guiseley"
How many rebound did the person who scored 147 points have?
CREATE TABLE table_25372 ("Player" text,"Games Played" real,"Minutes" real,"Field Goals" real,"Three Pointers" real,"Free Throws" real,"Rebounds" real,"Assists" real,"Blocks" real,"Steals" real,"Points" real)
SELECT COUNT("Rebounds") FROM table_25372 WHERE "Points" = '147'
What is the last name of each student who is not allergic to any type of food? Count them with a bar chart.
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 Has_Allergy (StuID INTEGER,Allergy VARCHAR(20))CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20))
SELECT LName, COUNT(LName) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY LName
What was the sum roll of Karaka area?
CREATE TABLE table_57832 ("Name" text,"Years" text,"Gender" text,"Area" text,"Authority" text,"Decile" real,"Roll" real)
SELECT SUM("Roll") FROM table_57832 WHERE "Area" = 'karaka'
on 06/22/last year', what was average arterial bp [diastolic] of patient 25523?
CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE patients (...
SELECT AVG(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 = 25523)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
what is the total number of points scored ?
CREATE TABLE table_204_918 (id number,"week" number,"date" text,"opponent" text,"result" text,"record" text,"attendance" number,"bye" text)
SELECT SUM("result" + "result") FROM table_204_918
matlab questions with a close flag/vote.
CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidan...
SELECT DISTINCT pt.PostId AS "post_link" FROM PostTags AS pt INNER JOIN PendingFlags AS pf ON pf.PostId = pt.PostId AND pf.FlagTypeId IN (13, 14) INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'outlook'
has volume (ml) heparin been given to patient 030-4181 in 06/last year?
CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim...
SELECT 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 = '030-4181')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput...
Give me the comparison about the average of meter_100 over the meter_200 , and group by attribute meter_200.
CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te...
SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200
What is the air date for the episode with production code ad1c13?
CREATE TABLE table_name_64 (original_air_date VARCHAR,production_code VARCHAR)
SELECT original_air_date FROM table_name_64 WHERE production_code = "ad1c13"
What was the numer of the game when the record was 4-0?
CREATE TABLE table_21034801_1 (game INTEGER,record VARCHAR)
SELECT MAX(game) FROM table_21034801_1 WHERE record = "4-0"
What is the prize for the tournament at Ibaraki?
CREATE TABLE table_26144632_1 (prize_fund___¥__ VARCHAR,location VARCHAR)
SELECT prize_fund___¥__ FROM table_26144632_1 WHERE location = "Ibaraki"
give the number of patients whose drug type is base and lab test name is red blood cells.
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "BASE" AND lab.label = "Red Blood Cells"
when is the first time that patient 14671 has the maximum arterial bp mean value on the current icu visit?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,h...
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 = 14671) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WH...
Name the city of license for call sign of kcmp
CREATE TABLE table_name_95 (city_of_license VARCHAR,call_sign VARCHAR)
SELECT city_of_license FROM table_name_95 WHERE call_sign = "kcmp"
Find all the payment dates for the payments with an amount larger than 10 and the payments handled by a staff person with the first name Elsa, and count them by a bar chart, order Y in desc order.
CREATE TABLE film_text (film_id SMALLINT,title VARCHAR(255),description TEXT)CREATE TABLE language (language_id TINYINT UNSIGNED,name CHAR(20),last_update TIMESTAMP)CREATE TABLE film (film_id SMALLINT UNSIGNED,title VARCHAR(255),description TEXT,release_year YEAR,language_id TINYINT UNSIGNED,original_language_id TINYIN...
SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' ORDER BY COUNT(payment_date) DESC
How old was the horse when the SP was 200/1?
CREATE TABLE table_22265261_1 (age VARCHAR,sp VARCHAR)
SELECT COUNT(age) FROM table_22265261_1 WHERE sp = "200/1"
was edmund barton or alfred deakin younger at the beginning of his first term ?
CREATE TABLE table_204_812 (id number,"#" number,"prime minister" text,"date of birth" text,"start date\nof (first) term" text,"age at beginning\nof (first) term" text,"end date\nof (final) term" text,"total time in\noffice" text,"date of death" text,"lifespan" text)
SELECT "prime minister" FROM table_204_812 WHERE "prime minister" IN ('edmund barton', 'alfred deakin') ORDER BY "age at beginning\nof (first) term" LIMIT 1
who was the only nation with 5 gold medals ?
CREATE TABLE table_204_922 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "nation" FROM table_204_922 WHERE "gold" = 5
what 's the earliest flight from SAN FRANCISCO to BOSTON
CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basi...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
What are the High assists for Team houston?
CREATE TABLE table_9355 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High assists" FROM table_9355 WHERE "Team" = 'houston'
What is the highest percent supporting prohibition when the number opposing is less than 2,978 and the percent opposing is less than 31.2 while the number supporting is less than 9,461?
CREATE TABLE table_51223 ("Jurisdiction" text,"For Prohibition" real,"Percent For" real,"Against Prohibition" real,"Percent Against" real)
SELECT MAX("Percent For") FROM table_51223 WHERE "Against Prohibition" < '2,978' AND "Percent Against" < '31.2' AND "For Prohibition" < '9,461'
What is the fleet number for the model of Gillig Phantom 3096TB?
CREATE TABLE table_name_95 (fleet_number VARCHAR,model VARCHAR)
SELECT fleet_number FROM table_name_95 WHERE model = "gillig phantom 3096tb"
please give me the flights from KANSAS CITY to CHICAGO on 6 16
CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE flig...
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 = 'CHICAGO' AND date_day.day_number = 16 AND date_day.month_number = 6 AND d...
Accepted answers to questions by now-anonymous users.
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLice...
SELECT a.Id AS "post_link" FROM Posts AS a INNER JOIN Posts AS q ON q.AcceptedAnswerId = a.Id LEFT OUTER JOIN Users AS u ON q.OwnerUserId = u.Id WHERE a.OwnerUserId = '##UserId##' AND u.Id IS NULL
On what Week was the Detroit Lions the Opponent?
CREATE TABLE table_name_66 (week VARCHAR,opponent VARCHAR)
SELECT week FROM table_name_66 WHERE opponent = "detroit lions"
All tag names in decending order of uses.
CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,Las...
SELECT TagName, 'count' FROM Tags ORDER BY 'count' DESC
Which Points have a Drawn larger than 0, and a Lost larger than 1?
CREATE TABLE table_38422 ("Games" real,"Drawn" real,"Lost" real,"Points difference" text,"Points" real)
SELECT AVG("Points") FROM table_38422 WHERE "Drawn" > '0' AND "Lost" > '1'
Which method did pride bushido 10 have ?
CREATE TABLE table_38548 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" text,"Time" text,"Location" text)
SELECT "Method" FROM table_38548 WHERE "Event" = 'pride bushido 10'
who is the opponent where tv is abc and game site is tampa stadium
CREATE TABLE table_11406866_2 (opponent VARCHAR,tv VARCHAR,game_site VARCHAR)
SELECT opponent FROM table_11406866_2 WHERE tv = "ABC" AND game_site = "Tampa Stadium"
what is the number of songs with a length over 4 minutes ?
CREATE TABLE table_204_101 (id number,"#" number,"title" text,"producer(s)" text,"performer (s)" text,"sample(s)" text,"length" text)
SELECT COUNT("title") FROM table_204_101 WHERE "length" >= 4
which is the only one with 1074 km
CREATE TABLE table_204_876 (id number,"ecclesiastical jurisdictions" text,"latin name" text,"type" text,"rite" text,"ecclesiastical province" text,"established" text,"area (km2)" number)
SELECT "ecclesiastical jurisdictions" FROM table_204_876 WHERE "area (km2)" = '1074'
What is the production code for the show that aired on October 27, 1994?
CREATE TABLE table_11951237_1 (production_code INTEGER,original_air_date VARCHAR)
SELECT MAX(production_code) FROM table_11951237_1 WHERE original_air_date = "October 27, 1994"
What is the away team score when home team score is 20.12 (132)?
CREATE TABLE table_77559 ("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_77559 WHERE "Home team score" = '20.12 (132)'
Which Venue has Notes of 58.25 m, and a Competition of world championships?
CREATE TABLE table_name_33 (venue VARCHAR,notes VARCHAR,competition VARCHAR)
SELECT venue FROM table_name_33 WHERE notes = "58.25 m" AND competition = "world championships"
Name the type for hobart college
CREATE TABLE table_23230 ("Institution" text,"Nickname" text,"Location" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" real)
SELECT "Type" FROM table_23230 WHERE "Institution" = 'Hobart College'
how many titles did not list an english translation ?
CREATE TABLE table_203_476 (id number,"no." number,"title (latin)" text,"title (english translation)" text,"subject" text,"date" text)
SELECT COUNT(*) FROM table_203_476 WHERE "title (english translation)" IS NULL
what is the number of times the seattle sounders has reached the 2nd round of the open cup ?
CREATE TABLE table_204_463 (id number,"year" number,"division" number,"league" text,"regular season" text,"playoffs" text,"open cup" text)
SELECT COUNT(*) FROM table_204_463 WHERE "open cup" = '2nd round'
what are the different role codes for users, and how many users have each?
CREATE TABLE Users (user_id INTEGER,role_code VARCHAR(15),user_name VARCHAR(40),user_login VARCHAR(40),password VARCHAR(40))CREATE TABLE Images (image_id INTEGER,image_alt_text VARCHAR(80),image_name VARCHAR(40),image_url VARCHAR(255))CREATE TABLE Document_Structures (document_structure_code VARCHAR(15),parent_document...
SELECT role_code, COUNT(*) FROM Users GROUP BY role_code
What is the railway number of the aw class?
CREATE TABLE table_name_3 (railway_number_s_ VARCHAR,class VARCHAR)
SELECT railway_number_s_ FROM table_name_3 WHERE class = "aw"
What is the average births that had a death rate of 0.4
CREATE TABLE table_name_38 (births__000s_ INTEGER,deaths VARCHAR)
SELECT AVG(births__000s_) FROM table_name_38 WHERE deaths = 0.4
how many students are in each department?, and display X from high to low order.
CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CODE varchar(8),EMP_NUM int,DEPT_ADDRESS varchar(20),DEPT_EXTENSION varchar(4))CREATE TABLE ENROLL (CLASS_CODE varchar(5),STU_NUM int,ENROLL_GRADE varchar(50))CREATE TABLE COURSE (CRS_CODE varchar(10),DEPT_CODE varchar(10),CRS_DESCRIPTION varch...
SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE DESC
When was roshan mahanama born?
CREATE TABLE table_name_71 (date_of_birth VARCHAR,player VARCHAR)
SELECT date_of_birth FROM table_name_71 WHERE player = "roshan mahanama"
For those employees who was hired before 2002-06-21, draw a line chart about the change of commission_pct over hire_date , could you list by the X in descending?
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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 employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC
What is the average number of starts when the money list rank is 108 and the rank in the top 25 is greater than 4?
CREATE TABLE table_41649 ("Year" text,"Starts" real,"Cuts Made" real,"Wins" real,"Top 10" real,"Top 25" real,"Earnings (\u20ac)" real,"Money list rank" text)
SELECT AVG("Starts") FROM table_41649 WHERE "Money list rank" = '108' AND "Top 25" > '4'
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a scatter chart about the correlation between employee_id and salary .
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 locations (LOCATION_ID decimal(4,0),STREET_ADDRESS...
SELECT EMPLOYEE_ID, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
What country does Glory Alozie play for?
CREATE TABLE table_7941 ("Heat" real,"Lane" real,"Name" text,"Country" text,"Mark" text,"React" real)
SELECT "Country" FROM table_7941 WHERE "Name" = 'glory alozie'
what are the four most frequent procedures that followed in the same hospital visit for the patients who were diagnosed with mal neo bronch/lung nec in this year?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)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 d_labitems (row_id...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.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, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i...
give the maximum number of days of hospital stay for patients who had liver transplant.
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 MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT"
this year patient 027-82318 has been diagnosed with hiv positive - cd4 > 350?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-82318')) AND diagnosis.diagnosisname = 'hiv positive - cd4 > 350' AND DA...
what was the top four of the most frequent procedures until 3 years ago?
CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime ...
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 DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY procedur...
What is the NTSC M for Pal M 525/60?
CREATE TABLE table_44199 ("NTSC M" text,"PAL B,G,H" text,"PAL I" text,"PAL N" text,"PAL M" text)
SELECT "NTSC M" FROM table_44199 WHERE "PAL M" = '525/60'
Closed posts by votes on answers. This is used to see how many closed questions have up, down and neutral voted answers. A single post can be in all three categories if there is an answer which is positive, negative and neutral.
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREA...
WITH ClosedPostsVotes AS (SELECT p.Id AS "Post Link", SUM(CASE WHEN a.Score > 0 THEN 1 ELSE 0 END) AS Up, SUM(CASE WHEN a.Score < 0 THEN 1 ELSE 0 END) AS Down, SUM(CASE WHEN a.Score = 0 THEN 1 ELSE 0 END) AS Neutral FROM Posts AS p INNER JOIN Posts AS a ON a.ParentId = p.Id WHERE NOT p.ClosedDate IS NULL GROUP BY p.Id)...
Who is the opponent in game 7?
CREATE TABLE table_name_21 (opponent VARCHAR,game VARCHAR)
SELECT opponent FROM table_name_21 WHERE game = 7
how many countries in this competition had more than two silver medals ?
CREATE TABLE table_204_771 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT COUNT("nation") FROM table_204_771 WHERE "silver" > 2
What has Dr. India Plough taught in the past ?
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 varchar,minor varchar,internship varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour...
What was the spending per capita when the revenue per capita was $7,755?
CREATE TABLE table_19508 ("Rank" real,"State" text,"Revenue (millions)" text,"Population" real,"Revenue per capita" text,"Spending (millions)" text,"Spending per capita" text,"Net contribution per capita" text,"Presidential majority 2000/2004" text,"Presidential majority 2008" text,"Presidential majority 2012" text,"Ob...
SELECT "Spending per capita" FROM table_19508 WHERE "Revenue per capita" = '$7,755'
What was the last week when the team had a bye week?
CREATE TABLE table_name_58 (week INTEGER,result VARCHAR)
SELECT MAX(week) FROM table_name_58 WHERE result = "bye"
what are the five most commonly prescribed medications for patients who were previously prescribed nystatin ointment within 2 months, a year before?
CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,st...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'nystatin ointment' AND DATETIME(prescriptions.startdate, 'start o...
What is the Capacity of the Rainer Kraft's Stadium?
CREATE TABLE table_7833 ("Team" text,"Head Coach" text,"City" text,"Stadium" text,"Capacity" real)
SELECT AVG("Capacity") FROM table_7833 WHERE "Head Coach" = 'rainer kraft'
Zero-answer zero-upvote unclosed questions with no recent updates since date.
CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE Re...
SELECT p.Title, p.CreationDate, p.LastActivityDate, p.Tags, 'http://stackoverflow.com/questions/' + CAST(p.Id AS TEXT(50)) AS Link FROM Posts AS p LEFT JOIN PostLinks AS l ON l.PostId = p.Id LEFT JOIN Votes AS v ON p.Id = v.PostId WHERE p.PostTypeId = 1 AND p.AnswerCount = 0 AND p.Score <= 0 AND l.Id IS NULL AND v.Id I...
Name the frequency with on-air ID of 1way fm
CREATE TABLE table_37964 ("Callsign" text,"Area served" text,"Frequency" text,"Band" text,"On-air ID" text,"Purpose" text)
SELECT "Frequency" FROM table_37964 WHERE "On-air ID" = '1way fm'
what is the properties of sodium when lithium is h a l o g e n s and rubidium is nacl (2.1)?
CREATE TABLE table_name_10 (sodium VARCHAR,lithium VARCHAR,rubidium VARCHAR)
SELECT sodium FROM table_name_10 WHERE lithium = "h a l o g e n s" AND rubidium = "nacl (2.1)"
What is the smallest number of races competed in with 11 podiums?
CREATE TABLE table_3295 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"F/Laps" real,"Podiums" real,"Points" real,"Position" text)
SELECT MIN("Races") FROM table_3295 WHERE "Podiums" = '11'
Name the 2nd leg for defence force
CREATE TABLE table_name_61 (team_2 VARCHAR)
SELECT 2 AS nd_leg FROM table_name_61 WHERE team_2 = "defence force"
What is the total of all Shot PCT occurrences when the value of Blank Ends is 8?
CREATE TABLE table_19829 ("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." text)
SELECT COUNT("Shot Pct.") FROM table_19829 WHERE "Blank Ends" = '8'
what is subject name of subject id 3343?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,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 t...
SELECT demographic.name FROM demographic WHERE demographic.subject_id = "3343"
what is the number of patients who have drug code vori200?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "VORI200"
What was the Winner of the SS5 Stage?
CREATE TABLE table_14980 ("Stage" text,"Time" text,"Name" text,"Length" text,"Winner" text,"Rally leader" text)
SELECT "Winner" FROM table_14980 WHERE "Stage" = 'ss5'
What location attendance has russell westbrook (5) as high assists and nenad krstic (8) as high rebounds?
CREATE TABLE table_73521 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Location Attendance" FROM table_73521 WHERE "High assists" = 'Russell Westbrook (5)' AND "High rebounds" = 'Nenad Krstic (8)'
what was the number of points scored in week 3 ?
CREATE TABLE table_204_662 (id number,"week" number,"date" text,"opponent" text,"result" text,"attendance" number,"bye" text)
SELECT "result" + "result" FROM table_204_662 WHERE "week" = 3
What was the earliest year a game was played in Athens?
CREATE TABLE table_name_95 (year INTEGER,location VARCHAR)
SELECT MIN(year) FROM table_name_95 WHERE location = "athens"
What's the number of the player with 68.46 (1144 pts) in riding?
CREATE TABLE table_17651 ("#" real,"Athlete (NOC)" text,"Shooting" text,"Fencing" text,"Swimming" text,"Riding" text,"Running" text,"Total" real)
SELECT MAX("#") FROM table_17651 WHERE "Riding" = '68.46 (1144 pts)'
hba1c > 7.5 %
CREATE TABLE table_train_207 ("id" int,"anemia" bool,"hemoglobin_a1c_hba1c" float,"diabetic" string,"body_mass_index_bmi" float,"age" float,"NOUSE" float)
SELECT * FROM table_train_207 WHERE hemoglobin_a1c_hba1c > 7.5
Show different locations and the number of performances at each location Visualize by bar chart, and display by the Y-axis in descending.
CREATE TABLE performance (Performance_ID real,Date text,Host text,Location text,Attendance int)CREATE TABLE member_attendance (Member_ID int,Performance_ID int,Num_of_Pieces int)CREATE TABLE member (Member_ID text,Name text,Nationality text,Role text)
SELECT Location, COUNT(*) FROM performance GROUP BY Location ORDER BY COUNT(*) DESC
In what venue is Essendon the home team?
CREATE TABLE table_name_92 (venue VARCHAR,home_team VARCHAR)
SELECT venue FROM table_name_92 WHERE home_team = "essendon"
Next Winter , what are the special topics classes ?
CREATE TABLE gsi (course_offering_id int,student_id 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 int,respe...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E...
when was patient 006-195316 prescribed for a medication for the last time on this hospital visit?
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,orga...
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 = '006-195316' AND patient.hospitaldischargetime IS NULL)) ORDER ...
what is the largest attendance on the chart
CREATE TABLE table_204_994 (id number,"date" text,"time" text,"opponent#" text,"rank#" text,"site" text,"tv" text,"result" text,"attendance" number)
SELECT MAX("attendance") FROM table_204_994
Find the name of amenity that is most common in all dorms.
CREATE TABLE dorm_amenity (amenid number,amenity_name text)CREATE TABLE lives_in (stuid number,dormid number,room_number number)CREATE TABLE dorm (dormid number,dorm_name text,student_capacity number,gender text)CREATE TABLE has_amenity (dormid number,amenid number)CREATE TABLE student (stuid number,lname text,fname te...
SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY COUNT(*) DESC LIMIT 1
Which Opposing Teams is on 06/02/1988?
CREATE TABLE table_59497 ("Opposing Teams" text,"Against" real,"Date" text,"Venue" text,"Status" text)
SELECT "Opposing Teams" FROM table_59497 WHERE "Date" = '06/02/1988'
What's the format of the season that ended on June 25?
CREATE TABLE table_1949994_7 (format VARCHAR,end_date VARCHAR)
SELECT format FROM table_1949994_7 WHERE end_date = "June 25"
What was the most Nepalis admitted when fewer than 1,896 Bangladeshis were admitted?
CREATE TABLE table_47314 ("Year" text,"Indians admitted" real,"Pakistanis admitted" real,"Sri Lankans admitted" real,"Bangladeshis admitted" real,"Nepalis admitted" real)
SELECT MAX("Nepalis admitted") FROM table_47314 WHERE "Bangladeshis admitted" < '1,896'
What label is in download format in the United States?
CREATE TABLE table_name_42 (label VARCHAR,region VARCHAR,format VARCHAR)
SELECT label FROM table_name_42 WHERE region = "united states" AND format = "download"
Which share had an audience of 4.693.000?
CREATE TABLE table_name_12 (share VARCHAR,audience VARCHAR)
SELECT share FROM table_name_12 WHERE audience = "4.693.000"
Name the total number of class aaa for 2006-07
CREATE TABLE table_14630796_1 (class_aAA VARCHAR,school_year VARCHAR)
SELECT COUNT(class_aAA) FROM table_14630796_1 WHERE school_year = "2006-07"
What is the genre name of the film HUNGER ROOF?
CREATE TABLE inventory (inventory_id number,film_id number,store_id number,last_update time)CREATE TABLE actor (actor_id number,first_name text,last_name text,last_update time)CREATE TABLE rental (rental_id number,rental_date time,inventory_id number,customer_id number,return_date time,staff_id number,last_update time)...
SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF'
what is patient 007-15837's bedside glucose difference from the last value measured on the current hospital visit compared to the second to last value measured on the current hospital visit?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab ...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-15837' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'bedsi...
What is the name and the average gpa of department whose students have the highest average gpa?
CREATE TABLE department (dept_code text,dept_name text,school_code text,emp_num number,dept_address text,dept_extension text)CREATE TABLE student (stu_num number,stu_lname text,stu_fname text,stu_init text,stu_dob time,stu_hrs number,stu_class text,stu_gpa number,stu_transfer number,dept_code text,stu_phone text,prof_n...
SELECT T2.dept_name, AVG(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY AVG(T1.stu_gpa) DESC LIMIT 1
What team defeated the Capital City Giants?
CREATE TABLE table_name_11 (team VARCHAR,runner_up VARCHAR)
SELECT team FROM table_name_11 WHERE runner_up = "capital city giants"
When the Venue was mcg what was the sum of all Crowds for that venue?
CREATE TABLE table_55038 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT SUM("Crowd") FROM table_55038 WHERE "Venue" = 'mcg'
What was the incumbent for missouri 1?
CREATE TABLE table_1341640_26 (incumbent VARCHAR,district VARCHAR)
SELECT incumbent FROM table_1341640_26 WHERE district = "Missouri 1"
Which Opponent has a Round smaller than 3, and a Time of 1:09?
CREATE TABLE table_48083 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Opponent" FROM table_48083 WHERE "Round" < '3' AND "Time" = '1:09'
Count the number of games taken place in park 'Columbia Park' in 1907.
CREATE TABLE team_franchise (franchise_id text,franchise_name text,active text,na_assoc text)CREATE TABLE manager_half (player_id text,year number,team_id text,league_id text,inseason number,half number,g number,w number,l number,rank number)CREATE TABLE player_award_vote (award_id text,year number,league_id text,playe...
SELECT COUNT(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 1907 AND T2.park_name = 'Columbia Park'