instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
When was the Treaty of Cession for Karikal Colony?
CREATE TABLE table_34456 ("Colony" text,"Liberation" text,"de facto transfer" text,"Treaty of Cession" text,"de jure transfer" text,"Merger" text)
SELECT "Treaty of Cession" FROM table_34456 WHERE "Colony" = 'karikal'
how many laps total were completed by all drivers ?
CREATE TABLE table_203_52 (id number,"pos" text,"no" number,"driver" text,"constructor" text,"laps" number,"time/retired" text,"grid" number,"points" number)
SELECT SUM("laps") FROM table_203_52
what airlines fly from ST. PETERSBURG to MILWAUKEE and from MILWAUKEE to TACOMA
CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE dual_carrier (main_airline varchar,low_flight_numb...
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight AS FLIGHT_0, flight AS FLIGHT_1 WHERE CITY_0.c...
When hayden roulston is the winner what is the stage?
CREATE TABLE table_28298471_14 (stage VARCHAR,winner VARCHAR)
SELECT stage FROM table_28298471_14 WHERE winner = "Hayden Roulston"
How many couples have an average of 25.3?
CREATE TABLE table_23706 ("Rank by average" real,"Place" real,"Couple" text,"Total points" real,"Number of dances" real,"Average" text)
SELECT COUNT("Couple") FROM table_23706 WHERE "Average" = '25.3'
I want you to show me some 300 -level courses that are easy .
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 DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND program_course.course_id = course.course_id AND program_course.workload < 3 ORDER BY program_course.workload
What is the lowest quantity of the 1b n2 type, which was retired in 1907-12?
CREATE TABLE table_name_50 (quantity INTEGER,type VARCHAR,retired VARCHAR)
SELECT MIN(quantity) FROM table_name_50 WHERE type = "1b n2" AND retired = "1907-12"
how many patients during a year before were diagnosed with peripheral vascular ischemia - atherosclerotic thrombo-occlusion in the same hospital visit after antibacterials - third generation cephalosporin procedures?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicm...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antibacterials - third generation cephalosporin' AND DATETIME(treatment.t...
what is diagnoses short title and diagnoses long title of subject name gonzalo wasson?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT diagnoses.short_title, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Gonzalo Wasson"
count the number of patients on main drug type prescription who have diagnoses icd9 code 2752.
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "2752" AND prescriptions.drug_type = "MAIN"
What is the maximum torque at rpm for the engine coded BJB/BKC/BXE/BLS?
CREATE TABLE table_name_7 (max_torque_at_rpm VARCHAR,engine_code_s_ VARCHAR)
SELECT max_torque_at_rpm FROM table_name_7 WHERE engine_code_s_ = "bjb/bkc/bxe/bls"
Which place was earned on 12 feb 2012?
CREATE TABLE table_name_93 (place VARCHAR,date VARCHAR)
SELECT place FROM table_name_93 WHERE date = "12 feb 2012"
the number of times patient 28447 has received a hematocrit test during this year.
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id n...
SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hematocrit') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28447) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(),...
How many eviction results occurred with a eviction no. 12 and a vote to save of 2.76%?
CREATE TABLE table_19872 ("Eviction No." real,"Nominee" text,"Vote to Save" text,"Vote to Evict" text,"Net vote" text,"Eviction result" text)
SELECT COUNT("Eviction result") FROM table_19872 WHERE "Eviction No." = '12' AND "Vote to Save" = '2.76%'
On what NHL team does Roman Vopat play for?
CREATE TABLE table_name_57 (nhl_team VARCHAR,player VARCHAR)
SELECT nhl_team FROM table_name_57 WHERE player = "roman vopat"
What is the lowest value of average attendance when average on previous season is -459?
CREATE TABLE table_31302 ("Season" text,"Ave. Attendance" real,"+/- ave. on prev. season" text,"Competition" text,"Occupier" text)
SELECT MIN("Ave. Attendance") FROM table_31302 WHERE "+/- ave. on prev. season" = '-459'
All possible Location entries for Brazil ('%Bra%').
CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans...
SELECT DISTINCT Location FROM Users WHERE Location LIKE '%Bra%'
Speed of answers in JS depending on fiddle..
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 CAST((JULIANDAY(MAX(a.CreationDate)) - JULIANDAY(p.CreationDate)) * 1440.0 AS INT), COUNT(DISTINCT p.Id) AS "wo/fiddle", COUNT(DISTINCT CASE WHEN NOT PATINDEX('%http://jsfiddle.net/%', p.Body) IS NULL THEN p.Id ELSE NULL END) AS "w/fiddle" FROM PostTags AS pt JOIN Posts AS p ON pt.PostId = p.Id JOIN Posts AS a O...
What was the highest attendance for the game where the record was 0-5 and the opponents scored more than 20 points?
CREATE TABLE table_48235 ("Game" real,"Date" text,"Opponent" text,"Result" text,"49ers points" real,"Opponents" real,"Record" text,"Streak" text,"Attendance" real)
SELECT MAX("Attendance") FROM table_48235 WHERE "Record" = '0-5' AND "Opponents" > '20'
how many patients whose age is less than 58 and admission year is less than 2107?
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 lab (subject_id text,hadm_id text,itemid text,charttime te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "58" AND demographic.admityear < "2107"
Return a bar chart about the distribution of Sex and the amount of Sex , and group by attribute Sex, rank in ascending by the bar.
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, COUNT(Sex) FROM people GROUP BY Sex ORDER BY Sex
Which Second has a Third of david nedohin, and a Lead of ben hebert?
CREATE TABLE table_76524 ("Season" text,"Skip" text,"Third" text,"Second" text,"Lead" text)
SELECT "Second" FROM table_76524 WHERE "Third" = 'david nedohin' AND "Lead" = 'ben hebert'
count the number of patients who have received a kidney transplant nec procedure within 2 months after receiving a dx ultrasound-heart treatment until 2 years 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 cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE admissions (row_id number,subject_id number,...
SELECT COUNT(DISTINCT t1.subject_id) 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 FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'dx ultrasou...
give me the number of patients whose death status is 0 and diagnoses icd9 code is 29570?
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 WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "29570"
What was Bob Jameson's lowest bonus where he had less than 15 rides?
CREATE TABLE table_name_36 (bonus_pts INTEGER,rider VARCHAR,rides VARCHAR)
SELECT MIN(bonus_pts) FROM table_name_36 WHERE rider = "bob jameson" AND rides < 15
How many episode numbers had US viewership of 4.26 million?
CREATE TABLE table_27905664_1 (COUNT VARCHAR,us_viewers__million_ VARCHAR)
SELECT COUNT AS № FROM table_27905664_1 WHERE us_viewers__million_ = "4.26"
What was the record on April 16?
CREATE TABLE table_34200 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Record" FROM table_34200 WHERE "Date" = 'april 16'
What is Player, when Year(s) Won is 1955?
CREATE TABLE table_76440 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real,"Finish" text)
SELECT "Player" FROM table_76440 WHERE "Year(s) won" = '1955'
For directors who had more than one movie, bin the dates of release into Year interval and them compute the total number of movies in each year bucket Show me the result using a line chart, I want to rank year from low to high order.
CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)
SELECT year, COUNT(year) FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title ORDER BY year
Most popular StackOverflow tags in April 2017.
CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS YearRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInYear, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId ...
count the number of patients whose procedure long title is creation of conduit between left ventricle and aorta?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Creation of conduit between left ventricle and aorta"
Compare Gold, Silver and Bronze Badges.
CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans...
WITH UserBadges AS (SELECT UserId, COUNT(*) AS NumBadges FROM Badges GROUP BY UserId, Name) SELECT 1 AS "order", 'Gold' AS Label, UserId AS "user_link", Num FROM (SELECT UserId, COUNT(*) AS Num FROM (SELECT UserId FROM UserBadges) AS d GROUP BY UserId ORDER BY Num DESC LIMIT 10) AS G UNION ALL SELECT 2 AS "order", 'Sil...
CLEANUP: find long tag wiki excerpts.
CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostFeedback (Id...
SELECT LENGTH(p.Body) AS "length", p.Body, CASE WHEN LENGTH(p.Body) > @truncation_length THEN 'YES' ELSE '' END AS "truncated?", t.TagName, t.Count, 'site://edit-tag-wiki/' + CAST(t.Id AS TEXT) + '|(edit)' AS "editlink" FROM Posts AS p INNER JOIN Tags AS t ON p.Id = t.ExcerptPostId WHERE p.PostTypeId = 4 AND LENGTH(p.B...
Which Points have a Drawn smaller than 2, and a Lost of 12, and a Name of ev bad w rishofen?
CREATE TABLE table_name_24 (points INTEGER,name VARCHAR,drawn VARCHAR,lost VARCHAR)
SELECT MAX(points) FROM table_name_24 WHERE drawn < 2 AND lost = 12 AND name = "ev bad wörishofen"
On May 9 after Game 3, what was the Opponent?
CREATE TABLE table_name_66 (opponent VARCHAR,game VARCHAR,date VARCHAR)
SELECT opponent FROM table_name_66 WHERE game > 3 AND date = "may 9"
What show was on at 8:00 when american idol was on at 9:00?
CREATE TABLE table_41946 ("8:00" text,"8:30" text,"9:00" text,"9:30" text,"10:00" text)
SELECT "8:00" FROM table_41946 WHERE "9:00" = 'american idol'
What Dissolved has a 2nd member of humphrey winch, and Assembled of 27 october 1601?
CREATE TABLE table_13111 ("Elected" text,"Assembled" text,"Dissolved" text,"1st member" text,"2nd member" text)
SELECT "Dissolved" FROM table_13111 WHERE "2nd member" = 'humphrey winch' AND "Assembled" = '27 october 1601'
For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarter and the average of manufacturer , and group by attribute headquarter, could you list in ascending by the X?
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
Name the fewest points of 5 place
CREATE TABLE table_31764 ("Draw" real,"Artist" text,"Song" text,"Place" real,"Points" real)
SELECT MIN("Points") FROM table_31764 WHERE "Place" = '5'
what is the perfect of mass when the molecules is 1.74e14*?
CREATE TABLE table_71347 ("Molecule" text,"Percent of Mass" text,"Mol.Weight (daltons)" text,"Molecules" text,"Percent of Molecules" text)
SELECT "Percent of Mass" FROM table_71347 WHERE "Molecules" = '1.74e14*'
What is the final placing of the team with 0 ples, more than 16 races, and 16 podiums?
CREATE TABLE table_55604 ("Season" real,"Series" text,"Team Name" text,"Races" real,"Wins" real,"Poles" real,"F/Laps" real,"Podiums" real,"Points" text,"Final Placing" text)
SELECT "Final Placing" FROM table_55604 WHERE "Poles" = '0' AND "Races" > '16' AND "Podiums" = '16'
For how long the patients admitted to clinic referral (premature) stayed in the hospital?
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 MAX(demographic.days_stay) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE"
what was the name of the medicine that patient 016-14568 was prescribed first on the first hospital encounter?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnos...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-14568' AND NOT patient.hospitaldischargetime IS NULL ORDER BY p...
what is the name of the laetare medalist listed before edward preuss ?
CREATE TABLE table_203_509 (id number,"year" number,"laetare medalist" text,"position" text)
SELECT "laetare medalist" FROM table_203_509 WHERE id = (SELECT id FROM table_203_509 WHERE "laetare medalist" = 'edward preuss') - 1
Find the ids of orders which are shipped after 2000-01-01.
CREATE TABLE shipments (order_id VARCHAR,shipment_date INTEGER)
SELECT order_id FROM shipments WHERE shipment_date > "2000-01-01"
Return all the information for each election record.
CREATE TABLE election (election_id number,counties_represented text,district number,delegate text,party number,first_elected number,committee text)CREATE TABLE county (county_id number,county_name text,population number,zip_code text)CREATE TABLE party (party_id number,year number,party text,governor text,lieutenant_go...
SELECT * FROM election
What is the highest number of bronze for the United States with more than 1 silver?
CREATE TABLE table_6748 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MAX("Bronze") FROM table_6748 WHERE "Nation" = 'united states' AND "Silver" > '1'
was there a cholecystectomy performed on patient 26849 since 2102?
CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid numbe...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cholecystectomy') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26849) AND STRFTIME('%y', proce...
What are the players that attented long beach state?
CREATE TABLE table_336 ("Player" text,"No.(s)" text,"Height in Ft." text,"Position" text,"Years for Rockets" text,"School/Club Team/Country" text)
SELECT "Player" FROM table_336 WHERE "School/Club Team/Country" = 'Long Beach State'
What was the total number of Top Division Titles where the year founded was prior to 1975 and the location was in Chaguaramas?
CREATE TABLE table_77665 ("Club" text,"Founded" real,"Joined" real,"Location" text,"Stadium" text,"Capacity" real,"2012\u201313 Position" text,"Top Division Titles" real)
SELECT SUM("Top Division Titles") FROM table_77665 WHERE "Founded" < '1975' AND "Location" = 'chaguaramas'
How many gold have a bronze of 1, a rank smaller than 6, and a total less than 3?
CREATE TABLE table_42145 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT SUM("Gold") FROM table_42145 WHERE "Bronze" = '1' AND "Rank" < '6' AND "Total" < '3'
What is the largest crowd for North Melbourne home games?
CREATE TABLE table_53694 ("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_53694 WHERE "Home team" = 'north melbourne'
Who is the driver for laps of 45
CREATE TABLE table_name_62 (driver VARCHAR,laps VARCHAR)
SELECT driver FROM table_name_62 WHERE laps = 45
what is the difference in time between the first place and second place cyclist ?
CREATE TABLE table_204_204 (id number,"rank" number,"heat" number,"country" text,"cyclists" text,"result" number,"notes" text)
SELECT ABS((SELECT "result" FROM table_204_204 WHERE "rank" = 1) - (SELECT "result" FROM table_204_204 WHERE "rank" = 2))
count the number of patients less than 81 years who belong to american indian/alaska native ethnic background.
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.age < "81"
What is the longest length of mandatory secondary school?
CREATE TABLE table_22254 ("Canton" text,"Years of Kindergarten" real,"Years of Kindergarten provided" text,"Years of Kindergarten legally required" text,"Length of Primary School" real,"Length of mandatory Secondary School" real,"Separate Secondary Schools?" text,"Cooperative Secondary Schools?" text,"Integrated Second...
SELECT MAX("Length of mandatory Secondary School") FROM table_22254
On October 8, what city was the game played?
CREATE TABLE table_35633 ("Date" text,"City" text,"Opponent" text,"Results\u00b9" text,"Type of game" text)
SELECT "City" FROM table_35633 WHERE "Date" = 'october 8'
how long did it take italy to finish in cycling at the 1996 summer olympics men 's team pursuit ?
CREATE TABLE table_204_735 (id number,"rank" number,"team" text,"names" text,"time" text,"qualification" text)
SELECT "time" FROM table_204_735 WHERE "team" = 'italy'
Which final has rank of 10?
CREATE TABLE table_47596 ("Rank" text,"Team" text,"Run 1" text,"Run 2" text,"Run 3" text,"Final" text)
SELECT "Final" FROM table_47596 WHERE "Rank" = '10'
How many goals for the player with 2 caps at degerfors if?
CREATE TABLE table_32940 ("name" text,"pos." text,"caps" real,"goals" real,"club" text)
SELECT "goals" FROM table_32940 WHERE "caps" = '2' AND "club" = 'degerfors if'
has patient 3277's temperature c (calc) been normal?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)C...
SELECT COUNT(*) > 0 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 = 3277)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperature c (cal...
How many production codes were there for the episode that aired on November 15?
CREATE TABLE table_28013 ("Episode #" real,"The W\u00f8rd" text,"Guest" text,"Introductory phrase" text,"Original airdate" text,"Production code" real)
SELECT COUNT("Production code") FROM table_28013 WHERE "Original airdate" = 'November 15'
For those records from the products and each product's manufacturer, find name and manufacturer , and group by attribute founder, and visualize them by a bar chart, could you display by the Manufacturer in asc?
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Manufacturer
How many teams does Maxim Bets play for?
CREATE TABLE table_29993 ("Pick" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT COUNT("NHL team") FROM table_29993 WHERE "Player" = 'Maxim Bets'
What is the value in 2013 when it is 1R in 2007 and 2009?
CREATE TABLE table_4981 ("Tournament" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2012" text,"2013" text)
SELECT "2013" FROM table_4981 WHERE "2007" = '1r' AND "2009" = '1r'
who was coach before tilden campbell ?
CREATE TABLE table_203_577 (id number,"tenure" text,"coach" text,"years" number,"record" text,"pct." number)
SELECT "coach" FROM table_203_577 WHERE id = (SELECT id FROM table_203_577 WHERE "coach" = 'tilden campbell') - 1
Give me the comparison about the amount of date_address_from over the date_address_from , and group by attribute other_details and bin date_address_from by weekday.
CREATE TABLE Student_Addresses (student_id INTEGER,address_id INTEGER,date_address_from DATETIME,date_address_to DATETIME,monthly_rental DECIMAL(19,4),other_details VARCHAR(255))CREATE TABLE Students_in_Detention (student_id INTEGER,detention_id INTEGER,incident_id INTEGER)CREATE TABLE Students (student_id INTEGER,addr...
SELECT date_address_from, COUNT(date_address_from) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
For an ICAO of VCCT, what is the IATA?
CREATE TABLE table_name_66 (iata VARCHAR,icao VARCHAR)
SELECT iata FROM table_name_66 WHERE icao = "vcct"
What is the number of gold when the silver is 1, bronze is 1, and the nation is Austria?
CREATE TABLE table_43347 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Gold") FROM table_43347 WHERE "Silver" = '1' AND "Bronze" = '1' AND "Nation" = 'austria'
What country has an ICAO of ENZV?
CREATE TABLE table_name_85 (country VARCHAR,icao VARCHAR)
SELECT country FROM table_name_85 WHERE icao = "enzv"
How many Golds did Rank 10 get, with a Bronze larger than 2?
CREATE TABLE table_name_99 (gold VARCHAR,rank VARCHAR,bronze VARCHAR)
SELECT COUNT(gold) FROM table_name_99 WHERE rank = "10" AND bronze > 2
What was the result of the game on January 5, 1926?
CREATE TABLE table_name_79 (result VARCHAR,date VARCHAR)
SELECT result FROM table_name_79 WHERE date = "january 5, 1926"
A bar chart for giveing me the number of the descriptions of the service types that cost more than 100.
CREATE TABLE Invoices (Invoice_ID INTEGER,Order_ID INTEGER,payment_method_code CHAR(15),Product_ID INTEGER,Order_Quantity VARCHAR(288),Other_Item_Details VARCHAR(255),Order_Item_ID INTEGER)CREATE TABLE Customer_Orders (Order_ID INTEGER,Customer_ID INTEGER,Store_ID INTEGER,Order_Date DATETIME,Planned_Delivery_Date DATET...
SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description
What is City of License, when Frequency is greater than 1380?
CREATE TABLE table_name_80 (city_of_license VARCHAR,frequency INTEGER)
SELECT city_of_license FROM table_name_80 WHERE frequency > 1380
how much does it cost to get checked for fall from ladder?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE prescriptions (row_id...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fall from ladder'))
what is the prod.code of the episode with original air date 01/12/1968?
CREATE TABLE table_18091 ("#" real,"Title" text,"Director" text,"Writer(s)" text,"Originalairdate" text,"Repeatairdate(s)" text,"Prod.Code" text)
SELECT COUNT("Prod.Code") FROM table_18091 WHERE "Originalairdate" = '01/12/1968'
What team was the player that received a penalty at time 32:17 playing for?
CREATE TABLE table_47122 ("Period" text,"Team" text,"Player" text,"Penalty" text,"Time" text)
SELECT "Team" FROM table_47122 WHERE "Time" = '32:17'
How many Wins have a Scored smaller than 24, and a Conceded larger than 25, and Draws larger than 5, and a Position smaller than 9?
CREATE TABLE table_38407 ("Position" real,"Team" text,"Played" real,"Wins" real,"Draws" real,"Losses" real,"Scored" real,"Conceded" real,"Points" real)
SELECT COUNT("Wins") FROM table_38407 WHERE "Scored" < '24' AND "Conceded" > '25' AND "Draws" > '5' AND "Position" < '9'
has patient 015-94586 ever undergone a bronchodilator?
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 lab (labid number,patientunitstayid number,labname text,labresult nu...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-94586')) AND treatment.treatmentname = 'bronchodilator'
Name the population 2011 for mihajlovo
CREATE TABLE table_2562572_35 (population__2011_ VARCHAR,settlement VARCHAR)
SELECT COUNT(population__2011_) FROM table_2562572_35 WHERE settlement = "Mihajlovo"
Questions by summed rep of the answerers.
CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time...
SELECT QuestionId AS "post_link", QuestionId, COUNT(*) AS AnswererNo, SUM(CAST(AnswererRep AS INT)) AS SumAnswererRep FROM (SELECT DISTINCT Q.Id AS QuestionId, Users.Id AS AnswererId, Users.Reputation AS AnswererRep FROM Posts AS Q, Posts AS A, Users WHERE A.ParentId = Q.Id AND Users.Id = A.OwnerUserId AND Q.ClosedDate...
What name has a population of 810?
CREATE TABLE table_name_13 (name VARCHAR,population VARCHAR)
SELECT name FROM table_name_13 WHERE population = "810"
Show the number of accounts opened in each year for all accounts in a line chart.
CREATE TABLE Orders (order_id INTEGER,customer_id INTEGER,date_order_placed DATETIME,order_details VARCHAR(255))CREATE TABLE Invoices (invoice_number INTEGER,order_id INTEGER,invoice_date DATETIME)CREATE TABLE Order_Items (order_item_id INTEGER,order_id INTEGER,product_id INTEGER,product_quantity VARCHAR(50),other_orde...
SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts
Which venue had a crowd larger than 20,000?
CREATE TABLE table_33556 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_33556 WHERE "Crowd" > '20,000'
for the 10:00 of the simple life what is the 9:00?
CREATE TABLE table_69778 ("7:00" text,"7:30" text,"8:00" text,"8:30" text,"9:00" text,"10:00" text,"10:30" text)
SELECT "9:00" FROM table_69778 WHERE "10:00" = 'the simple life'
Draw a bar chart about the distribution of ACC_Road and the sum of Team_ID , and group by attribute ACC_Road, sort in descending by the X.
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 ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC
what is the number of patients whose insurance is government and procedure icd9 code is 4439?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.icd9_code = "4439"
For all employees who have the letters D or S in their first name, a line chart shows the change of manager_id over hire_date, and sort HIRE_DATE in descending order.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),...
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC
What is the max pop of 2008 for selfoss?
CREATE TABLE table_2252745_1 (population_2008_07_01 INTEGER,administrative_centre VARCHAR)
SELECT MAX(population_2008_07_01) FROM table_2252745_1 WHERE administrative_centre = "Selfoss"
If artist 1 is Wolfgang Gartner, what is the release date?
CREATE TABLE table_23649244_2 (release_date VARCHAR,artist_1 VARCHAR)
SELECT release_date FROM table_23649244_2 WHERE artist_1 = "Wolfgang Gartner"
How many counties have a place name of Macedonia?
CREATE TABLE table_3172 ("Place Name" text,"County(ies) [A ]" text,"Population (2010)" real,"Land Area (2010)" text,"Density (2010)" text)
SELECT COUNT("County(ies) [A ]") FROM table_3172 WHERE "Place Name" = 'Macedonia'
What is the smallest Crowd number for the Venue named Princes Park?
CREATE TABLE table_name_96 (crowd INTEGER,venue VARCHAR)
SELECT MIN(crowd) FROM table_name_96 WHERE venue = "princes park"
Which Call sign has an ERP W of 75?
CREATE TABLE table_62260 ("Call sign" text,"Frequency MHz" real,"City of license" text,"Facility ID" real,"ERP W" real,"Height m (ft)" text,"Class" text,"FCC info" text)
SELECT "Call sign" FROM table_62260 WHERE "ERP W" = '75'
What is the football Bronze with more than 1 Silver?
CREATE TABLE table_55381 ("Sport" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT AVG("Bronze") FROM table_55381 WHERE "Sport" = 'football' AND "Silver" > '1'
What date did the away team Mansfield Town play?
CREATE TABLE table_9135 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Date" FROM table_9135 WHERE "Away team" = 'mansfield town'
In what round was Clyde the opponent?
CREATE TABLE table_name_28 (round VARCHAR,opponent VARCHAR)
SELECT round FROM table_name_28 WHERE opponent = "clyde"
what is the number of patients diagnosed for human immuno virus dis with iv drug route?
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Human immuno virus dis" AND prescriptions.route = "IV"
Top iOS Users in Madrid.
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)...
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
Who's the incumbent of Indiana 4 district?
CREATE TABLE table_18393 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text,"Candidates" text)
SELECT "Incumbent" FROM table_18393 WHERE "District" = 'Indiana 4'
How many students taking a course who received an A or C? Group by students' first name with a bar chart, and show by the how many stu fname in asc please.
CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12),EMP_INITIAL varchar(1),EMP_JOBCODE varchar(5),EMP_HIREDATE datetime,EMP_DOB datetime)CREATE TABLE STUDENT (STU_NUM int,STU_LNAME varchar(15),STU_FNAME varchar(15),STU_INIT varchar(1),STU_DOB datetime,STU_HRS int,STU_CLASS varchar(2),STU_GPA ...
SELECT STU_FNAME, COUNT(STU_FNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_FNAME ORDER BY COUNT(STU_FNAME)