instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What was the record when Minnesota was the home team?
CREATE TABLE table_name_64 (record VARCHAR,home VARCHAR)
SELECT record FROM table_name_64 WHERE home = "minnesota"
Which league did not qualify for the Playoffs, and had a Year larger than 2008?
CREATE TABLE table_name_59 (league VARCHAR,playoffs VARCHAR,the_year VARCHAR)
SELECT league FROM table_name_59 WHERE playoffs = "did not qualify" AND the_year > 2008
What was Herdez Competition's total points with a grid larger than 1?
CREATE TABLE table_name_39 (points VARCHAR,team VARCHAR,grid VARCHAR)
SELECT COUNT(points) FROM table_name_39 WHERE team = "herdez competition" AND grid > 1
did patient 017-49538's sao2, on the current icu visit, have been normal?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature ...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-49538') AND patient.unitdischargetime IS NULL) AND vitalperiodic...
give me the number of patients whose death status is 0 and procedure short title is left heart cardiac cath?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Left heart cardiac cath"
what is the name of the first player on this chart ?
CREATE TABLE table_204_126 (id number,"place" text,"player" text,"country" text,"score" text,"to par" number,"money ($)" number)
SELECT "player" FROM table_204_126 WHERE id = 1
Which album had a release of heavenly (hvn95)?
CREATE TABLE table_33303 ("Song" text,"Release date" text,"Release info" text,"Formats" text,"Album" text)
SELECT "Album" FROM table_33303 WHERE "Release info" = 'heavenly (hvn95)'
how many patients whose primary disease is st elevated myocardial infarction\cardiac cath and lab test fluid is ascites?
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,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND lab.fluid = "Ascites"
What is the total of the first elected year of the incumbent from the washington 8 district?
CREATE TABLE table_name_91 (first_elected VARCHAR,district VARCHAR)
SELECT COUNT(first_elected) FROM table_name_91 WHERE district = "washington 8"
Which classes has Dr. Frederick Conrad taught previously ?
CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_prerequisite (...
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...
How many company commanders were commissioned or elected on November 12, 1861?
CREATE TABLE table_4156 ("Regiment" text,"Company" text,"Company Commander" text,"Date of Election/Commission" text,"County" text)
SELECT COUNT("Company Commander") FROM table_4156 WHERE "Date of Election/Commission" = 'November 12, 1861'
Most Popular Tags regarding Django.
CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,B...
SELECT COUNT(*) AS tag_count, Tags.TagName, Tags.Id FROM PostTags JOIN Tags ON Tags.Id = PostTags.TagId JOIN Posts ON PostTags.PostId = Posts.Id WHERE Posts.Id IN (SELECT PostId FROM PostTags WHERE TagId = 243) GROUP BY Tags.TagName, Tags.Id ORDER BY tag_count DESC
Which is the lowest Decile that is coed?
CREATE TABLE table_70411 ("Name" text,"Years" text,"Gender" text,"Area" text,"Authority" text,"Decile" real)
SELECT MIN("Decile") FROM table_70411 WHERE "Gender" = 'coed'
Reputation List: Choose a location. List of users by reputation score by location.
CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUser...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Location, Reputation, LastAccessDate, Age FROM Users WHERE LENGTH(Location) > 1 AND LOWER(Location) LIKE LOWER('%##Location##%') ORDER BY Reputation DESC
COunt the sum of Prominence (m) of an Elevation (m) of 2,024?
CREATE TABLE table_name_69 (prominence__m_ INTEGER,elevation__m_ VARCHAR)
SELECT SUM(prominence__m_) FROM table_name_69 WHERE elevation__m_ = 2 OFFSET 024
What was the date of the game that had a result of Army 16, SMU 14?
CREATE TABLE table_30707 ("Bowl Game" text,"Date" text,"Stadium" text,"City" text,"Television" text,"Matchups/Results" text,"Attendance" real,"Payout (US$)" text)
SELECT "Date" FROM table_30707 WHERE "Matchups/Results" = 'Army 16, SMU 14'
What is the number of career caps for a full back, when tour Apps is smaller than 29?
CREATE TABLE table_62889 ("Name" text,"Tests" real,"Club" text,"Career caps" real,"Tour Apps" real,"Position" text)
SELECT COUNT("Career caps") FROM table_62889 WHERE "Position" = 'full back' AND "Tour Apps" < '29'
What is the Number of dances is 11 and competition finish is larger than 2.0 total
CREATE TABLE table_807 ("Rank by average" real,"Competition finish" real,"Couple" text,"Total" real,"Number of dances" real,"Average" text)
SELECT "Total" FROM table_807 WHERE "Number of dances" = '11' AND "Competition finish" > '2.0'
Name the most no votes
CREATE TABLE table_256286_14 (no_votes INTEGER)
SELECT MAX(no_votes) FROM table_256286_14
the other team besides brazil to score 5 goals
CREATE TABLE table_204_487 (id number,"home team" text,"score" text,"visiting team" text,"location" text,"venue" text,"door" text,"surface" text)
SELECT "home team" FROM table_204_487 WHERE "home team" <> 'brazil' AND "score" = 5
What is the Attendance at the game against the Cincinnati Bengals?
CREATE TABLE table_name_7 (attendance VARCHAR,opponent VARCHAR)
SELECT attendance FROM table_name_7 WHERE opponent = "cincinnati bengals"
Show the proportion of the number of grape of the wines whose price is bigger than 100 ordered by year.
CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT)CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT)CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT)
SELECT Grape, COUNT(Grape) FROM wine WHERE Price > 100 GROUP BY Grape
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, give me the comparison about the sum of department_id over the hire_date bin hire_date by time, sort in descending by the y-axis.
CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),M...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(DEPARTMENT_ID) DESC
What was the home team that scored 13.13 (91) in front of a crowd larger than 10,000?
CREATE TABLE table_32506 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team" FROM table_32506 WHERE "Crowd" > '10,000' AND "Home team score" = '13.13 (91)'
what is the number of patients whose ethnicity is white - russian and item id is 51375?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)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 ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND lab.itemid = "51375"
What was the record at the game against the Blue Jays with a loss of Batista (0 3)?
CREATE TABLE table_67316 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Time" text,"Att." text,"Record" text)
SELECT "Record" FROM table_67316 WHERE "Opponent" = 'blue jays' AND "Loss" = 'batista (0–3)'
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the average of department_id bin hire_date by weekday.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))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),MANAGE...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
Name the No. 5 which has a No. 8 of logan, and a No. 10 of ethan, and a No. 4 of jacob?
CREATE TABLE table_name_39 (no_5 VARCHAR,no_4 VARCHAR,no_8 VARCHAR,no_10 VARCHAR)
SELECT no_5 FROM table_name_39 WHERE no_8 = "logan" AND no_10 = "ethan" AND no_4 = "jacob"
Who is the player who's number is 3?
CREATE TABLE table_11734041_11 (player VARCHAR,no_s_ VARCHAR)
SELECT player FROM table_11734041_11 WHERE no_s_ = "3"
Bar graph to show the number of nationality from different nationality
CREATE TABLE journalist (journalist_ID int,Name text,Nationality text,Age text,Years_working int)CREATE TABLE news_report (journalist_ID int,Event_ID int,Work_Type text)CREATE TABLE event (Event_ID int,Date text,Venue text,Name text,Event_Attendance int)
SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality
What was the host city of the 8th edition in the the host country of Croatia?
CREATE TABLE table_26669939_1 (host_city VARCHAR,host_country VARCHAR,edition VARCHAR)
SELECT host_city FROM table_26669939_1 WHERE host_country = "Croatia" AND edition = "8th"
What competition resulted in 2-0 score, hosted in Amman?
CREATE TABLE table_53178 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text)
SELECT "Competition" FROM table_53178 WHERE "Score" = '2-0' AND "Venue" = 'amman'
Undeleted accepted answers without accept vote.
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...
SELECT p.AcceptedAnswerId AS "post_link", p.OwnerUserId AS "user_link" FROM Posts AS p INNER JOIN PostHistory AS e ON p.AcceptedAnswerId = e.PostId WHERE e.PostHistoryTypeId = 13 AND NOT p.OwnerUserId IS NULL AND p.AcceptedAnswerId NOT IN (SELECT v.PostId FROM Votes AS v WHERE v.VoteTypeId = 1) ORDER BY p.AcceptedAnswe...
What is the mascot for the team smaller than 154 from 49 Marion?
CREATE TABLE table_13480 ("School" text,"Location" text,"Mascot" text,"Size" real,"IHSAA Class" text,"County" text)
SELECT "Mascot" FROM table_13480 WHERE "Size" < '154' AND "County" = '49 marion'
In 1972, what was the highest number of points with a Ford engine and an entrant of Brooke Bond Oxo Team Surtees?
CREATE TABLE table_name_41 (pts INTEGER,year VARCHAR,engine VARCHAR,entrant VARCHAR)
SELECT MAX(pts) FROM table_name_41 WHERE engine = "ford" AND entrant = "brooke bond oxo team surtees" AND year = 1972
how many patients were given a ammonia test?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,tr...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'ammonia')
anemia ( hemoglobin < 8.5 mg / dl )
CREATE TABLE table_test_20 ("id" int,"ejection_fraction_ef" int,"anemia" bool,"gender" string,"bleeding" int,"systolic_blood_pressure_sbp" int,"left_main_coronary_artery_stenosis" int,"hemoglobin_a1c_hba1c" float,"renal_disease" bool,"creatinine_clearance_cl" float,"prior_creatinine" float,"diastolic_blood_pressure_dbp...
SELECT * FROM table_test_20 WHERE anemia = 1 OR hemoglobin_a1c_hba1c < 8.5
Who wrote the episode titled 'The Morning After Job'?
CREATE TABLE table_23832 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (in millions)" text)
SELECT "Written by" FROM table_23832 WHERE "Title" = 'The Morning After Job'
What 2007 has 236 for 2006?
CREATE TABLE table_36721 ("Tournament" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text)
SELECT "2007" FROM table_36721 WHERE "2006" = '236'
Name the 10 4 k /min 1 (30 c) ( 1-2%) absolute for 1.00
CREATE TABLE table_2273 ("-Butadiene" text,"10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) absolute" text,"10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) relative" text,"\u0394H \u2021 /kcal mol \u22121" text,"\u0394S \u2021 /cal mol \u22121 K \u22121" text)
SELECT "10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) absolute" FROM table_2273 WHERE "10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) relative" = '1.00'
what was the average number of games lost ?
CREATE TABLE table_203_171 (id number,"place\n(posicion)" number,"team\n(equipo)" text,"played\n(pj)" number,"won\n(pg)" number,"draw\n(pe)" number,"lost\n(pp)" number,"goals scored\n(gf)" number,"goals conceded\n(gc)" number,"+/-\n(dif.)" number,"points\n(pts.)" number)
SELECT AVG("lost\n(pp)") FROM table_203_171
Show me mean cloud cover by date in a histogram, could you display the average of cloud cover in ascending order?
CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f INTEGER,max_dew_point_f INTEGER,mean_dew_point_f INTEGER,min_dew_point_f INTEGER,max_humidity INTEGER,mean_humidity INTEGER,min_humidity INTEGER,max_sea_level_pressure_inches NUMERIC,mean_sea_level_pressure_inches NUM...
SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover)
let me know the age and religious background of patient with patient id 17519.
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 demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = "17519"
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, show me the trend about employee_id over hire_date with a line chart, and display by the X-axis in descending.
CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))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,JO...
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC
how many patients whose death status is 0 and procedure long title is suture of laceration of bladder?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Suture of laceration of bladder"
How many points for did Munster have?
CREATE TABLE table_27293285_2 (points_for VARCHAR,club VARCHAR)
SELECT points_for FROM table_27293285_2 WHERE club = "Munster"
Which home team plays at Punt Road Oval?
CREATE TABLE table_55192 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team" FROM table_55192 WHERE "Venue" = 'punt road oval'
Find the id of courses which are registered or attended by student whose id is 121?
CREATE TABLE people (person_id number,first_name text,middle_name text,last_name text,cell_mobile_number text,email_address text,login_name text,password text)CREATE TABLE student_course_registrations (student_id number,course_id number,registration_date time)CREATE TABLE people_addresses (person_address_id number,pers...
SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121
What was deputies with the lowest number of unknown received votes, in an election year after 1986?
CREATE TABLE table_name_17 (number_of_deputies INTEGER,number_of_votes_received VARCHAR,election_date VARCHAR)
SELECT MIN(number_of_deputies) FROM table_name_17 WHERE number_of_votes_received = "unknown" AND election_date > 1986
count the number of white-russian ethnic background patients who had emergency hospital admission.
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.ethnicity = "WHITE - RUSSIAN"
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, give me the comparison about the amount of job_id over the job_id , and group by attribute job_id, and I want to sort y axis in ascending order.
CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME var...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY COUNT(JOB_ID)
What is the percentage of renewable electricity without hydrogen power in the state of South Dakota?
CREATE TABLE table_73770 ("Rank" real,"Rank w/o Hydropower" real,"State" text,"% Renewable" text,"% Renewable w/o Hydro" text,"Renewable electricity (GW\u2022h)" real,"Renewable electricity w/o Hydro (GW\u2022h)" real,"Total electricity (GW\u2022h)" real)
SELECT "% Renewable w/o Hydro" FROM table_73770 WHERE "State" = 'South Dakota'
Find the id and local authority of the station whose maximum precipitation is higher than 50 Visualize by bar chart, I want to list in asc by the bars.
CREATE TABLE weekly_weather (station_id int,day_of_week text,high_temperature int,low_temperature int,precipitation real,wind_speed_mph int)CREATE TABLE station (id int,network_name text,services text,local_authority text)CREATE TABLE route (train_id int,station_id int)CREATE TABLE train (id int,train_number int,name t...
SELECT local_authority, id FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id ORDER BY local_authority
What is the total number of churches named H yanger Kyrkje?
CREATE TABLE table_1773 ("Parish (Prestegjeld)" text,"Sub-Parish (Sogn)" text,"Church Name" text,"Year Built" real,"Location of the Church" text)
SELECT COUNT("Sub-Parish (Sogn)") FROM table_1773 WHERE "Church Name" = 'Høyanger kyrkje'
On what date was the opponent the White Sox and the record 18-13?
CREATE TABLE table_67932 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT "Date" FROM table_67932 WHERE "Opponent" = 'white sox' AND "Record" = '18-13'
What is the lowest avg/g that has an effic greater than 34.36, with wesley carroll as the name?
CREATE TABLE table_42479 ("Name" text,"GP-GS" text,"Effic" real,"Att-Cmp-Int" text,"Avg/G" real)
SELECT MIN("Avg/G") FROM table_42479 WHERE "Effic" > '34.36' AND "Name" = 'wesley carroll'
What is the highest League Cup with a Player that is steed malbranque?
CREATE TABLE table_name_95 (league_cup INTEGER,player VARCHAR)
SELECT MAX(league_cup) FROM table_name_95 WHERE player = "steed malbranque"
what is the amount of phenytoin sodium prescribed to patient 32168 totally until 47 months ago?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE microbiologyevents (row_id number,subject_id number,...
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32168) AND prescriptions.drug = 'phenytoin sodium' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-47 month')
shortest morning flights from CINCINNATI to TAMPA
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 state (state_code text,state_name text,country_name text)CREATE TABLE code_description (code varchar,description text)CREATE T...
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 = 'CINCINNATI' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'T...
Name the highest total for the tournament more than 0 and regular season after 8
CREATE TABLE table_11797 ("Team" text,"Seasons" text,"Regular season" real,"Tournament" real,"Total" real)
SELECT MAX("Total") FROM table_11797 WHERE "Tournament" > '0' AND "Regular season" > '8'
When new york 8th is teh district who is the successor?
CREATE TABLE table_2147588_4 (successor VARCHAR,district VARCHAR)
SELECT successor FROM table_2147588_4 WHERE district = "New York 8th"
Who was the away team when North Melbourne was the home team?
CREATE TABLE table_name_17 (away_team VARCHAR,home_team VARCHAR)
SELECT away_team FROM table_name_17 WHERE home_team = "north melbourne"
What is the 1989 result for the tournament that had a 1983 and 1987 result of A?
CREATE TABLE table_46602 ("Tournament" text,"1983" text,"1984" text,"1985" text,"1986" text,"1987" text,"1988" text,"1989" text,"1990" text,"Career SR" text)
SELECT "1989" FROM table_46602 WHERE "1983" = 'a' AND "1987" = 'a'
What is the first election year listed?
CREATE TABLE table_18180 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT MIN("First elected") FROM table_18180
what is the to par for mathew goggin?
CREATE TABLE table_65187 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "To par" FROM table_65187 WHERE "Player" = 'mathew goggin'
Questions you've answered, by view count.
CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,Reje...
SELECT q.Id AS "post_link", q.ViewCount, q.CreationDate AS "asked", a.CreationDate AS "answered" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE a.OwnerUserId = '##user##' ORDER BY q.ViewCount DESC
WHAT ARE THE RACES WHEN FLAPS ARE ZERO, PODIUMS ARE LARGER THAN 0, SEASON IS 2008, AND POLE SMALLER THAN 1?
CREATE TABLE table_name_93 (races INTEGER,pole VARCHAR,season VARCHAR,flaps VARCHAR,podiums VARCHAR)
SELECT SUM(races) FROM table_name_93 WHERE flaps = 0 AND podiums > 0 AND season = "2008" AND pole < 1
How many matches did Pinnacle have betting records?
CREATE TABLE betfront (year number,datetime time,country text,competion text,match text,home_opening number,draw_opening number,away_opening number,home_closing number,draw_closing number,away_closing number)CREATE TABLE football_data (season text,datetime time,div text,country text,league text,referee text,hometeam te...
SELECT COUNT(*) FROM football_data WHERE psh <> "" AND psd <> "" AND psa <> ""
What is the qual with 200 laps and a rank of 27?
CREATE TABLE table_71763 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real)
SELECT "Qual" FROM table_71763 WHERE "Laps" = '200' AND "Rank" = '27'
tell me whether patient 002-13643 been prescribed albumin human 25% since 75 months ago?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname te...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-13643')) AND medication.drugname = 'albumin human 25%' AND DATETIME(me...
tell me the age of patient jerry deberry.
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 procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT demographic.age FROM demographic WHERE demographic.name = "Jerry Deberry"
For next Winter , who will teach the Core classes ?
CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE co...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
Where is Dynamo-2 located?
CREATE TABLE table_name_38 (location VARCHAR,team VARCHAR)
SELECT location FROM table_name_38 WHERE team = "dynamo-2"
Gold that has a Rank of 6, and a Bronze larger than 0 had what total number of gold?
CREATE TABLE table_38525 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Gold") FROM table_38525 WHERE "Rank" = '6' AND "Bronze" > '0'
What college did the defensive back attend?
CREATE TABLE table_16376436_1 (college VARCHAR,position VARCHAR)
SELECT college FROM table_16376436_1 WHERE position = "Defensive Back"
What is the name and description for document type code RV?
CREATE TABLE Ref_document_types (document_type_name VARCHAR,document_type_description VARCHAR,document_type_code VARCHAR)
SELECT document_type_name, document_type_description FROM Ref_document_types WHERE document_type_code = "RV"
If two years is 159, what is the amount for one year?
CREATE TABLE table_174266_6 (one_year INTEGER,two_years VARCHAR)
SELECT MIN(one_year) FROM table_174266_6 WHERE two_years = 159
Show different types of ships and the number of ships of each type with a pie chart.
CREATE TABLE ship (Ship_ID int,Name text,Type text,Nationality text,Tonnage int)CREATE TABLE mission (Mission_ID int,Ship_ID int,Code text,Launched_Year int,Location text,Speed_knots int,Fate text)
SELECT Type, COUNT(*) FROM ship GROUP BY Type
When was the attendance less than 44,851 during the first 4 weeks of the season?
CREATE TABLE table_name_90 (date VARCHAR,week VARCHAR,attendance VARCHAR)
SELECT date FROM table_name_90 WHERE week < 4 AND attendance = "44,851"
how many teams won at least 1 title ?
CREATE TABLE table_204_129 (id number,"place" number,"team" text,"titles" number,"runners-up" number,"winning years" text)
SELECT COUNT("team") FROM table_204_129 WHERE "titles" >= 1
Which match report has l 7-30 as the result/score?
CREATE TABLE table_43097 ("Week" real,"Date" text,"Opponent" text,"Time" text,"Game Site" text,"Result/Score" text,"Record" text,"Match Report" text)
SELECT "Match Report" FROM table_43097 WHERE "Result/Score" = 'l 7-30'
count the number of patients whose diagnoses long title is sepsis and drug route is ed?
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 lab (subject_id text,hadm_id text,itemid text,charttime te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Sepsis" AND prescriptions.route = "ED"
Name the kicks with goals of 1
CREATE TABLE table_name_40 (kicks VARCHAR,goals VARCHAR)
SELECT kicks FROM table_name_40 WHERE goals = "1"
give me the number of patients whose marital status is married and year of birth is less than 2064?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.dob_year < "2064"
What is the to par for japan
CREATE TABLE table_name_49 (to_par VARCHAR,country VARCHAR)
SELECT to_par FROM table_name_49 WHERE country = "japan"
Average Post Length for Users with at least 10,000 Rep.
CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate ti...
SELECT p.OwnerUserId, u.DisplayName, AVG(LENGTH(p.Body)) AS AvgLen FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE u.Reputation >= 10000 GROUP BY p.OwnerUserId, u.DisplayName ORDER BY AvgLen DESC
What are the number of the invoice dates for customers with the first name Astrid and the last name Gruber?, and order from high to low by the Y-axis.
CREATE TABLE MediaType (MediaTypeId integer,Name varchar(120))CREATE TABLE Genre (GenreId integer,Name varchar(120))CREATE TABLE Playlist (PlaylistId integer,Name varchar(120))CREATE TABLE Customer (CustomerId integer,FirstName varchar(40),LastName varchar(20),Company varchar(80),Address varchar(70),City varchar(40),St...
SELECT InvoiceDate, COUNT(InvoiceDate) FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber" ORDER BY COUNT(InvoiceDate) DESC
Bin the claim date into the Year interval and count them for visualizing a bar chart, could you list Y-axis in ascending order please?
CREATE TABLE Settlements (Settlement_ID INTEGER,Claim_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settled DATE,Amount_Claimed INTEGER,Amount_Settled INTEGER,Customer_Policy_ID INTEGER)CREATE TABLE Customer_Policies (Policy_ID INTEGER,Customer_ID INTEGER,Policy_Type_Code CHAR(15),Start_Date DATE,End_Date DATE)CREATE TABL...
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Settlements ORDER BY COUNT(Date_Claim_Made)
Which customer have the most policies? Give me the customer details.
CREATE TABLE claim_headers (claim_header_id number,claim_status_code text,claim_type_code text,policy_id number,date_of_claim time,date_of_settlement time,amount_claimed number,amount_piad number)CREATE TABLE staff (staff_id number,staff_details text)CREATE TABLE policies (policy_id number,customer_id number,policy_typ...
SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY COUNT(*) DESC LIMIT 1
What was the profession of the celebrity who was featured on season 15 and finished 7th place?
CREATE TABLE table_24775967_1 (notability_profession VARCHAR,season VARCHAR,finish VARCHAR)
SELECT notability_profession FROM table_24775967_1 WHERE season = 15 AND finish = "7th"
What album had the reunion label in 2006?
CREATE TABLE table_7146 ("Year" real,"Artist" text,"Album" text,"Label" text,"Credit" text)
SELECT "Album" FROM table_7146 WHERE "Label" = 'reunion' AND "Year" = '2006'
Which Week 7 Oct 12 has a Week 11 Nov 9 of week 11 nov 9?
CREATE TABLE table_name_15 (week_7_oct_12 VARCHAR,week_11_nov_9 VARCHAR)
SELECT week_7_oct_12 FROM table_name_15 WHERE week_11_nov_9 = "week 11 nov 9"
calculate the average age of patients with copd exacerbation primary disease who died before the year 2158.
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 AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "COPD EXACERBATION" AND demographic.dod_year < "2158.0"
when was patient 3929 prescribed a medication during their current hospital visit for the last time via the po/ng route?
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 prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3929 AND admissions.dischtime IS NULL) AND prescriptions.route = 'po/ng' ORDER BY prescriptions.startdate DESC LIMIT 1
Who was the home team that played the Lakers?
CREATE TABLE table_name_85 (home VARCHAR,visitor VARCHAR)
SELECT home FROM table_name_85 WHERE visitor = "lakers"
what were the three most frequent procedures that patients received within 2 months after the diagnosis of wbc disease nec?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)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 inputevents_cv (row_id number,subject_id number,hadm_id number,i...
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 FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi...
Who is the artist 2 on the setlist where the artist 1 is Sparfunk & D-Code?
CREATE TABLE table_31029 ("Song 1 title" text,"Artist 1" text,"Song 2 title" text,"Artist 2" text,"Mix artist" text,"Venue" text,"Battle Mix?" text,"Setlist" text)
SELECT "Artist 2" FROM table_31029 WHERE "Artist 1" = 'Sparfunk & D-Code'
what was the time of the last bicarbonate lab test of patient 24118 when they came to the hospital last time?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,l...
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24118 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime...
What is the earliest year of a film from Mexico?
CREATE TABLE table_name_44 (year INTEGER,country VARCHAR)
SELECT MIN(year) FROM table_name_44 WHERE country = "mexico"
what is the average score of the players from the united states ?
CREATE TABLE table_203_499 (id number,"place" text,"player" text,"country" text,"score" text,"to par" number,"money ($)" number)
SELECT AVG("score") FROM table_203_499 WHERE "country" = 'united states'