instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Find Nationality and the sum of meter_100 , and group by attribute Nationality, and visualize them by a bar chart, and sort by the X-axis from high to low.
CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te...
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC
What is the largest grid with a Driver of ralph firman, and a Lap smaller than 18?
CREATE TABLE table_name_15 (grid INTEGER,driver VARCHAR,laps VARCHAR)
SELECT MAX(grid) FROM table_name_15 WHERE driver = "ralph firman" AND laps < 18
what number of patients admitted in emergency were tested for acetaminophen?
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 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Acetaminophen"
Name the points for car number 4
CREATE TABLE table_73853 ("Season" real,"Series" text,"Team" text,"Car No." real,"Races" real,"Poles" real,"Wins" real,"FLaps" real,"Points" text,"Position" text)
SELECT "Points" FROM table_73853 WHERE "Car No." = '4'
Who was the Centerfold model in the issue in which the Interview subject was Jos Napole n Duarte?
CREATE TABLE table_name_96 (centerfold_model VARCHAR,interview_subject VARCHAR)
SELECT centerfold_model FROM table_name_96 WHERE interview_subject = "josé napoleón duarte"
Show the number of the countries that have managers of age above 50 or below 46, list in descending by the bars.
CREATE TABLE railway_manage (Railway_ID int,Manager_ID int,From_Year text)CREATE TABLE railway (Railway_ID int,Railway text,Builder text,Built text,Wheels text,Location text,ObjectNumber text)CREATE TABLE train (Train_ID int,Train_Num text,Name text,From text,Arrival text,Railway_ID int)CREATE TABLE manager (Manager_ID...
SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country ORDER BY Country DESC
what was the name of the first intake of patient 8116 that they had today?
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 d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116)) AND DATETIME(inputevents_cv.c...
how many patients until 2 years ago had a hyperglycemia diagnosis within 2 months after having undergone stress ulcer treatment - ranitidine?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'stress ulcer treatment - ranitidine' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-2 y...
What is the format of catalog number 886973273913 (gowow012) in the United Kingdom?
CREATE TABLE table_name_70 (format VARCHAR,country VARCHAR,catalogue__number VARCHAR)
SELECT format FROM table_name_70 WHERE country = "united kingdom" AND catalogue__number = "886973273913 (gowow012)"
What is Alan Campbell's Country with Notes of FA?
CREATE TABLE table_13989 ("Rank" real,"Athlete" text,"Country" text,"Time" text,"Notes" text)
SELECT "Country" FROM table_13989 WHERE "Notes" = 'fa' AND "Athlete" = 'alan campbell'
What date did the away team Bristol Rovers play?
CREATE TABLE table_9137 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Date" FROM table_9137 WHERE "Away team" = 'bristol rovers'
What is the nationality of the player with a round after 4 and plays right wing?
CREATE TABLE table_57835 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team (League)" text)
SELECT "Nationality" FROM table_57835 WHERE "Round" > '4' AND "Position" = 'right wing'
Which Date has an Attendance of 30,612?
CREATE TABLE table_14563 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text)
SELECT "Date" FROM table_14563 WHERE "Attendance" = '30,612'
How many episodes were directed by Arlene Sanford?
CREATE TABLE table_26429658_1 (written_by VARCHAR,directed_by VARCHAR)
SELECT COUNT(written_by) FROM table_26429658_1 WHERE directed_by = "Arlene Sanford"
What is the sum of the years with bus conner as the BSU head coach?
CREATE TABLE table_name_24 (year INTEGER,bsu_head_coach VARCHAR)
SELECT SUM(year) FROM table_name_24 WHERE bsu_head_coach = "bus conner"
Give me a pie to show total number of number of platforms from different location.
CREATE TABLE train_station (Train_ID int,Station_ID int)CREATE TABLE station (Station_ID int,Name text,Annual_entry_exit real,Annual_interchanges real,Total_Passengers real,Location text,Main_Services text,Number_of_Platforms int)CREATE TABLE train (Train_ID int,Name text,Time text,Service text)
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location
Name the date for sprint winner mexico
CREATE TABLE table_3066 ("Round" real,"Date" text,"Country" text,"Circuit" text,"Sprint Winner" text,"Main Winner" text,"Report" text)
SELECT "Date" FROM table_3066 WHERE "Sprint Winner" = 'Mexico'
what is the total number of songs that are listed in the table ?
CREATE TABLE table_203_755 (id number,"singing position" number,"song title" text,"informal translation" text,"act" text,"percentage of votes" text,"final position" text)
SELECT COUNT("song title") FROM table_203_755
Which Company or Product name requested 70,000 on Episode 11?
CREATE TABLE table_name_17 (company_or_product_name VARCHAR,episode VARCHAR,money_requested__£_ VARCHAR)
SELECT company_or_product_name FROM table_name_17 WHERE episode = "episode 11" AND money_requested__£_ = "70,000"
What is withdrawn with a GSR Class of 296?
CREATE TABLE table_name_72 (withdrawn VARCHAR,gsr_class VARCHAR)
SELECT withdrawn FROM table_name_72 WHERE gsr_class = "296"
tell me the icu stay id of the patient with patient id 2560.
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t...
SELECT prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "2560"
who was the first flag bearer ?
CREATE TABLE table_204_986 (id number,"#" number,"event year" number,"season" text,"flag bearer" text)
SELECT "flag bearer" FROM table_204_986 ORDER BY "event year" LIMIT 1
What was the latest year that Colin Berry was the spokesperson?
CREATE TABLE table_21901 ("Year(s)" real,"Final television commentator" text,"Radio commentator" text,"Spokesperson" text,"Semi-final television commentator" text,"Semi-final second television commentator" text)
SELECT MAX("Year(s)") FROM table_21901 WHERE "Spokesperson" = 'Colin Berry'
Hidden gems: Highest question score per thousand views (minimum 1,000 views).
CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score ...
SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", Score, ViewCount, Score * 1000 / ViewCount AS "Score per Thousand Views" FROM Posts WHERE Score > 0 AND ViewCount >= 1000 AND PostTypeId = 1 ORDER BY Score * 1000 / ViewCount DESC LIMIT 1000
when was the last time patient 021-25705 has been diagnosed with depression since 2 years ago?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmentid number,patientunitstayid ...
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25705')) AND diagnosis.diagnosisname = 'depression' AND DATET...
Name the total number of years where runner-up and championship is us open
CREATE TABLE table_1547951_3 (year VARCHAR,outcome VARCHAR,championship VARCHAR)
SELECT COUNT(year) FROM table_1547951_3 WHERE outcome = "Runner-up" AND championship = "US Open"
What is the company from Greece with author Aeschylus?
CREATE TABLE table_63765 ("play" text,"author" text,"company" text,"base" text,"country" text)
SELECT "company" FROM table_63765 WHERE "country" = 'greece' AND "author" = 'aeschylus'
What are the interview scores for contestants whose average is 9.090?
CREATE TABLE table_16390001_2 (interview VARCHAR,average VARCHAR)
SELECT interview FROM table_16390001_2 WHERE average = "9.090"
Date of 23 september 1961, and a Pilot of b.v. zemskov had what record description?
CREATE TABLE table_name_38 (record_description VARCHAR,date VARCHAR,pilot VARCHAR)
SELECT record_description FROM table_name_38 WHERE date = "23 september 1961" AND pilot = "b.v. zemskov"
What's the total byes for more than 1 draw?
CREATE TABLE table_62313 ("Golden Rivers" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real)
SELECT COUNT("Byes") FROM table_62313 WHERE "Draws" > '1'
was patient 016-23497 prescribed any medications until 2 years ago?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemic...
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 = '016-23497')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TI...
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 employee_id over the job_id , and group by attribute job_id, and order by the y axis in descending.
CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))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 varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_D...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC
when has patient 015-59871 first received a procedure when they came to the hospital last time?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,disch...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59871' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
What are the minimum indoor results that have a 5 for inspection?
CREATE TABLE table_19534874_2 (indoor INTEGER,inspection VARCHAR)
SELECT MIN(indoor) FROM table_19534874_2 WHERE inspection = 5
get me the number of patients who are diagnosed with unspecified acute uri and are taking drug via po route.
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,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
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 = "Acute uri NOS" AND prescriptions.route = "PO"
Which part 2 has a verb that means to leap?
CREATE TABLE table_49229 ("Class" text,"Part 1" text,"Part 2" text,"Part 3" text,"Part 4" text,"Verb meaning" text)
SELECT "Part 2" FROM table_49229 WHERE "Verb meaning" = 'to leap'
When did Collingwood play?
CREATE TABLE table_11125 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_11125 WHERE "Home team" = 'collingwood'
Which game site has an Opponent of buffalo bills?
CREATE TABLE table_10112 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Attendance" text)
SELECT "Game site" FROM table_10112 WHERE "Opponent" = 'buffalo bills'
For the week of August 6, who is the finalist?
CREATE TABLE table_49233 ("Tournament" text,"Surface" text,"Week" text,"Winner and score" text,"Finalist" text,"Semifinalists" text)
SELECT "Finalist" FROM table_49233 WHERE "Week" = 'august 6'
Which type has 140 made?
CREATE TABLE table_7970 ("Aircraft" text,"Type" text,"Version" text,"Produced" text,"Quantity" text)
SELECT "Type" FROM table_7970 WHERE "Quantity" = '140'
What is the number of patients who had iron lab tests done?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Iron"
Tell me the date for pittsburgh steelers
CREATE TABLE table_name_16 (date VARCHAR,visiting_team VARCHAR)
SELECT date FROM table_name_16 WHERE visiting_team = "pittsburgh steelers"
What was the latest year that had a 100m freestyle?
CREATE TABLE table_50793 ("Event" text,"Long Course/Short Course" text,"Year Set" real,"Time" text,"Meet" text)
SELECT MAX("Year Set") FROM table_50793 WHERE "Event" = '100m freestyle'
what is primary disease and lab test fluid of subject name wilbur braatz?
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.diagnosis, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Wilbur Braatz"
how many patients whose discharge location is short term hospital and year of birth is less than 2076?
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 WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "2076"
When has a Winning score of 16 (70-65-65=200)?
CREATE TABLE table_name_98 (date VARCHAR,winning_score VARCHAR)
SELECT date FROM table_name_98 WHERE winning_score = –16(70 - 65 - 65 = 200)
most common topics at ACL 2014
CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE field (fieldid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE paperdataset...
SELECT DISTINCT COUNT(paper.paperid), keyphrase.keyphraseid FROM keyphrase, paper, paperkeyphrase, venue WHERE paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' GROUP BY keyphrase.keyphraseid ...
Which Date has a Road team of portland, and a Game of game 5?
CREATE TABLE table_name_16 (date VARCHAR,road_team VARCHAR,game VARCHAR)
SELECT date FROM table_name_16 WHERE road_team = "portland" AND game = "game 5"
Top SO users from Arizona.
CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE Reputation >= (SELECT Reputation FROM Users WHERE Id = 5285908) AND (UPPER(Location) LIKE '% AZ%' OR UPPER(Location) LIKE '% ARIZONA%') ORDER BY Reputation DESC
Please tell me the average star ratings of each movie title using a bar chart, and could you show by the bar in desc?
CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Reviewer (rID int,name text)
SELECT title, AVG(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY title DESC
count the number of patients on buccal route of drug administration who were admitted before the year 2173.
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2173" AND prescriptions.route = "BUCCAL"
What place did Lee Westwood finish in?
CREATE TABLE table_name_74 (place VARCHAR,player VARCHAR)
SELECT place FROM table_name_74 WHERE player = "lee westwood"
what was the last film directed by c. v. sridhar ?
CREATE TABLE table_203_204 (id number,"year" number,"film" text,"language" text,"actors" text,"music" text,"banner" text,"note" text)
SELECT "film" FROM table_203_204 ORDER BY "year" DESC LIMIT 1
Which game had 8 bronze and 4 gold?
CREATE TABLE table_name_61 (games VARCHAR,bronze VARCHAR,gold VARCHAR)
SELECT games FROM table_name_61 WHERE bronze = "8" AND gold = "4"
Who was Kraco Twin 125 (R2)'s Winning Driver?
CREATE TABLE table_4498 ("Name" text,"Pole Position" text,"Fastest Lap" text,"Winning driver" text,"Winning team" text,"Report" text)
SELECT "Winning driver" FROM table_4498 WHERE "Name" = 'kraco twin 125 (r2)'
How many played have 8 wins and more than 58 goals against?
CREATE TABLE table_name_20 (played VARCHAR,wins VARCHAR,goals_against VARCHAR)
SELECT COUNT(played) FROM table_name_20 WHERE wins = 8 AND goals_against > 58
What is the current affiliation when the years owned is between 1955 1995?
CREATE TABLE table_name_62 (current_affiliation VARCHAR,years_owned VARCHAR)
SELECT current_affiliation FROM table_name_62 WHERE years_owned = "1955–1995"
get me the number of patients on iv route of drug administration who are diagnosed with closed fracture of surgical neck of humerus.
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Fx surg nck humerus-clos" AND prescriptions.route = "IV"
What's the lowest Overall average that has a College of Arkansas, and a Round larger than 3?
CREATE TABLE table_67733 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT MIN("Overall") FROM table_67733 WHERE "College" = 'arkansas' AND "Round" > '3'
How many points did the song with a draw number 3 get?
CREATE TABLE table_23601 ("Draw" real,"Artist" text,"Song" text,"Regions" real,"Studio Audience" real,"Press Jury" real,"Oil Rig" real,"Total Points" real,"Place" text)
SELECT "Total Points" FROM table_23601 WHERE "Draw" = '3'
What year was the US Open that had a partnering of Maikel Scheffers?
CREATE TABLE table_name_56 (year INTEGER,partnering VARCHAR,championship VARCHAR)
SELECT SUM(year) FROM table_name_56 WHERE partnering = "maikel scheffers" AND championship = "us open"
Which Year Left is the lowest one that has a School of calumet, and a Year Joined larger than 1993?
CREATE TABLE table_name_13 (year_left INTEGER,school VARCHAR,year_joined VARCHAR)
SELECT MIN(year_left) FROM table_name_13 WHERE school = "calumet" AND year_joined > 1993
Which Position has a Competition of world championships, and a Year larger than 1997?
CREATE TABLE table_37024 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Notes" text)
SELECT "Position" FROM table_37024 WHERE "Competition" = 'world championships' AND "Year" > '1997'
List document id of documents status is done and document type is Paper and the document is shipped by shipping agent named USPS.
CREATE TABLE Ref_Shipping_Agents (document_id VARCHAR,document_status_code VARCHAR,document_type_code VARCHAR)CREATE TABLE Documents (document_id VARCHAR,document_status_code VARCHAR,document_type_code VARCHAR)
SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper" INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS"
Ram Vaswani was a winner on what date?
CREATE TABLE table_name_91 (date VARCHAR,winner VARCHAR)
SELECT date FROM table_name_91 WHERE winner = "ram vaswani"
What is Score, when Tie No is Replay, and when Home Team is Sunderland?
CREATE TABLE table_name_75 (score VARCHAR,tie_no VARCHAR,home_team VARCHAR)
SELECT score FROM table_name_75 WHERE tie_no = "replay" AND home_team = "sunderland"
What is the total number of byes that has 13 losses and wins less than 5?
CREATE TABLE table_11922 ("Tallangatta DFL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real)
SELECT COUNT("Byes") FROM table_11922 WHERE "Losses" = '13' AND "Wins" < '5'
As of right now , what 's my GPA ?
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 course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credi...
SELECT DISTINCT total_gpa FROM student WHERE student_id = 1
When vista radio is the owner what is the frequency?
CREATE TABLE table_22418 ("Frequency" text,"Call sign" text,"Branding" text,"Format" text,"Owner" text,"Language/Rebroadcast" text)
SELECT "Frequency" FROM table_22418 WHERE "Owner" = 'Vista Radio'
What is the 1st Edition for the Episode 4?
CREATE TABLE table_56141 ("Episode" text,"1st edition" text,"2nd edition" text,"3rd edition" text,"4th edition" text)
SELECT "1st edition" FROM table_56141 WHERE "Episode" = '4'
What is the highest number of points team vit ria, which had more than 38 played, had?
CREATE TABLE table_name_92 (points INTEGER,team VARCHAR,played VARCHAR)
SELECT MAX(points) FROM table_name_92 WHERE team = "vitória" AND played > 38
A bar chart shows the distribution of meter_500 and ID , and I want to rank y axis from low to high order.
CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te...
SELECT meter_500, ID FROM swimmer ORDER BY ID
Get Question's Tag Data related Python.
CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostI...
SELECT questions.PyPostId AS Python_Questions FROM (SELECT p_tags.PostId AS PyPostId FROM Tags AS tag INNER JOIN PostTags AS p_tags ON tag.Id = p_tags.TagId INNER JOIN Posts AS posts ON Posts.Id = p_tags.PostId WHERE TagName = 'python') AS questions INNER JOIN Posts AS post ON questions.PyPostId = post.Id WHERE Creatio...
Which engine has a Lotus 49c chassis?
CREATE TABLE table_name_41 (engine VARCHAR,chassis VARCHAR)
SELECT engine FROM table_name_41 WHERE chassis = "lotus 49c"
when patient 003-33922 was prescribed for the first time 2 ml : fentanyl citrate 0.05 mg/ml ij soln in 10/2102?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-33922')) AND medication.drugname = '2 ml : fentanyl citrat...
tridion thread volume, page views, unique OPs by month.
CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostN...
SELECT COUNT(*) AS Volume, SUM(ViewCount) AS PageViews, COUNT(DISTINCT OwnerUserId) AS UniqueOPs, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE Tags LIKE '%<tridion%' AND PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY TIME_TO...
what is the number of patients born before 2109 who are still living?
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.expire_flag = "0" AND demographic.dob_year < "2109"
What method of resolution was the fight that took place at hardcore championship fighting: destiny?
CREATE TABLE table_43582 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Method" FROM table_43582 WHERE "Event" = 'hardcore championship fighting: destiny'
Who had a to par of e and scored 71-69=140?
CREATE TABLE table_name_32 (player VARCHAR,to_par VARCHAR,score VARCHAR)
SELECT player FROM table_name_32 WHERE to_par = "e" AND score = 71 - 69 = 140
What was the label in Japan?
CREATE TABLE table_name_14 (label VARCHAR,region VARCHAR)
SELECT label FROM table_name_14 WHERE region = "japan"
Calculate the maximum age of patients who had pneumonia, human immunodeficiency virus (rule out tuberculosis) as their primary disease and remained admitted for 5 days.
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 MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" AND demographic.days_stay = "5"
with hepatic failure ( child _ pugh class b or c )
CREATE TABLE table_test_22 ("id" int,"ejection_fraction_ef" int,"pregnancy_or_lactation" bool,"child_pugh_class" string,"hbv" bool,"systolic_blood_pressure_sbp" int,"active_infection" bool,"leukocyte_count" int,"hiv_infection" bool,"left_ventricular_dysfunction" bool,"active_inflammatory_diseases" bool,"hcv" bool,"neut...
SELECT * FROM table_test_22 WHERE hepatic_disease = 1 OR child_pugh_class = 'b' OR child_pugh_class = 'c'
what's the character name with voice actor (englbeingh 1998 / pioneer) being paul dobson
CREATE TABLE table_19132 ("Character Name" text,"Voice Actor (Japanese)" text,"Voice Actor (English 1997 / Saban)" text,"Voice Actor (English 1998 / Pioneer)" text,"Voice Actor (English 2006 / FUNimation)" text)
SELECT "Character Name" FROM table_19132 WHERE "Voice Actor (English 1998 / Pioneer)" = 'Paul Dobson'
What is the distibution of results for each music festival? Could you show me the result with a bar chart, list from high to low by the x axis.
CREATE TABLE volume (Volume_ID int,Volume_Issue text,Issue_Date text,Weeks_on_Top real,Song text,Artist_ID int)CREATE TABLE music_festival (ID int,Music_Festival text,Date_of_ceremony text,Category text,Volume int,Result text)CREATE TABLE artist (Artist_ID int,Artist text,Age int,Famous_Title text,Famous_Release_date t...
SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result ORDER BY Result DESC
When joan tewkesbury is the director what is the number in seasons?
CREATE TABLE table_1864 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real)
SELECT "No. in season" FROM table_1864 WHERE "Directed by" = 'Joan Tewkesbury'
Which class has less than 3 in quantity with a type of 4-6-0?
CREATE TABLE table_name_70 (class VARCHAR,type VARCHAR,quantity VARCHAR)
SELECT class FROM table_name_70 WHERE type = "4-6-0" AND quantity < 3
Who was relegated to league if Barking Birmingham & Solihull Stourbridge were relegated from league?
CREATE TABLE table_26408 ("Season" text,"Name" text,"Teams" real,"Relegated to league" text,"Promoted to league" text,"Promoted from league" text,"Relegated from league" text)
SELECT "Relegated to league" FROM table_26408 WHERE "Relegated from league" = 'Barking Birmingham & Solihull Stourbridge'
Find All_Neutral and All_Games_Percent , and visualize them by a bar chart, and order y axis from high to low order.
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_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT All_Neutral, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC
WHAT IS THE PLAYER WITH A SCORE OF 66?
CREATE TABLE table_7854 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text)
SELECT "Player" FROM table_7854 WHERE "Score" = '66'
what was steve flesch's to par when he was placed at t3 in the united states?
CREATE TABLE table_name_71 (to_par VARCHAR,player VARCHAR,place VARCHAR,country VARCHAR)
SELECT to_par FROM table_name_71 WHERE place = "t3" AND country = "united states" AND player = "steve flesch"
how many days has passed since the last time patient 006-105495 on the current intensive care unit visit took a 1/2ns + add intake?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
What is the Title of the Pye Label mono LP release?
CREATE TABLE table_name_18 (title VARCHAR,format VARCHAR,label VARCHAR)
SELECT title FROM table_name_18 WHERE format = "mono lp" AND label = "pye"
What is the counting method for a network-centric basis?
CREATE TABLE table_name_89 (counting_method VARCHAR,basis VARCHAR)
SELECT counting_method FROM table_name_89 WHERE basis = "network-centric"
How many people watched the away team of Geelong?
CREATE TABLE table_name_63 (crowd VARCHAR,away_team VARCHAR)
SELECT crowd FROM table_name_63 WHERE away_team = "geelong"
What chassis had fewer than 0 points in a year before 1954?
CREATE TABLE table_69944 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT "Chassis" FROM table_69944 WHERE "Year" < '1954' AND "Points" = '0'
Which general election had a pq majority and a 44.75% of the popular vote?
CREATE TABLE table_106367_2 (general_election VARCHAR,result VARCHAR,_percentage_of_popular_vote VARCHAR)
SELECT general_election FROM table_106367_2 WHERE result = "PQ majority" AND _percentage_of_popular_vote = "44.75%"
Which nationality's pick was 415?
CREATE TABLE table_10937 ("Round" text,"Pick" text,"Player" text,"Nationality" text,"School" text)
SELECT "Nationality" FROM table_10937 WHERE "Pick" = '415'
What is the average Natural Change (Per 1000), when Crude Death Rate (Per 1000) is greater than 13.2, when Deaths is 4,142, and when Natural Change is less than 752?
CREATE TABLE table_40963 ("Average population (x 1000)" real,"Live births" real,"Deaths" real,"Natural change" real,"Crude birth rate (per 1000)" real,"Crude death rate (per 1000)" real,"Natural change (per 1000)" real)
SELECT AVG("Natural change (per 1000)") FROM table_40963 WHERE "Crude death rate (per 1000)" > '13.2' AND "Deaths" = '4,142' AND "Natural change" < '752'
give me the number of patients whose admission year is less than 2165 and item id is 50990?
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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2165" AND lab.itemid = "50990"
What teams started at 39.1?
CREATE TABLE table_28746 ("Year" real,"Races" real,"Wins" real,"Poles" real,"Top 5" real,"Top 10" real,"DNF" real,"Finish" text,"Start" text,"Winnings" text,"Season Rank" text,"Team(s)" text)
SELECT "Team(s)" FROM table_28746 WHERE "Start" = '39.1'