instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is the branding for cbxp-fm? | CREATE TABLE table_66085 ("Frequency" text,"Call sign" text,"Branding" text,"Format" text,"Owner" text) | SELECT "Branding" FROM table_66085 WHERE "Call sign" = 'cbxp-fm' |
What is the lowest Rank, when Nation is Great Britain, and when Bronze is less than 1? | CREATE TABLE table_name_40 (rank INTEGER,nation VARCHAR,bronze VARCHAR) | SELECT MIN(rank) FROM table_name_40 WHERE nation = "great britain" AND bronze < 1 |
What is Nation, when Model is M1895 & M1897 Carbine? | CREATE TABLE table_name_76 (nation VARCHAR,model VARCHAR) | SELECT nation FROM table_name_76 WHERE model = "m1895 & m1897 carbine" |
What is the avg/g of Rhines, Chris, who has an effic greater than 73.95? | CREATE TABLE table_77351 ("Name" text,"GP-GS" text,"Effic" real,"Cmp-Att-Int" text,"Avg/G" real) | SELECT "Avg/G" FROM table_77351 WHERE "Effic" > '73.95' AND "Name" = 'rhines, chris' |
Which College/junior/club team (league) was the player from Switzerland from? | CREATE TABLE table_name_58 (college_junior_club_team__league_ VARCHAR,nationality VARCHAR) | SELECT college_junior_club_team__league_ FROM table_name_58 WHERE nationality = "switzerland" |
What coutry had a rampaged killing 14 in 1965? | CREATE TABLE table_name_29 (country VARCHAR,killed VARCHAR,year VARCHAR) | SELECT country FROM table_name_29 WHERE killed = "14" AND year = 1965 |
What country was the woman from who was born 1976-07-23 and became a grandmaster in 1991? | CREATE TABLE table_45250 ("Name" text,"Country" text,"Birth Date" text,"Date" real,"Earned" text,"Peak rating (Nov 2012)" real) | SELECT "Country" FROM table_45250 WHERE "Date" = '1991' AND "Birth Date" = '1976-07-23' |
What is the average diff when games played are more than 6? | CREATE TABLE table_32864 ("Club" text,"Played" real,"Lost" real,"Drawn" real,"Against" real,"Diff." real,"Points" real) | SELECT AVG("Diff.") FROM table_32864 WHERE "Played" > '6' |
When the country was Scotland, how many ends were won? | CREATE TABLE table_16922657_2 (Ends VARCHAR,country VARCHAR,Scotland VARCHAR) | SELECT COUNT(Ends) AS won FROM table_16922657_2 WHERE country = Scotland |
tell me the average sao2 in patient 5866? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE patients (row_id number,subject_id number,gen... | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5866)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2'... |
how many patients died within 2 months after being diagnosed until 4 years ago with alkalosis? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,end... | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... |
what was patient 021-35326's minimum sao2, until 03/01/2105? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number... | SELECT MIN(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-35326')) AND NOT vitalperiodic.sao2 IS NULL AND STRFT... |
have patient 13536 had any br milk fs ng intake in 05/this year? | 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 d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id numbe... | SELECT COUNT(*) > 0 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 = 13536)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'br milk ... |
What's Jim Farmer's nationality? | CREATE TABLE table_16868 ("Player" text,"No." real,"Nationality" text,"Position" text,"Years for Jazz" text,"School/Club Team" text) | SELECT "Nationality" FROM table_16868 WHERE "Player" = 'Jim Farmer' |
What is the average number of deaths for earthquakes centered in Damghan? | CREATE TABLE table_4655 ("Date" text,"Epicenter" text,"Magnitude" text,"Fatalities" real,"Name" text) | SELECT AVG("Fatalities") FROM table_4655 WHERE "Epicenter" = 'damghan' |
give me the top three most common diagnoses for patients with an age of 40s this year? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemi... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... |
What position has a spread greater than -319, and United States as the country, a win loss of 11-13, and gabriel, marty as the name? | CREATE TABLE table_name_96 (position VARCHAR,name VARCHAR,win_loss VARCHAR,spread VARCHAR,country VARCHAR) | SELECT position FROM table_name_96 WHERE spread > -319 AND country = "united states" AND win_loss = "11-13" AND name = "gabriel, marty" |
What is the date of the match with a 28-15 record? | CREATE TABLE table_name_24 (date VARCHAR,record VARCHAR) | SELECT date FROM table_name_24 WHERE record = "28-15" |
What type of aircraft was the plane with a tail number of ya-bao? | CREATE TABLE table_name_75 (aircraft VARCHAR,tail_number VARCHAR) | SELECT aircraft FROM table_name_75 WHERE tail_number = "ya-bao" |
Which Nation has the USA-18 sail? | CREATE TABLE table_name_91 (nation VARCHAR,sail VARCHAR) | SELECT nation FROM table_name_91 WHERE sail = "usa-18" |
What away team is the home team richmond? | CREATE TABLE table_name_16 (away_team VARCHAR,home_team VARCHAR) | SELECT away_team FROM table_name_16 WHERE home_team = "richmond" |
Name the winning driver with circuit of monza | CREATE TABLE table_name_59 (winning_driver VARCHAR,circuit VARCHAR) | SELECT winning_driver FROM table_name_59 WHERE circuit = "monza" |
What is 2000, when Tournament is 'Canada Masters'? | CREATE TABLE table_name_67 (tournament VARCHAR) | SELECT 2000 FROM table_name_67 WHERE tournament = "canada masters" |
what is the score for game 4? | CREATE TABLE table_65579 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Series" text) | SELECT "Score" FROM table_65579 WHERE "Game" = '4' |
Number of Rust questions per month. | 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 DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) AS "month", COUNT(DISTINCT Posts.Id) AS Count FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName LIKE '%rust%' AND PostTypeId = 1 GROUP BY DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), ... |
provide the number of patients whose admission location is clinic referral/premature and diagnoses long title is acidosis? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.long_title = "Acidosis" |
How many poles did team #14 ginn racing have? | CREATE TABLE table_1708014_1 (poles VARCHAR,team_s_ VARCHAR) | SELECT poles FROM table_1708014_1 WHERE team_s_ = "#14 Ginn Racing" |
Count the total number of available services. | CREATE TABLE services (service_id number,service_name text)CREATE TABLE settlements (settlement_id number,claim_id number,effective_date time,settlement_amount number)CREATE TABLE claims (claim_id number,fnol_id number,effective_date time)CREATE TABLE available_policies (policy_id number,policy_type_code text,customer_... | SELECT COUNT(*) FROM services |
Show all the actual delivery dates and bin by weekday in a bar chart, and sort in desc by the y-axis please. | CREATE TABLE Customers (Customer_ID VARCHAR(100),Address_ID INTEGER,Customer_Name VARCHAR(255),Customer_Phone VARCHAR(255),Customer_Email_Address VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Marketing_Regions (Marketing_Region_Code CHAR(15),Marketing_Region_Name VARCHAR(255),Marketing_Region_Descriptrion VARCHA... | SELECT Actual_Delivery_Date, COUNT(Actual_Delivery_Date) FROM Bookings ORDER BY COUNT(Actual_Delivery_Date) DESC |
What is 2009, when 2008 is 'A', when 2011 is 'A', and when Tournament is 'Paris Masters'? | CREATE TABLE table_name_25 (tournament VARCHAR) | SELECT 2009 FROM table_name_25 WHERE 2008 = "a" AND 2011 = "a" AND tournament = "paris masters" |
What is the highest number lost when the number tied is more than 42, the years are less than 132, and the PCT is less than 0.5729000000000001? | CREATE TABLE table_10467 ("Independent" text,"Lost" real,"Tied" real,"Pct." real,"Years" real,"Total Games" real) | SELECT MAX("Lost") FROM table_10467 WHERE "Tied" > '42' AND "Years" < '132' AND "Pct." < '0.5729000000000001' |
Give me a bar chart to show the names and revenue of the company that earns the highest revenue in each headquarter city. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT Name, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter |
give me the number of patients whose ethnicity is asian and year of death is less than or equal to 2148? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.dod_year <= "2148.0" |
What is the segment A name, having a Netflix of s01e12? | CREATE TABLE table_75288 ("Series Ep." text,"Episode" real,"Netflix" text,"Segment A" text,"Segment B" text,"Segment C" text,"Segment D" text) | SELECT "Segment A" FROM table_75288 WHERE "Netflix" = 's01e12' |
Name the Points which has a Team of sportivo luque o, and Wins larger than 1? | CREATE TABLE table_45251 ("Position" real,"Team" text,"Played" real,"Wins" real,"Draws" real,"Losses" real,"Scored" real,"Conceded" real,"Bonus Points" text,"Points" real) | SELECT MIN("Points") FROM table_45251 WHERE "Team" = 'sportivo luqueño' AND "Wins" > '1' |
Group and count the name attribute for visualizing a bar chart. | CREATE TABLE editor (Editor_ID int,Name text,Age real)CREATE TABLE journal_committee (Editor_ID int,Journal_ID int,Work_Type text)CREATE TABLE journal (Journal_ID int,Date text,Theme text,Sales int) | SELECT Name, COUNT(Name) FROM editor GROUP BY Name |
when did patient 49654 last have a microbiological test in 07/this year? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,disch... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49654) AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', microbiolo... |
show me all flights from PITTSBURGH to SAN FRANCISCO | CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE e... | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN... |
What is the sum of Total for 0 gold and less than 2, silver with a rank of 6? | CREATE TABLE table_name_11 (total INTEGER,rank VARCHAR,gold VARCHAR,silver VARCHAR) | SELECT SUM(total) FROM table_name_11 WHERE gold = 0 AND silver < 2 AND rank = "6" |
What is the Game site week 1? | CREATE TABLE table_name_20 (game_site VARCHAR,week VARCHAR) | SELECT game_site FROM table_name_20 WHERE week = 1 |
how many canadian players are listed ? | CREATE TABLE table_203_305 (id number,"round" number,"#" number,"player" text,"nationality" text,"college/junior/club team (league)" text) | SELECT COUNT("player") FROM table_203_305 WHERE "nationality" = 'canada' |
Who was the constructor in the location Monza? | CREATE TABLE table_16729 ("Rnd" real,"Race" text,"Date" text,"Location" text,"Pole Position" text,"Fastest Lap" text,"Race Winner" text,"Constructor" text,"Report" text) | SELECT "Constructor" FROM table_16729 WHERE "Location" = 'Monza' |
What is the word count that is named omega dot? | CREATE TABLE table_78074 ("Subframe #" real,"Page #" text,"Name" text,"Word #" real,"Bits" text) | SELECT "Word #" FROM table_78074 WHERE "Name" = 'omega dot' |
When by80607002907ahbx80607i7720qm is the part number what is the socket? | CREATE TABLE table_22633 ("Model number" text,"sSpec number" text,"Frequency" text,"Turbo" text,"Cores" real,"L2 cache" text,"L3 cache" text,"I/O bus" text,"Mult." text,"Memory" text,"Voltage" text,"TDP" text,"Socket" text,"Release date" text,"Part number(s)" text,"Release price (USD)" text) | SELECT "Socket" FROM table_22633 WHERE "Part number(s)" = 'BY80607002907AHBX80607I7720QM' |
Duplicate questions asked by someone who answered the original. | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModera... | SELECT orgs.Id AS "post_link", orgs.Id, orgs.Title AS "titulo_original", dupes.Id AS "post_link", dupes.Id, dupes.Title AS "titulo_duplicado" FROM Posts AS orgs JOIN PostLinks AS links ON (orgs.Id = links.RelatedPostId AND LinkTypeId = 3) JOIN Posts AS dupes ON (dupes.Id = links.PostId AND dupes.PostTypeId = 1) WHERE o... |
Can you tell me the Name that has the Rank of 4? | CREATE TABLE table_64409 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" text) | SELECT "Name" FROM table_64409 WHERE "Rank" = '4' |
How many wins when there are 4 losses and against are fewer than 1281? | CREATE TABLE table_name_7 (wins INTEGER,losses VARCHAR,against VARCHAR) | SELECT AVG(wins) FROM table_name_7 WHERE losses = 4 AND against < 1281 |
has patient 97733 been diagnosed with rotator cuff synd nos since 2105. | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueu... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'rotator cuff synd nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97733) AND STRFTIME('%y', diagn... |
Name the catalogue for australia | CREATE TABLE table_name_53 (catalogue VARCHAR,region VARCHAR) | SELECT catalogue FROM table_name_53 WHERE region = "australia" |
When middle prut valley is the land formation what is the highest of which currently forests, km ? | CREATE TABLE table_19242_5 (_km² VARCHAR,of_which_currently_forests INTEGER,land_formation VARCHAR) | SELECT MAX(of_which_currently_forests), _km² FROM table_19242_5 WHERE land_formation = "Middle Prut Valley" |
what is the number of asian ethnic background patients who were admitted in hospital before the year 2112? | 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 WHERE demographic.ethnicity = "ASIAN" AND demographic.admityear < "2112" |
What country won in 1977? | CREATE TABLE table_name_46 (country VARCHAR,year_s__won VARCHAR) | SELECT country FROM table_name_46 WHERE year_s__won = "1977" |
How many students are taught by teacher TARRING LEIA? | CREATE TABLE list (lastname text,firstname text,grade number,classroom number)CREATE TABLE teachers (lastname text,firstname text,classroom number) | SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "TARRING" AND T2.lastname = "LEIA" |
what is the single of the queen | CREATE TABLE table_34579 ("Position" text,"Artist" text,"Single" text,"Year" text,"Weeks" text) | SELECT "Single" FROM table_34579 WHERE "Artist" = 'queen' |
What is the total number of different nationalities of all ships? Give me a bar graph, list X-axis in desc order. | 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 Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality ORDER BY Nationality DESC |
Name the number of points for right halfback and starter being yes | CREATE TABLE table_19272 ("Player" text,"Position" text,"Starter" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real) | SELECT COUNT("Points") FROM table_19272 WHERE "Position" = 'Right halfback' AND "Starter" = 'yes' |
What is the class of the a1 bm type? | CREATE TABLE table_name_10 (class VARCHAR,type VARCHAR) | SELECT class FROM table_name_10 WHERE type = "a1 bm" |
What's the average pct for George Felton when he had losses greater than 7? | CREATE TABLE table_34064 ("Name" text,"Years" text,"Seasons" real,"Lost" real,"Pct." real) | SELECT AVG("Pct.") FROM table_34064 WHERE "Lost" > '7' AND "Name" = 'george felton' |
How many patients of hispanic, or latino-puerto rican ethnicity had colonoscopy? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND procedures.long_title = "Colonoscopy" |
WHAT IS THE SUM OF PICK WITH AN OVERALL LARGER THAN 250, AND FOR FLORIDA COLLEGE? | CREATE TABLE table_46534 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT SUM("Pick") FROM table_46534 WHERE "Overall" > '250' AND "College" = 'florida' |
Give me a pie to show how many sex from different sex. | 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 |
How many Against has Byes smaller than 2? | CREATE TABLE table_75700 ("Ballarat FL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT AVG("Against") FROM table_75700 WHERE "Byes" < '2' |
Which Week has a TV Time of cbs 1:00pm, and an Attendance of 72,714? | CREATE TABLE table_name_44 (week VARCHAR,tv_time VARCHAR,attendance VARCHAR) | SELECT week FROM table_name_44 WHERE tv_time = "cbs 1:00pm" AND attendance = "72,714" |
Which wineries produce at least four wines? | CREATE TABLE appellations (no number,appelation text,county text,state text,area text,isava text)CREATE TABLE grapes (id number,grape text,color text)CREATE TABLE wine (no number,grape text,winery text,appelation text,state text,name text,year number,price number,score number,cases number,drink text) | SELECT winery FROM wine GROUP BY winery HAVING COUNT(*) >= 4 |
What is the transfer window of the player moving from barueri? | CREATE TABLE table_name_40 (transfer_window VARCHAR,moving_from VARCHAR) | SELECT transfer_window FROM table_name_40 WHERE moving_from = "barueri" |
What is the number of patients who had exteriorization of small intestine and died in or before 2111? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2111.0" AND procedures.long_title = "Exteriorization of small intestine" |
What was the lowest wins in a season less than 1915 with a 7th finish and 0.429 win %? | CREATE TABLE table_53204 ("MLB season" text,"Reds season" real,"League" text,"Division" text,"Finish" text,"Wins" real,"Losses" real,"Win%" real,"GB [c ]" text) | SELECT MIN("Wins") FROM table_53204 WHERE "Finish" = '7th' AND "Win%" > '0.429' AND "Reds season" < '1915' |
patients < 18 years of age, pregnant patients, and patients with limitations of care. | CREATE TABLE table_train_21 ("id" int,"pregnancy_or_lactation" bool,"severe_sepsis" bool,"systolic_blood_pressure_sbp" int,"active_infection" bool,"limited_care" bool,"septic_shock" bool,"coagulopathy" bool,"age" float,"lactate" int,"NOUSE" float) | SELECT * FROM table_train_21 WHERE age < 18 OR pregnancy_or_lactation = 1 OR limited_care = 1 |
who published the most papers at EMNLP or ACL since 2011 | CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE venue (venueid int,venuename va... | SELECT DISTINCT COUNT(DISTINCT paper.paperid), writes.authorid FROM keyphrase, paper, paperkeyphrase, venue, writes WHERE paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year > 2011 AND venue.venueid = paper.venueid AND venue.venuename IN ('ACL', 'EMNLP') AND writ... |
Percentage of users above a certain reputation threshold. | 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 ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostTypes (Id number,Name text... | SELECT ((SELECT CAST(COUNT(*) AS FLOAT) FROM Users WHERE Reputation >= 15) / (SELECT COUNT(*) FROM Users)) |
A bar chart about what are the student IDs and middle names of the students enrolled in at most two courses?, and I want to sort by the bars in descending. | CREATE TABLE Course_Authors_and_Tutors (author_id INTEGER,author_tutor_ATB VARCHAR(3),login_name VARCHAR(40),password VARCHAR(40),personal_name VARCHAR(80),middle_name VARCHAR(80),family_name VARCHAR(80),gender_mf VARCHAR(1),address_line_1 VARCHAR(80))CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))... | SELECT T2.middle_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T2.middle_name DESC |
What is the score that the player who placed t4 from the united states get? | CREATE TABLE table_43180 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Score" FROM table_43180 WHERE "Country" = 'united states' AND "Place" = 't4' |
Who is the producer for the director Richard Clark? | CREATE TABLE table_name_31 (producer VARCHAR,director VARCHAR) | SELECT producer FROM table_name_31 WHERE director = "richard clark" |
give me the number of patients whose admission type is urgent and drug route is ivpca? | 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.admission_type = "URGENT" AND prescriptions.route = "IVPCA" |
What is Country, when Player is Billy Mayfair? | CREATE TABLE table_44539 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Country" FROM table_44539 WHERE "Player" = 'billy mayfair' |
give me the number of patients whose primary disease is cerebral aneurysm/sda and admission year is less than 2200? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CEREBRAL ANEURYSM/SDA" AND demographic.admityear < "2200" |
when was the last time until 11/2105 patient 52898 was prescribed a drug via the ir route? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898) AND prescriptions.route = 'ir' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-11' ORDER BY prescriptions.startdate DESC LIMIT 1 |
How many years has 2 points? | CREATE TABLE table_69652 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT SUM("Year") FROM table_69652 WHERE "Points" = '2' |
What is the number for years 1985-88 | CREATE TABLE table_16840 ("Player" text,"No." real,"Nationality" text,"Position" text,"Years for Jazz" text,"School/Club Team" text) | SELECT MIN("No.") FROM table_16840 WHERE "Years for Jazz" = '1985-88' |
what is age and date of birth of subject name paul edwards? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT demographic.age, demographic.dob FROM demographic WHERE demographic.name = "Paul Edwards" |
When was the first elected when the party was republican and the candidate were robert h. michel (r) 66.1% rosa lee fox (d) 33.9%? | CREATE TABLE table_1341718_14 (first_elected INTEGER,party VARCHAR,candidates VARCHAR) | SELECT MIN(first_elected) FROM table_1341718_14 WHERE party = "Republican" AND candidates = "Robert H. Michel (R) 66.1% Rosa Lee Fox (D) 33.9%" |
Which batter played P and was born 18 April 1984? | CREATE TABLE table_36221 ("Surname" text,"First" text,"D.O.B." text,"Bats" text,"Throws" text,"Position" text) | SELECT "Bats" FROM table_36221 WHERE "Position" = 'p' AND "D.O.B." = '18 april 1984' |
If 2006 is 13% and 2001 is greater than 12.1%, what is the greatest number of seats for 2001? | CREATE TABLE table_70959 ("Parties and voter communities" text,"% 2006" real,"seats 2006" real,"% 2001" real,"seats 2001" real) | SELECT MAX("seats 2001") FROM table_70959 WHERE "% 2006" = '13' AND "% 2001" > '12.1' |
What tournament is on 18 May 1992? | CREATE TABLE table_name_29 (tournament VARCHAR,date VARCHAR) | SELECT tournament FROM table_name_29 WHERE date = "18 may 1992" |
What is the name of the race in Kenya with a time of 30:27? | CREATE TABLE table_44346 ("Rank" text,"Time" text,"Athlete" text,"Nation" text,"Date" text,"Race" text) | SELECT "Race" FROM table_44346 WHERE "Nation" = 'kenya' AND "Time" = '30:27' |
Are there Analysis of Modernist Music courses of 2 credits that you could show me ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday... | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Analysis of Modernist Music%' OR name LIKE '%Analysis of Modernist Music%') AND credits = 2 |
What is the IcAO of Frankfurt? | CREATE TABLE table_79538 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text) | SELECT "ICAO" FROM table_79538 WHERE "City" = 'frankfurt' |
What is the to par of the player with a 73-70-70-65=278 score? | CREATE TABLE table_name_92 (to_par VARCHAR,score VARCHAR) | SELECT to_par FROM table_name_92 WHERE score = 73 - 70 - 70 - 65 = 278 |
How many times is the title am/pm callanetics? | CREATE TABLE table_29432 ("Year" real,"Title" text,"Format" text,"Studio" text,"Release Date" text,"Copyright Information" text,"Catalog Number" text) | SELECT COUNT("Studio") FROM table_29432 WHERE "Title" = 'AM/PM Callanetics' |
Create inverted index table data for. | CREATE TABLE PostsWithDeleted (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,Ta... | SELECT * FROM Users WHERE LastAccessDate LIKE '%2018%' |
Which classes are being taught by Dr. Jaime Rodriguez-matos next semester ? | CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varchar,has_lab varchar,has_projects varchar,has_exams varchar,num_reviews int,clarity_score i... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Jaime Rodriguez-matos%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instru... |
Show me start_station_id by start station name in a histogram | CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_type TEXT,zip_code INTEGER)CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temp... | SELECT start_station_name, start_station_id FROM trip |
Find the names of items whose rank is higher than 3 and whose average rating is above 5. | CREATE TABLE item (title VARCHAR,i_id VARCHAR)CREATE TABLE review (i_id VARCHAR,rank INTEGER,rating INTEGER) | SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rank > 3 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id HAVING AVG(T2.rating) > 5 |
give me the flights from NEW YORK to LAS VEGAS on sunday and the flights from MEMPHIS to LAS VEGAS on sunday | CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE month (month_number int,month_name text)CRE... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, date_day, days, flight WHERE (CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'LAS VEGAS' AND date... |
During what Championship was the Opponent Jeff Borowiak? | CREATE TABLE table_56196 ("Outcome" text,"Date" real,"Championship" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Championship" FROM table_56196 WHERE "Opponent" = 'jeff borowiak' |
which has a unicode of u +22 a1 , the benchmark symbol or the factory symbol ? | CREATE TABLE table_203_540 (id number,"symbol" text,"gsi" text,"meaning" text,"unicode" text,"description" text) | SELECT "meaning" FROM table_203_540 WHERE "unicode" = 'u+22a1' |
Jon Skeet Non Tag Badge Counts. | CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PostHistor... | SELECT Name, COUNT(*) AS NumTagBadges FROM Badges WHERE Name NOT IN (SELECT TagName FROM Tags) AND UserId = 22656 GROUP BY Name ORDER BY NumTagBadges DESC |
Bar graph to show how many yearid from different yearid, list in descending by the Y-axis. | CREATE TABLE postseason (year INTEGER,round TEXT,team_id_winner TEXT,league_id_winner TEXT,team_id_loser TEXT,league_id_loser TEXT,wins INTEGER,losses INTEGER,ties INTEGER)CREATE TABLE salary (year INTEGER,team_id TEXT,league_id TEXT,player_id TEXT,salary INTEGER)CREATE TABLE manager_half (player_id TEXT,year INTEGER,t... | SELECT yearid, COUNT(yearid) FROM hall_of_fame ORDER BY COUNT(yearid) DESC |
Return the title and inventory id of the film that is rented most often. | CREATE TABLE rental (rental_id number,rental_date time,inventory_id number,customer_id number,return_date time,staff_id number,last_update time)CREATE TABLE country (country_id number,country text,last_update time)CREATE TABLE actor (actor_id number,first_name text,last_name text,last_update time)CREATE TABLE language ... | SELECT T1.title, T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T2.inventory_id ORDER BY COUNT(*) DESC LIMIT 1 |
On what date was there both a crowd larger than 16,570 and the away team was Footscray? | CREATE TABLE table_32436 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_32436 WHERE "Crowd" > '16,570' AND "Away team" = 'footscray' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.