instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What's the date the score was 379?
CREATE TABLE table_name_5 (date VARCHAR,score VARCHAR)
SELECT date FROM table_name_5 WHERE score = "379"
count the number of patients whose insurance is government and procedure icd9 code is 3727?
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.icd9_code = "3727"
provide the number of patients whose ethnicity is american indian/alaska native?
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.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
how many hours have passed since first time that patient 013-30085 stayed in ward 550 in their current hospital visit?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid text,patienthealthsystemstayi...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '013-30085' AND patient.wardid = 550 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1
When did the tom smith built train enter service with a number under 7007?
CREATE TABLE table_56212 ("Number" real,"Locomotive type" text,"Wheel arrangement" text,"Builder" text,"Entered Service" real,"Withdrawn" real)
SELECT AVG("Entered Service") FROM table_56212 WHERE "Builder" = 'tom smith' AND "Number" < '7007'
What is the Visitor of the game on January 24?
CREATE TABLE table_name_33 (visitor VARCHAR,date VARCHAR)
SELECT visitor FROM table_name_33 WHERE date = "january 24"
List the name of all products along with the number of complaints that they have received, and order from low to high by the X-axis.
CREATE TABLE Products (product_id INTEGER,parent_product_id INTEGER,product_category_code VARCHAR(20),date_product_first_available DATETIME,date_product_discontinued DATETIME,product_name VARCHAR(80),product_description VARCHAR(255),product_price DECIMAL(19,4))CREATE TABLE Staff (staff_id INTEGER,gender VARCHAR(1),firs...
SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY product_name
Feature-requests by the delay of becoming [status-completed].
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId...
WITH Raw AS (SELECT Id, PostId, Text, LAG(Text) OVER (PARTITION BY PostId ORDER BY Id) AS PrevText FROM PostHistory WHERE PostHistoryTypeId = 6), Raw2 AS (SELECT MIN(Id) AS Id, PostId FROM Raw WHERE (PrevText IS NULL OR NOT PrevText LIKE '%<status-completed>%') AND Text LIKE '%<status-completed>%' AND Text LIKE '%<feat...
What is the CERCLIS ID of the site in Polk County, with the date 08/04/2009?
CREATE TABLE table_name_96 (cerclis_id VARCHAR,county VARCHAR,deleted VARCHAR)
SELECT cerclis_id FROM table_name_96 WHERE county = "polk" AND deleted = "08/04/2009"
during the second leg , what number of matches ended in a draw ?
CREATE TABLE table_204_475 (id number,"home team" text,"score" text,"away team" text,"date" text,"agg" text)
SELECT COUNT(*) FROM table_204_475 WHERE "score" = "score"
what is the maximum amount of the total hospital cost which involves intracranial injury - with concussion since 5 years ago?
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 MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'intracranial injury - with concussion')) AND...
give me the number of patients whose diagnoses long title is personal history of malignant neoplasm of other gastrointestinal tract and lab test abnormal status is abnormal?
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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
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.long_title = "Personal history of malignant neoplasm of other gastrointestinal tract" AND lab.flag = "abnormal"
when was the episode with production code '2arg01' originally aired?
CREATE TABLE table_29438 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (millions)" text)
SELECT "Original air date" FROM table_29438 WHERE "Production code" = '2ARG01'
Distribution of post frequency by users.
CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReaso...
SELECT c.post_count, c.cum_posts, 100.0 * c.cum_posts / MAX(c.cum_posts) OVER (ORDER BY c.post_count DESC) AS cum_posts_pctg, c.cum_users, 100.0 * c.cum_users / MAX(c.cum_users) OVER (ORDER BY c.post_count DESC) AS cum_users_pctg FROM (SELECT b.post_count, 1.0 * SUM(b.post_count) OVER (ORDER BY b.post_count DESC) AS cu...
What country id Bob Rosburg from?
CREATE TABLE table_name_95 (country VARCHAR,player VARCHAR)
SELECT country FROM table_name_95 WHERE player = "bob rosburg"
specify birthdate and icd9 code of patient jerry deberry
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 demographic.dob, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Jerry Deberry"
find the age and status of death for patient with patient id 8323.
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 demographic.age, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "8323"
What is the transfer window with a status of transfer from the country of Wal?
CREATE TABLE table_name_65 (transfer_window VARCHAR,status VARCHAR,country VARCHAR)
SELECT transfer_window FROM table_name_65 WHERE status = "transfer" AND country = "wal"
in 2103, what are the four most frequent medications prescribed to stroke - ischemic stroke male patients of 20s after they have been diagnosed with stroke - ischemic stroke within 2 months?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight nu...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'stroke - ischemic stroke' AND STRFTIME('%y', diagn...
Show statement id, statement detail, account detail for accounts.
CREATE TABLE Accounts (statement_id VARCHAR,account_details VARCHAR)CREATE TABLE Statements (statement_details VARCHAR,statement_id VARCHAR)
SELECT T1.statement_id, T2.statement_details, T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id
What was the away team score for the game played at MCG?
CREATE TABLE table_58214 ("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_58214 WHERE "Venue" = 'mcg'
what's the occupied territory with estimated deaths of 600,000
CREATE TABLE table_10335_1 (occupied_territory VARCHAR,estimated_deaths VARCHAR)
SELECT occupied_territory FROM table_10335_1 WHERE estimated_deaths = "600,000"
what is average age of patients whose days of hospital stay is 1 and admission year is greater than or equal to 2146?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.days_stay = "1" AND demographic.admityear >= "2146"
who is the manufacturer for the order year 1998?
CREATE TABLE table_10007452_3 (manufacturer VARCHAR,order_year VARCHAR)
SELECT manufacturer FROM table_10007452_3 WHERE order_year = "1998"
What was the finish place with a qual of 123.660?
CREATE TABLE table_80299 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real)
SELECT "Finish" FROM table_80299 WHERE "Qual" = '123.660'
what is the date that the away team is aldershot?
CREATE TABLE table_name_16 (date VARCHAR,away_team VARCHAR)
SELECT date FROM table_name_16 WHERE away_team = "aldershot"
In what location was the tail number ZS-SPF?
CREATE TABLE table_name_83 (location VARCHAR,tail_number VARCHAR)
SELECT location FROM table_name_83 WHERE tail_number = "zs-spf"
Which city has a conference of LCC2 and a year earlier than 2009?
CREATE TABLE table_name_70 (city VARCHAR,year VARCHAR,conference VARCHAR)
SELECT city FROM table_name_70 WHERE year < 2009 AND conference = "lcc2"
What's the IHSAA class of the Red Devils?
CREATE TABLE table_name_77 (ihsaa_class VARCHAR,mascot VARCHAR)
SELECT ihsaa_class FROM table_name_77 WHERE mascot = "red devils"
What classes do not have sessions in the lab ?
CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE area (course_id int,area varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TAB...
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N'
Visualize a bar chart for what is the average age for each dorm and what are the names of each dorm?
CREATE TABLE Has_amenity (dormid INTEGER,amenid INTEGER)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 Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)CREATE TABLE Dorm (dormid INTEGER,dorm_nam...
SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name
count the number of patients whose diagnoses short title is abn react-surg proc nec and lab test category is chemistry?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Abn react-surg proc NEC" AND lab."CATEGORY" = "Chemistry"
what's the last test patient 64881 has had until 04/2104?
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 outputevents (row_id number,subject_id number,hadm_i...
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 = 64881) AND STRFTIME('%y-%m', labevents.charttime) <= '2104-04' ORDER BY labevents.charttime DESC LIMIT 1)
What is the visiting team of the game with the home team Grizzlies on 13 November 2007?
CREATE TABLE table_54277 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Record" text)
SELECT "Visitor" FROM table_54277 WHERE "Home" = 'grizzlies' AND "Date" = '13 november 2007'
What's the frequency of the model with part number TT80503300?
CREATE TABLE table_24096813_15 (frequency VARCHAR,part_number_s_ VARCHAR)
SELECT frequency FROM table_24096813_15 WHERE part_number_s_ = "TT80503300"
what number of hours have passed since patient 55281 last received a potassium lab test during their current hospital encounter?
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 transfers (row_id number,subject_id number,hadm_id number,icus...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55281 AND admissio...
What is the nba draft for the player from the hometown of virginia beach, va?
CREATE TABLE table_17095 ("Year" text,"Player" text,"School" text,"Hometown" text,"College" text,"NBA Draft" text)
SELECT "NBA Draft" FROM table_17095 WHERE "Hometown" = 'Virginia Beach, VA'
Which engine has a code of m113.980?
CREATE TABLE table_12884 ("Engine" text,"Cyl." text,"Power" text,"Torque" text,"Engine code" text,"0\u2013100km/h (sec.)" text)
SELECT "Engine" FROM table_12884 WHERE "Engine code" = 'm113.980'
What is the date of the game where Footscray was the away team?
CREATE TABLE table_4828 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_4828 WHERE "Away team" = 'footscray'
What is the largest amount of spectators when the home team scored 13.11 (89)?
CREATE TABLE table_55974 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT MAX("Crowd") FROM table_55974 WHERE "Home team score" = '13.11 (89)'
how many incumbent with first elected being 1932
CREATE TABLE table_1342331_5 (incumbent VARCHAR,first_elected VARCHAR)
SELECT COUNT(incumbent) FROM table_1342331_5 WHERE first_elected = 1932
How long was the course from Naples to Foggia?
CREATE TABLE table_67235 ("Date" text,"Course" text,"Distance" text,"Winner" text,"Race Leader" text)
SELECT "Distance" FROM table_67235 WHERE "Course" = 'naples to foggia'
How many 5+/inns have tyron henderson as the player, with wickets less than 21?
CREATE TABLE table_59627 ("Player" text,"Team" text,"Matches" real,"Overs" real,"Runs" real,"Wickets" real,"Best" text,"Econ" real,"S/Rate" real,"4/inns" real,"5+/inns" real,"Average" real)
SELECT COUNT("5+/inns") FROM table_59627 WHERE "Player" = 'tyron henderson' AND "Wickets" < '21'
Give the names of mountains in alphabetical order.
CREATE TABLE climber (climber_id number,name text,country text,time text,points number,mountain_id number)CREATE TABLE mountain (mountain_id number,name text,height number,prominence number,range text,country text)
SELECT name FROM mountain ORDER BY name
What is the population where the rank is higher than 51 and the Median House-hold income is $25,250?
CREATE TABLE table_name_50 (population INTEGER,rank VARCHAR,median_house__hold_income VARCHAR)
SELECT SUM(population) FROM table_name_50 WHERE rank > 51 AND median_house__hold_income = "$25,250"
How many numbers are ending in 1 year?
CREATE TABLE table_72487 ("N" real,"P" text,"Name" text,"EU" text,"Country" text,"Age" real,"Type" text,"Moving from" text,"Transfer window" text,"Ends" text,"Transfer fee" text,"Source" text)
SELECT COUNT("N") FROM table_72487 WHERE "Ends" = '1 year'
Give me a bar chart for the total number of each position
CREATE TABLE player (Player_ID int,Player text,Years_Played text,Total_WL text,Singles_WL text,Doubles_WL text,Team int)CREATE TABLE match_season (Season real,Player text,Position text,Country int,Team int,Draft_Pick_Number int,Draft_Class text,College text)CREATE TABLE team (Team_id int,Name text)CREATE TABLE country ...
SELECT Position, COUNT(*) FROM match_season GROUP BY Position
how many patients was given lap gastric restric proc in 2101 for two times?
CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'lap gastric restric p...
What are the Wycombe Wanderers when 1 January 2010 is 23 July 2009 and df is gk?
CREATE TABLE table_26360 ("1 January 2010" text,"DF" text,"Adam Hinshelwood" text,"Aldershot Town" text,"Wycombe Wanderers" text,"Undisclosed" text)
SELECT "Wycombe Wanderers" FROM table_26360 WHERE "1 January 2010" = '23 July 2009' AND "DF" = 'GK'
What is Southern Illinois University Edwardsville's affiliation?
CREATE TABLE table_name_48 (affiliation VARCHAR,institution VARCHAR)
SELECT affiliation FROM table_name_48 WHERE institution = "southern illinois university edwardsville"
How many totals have a Bronze of 0, and a Gold smaller than 0?
CREATE TABLE table_67368 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT SUM("Total") FROM table_67368 WHERE "Bronze" = '0' AND "Gold" < '0'
what is the series number where the date of first broadcast is 16 october 2008?
CREATE TABLE table_17906 ("Series number" text,"Episode number" real,"Date of first broadcast" text,"Total viewers" real,"Series average" real)
SELECT "Series number" FROM table_17906 WHERE "Date of first broadcast" = '16 October 2008'
what is the quantity when the year of manufacture is 1900 and the class is mc?
CREATE TABLE table_name_20 (quantity VARCHAR,year_s__of_manufacture VARCHAR,class VARCHAR)
SELECT quantity FROM table_name_20 WHERE year_s__of_manufacture = "1900" AND class = "mc"
What is the team 2 with turnovo as team 1?
CREATE TABLE table_60077 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text)
SELECT "Team 2" FROM table_60077 WHERE "Team 1" = 'turnovo'
Name the numbers for date of feb 27, 1996
CREATE TABLE table_20455 ("S No" real,"Team (A)" text,"Team (B)" text,"Winner" text,"Margin" text,"Match Date" text)
SELECT "S No" FROM table_20455 WHERE "Match Date" = 'Feb 27, 1996'
How many years did pia pajunen nina sundberg win women's doubles?
CREATE TABLE table_34956 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text)
SELECT COUNT("Year") FROM table_34956 WHERE "Women's doubles" = 'pia pajunen nina sundberg'
Which of the Latest version had a 16-bit Architecture and was released on Release date 1985-11-20?
CREATE TABLE table_32759 ("Name" text,"Release date" text,"Latest version" text,"Status support" text,"Source model" text,"Architecture" text,"Target market" text)
SELECT "Latest version" FROM table_32759 WHERE "Architecture" = '16-bit' AND "Release date" = '1985-11-20'
Name who directed the episode for the series number 236
CREATE TABLE table_72896 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text)
SELECT "Directed by" FROM table_72896 WHERE "Series #" = '236'
What was the Snatch weight for the year that had a total of 409kg?
CREATE TABLE table_name_92 (snatch VARCHAR,total VARCHAR)
SELECT snatch FROM table_name_92 WHERE total = "409kg"
What is City of License, when Frequency is 101.1?
CREATE TABLE table_42414 ("City of license" text,"Identifier" text,"Frequency" text,"Power" text,"Class" text,"RECNet" text)
SELECT "City of license" FROM table_42414 WHERE "Frequency" = '101.1'
What was the average point total for the nets in games before game 9 where the opponents scored less than 95?
CREATE TABLE table_name_62 (nets_points INTEGER,game VARCHAR,opponents VARCHAR)
SELECT AVG(nets_points) FROM table_name_62 WHERE game < 9 AND opponents < 95
Name the league for 2000
CREATE TABLE table_2553861_1 (league VARCHAR,year VARCHAR)
SELECT league FROM table_2553861_1 WHERE year = 2000
Can I do AOSS 421 immediately ?
CREATE TABLE area (course_id int,area varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time...
SELECT COUNT(*) > 0 FROM course, course_offering, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'AOSS' AND course.number = 421 AND offering_instructor.offering_id = course_offering.offering_id AND semester.semester = 'WN' AND semester.semester_id = course_offer...
Name the average pop for ch goku and prefecture of okayama
CREATE TABLE table_name_75 (pop_¹ INTEGER,region VARCHAR,prefecture VARCHAR)
SELECT AVG(pop_¹) FROM table_name_75 WHERE region = "chūgoku" AND prefecture = "okayama"
what are the five most commonly prescribed microbiology tests for patients who had previously received opn/oth rep mtrl vlv-tis within 2 months in 2103?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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 = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
How many years have a Position of 17th (q)?
CREATE TABLE table_14034 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Notes" text)
SELECT COUNT("Year") FROM table_14034 WHERE "Position" = '17th (q)'
which country has the most number of medals ?
CREATE TABLE table_203_608 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "nation" FROM table_203_608 ORDER BY "total" DESC LIMIT 1
Which European Cup is in the 2006-07 season?
CREATE TABLE table_name_91 (european_cup VARCHAR,season VARCHAR)
SELECT european_cup FROM table_name_91 WHERE season = "2006-07"
display all the details from Employees table for those employees who was hired before 2002-06-21.
CREATE TABLE countries (country_id text,country_name text,region_id number)CREATE TABLE employees (employee_id number,first_name text,last_name text,email text,phone_number text,hire_date time,job_id text,salary number,commission_pct number,manager_id number,department_id number)CREATE TABLE regions (region_id number,r...
SELECT * FROM employees WHERE hire_date < '2002-06-21'
All the downvoted posts of a user.
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUser...
SELECT * FROM Posts WHERE OwnerUserId = '##UserID##' AND Score < 0
What was the winning score for runnerup Greg Norman
CREATE TABLE table_name_5 (winning_score VARCHAR,runner_s__up VARCHAR)
SELECT winning_score FROM table_name_5 WHERE runner_s__up = "greg norman"
when did patient 12775 first got the minimum of heart rate yesterday?
CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses_icd (r...
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 = 12775)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra...
Find meter_200 and the average of ID , and group by attribute meter_200, and visualize them by a bar chart, and order by the bar in descending.
CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadiu...
SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 DESC
What is the lowest value for Olympics, when Sailors is greater than 1, when First OG is after 1948, and when Class is 'Flying Dutchman'?
CREATE TABLE table_12901 ("Class" text,"Type" text,"Sailors" real,"Trapeze" real,"First OG" real,"Olympics so far" real)
SELECT MIN("Olympics so far") FROM table_12901 WHERE "Sailors" > '1' AND "First OG" > '1948' AND "Class" = 'flying dutchman'
What's the score in andray blatche (17) high points?
CREATE TABLE table_29818 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT COUNT("Score") FROM table_29818 WHERE "High points" = 'Andray Blatche (17)'
what is the number of patients whose primary disease is sigmoid diverticulitis, colovestical fistula/sda and year of death is less than or equal to 2112?
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 text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" AND demographic.dod_year <= "2112.0"
What is the rank of Bronco Billy?
CREATE TABLE table_name_21 (rank INTEGER,title VARCHAR)
SELECT AVG(rank) FROM table_name_21 WHERE title = "bronco billy"
Name the high assists for madison square garden 19,763 and record is 39 38
CREATE TABLE table_74170 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High assists" FROM table_74170 WHERE "Location Attendance" = 'Madison Square Garden 19,763' AND "Record" = '39–38'
Draw a bar chart for what is the name of every city that has at least 15 stations and how many stations does it have?, and rank by the city from low to high.
CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_type TEXT,zip_code INTEGER)CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time ...
SELECT city, COUNT(*) FROM station GROUP BY city ORDER BY city
What is the title of the episode written by Frank Military?
CREATE TABLE table_28611413_2 (title VARCHAR,written_by VARCHAR)
SELECT title FROM table_28611413_2 WHERE written_by = "Frank Military"
who was the last head of medici ?
CREATE TABLE table_203_421 (id number,"name" text,"from" text,"until" text,"relationship with predecessor" text)
SELECT "name" FROM table_203_421 ORDER BY "from" DESC LIMIT 1
What is the attendance of tie no. 23?
CREATE TABLE table_8246 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Attendance" text)
SELECT "Attendance" FROM table_8246 WHERE "Tie no" = '23'
What is the total number of discs where the run time was 4 hours 40 minutes?
CREATE TABLE table_17194 ("DVD Name" text,"Released" text,"Audio" text,"Aspect Ratio" text,"Duration" text,"Number of Episodes" real,"Num of Discs" real)
SELECT COUNT("Num of Discs") FROM table_17194 WHERE "Duration" = '4 hours 40 minutes'
In Fall 2007 , is it possible for me to take MCDB 457 ?
CREATE TABLE area (course_id int,area varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE program_course (program_id int,course_id int,workload int,categ...
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...
Who tied in the highest point scorer when playing against Phoenix?
CREATE TABLE table_23274514_4 (high_points VARCHAR,team VARCHAR)
SELECT high_points FROM table_23274514_4 WHERE team = "Phoenix"
i would like a flight from DENVER to PITTSBURGH
CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE code_description (code varchar,description text)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE compartment_class (compartment varchar,class...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU...
tell me the name of the test that patient 8005 first received in 03/last year?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE procedures_icd (row_id number,subject_id num...
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 = 8005) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') A...
Plot the total number by grouped by how to get there as a bar graph, and show from low to high by the total number.
CREATE TABLE Staff (Staff_ID INTEGER,Tourist_Attraction_ID INTEGER,Name VARCHAR(40),Other_Details VARCHAR(255))CREATE TABLE Locations (Location_ID INTEGER,Location_Name VARCHAR(255),Address VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Visits (Visit_ID INTEGER,Tourist_Attraction_ID INTEGER,Tourist_ID INTEGER,Vis...
SELECT How_to_Get_There, COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*)
specify the icu stay of patient id 22377
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 prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "22377"
when was the notorious b.i.g signed to bad boy ?
CREATE TABLE table_200_14 (id number,"act" text,"year signed" number,"# albums released under bad boy" number)
SELECT "year signed" FROM table_200_14 WHERE "act" = 'the notorious b.i.g'
Who had third place when the champions is ban k ostrava (1)?
CREATE TABLE table_26730 ("Season" text,"Champions" text,"Runner-up" text,"Third Place" text,"Top Goalscorer" text,"Club" text)
SELECT "Third Place" FROM table_26730 WHERE "Champions" = 'Baník Ostrava (1)'
What school did player number 21 play for?
CREATE TABLE table_72069 ("Player" text,"No." text,"Nationality" text,"Position" text,"Years in Toronto" text,"School/Club Team" text)
SELECT "School/Club Team" FROM table_72069 WHERE "No." = '21'
cheapest fare from INDIANAPOLIS to ORLANDO on the 27 of 12
CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_speed int,range_miles int,pressurized varchar)CREATE TABLE dual_carrier (main_airline ...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C...
I have the same problem.
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,Appr...
SELECT Id AS "post_link", CreationDate FROM Posts WHERE Body LIKE '%I have the same problem%' AND CreationDate > '2014-01-01 00:00:00'
What did billy andrade to par?
CREATE TABLE table_14350 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text)
SELECT "To par" FROM table_14350 WHERE "Player" = 'billy andrade'
until 10/29/2103, when did patient 028-53285 receive an intake for the first time?
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 cost (cos...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-53285')) AND intakeoutput.cellpath LIKE '%intake%...
What was the Play-by-play when the color commentator was Eric Wynalda, earlier than 2005?
CREATE TABLE table_44806 ("Year" real,"Network" text,"Play-by-play" text,"Color commentator(s)" text,"Pregame host" text)
SELECT "Play-by-play" FROM table_44806 WHERE "Color commentator(s)" = 'eric wynalda' AND "Year" < '2005'
What was the school/club after round 12, and picked smaller than 342?
CREATE TABLE table_9602 ("Round" real,"Pick" real,"Player" text,"Position" text,"School/Club Team" text)
SELECT "School/Club Team" FROM table_9602 WHERE "Round" > '12' AND "Pick" < '342'
Name the most number for charvez davis
CREATE TABLE table_25360865_1 (_number INTEGER,name VARCHAR)
SELECT MAX(_number) FROM table_25360865_1 WHERE name = "Charvez Davis"
What is segment C in s07e05
CREATE TABLE table_15187735_14 (segment_c VARCHAR,netflix VARCHAR)
SELECT segment_c FROM table_15187735_14 WHERE netflix = "S07E05"