instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is Margin, when Match Date is Oct 17, 2007?
CREATE TABLE table_41135 ("S No" real,"Team (A)" text,"Team (B)" text,"Winner" text,"Margin" text,"Match Date" text)
SELECT "Margin" FROM table_41135 WHERE "Match Date" = 'oct 17, 2007'
Which Gen.-Secretary that has a Vice President named charlotte saes?
CREATE TABLE table_55247 ("Year" text,"President" text,"Vice President" text,"Gen.-Secretary" text,"Treasurer" text)
SELECT "Gen.-Secretary" FROM table_55247 WHERE "Vice President" = 'charlotte saes'
Which team does David O'leary manage?
CREATE TABLE table_name_28 (team VARCHAR,manager VARCHAR)
SELECT team FROM table_name_28 WHERE manager = "david o'leary"
How many patients are with admission year below 2164 and with lab test name p02?
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.admityear < "2164" AND lab.label = "pO2"
How many patients from american indian/alaska native origin were admitted before the year 2164?
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 WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.admityear < "2146"
Which nhl team has kris draper as the player?
CREATE TABLE table_2897457_3 (nhl_team VARCHAR,player VARCHAR)
SELECT nhl_team FROM table_2897457_3 WHERE player = "Kris Draper"
What was the result of the match against Pat Lawlor?
CREATE TABLE table_32099 ("Result" text,"Opponent" text,"Type" text,"Rd.,Time" text,"Date" text)
SELECT "Result" FROM table_32099 WHERE "Opponent" = 'pat lawlor'
What is the lowest number of games played for deportivo espa ol?
CREATE TABLE table_14460085_3 (played INTEGER,team VARCHAR)
SELECT MIN(played) FROM table_14460085_3 WHERE team = "Deportivo Español"
what was the last height of patient 7698 in the last month?
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 d_labitems (row_id number,itemid number,label text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id n...
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7698)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht' ...
Give me a pie chart to reflect the proportion of Team_Name and ACC_Percent.
CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce...
SELECT Team_Name, ACC_Percent FROM basketball_match
What position for jj gagiano?
CREATE TABLE table_name_3 (position VARCHAR,player VARCHAR)
SELECT position FROM table_name_3 WHERE player = "jj gagiano"
what is the name of procedure patient 58730 has been given two or more times until 30 months ago?
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE transfers (row_id num...
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, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 587...
What result in the table is from the year 2012?
CREATE TABLE table_70327 ("Year" real,"Award" text,"Category" text,"Nominated Work" text,"Result" text)
SELECT "Result" FROM table_70327 WHERE "Year" = '2012'
At the match where the away team scored 4.5 (29), what was the crowd size?
CREATE TABLE table_74802 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT COUNT("Crowd") FROM table_74802 WHERE "Away team score" = '4.5 (29)'
Where is the airport located that has a 98.9% in use capacity?
CREATE TABLE table_41632 ("Rank" real,"Location" text,"Total Passengers" real,"Annual change" text,"Capacity in use" text)
SELECT "Location" FROM table_41632 WHERE "Capacity in use" = '98.9%'
Give me a histogram for how many students are older than 20 in each dorm?, display by the names from low to high.
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 Dorm_amenity (amenid INTEGER,amenity_name VARCHAR(25))CREATE TABLE Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)CREATE TABLE Dorm (dormid INTEG...
SELECT dorm_name, COUNT(*) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.Age > 20 GROUP BY T3.dorm_name ORDER BY dorm_name
What is the sum of value for average finish with poles less than 0?
CREATE TABLE table_46799 ("Year" real,"Starts" real,"Wins" real,"Top 5" real,"Top 10" real,"Poles" real,"Avg. Start" real,"Avg. Finish" real,"Winnings" text,"Position" text,"Team(s)" text)
SELECT SUM("Avg. Finish") FROM table_46799 WHERE "Poles" < '0'
what are all the different product names, and how many complains has each received?, rank in desc by the product_name.
CREATE TABLE Staff (staff_id INTEGER,gender VARCHAR(1),first_name VARCHAR(80),last_name VARCHAR(80),email_address VARCHAR(255),phone_number VARCHAR(80))CREATE TABLE Customers (customer_id INTEGER,customer_type_code VARCHAR(20),address_line_1 VARCHAR(80),address_line_2 VARCHAR(80),town_city VARCHAR(80),state VARCHAR(80)...
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 DESC
What is the total number of seasons with more than 0 wins and a 1st final placing?
CREATE TABLE table_name_30 (season VARCHAR,wins VARCHAR,final_placing VARCHAR)
SELECT COUNT(season) FROM table_name_30 WHERE wins > 0 AND final_placing = "1st"
What was the attendance for a week larger than 3, and an opponent of philadelphia eagles?
CREATE TABLE table_name_58 (attendance VARCHAR,week VARCHAR,opponent VARCHAR)
SELECT attendance FROM table_name_58 WHERE week > 3 AND opponent = "philadelphia eagles"
What Year has a Rank of 12.0 12?
CREATE TABLE table_52862 ("Rank" text,"Name" text,"Height ft (m)" text,"Floors" real,"Year" real)
SELECT AVG("Year") FROM table_52862 WHERE "Rank" = '12.0 12'
What's the total of the position of 1?
CREATE TABLE table_79517 ("Position" real,"Athlete" text,"Compulsory" real,"Voluntary" real,"Total" real)
SELECT SUM("Total") FROM table_79517 WHERE "Position" < '1'
What is the sum of Ends with a Name of abidal, and has a Since larger than 2007?
CREATE TABLE table_name_58 (ends INTEGER,name VARCHAR,since VARCHAR)
SELECT SUM(ends) FROM table_name_58 WHERE name = "abidal" AND since > 2007
who ran a shorter time than emebet anteneh mengistu ?
CREATE TABLE table_204_90 (id number,"rank" number,"name" text,"nationality" text,"time" text)
SELECT "name" FROM table_204_90 WHERE "time" < (SELECT "time" FROM table_204_90 WHERE "name" = 'emebet anteneh mengistu')
What was Raymond Floyd's score?
CREATE TABLE table_name_58 (score VARCHAR,player VARCHAR)
SELECT score FROM table_name_58 WHERE player = "raymond floyd"
give me the flights from PITTSBURGH to LOS ANGELES on thursday evening
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 flight_fare (flight_id int,...
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 = 'LOS ANGELES' AND date_day.day_number = 24 AND date_day.month_number = 5 ...
What is every location for the date of March 20?
CREATE TABLE table_26115 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Attendance" real,"Record" text,"Points" real)
SELECT "Location" FROM table_26115 WHERE "Date" = 'March 20'
how many medals total did poland win ?
CREATE TABLE table_203_496 (id number,"pos" number,"country" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "total" FROM table_203_496 WHERE "country" = 'poland'
How many ECTS credit points occur with Master in Management?
CREATE TABLE table_69950 ("Program" text,"Degree" text,"Teaching language" text,"Duration (years)" real,"full-time/part-time" text,"ECTS Credit Points" real)
SELECT COUNT("ECTS Credit Points") FROM table_69950 WHERE "Program" = 'master in management'
What is the lowest CPC Blend Kazakhstan number when Draugen North Sea is 17?
CREATE TABLE table_60225 ("Crude oil name \\Rightarrow Location \\Rightarrow" text,"Barrow Island Australia" real,"Mutineer-Exeter Australia" real,"CPC Blend Kazakhstan" real,"Draugen North Sea" real)
SELECT MIN("CPC Blend Kazakhstan") FROM table_60225 WHERE "Draugen North Sea" = '17'
v2 - Answers that are possibly link only which were posted by new users and question asker is new. credit to Bill the Lizard for help putting this together http://meta.stackexchange.com/a/238320/244519
CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate ti...
SELECT p.Id AS "post_link", p.CreationDate, LEN(p.Body) AS BodyLength FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.PostTypeId = 1 AND p.CreationDate > '2015-04-15T00:00:00.000' AND DATEDIFF(WEEK, u.CreationDate, CreationDate) < 104 ORDER BY p.CreationDate
when was the first time patient 22449 was having less than 111.0 arterial bp [systolic] since 1302 days ago?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE admissions ...
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 = 22449)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
How many viewers in millions for episode 'sokka's master'?
CREATE TABLE table_72651 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"Viewers (millions)" text)
SELECT "Viewers (millions)" FROM table_72651 WHERE "Title" = 'Sokka''s Master'
What round was Craig Erickson drafted?
CREATE TABLE table_name_58 (round VARCHAR,player VARCHAR)
SELECT round FROM table_name_58 WHERE player = "craig erickson"
what were the five drugs most frequently prescribed to the patients aged 50s during the same hospital visit after they had been diagnosed with 35-36 comp wks gestation until 2101?
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 cost (row_id number,subject_id number,hadm_i...
SELECT t3.drug FROM (SELECT t2.drug, 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_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
count the amount of hospital visits of patient 26720 until 2 years ago.
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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,l...
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 26720 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-2 year')
What party did Hale Boggs belong to?
CREATE TABLE table_1341884_20 (party VARCHAR,incumbent VARCHAR)
SELECT party FROM table_1341884_20 WHERE incumbent = "Hale Boggs"
For those employees who did not have any job in the past, show me about the distribution of hire_date and the sum of department_id bin hire_date by time in a bar chart.
CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))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,J...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
what are the top three prescribed drugs for the patients of age 50s until 2100?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,...
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND STRFTIME('%y', medication.drugstarttime) <= '2100' GROUP BY medication.drugn...
What is the number of games played in the season before 2005?
CREATE TABLE table_15388 ("First game" real,"Played" real,"Drawn" real,"Lost" real,"Percentage" text)
SELECT SUM("Played") FROM table_15388 WHERE "First game" < '2005'
Which Little League World Series took place in Parsippany?
CREATE TABLE table_80020 ("Year" real,"Champion" text,"City" text,"LLWS" text,"Record" text)
SELECT "LLWS" FROM table_80020 WHERE "City" = 'parsippany'
What race did Bobby Unser win?
CREATE TABLE table_4766 ("Name" text,"Pole Position" text,"Fastest Lap" text,"Winning driver" text,"Winning team" text,"Report" text)
SELECT "Name" FROM table_4766 WHERE "Winning driver" = 'bobby unser'
mention the drug type and route of the drug code onda4i.
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 demographic (subject_id text,hadm_id text,name text,marital...
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ONDA4I"
when was patient 031-23605's last microbiological sputum, expectorated test performed until 08/2104?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND microlab.culturesite = 'sputum, expectorated' AN...
On what date was a two-way tie (8) the high rebound?
CREATE TABLE table_name_3 (date VARCHAR,high_rebounds VARCHAR)
SELECT date FROM table_name_3 WHERE high_rebounds = "two-way tie (8)"
Name the date successor seated for successor being vacant
CREATE TABLE table_26638 ("District" text,"Vacator" text,"Reason for change" text,"Successor" text,"Date successor seated" text)
SELECT "Date successor seated" FROM table_26638 WHERE "Successor" = 'Vacant'
What is the grid of car no. 3?
CREATE TABLE table_name_17 (grid VARCHAR,car_no VARCHAR)
SELECT grid FROM table_name_17 WHERE car_no = "3"
top users by amount of answers in a day.
CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicRea...
SELECT OwnerUserId, DATE(CreationDate) AS DT, COUNT(p.Id) FROM Posts AS p WHERE PostTypeId = 2 AND OwnerUserId > 0 GROUP BY OwnerUserId, DATE(CreationDate) ORDER BY 3 DESC
Who was the jockey in 7th position?
CREATE TABLE table_22265261_1 (jockey VARCHAR,position VARCHAR)
SELECT jockey FROM table_22265261_1 WHERE position = "7th"
Which format has a Frequency larger than 1050, and a Station of kvto?
CREATE TABLE table_14922 ("Station" text,"Frequency" real,"Network Affiliation" text,"Format" text,"City of License" text,"Status" text)
SELECT "Format" FROM table_14922 WHERE "Frequency" > '1050' AND "Station" = 'kvto'
what is the number of patients who died in or before 2122 and with drug code pred5sm?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2122.0" AND prescriptions.formulary_drug_cd = "PRED5SM"
what number of patients born before the year 1837 had lab test item id as 50885?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1837" AND lab.itemid = "50885"
Which To par is the lowest one that has a Year(s) won of 1962, 1967, 1972, 1980, and a Total larger than 149?
CREATE TABLE table_47448 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real)
SELECT MIN("To par") FROM table_47448 WHERE "Year(s) won" = '1962, 1967, 1972, 1980' AND "Total" > '149'
did big bang release more or less albums than 2ne1 ?
CREATE TABLE table_204_680 (id number,"released" text,"title" text,"artist" text,"format" text,"language" text)
SELECT (SELECT COUNT(*) FROM table_204_680 WHERE "artist" = 'big bang') > (SELECT COUNT(*) FROM table_204_680 WHERE "artist" = '2ne1')
The record of 35-31 has what score?
CREATE TABLE table_36531 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT "Score" FROM table_36531 WHERE "Record" = '35-31'
number of cylinders the standard 8 have
CREATE TABLE table_204_108 (id number,"typ" text,"construction time" text,"cylinders" text,"capacity" text,"power" text,"top speed" text)
SELECT "cylinders" FROM table_204_108 WHERE "typ" = 'standard 8'
If the title if the Lost Boy, how many directors were there?
CREATE TABLE table_19517621_3 (directed_by VARCHAR,title VARCHAR)
SELECT COUNT(directed_by) FROM table_19517621_3 WHERE title = "The Lost Boy"
For all employees who have the letters D or S in their first name, show me about the change of manager_id over hire_date in a line chart, sort by the X-axis in ascending.
CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0)...
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE
What is the highest Wins, when Goals For is greater than 39, and when Points is less than 25?
CREATE TABLE table_12548 ("Position" real,"Played" real,"Points" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real)
SELECT MAX("Wins") FROM table_12548 WHERE "Goals for" > '39' AND "Points" < '25'
Number of posts by type.
CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl...
SELECT COUNT(1) AS N FROM Posts WHERE PostTypeId = '##type##'
how many nations received more medals than canada ?
CREATE TABLE table_204_595 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT COUNT("nation") FROM table_204_595 WHERE "total" > (SELECT "total" FROM table_204_595 WHERE "nation" = 'canada')
what laboratory test was given to patient 010-33968 for the last time until 12/2104?
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 diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,...
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-33968')) AND STRFTIME('%y-%m', lab.labresulttime) <= '2104-12' ORDER BY lab.labresult...
What is the average game number when the record is 4-1?
CREATE TABLE table_48453 ("Game" real,"Date" text,"Team" text,"Score" text,"Location Attendance" text,"Record" text)
SELECT AVG("Game") FROM table_48453 WHERE "Record" = '4-1'
how many days has it been since patient 15794 last got a lab test for pco2 during their current hospital visit?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)C...
SELECT 1 * (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 = 'pco2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794 AND admissions.dis...
how many urban areas have a population above 90,000 ?
CREATE TABLE table_203_74 (id number,"rank" number,"urban area" text,"population\n(2001 census)" number,"area (km2)" number,"density (people/km2)" number,"major subdivisions" text,"metropolitan area" text)
SELECT COUNT("urban area") FROM table_203_74 WHERE "population\n(2001 census)" > 90000
What is the total number of Losses when the percentage is 54.83, with more than 8 points?
CREATE TABLE table_40767 ("Club" text,"Wins" real,"Losses" real,"Points For" real,"Points Against" real,"Percentage" real,"Points" real)
SELECT COUNT("Losses") FROM table_40767 WHERE "Percentage" = '54.83' AND "Points" > '8'
What was the score when Arsenal was the away team?
CREATE TABLE table_65642 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Score" FROM table_65642 WHERE "Away team" = 'arsenal'
What is the power capacity when the generators were 781?
CREATE TABLE table_11456251_5 (power_capacity__gw_ VARCHAR,number_of_generators VARCHAR)
SELECT power_capacity__gw_ FROM table_11456251_5 WHERE number_of_generators = 781
How many products are there for each manufacturer Visualize by bar chart, list in desc by the X.
CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)
SELECT T2.Name, COUNT(*) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
show me all the DL flights leaving or arriving at PITTSBURGH between 1200 and 1600 in the afternoon
CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE month (month_number int,month_name text)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_...
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE (((flight.arrival_time <= 1600 AND flight.arrival_time >= 1200) AND city.city_code = airport_service.city_code AND city.city_name = 'PITTSBURGH' AND flight.to_airport = airport_service.airport_code) OR ((flight.departure_time <= 1600 AND flight.d...
How many lanes have a Nationality of iceland?
CREATE TABLE table_69881 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" text)
SELECT SUM("Lane") FROM table_69881 WHERE "Nationality" = 'iceland'
Which Score has a Place of t1, and a Player of hubert green?
CREATE TABLE table_name_35 (score INTEGER,place VARCHAR,player VARCHAR)
SELECT AVG(score) FROM table_name_35 WHERE place = "t1" AND player = "hubert green"
What is the highest number of games played?
CREATE TABLE table_18018214_4 (games_played INTEGER)
SELECT MAX(games_played) FROM table_18018214_4
Which Score has a Visitor of ny rangers, and a Record of 19 28 15?
CREATE TABLE table_name_19 (score VARCHAR,visitor VARCHAR,record VARCHAR)
SELECT score FROM table_name_19 WHERE visitor = "ny rangers" AND record = "19–28–15"
At what venues did Lorena Ochoa win the championship?
CREATE TABLE table_1207 ("Year" real,"Dates" text,"Venue" text,"Champion" text,"Country" text,"Score" real,"To par" text,"Margin of victory" text,"Runner(s)-up" text,"Purse ($)" real,"Winners share ($)" real)
SELECT "Venue" FROM table_1207 WHERE "Champion" = 'Lorena Ochoa'
Who is the tournament winner in the Atlantic Coast Conference?
CREATE TABLE table_73442 ("Conference" text,"Regular Season Winner" text,"Conference Player of the Year" text,"Conference Tournament" text,"Tournament Venue (City)" text,"Tournament Winner" text)
SELECT "Tournament Winner" FROM table_73442 WHERE "Conference" = 'Atlantic Coast Conference'
Let 's see Actuarial Math courses with 7 credits .
CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE instructo...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Actuarial Math%' OR name LIKE '%Actuarial Math%') AND credits = 7
what is minimum age of patients whose marital status is single and admission location is emergency room admit?
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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admission_location = "EMERGENCY ROOM ADMIT"
Get user id and rep by name.
CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate tim...
SELECT Id, Reputation FROM Users WHERE DisplayName = 'HyperNeutrino' LIMIT 1
What is the latest round for Pohang Steelers as the away team?
CREATE TABLE table_65059 ("Round" real,"Date" text,"Home Team" text,"Score" text,"Away Team" text,"Attendance" real,"Stadium" text)
SELECT MAX("Round") FROM table_65059 WHERE "Away Team" = 'pohang steelers'
Which Sub-Parish (Sogn) was built before 1883 in the Parish (Prestegjeld) of jostedal parish and is located in the Church of Gaupne?
CREATE TABLE table_59789 ("Parish (Prestegjeld)" text,"Sub-Parish (Sogn)" text,"Church Name" text,"Year Built" real,"Location of the Church" text)
SELECT "Sub-Parish (Sogn)" FROM table_59789 WHERE "Year Built" < '1883' AND "Parish (Prestegjeld)" = 'jostedal parish' AND "Location of the Church" = 'gaupne'
which parish is the only one to have closed ?
CREATE TABLE table_203_36 (id number,"parish" text,"locality" text,"parish priest" text,"founded" number,"closed" number)
SELECT "parish" FROM table_203_36 WHERE NOT "closed" IS NULL
What is the name of the bike that has a grid number smaller than 9 with a time of +7.764?
CREATE TABLE table_47540 ("Rider" text,"Bike" text,"Laps" real,"Time" text,"Grid" real)
SELECT "Bike" FROM table_47540 WHERE "Grid" < '9' AND "Time" = '+7.764'
how long is the diagonal size of a 1/10 sensor ?
CREATE TABLE table_203_356 (id number,"type" text,"diagonal (mm)" text,"width (mm)" text,"height (mm)" text,"area (mm2)" text,"stops (area)" number,"crop factor" text)
SELECT "diagonal (mm)" FROM table_203_356 WHERE "type" = '1/10"'
what is the number of patients on promethazine hcl drug prescription who stayed in hospital for more than 5 days?
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 text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "5" AND prescriptions.drug = "Promethazine HCl"
What is average Top 10 with 0 wins?
CREATE TABLE table_41861 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT AVG("Top-10") FROM table_41861 WHERE "Wins" < '0'
had patient 021-155303 been under any analgesics - bolus parenteral analgesics procedure at other hospitals?
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 treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '021-155303' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '021-155303' AND patient.hospitaldischargetime IS NULL)) AND ...
What date did the episode that was written by Fintan Ryan originally air?
CREATE TABLE table_29369 ("Episode #" real,"Title" text,"Directed by" text,"Written by" text,"Originalairdate" text,"Ratings" text)
SELECT "Originalairdate" FROM table_29369 WHERE "Written by" = 'Fintan Ryan'
What was the lowest total for Italy when the latest win is 1950?
CREATE TABLE table_12869 ("Cyclist" text,"Nationality" text,"First win" real,"Latest win" real,"Total" real)
SELECT MIN("Total") FROM table_12869 WHERE "Nationality" = 'italy' AND "Latest win" = '1950'
is there any results from a microbiology test in patient 031-3355's other in the current hospital encounter?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight...
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) AND microlab.culturesite = '...
i would like to book a flight from CHICAGO into SEATTLE on 6 1 on CO
CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed int,to_airport varchar)CREATE TABLE dual_carrier (ma...
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 = 'SEATTLE' AND date_day.day_number = 1 AND date_day.month_number = 6 AND d...
What is the English word for the Russian words loshad, kobyla ( , )?
CREATE TABLE table_19820 ("Ido" text,"English" text,"Italian" text,"French" text,"German" text,"Russian" text,"Spanish" text)
SELECT "English" FROM table_19820 WHERE "Russian" = 'loshad, kobyla (лошадь, кобыла)'
Give me the comparison about the average of Weight over the Sex , and group by attribute Sex by a bar chart.
CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real)CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex
What is the affiliation of Davenport University?
CREATE TABLE table_28211213_1 (affiliation VARCHAR,institution VARCHAR)
SELECT affiliation FROM table_28211213_1 WHERE institution = "Davenport University"
give the number of male patients who had the procedure for insertion of non-drug-eluting coronaryartery stent(s).
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.long_title = "Insertion of non-drug-eluting coronary artery stent(s)"
Which model has a frequency of 750 mhz and a socket of bga2 pga2?
CREATE TABLE table_name_19 (model_number VARCHAR,frequency VARCHAR,socket VARCHAR)
SELECT model_number FROM table_name_19 WHERE frequency = "750 mhz" AND socket = "bga2μpga2"
How many viewers watched the 16mm t/r episode?
CREATE TABLE table_1849243_1 (viewers__in_millions_ VARCHAR,archive VARCHAR)
SELECT viewers__in_millions_ FROM table_1849243_1 WHERE archive = "16mm t/r"
WITH data (f) AS ( SELECT 'abc' UNION ALL.
CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat...
WITH data(f) AS (SELECT 'abc' UNION ALL SELECT 'def' UNION ALL SELECT 'abc') SELECT DISTINCT f, ROW_NUMBER() OVER (ORDER BY f) FROM data GROUP BY f
How many faculty members does each building have? List the result with the name of the building with a bar chart.
CREATE TABLE Faculty_Participates_in (FacID INTEGER,actid INTEGER)CREATE TABLE Participates_in (stuid INTEGER,actid INTEGER)CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),Rank VARCHAR(15),Sex VARCHAR(1),Phone INTEGER,Room VARCHAR(5),Building VARCHAR(13))CREATE TABLE Student (StuID INTEGER,LName...
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building
Tell me the surface for november 28, 2010
CREATE TABLE table_name_34 (surface VARCHAR,date VARCHAR)
SELECT surface FROM table_name_34 WHERE date = "november 28, 2010"