instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Return a bar chart about the distribution of Team_Name and School_ID , could you order by the X-axis in ascending? | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT Team_Name, School_ID FROM basketball_match ORDER BY Team_Name |
Which Category has an Award of monte carlo tv festival awards, and a Year larger than 2010? | CREATE TABLE table_61024 ("Year" real,"Award" text,"Category" text,"Role" text,"Result" text) | SELECT "Category" FROM table_61024 WHERE "Award" = 'monte carlo tv festival awards' AND "Year" > '2010' |
what are the four most commonly ordered specimen tests for patients who were previously diagnosed with gen cnv epil w/o intr ep within 2 months in a year before? | CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE d_labitems (row_id n... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... |
How many different players did the high assists in games where the high rebounds were done by Sales (10)? | CREATE TABLE table_23309 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location" text,"Record" text) | SELECT COUNT("High assists") FROM table_23309 WHERE "High rebounds" = 'Sales (10)' |
What was the Original Canadian air-date for the episode directed by mark rydell? | CREATE TABLE table_name_25 (original_canadian_air_date VARCHAR,director VARCHAR) | SELECT original_canadian_air_date FROM table_name_25 WHERE director = "mark rydell" |
list all the takeoffs and landings at MKE airport | CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_c... | SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE') |
what is the minimum age of patients whose gender is female and ethnicity is black/haitian? | 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 MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "BLACK/HAITIAN" |
what are the five most commonly prescribed drugs for patients the previous year that are also prescribed with nitroglycerin at the same time? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_procedures (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,chartt... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'nitroglycerin' AND DATETIME(prescriptions.startdate, 'start of ye... |
Which Away team has a Home team of al-ain fc, and a Score of 1 1? | CREATE TABLE table_name_58 (away_team VARCHAR,home_team VARCHAR,score VARCHAR) | SELECT away_team FROM table_name_58 WHERE home_team = "al-ain fc" AND score = "1–1" |
what year was the first elected incumbant Sidney R. Yates? | CREATE TABLE table_1341690_13 (first_elected VARCHAR,incumbent VARCHAR) | SELECT first_elected FROM table_1341690_13 WHERE incumbent = "Sidney R. Yates" |
what was valentino rossi's rider time? | CREATE TABLE table_45609 ("Rider" text,"Manufacturer" text,"Laps" real,"Time" text,"Grid" real) | SELECT "Time" FROM table_45609 WHERE "Rider" = 'valentino rossi' |
How many entries are shown for entered at 21:09? | CREATE TABLE table_29692554_2 (entered VARCHAR,time VARCHAR) | SELECT COUNT(entered) FROM table_29692554_2 WHERE time = "21:09" |
what is the number of patients whose diagnoses long title is cerebral aneurysm, nonruptured and drug route is dialys? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Cerebral aneurysm, nonruptured" AND prescriptions.route = "DIALYS" |
What was the nationality of player picked no. 179? | CREATE TABLE table_29023 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "Nationality" FROM table_29023 WHERE "Pick #" = '179' |
What is the Reserved for (SC / ST /None) when the constituency number is 203? | CREATE TABLE table_65878 ("Constituency number" text,"Name" text,"Reserved for (SC / ST /None)" text,"District" text,"Number of electorates (2009)" real) | SELECT "Reserved for ( SC / ST /None)" FROM table_65878 WHERE "Constituency number" = '203' |
i need a friday flight from NEWARK to TAMPA | CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stop... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TAMPA' AND date_day.day_number = 25 AND date_day.month_number = 6 AND dat... |
Who was the Class D winner in round 6? | CREATE TABLE table_24852622_1 (class_d_winner VARCHAR,round VARCHAR) | SELECT class_d_winner FROM table_24852622_1 WHERE round = "6" |
what is the distance from SFO airport to SAN FRANCISCO | CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,re... | SELECT DISTINCT airport_service.miles_distant FROM airport, airport_service, city WHERE airport.airport_code = 'SFO' AND airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'SAN FRANCISCO' |
Find all users with skill and location. | 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 * FROM Users WHERE Users.Location = 'Sydney' AND LOWER(Users.DisplayName) LIKE '%recordpoint%' ORDER BY Reputation DESC |
What was the number of points against when the amount won is 10? | CREATE TABLE table_18086 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text) | SELECT "Points against" FROM table_18086 WHERE "Won" = '10' |
this year, what were the top four most frequent diagnoses of which patients were diagnosed in the same hospital visit after receiving enteral feeds? | 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 t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'enter... |
what are the one year survival rates for fever 41 degrees c or over - heat stroke patients? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,ce... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... |
the number of patients in ward 874 since 5 years ago? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmen... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 874 AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-5 year') |
what was patient 29666's first value of ph in 03/this year? | CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29666) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ph') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(... |
Visualize a bar chart for how many players are from each country? | CREATE TABLE player (Player_ID int,Player text,Years_Played text,Total_WL text,Singles_WL text,Doubles_WL text,Team int)CREATE TABLE team (Team_id int,Name text)CREATE TABLE match_season (Season real,Player text,Position text,Country int,Team int,Draft_Pick_Number int,Draft_Class text,College text)CREATE TABLE country ... | SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name |
What is Place, when Prize is '$381.030'? | CREATE TABLE table_name_32 (place VARCHAR,prize VARCHAR) | SELECT place FROM table_name_32 WHERE prize = "$381.030" |
Draw a scatter chart about the correlation between Team_ID and School_ID , and group by attribute All_Road. | 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 Team_ID, School_ID FROM basketball_match GROUP BY All_Road |
What rank has 0 as the bronze, and a total less than 3, with north korea as the nation? | CREATE TABLE table_7530 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT "Rank" FROM table_7530 WHERE "Bronze" = '0' AND "Total" < '3' AND "Nation" = 'north korea' |
What is the name of the School of the Sussex Tech's Team? | CREATE TABLE table_71583 ("School" text,"Team" text,"Division Record" text,"Overall Record" text,"Season Outcome" text) | SELECT "Team" FROM table_71583 WHERE "School" = 'sussex tech' |
Who is the opponent when the record is 17-19-4? | CREATE TABLE table_43822 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Record" text) | SELECT "Opponent" FROM table_43822 WHERE "Record" = '17-19-4' |
Who won on May 2011? | CREATE TABLE table_name_76 (winner VARCHAR,date VARCHAR) | SELECT winner FROM table_name_76 WHERE date = "may 2011" |
What is the total number of games played that correlates with a first game in 1991, a percentage of 22.22%, and less than 7 losses? | CREATE TABLE table_name_22 (played VARCHAR,lost VARCHAR,first_game VARCHAR,percentage VARCHAR) | SELECT COUNT(played) FROM table_name_22 WHERE first_game = 1991 AND percentage = "22.22%" AND lost > 7 |
what game was on may 24 | CREATE TABLE table_name_27 (game VARCHAR,date VARCHAR) | SELECT game FROM table_name_27 WHERE date = "may 24" |
What 3ds game did Naohiko Aoyama direct? | CREATE TABLE table_name_72 (title VARCHAR,platform_s_ VARCHAR,director VARCHAR) | SELECT title FROM table_name_72 WHERE platform_s_ = "3ds" AND director = "naohiko aoyama" |
when did patient 65582 get in the first hospital encounter a lab test for the first time? | 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_unit_rx text,route text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id numb... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime LIMIT 1 |
Return the number of the countries of the mountains that have a height larger than 5000, display from high to low by the bar. | CREATE TABLE mountain (Mountain_ID int,Name text,Height real,Prominence real,Range text,Country text)CREATE TABLE climber (Climber_ID int,Name text,Country text,Time text,Points real,Mountain_ID int) | SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country ORDER BY Country DESC |
Accepted vs. Rejected edits per month. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId... | WITH Raw AS (SELECT TIME_TO_STR(COALESCE(ApprovalDate, RejectionDate), '%Y') AS yyyy, TIME_TO_STR(COALESCE(ApprovalDate, RejectionDate), '%M') AS mm, COUNT(ApprovalDate) AS ApprovalCount, COUNT(RejectionDate) AS RejectionCount FROM SuggestedEdits GROUP BY TIME_TO_STR(COALESCE(ApprovalDate, RejectionDate), '%Y'), TIME_T... |
What date was the record 34-41? | CREATE TABLE table_name_11 (date VARCHAR,record VARCHAR) | SELECT date FROM table_name_11 WHERE record = "34-41" |
What Area (km 2) is lowest with a type being Apostolic Administration? | CREATE TABLE table_78646 ("Ecclesiastical Jurisdictions" text,"Latin name" text,"Type" text,"Rite" text,"Ecclesiastical Province" text,"Area (km 2)" real) | SELECT MIN("Area (km 2 )") FROM table_78646 WHERE "Type" = 'apostolic administration' |
How many were in attendance during week 12? | CREATE TABLE table_46885 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Attendance" FROM table_46885 WHERE "Week" = '12' |
What are the ids and trade names of the medicine that can interact with at least 3 enzymes? | CREATE TABLE enzyme (id number,name text,location text,product text,chromosome text,omim number,porphyria text)CREATE TABLE medicine (id number,name text,trade_name text,fda_approved text)CREATE TABLE medicine_enzyme_interaction (enzyme_id number,medicine_id number,interaction_type text) | SELECT T1.id, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 3 |
What is the total number of React, when Name is Sean Wroe, and when Lane is greater than 2? | CREATE TABLE table_44751 ("Lane" real,"Name" text,"Country" text,"Mark" text,"React" real) | SELECT COUNT("React") FROM table_44751 WHERE "Name" = 'sean wroe' AND "Lane" > '2' |
Visualize the relationship between School_ID and ACC_Percent , and group by attribute ACC_Regular_Season. | 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 School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Regular_Season |
Performer 2 of chip esten has what performer 3? | CREATE TABLE table_36208 ("Date" text,"Episode" real,"Performer 1" text,"Performer 2" text,"Performer 3" text,"Performer 4" text) | SELECT "Performer 3" FROM table_36208 WHERE "Performer 2" = 'chip esten' |
how many patients with primary disease st-segment elevation myocardial infarction/cardiac catheterization have iv bolus route of drug administration? | 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 demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" AND prescriptions.route = "IV BOLUS" |
What is the state that the boat is from that finished in 2:15:14:06? | CREATE TABLE table_27817 ("Position" real,"Sail Number" text,"Yacht" text,"State/Country" text,"Yacht Type" text,"LOA (Metres)" text,"Skipper" text,"Elapsed Time d:hh:mm:ss" text) | SELECT "State/Country" FROM table_27817 WHERE "Elapsed Time d:hh:mm:ss" = '2:15:14:06' |
Which competition ended with a score of 58-4? | CREATE TABLE table_name_64 (competition VARCHAR,score VARCHAR) | SELECT competition FROM table_name_64 WHERE score = "58-4" |
What Replica has a race of supersport race 1? | CREATE TABLE table_name_46 (replica VARCHAR,race VARCHAR) | SELECT replica FROM table_name_46 WHERE race = "supersport race 1" |
how many drivers received points from the race ? | CREATE TABLE table_203_76 (id number,"pos" text,"no" number,"driver" text,"constructor" text,"laps" number,"time/retired" text,"grid" number,"points" number) | SELECT COUNT("driver") FROM table_203_76 WHERE NOT "points" IS NULL |
what was the first opponent oxford united f.c. defeated during the season ? | CREATE TABLE table_204_441 (id number,"date" text,"opponent" text,"venue" text,"result" text,"attendance" number,"scorers" text) | SELECT "opponent" FROM table_204_441 WHERE "result" > "result" ORDER BY "date" LIMIT 1 |
Which Played has Goals against larger than 34, and Wins smaller than 12, and Goals for smaller than 50, and Losses larger than 15? | CREATE TABLE table_name_39 (played INTEGER,losses VARCHAR,goals_for VARCHAR,goals_against VARCHAR,wins VARCHAR) | SELECT AVG(played) FROM table_name_39 WHERE goals_against > 34 AND wins < 12 AND goals_for < 50 AND losses > 15 |
Name the result for goal # more than 4 | CREATE TABLE table_68062 ("Goal #" real,"Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Result" FROM table_68062 WHERE "Goal #" > '4' |
What is the sum of enrollments for schools located in Culver? | CREATE TABLE table_64800 ("School (IHSAA ID#)" text,"Location" text,"Mascot" text,"Enrollment" real,"IHSAA Class" text,"# / County" text,"Year Joined" real) | SELECT SUM("Enrollment") FROM table_64800 WHERE "Location" = 'culver' |
what is the max fs where the status is status and the method is method? | CREATE TABLE table_21394 ("Name" text,"Model" text,"Max FS" text,"Tested FS" text,"Short description" text,"Publication" text,"Method" text,"Output" text,"Status" text) | SELECT "Max FS" FROM table_21394 WHERE "Status" = 'Status' AND "Method" = 'Method' |
Which Examples has Australian of m? | CREATE TABLE table_78710 ("Ending" text,"American" text,"British" text,"Australian" text,"Examples" text) | SELECT "Examples" FROM table_78710 WHERE "Australian" = 'əm' |
which california city has a higher percentage of korean americans ? | CREATE TABLE table_204_190 (id number,"rank" number,"city" text,"county" text,"state" text,"percentage" text) | SELECT "city" FROM table_204_190 WHERE "state" = 'california' ORDER BY "percentage" DESC LIMIT 1 |
give me the number of patients whose language is russ and discharge location is disc-tran cancer/chldrn h? | 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 WHERE demographic.language = "RUSS" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" |
How many original air dates were there for episode 22? | CREATE TABLE table_24798489_2 (original_airdate VARCHAR,episode_number VARCHAR) | SELECT COUNT(original_airdate) FROM table_24798489_2 WHERE episode_number = 22 |
What are each document's location code, and starting date and ending data in that location? | CREATE TABLE ref_document_types (document_type_code text,document_type_name text,document_type_description text)CREATE TABLE documents_to_be_destroyed (document_id number,destruction_authorised_by_employee_id number,destroyed_by_employee_id number,planned_destruction_date time,actual_destruction_date time,other_details... | SELECT location_code, date_in_location_from, date_in_locaton_to FROM document_locations |
What was lane 4's time? | CREATE TABLE table_name_70 (time VARCHAR,lane VARCHAR) | SELECT time FROM table_name_70 WHERE lane = 4 |
Name the title for number 16 | CREATE TABLE table_2859 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text) | SELECT "Title" FROM table_2859 WHERE "No. in season" = '16' |
Who is the player with a t6 place and a 72-68-72=212 score? | CREATE TABLE table_name_7 (player VARCHAR,place VARCHAR,score VARCHAR) | SELECT player FROM table_name_7 WHERE place = "t6" AND score = 72 - 68 - 72 = 212 |
What is the date of the omloop van de vlaamse scheldeboorden race with a UCI rating of 1.1? | CREATE TABLE table_name_22 (date VARCHAR,uci_rating VARCHAR,race_name VARCHAR) | SELECT date FROM table_name_22 WHERE uci_rating = "1.1" AND race_name = "omloop van de vlaamse scheldeboorden" |
What is the total pick with Bill Duffy? | CREATE TABLE table_name_12 (pick INTEGER,player VARCHAR) | SELECT SUM(pick) FROM table_name_12 WHERE player = "bill duffy" |
What is the original air date of episode 8? Answer: Dec. 21, 2006 | CREATE TABLE table_17467578_1 (original_airdate VARCHAR,episode__number VARCHAR) | SELECT COUNT(original_airdate) FROM table_17467578_1 WHERE episode__number = 8 |
What IHSAA football class do the Generals play in? | CREATE TABLE table_name_24 (ihsaa_class__football_ VARCHAR,mascot VARCHAR) | SELECT ihsaa_class__football_ FROM table_name_24 WHERE mascot = "generals" |
What is the number of seats in congress when the electoral district is Ucayali? | CREATE TABLE table_2676980_4 (seats_in_congress VARCHAR,electoral_district VARCHAR) | SELECT COUNT(seats_in_congress) FROM table_2676980_4 WHERE electoral_district = "Ucayali" |
Name the save for braves for may 15 | CREATE TABLE table_75238 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Save" text) | SELECT "Save" FROM table_75238 WHERE "Opponent" = 'braves' AND "Date" = 'may 15' |
Who made the car that Alberto Ascari went more than 35 laps on a grid less than 7? | CREATE TABLE table_53108 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT "Constructor" FROM table_53108 WHERE "Grid" < '7' AND "Laps" > '35' AND "Driver" = 'alberto ascari' |
What is the tournament on Apr 6? | CREATE TABLE table_34699 ("Date" text,"Tournament" text,"Location" text,"Winner" text,"Score" text,"1st prize ($)" text) | SELECT "Tournament" FROM table_34699 WHERE "Date" = 'apr 6' |
When was the last win for the club that had a final loss in 2011? | CREATE TABLE table_56537 ("Club" text,"Wins" text,"Last win" text,"Runners-up" text,"Last final lost" text) | SELECT "Last win" FROM table_56537 WHERE "Last final lost" = '2011' |
What is the county that produces the most wines scoring higher than 90? | 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)CREATE TABLE appellations (no number,appelation text,county text,state text,area text,isava text) | SELECT T1.county FROM appellations AS T1 JOIN wine AS T2 ON T1.appelation = T2.appelation WHERE T2.score > 90 GROUP BY T1.county ORDER BY COUNT(*) DESC LIMIT 1 |
who is the the candidates with district being mississippi 4 | CREATE TABLE table_1342379_23 (candidates VARCHAR,district VARCHAR) | SELECT candidates FROM table_1342379_23 WHERE district = "Mississippi 4" |
What is the lowest pick number? | CREATE TABLE table_1085 ("Pick #" real,"NFL Team" text,"Player" text,"Position" text,"College" text) | SELECT MIN("Pick #") FROM table_1085 |
What's the report about townsville crocodiles as an away team? | CREATE TABLE table_49347 ("Date" text,"Home team" text,"Score" text,"Away team" text,"Venue" text,"Crowd" real,"Box Score" text,"Report" text) | SELECT "Report" FROM table_49347 WHERE "Away team" = 'townsville crocodiles' |
how much was the intake of lactated ringers that patient 13329 received on the last icu visit? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)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 d_labitems (row_id numbe... | SELECT SUM(inputevents_cv.amount) 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 = 13329) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND inputev... |
What is Pick, when Round is greater than 1, and when School/Club Team is South Carolina? | CREATE TABLE table_43590 ("Round" real,"Pick" text,"Player" text,"Position" text,"Nationality" text,"School/Club Team" text) | SELECT "Pick" FROM table_43590 WHERE "Round" > '1' AND "School/Club Team" = 'south carolina' |
High-scoring questions that have been closed as being off-topic.. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous bool... | SELECT DISTINCT Q.Id AS "post_link", Q.Score AS "number_of_votes", PH.Comment AS "close_reason" FROM Posts AS Q INNER JOIN PostHistory AS PH ON (Q.Id = PH.PostId) WHERE Q.PostTypeId = 1 AND Q.Score >= 100 AND PH.PostHistoryTypeId = 10 AND PH.Comment IN (2, 3, 102, 104, 105) ORDER BY Q.Score DESC |
How many tournaments have their current venue as the Lindner Family Tennis Center? | CREATE TABLE table_14903081_1 (tournament VARCHAR,current_venue VARCHAR) | SELECT COUNT(tournament) FROM table_14903081_1 WHERE current_venue = "Lindner Family Tennis Center" |
How many different payment methods are there? | CREATE TABLE products (product_id number,product_name text,product_price number,product_description text)CREATE TABLE order_deliveries (location_code text,actual_order_id number,delivery_status_code text,driver_employee_id number,truck_id number,delivery_date time)CREATE TABLE actual_order_products (actual_order_id num... | SELECT COUNT(DISTINCT payment_method) FROM customers |
provide me the number of emergency hospital admitted patients with diagnosis icd9 code 6959. | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.icd9_code = "6959" |
Name the D 44 when it has a D 46 of d 31 | CREATE TABLE table_78248 ("D 48" text,"D 47" text,"D 46" text,"D 45" text,"D 44" text,"D 43" text,"D 42" text,"D 41" text) | SELECT "D 44" FROM table_78248 WHERE "D 46" = 'd 31' |
Name the island with age ma of 1.0 | CREATE TABLE table_name_73 (island VARCHAR,age___ma__ VARCHAR) | SELECT island FROM table_name_73 WHERE age___ma__ = "1.0" |
Asked by user1 and answered by user2. | 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 q.Id AS "post_link" FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND q.OwnerUserId = '##askerid##' AND a.OwnerUserId = '##answererid##' |
How many losses did the division who appeared less than 16 times have? | CREATE TABLE table_name_95 (losses VARCHAR,appearances INTEGER) | SELECT losses FROM table_name_95 WHERE appearances < 16 |
Bar graph to show mean memory in g from different carrier, rank Y-axis in asc order please. | CREATE TABLE phone_market (Market_ID int,Phone_ID text,Num_of_stock int)CREATE TABLE market (Market_ID int,District text,Num_of_employees int,Num_of_shops real,Ranking int)CREATE TABLE phone (Name text,Phone_ID int,Memory_in_G int,Carrier text,Price real) | SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY AVG(Memory_in_G) |
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the amount of name , and group by attribute name, and show in desc by the names. | 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, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC |
Display a bar chart for what are the names and ids of the tourist attractions that are visited at most once?, and list by the X in asc. | CREATE TABLE Features (Feature_ID INTEGER,Feature_Details VARCHAR(255))CREATE TABLE Street_Markets (Market_ID INTEGER,Market_Details VARCHAR(255))CREATE TABLE Shops (Shop_ID INTEGER,Shop_Details VARCHAR(255))CREATE TABLE Visitors (Tourist_ID INTEGER,Tourist_Details VARCHAR(255))CREATE TABLE Locations (Location_ID INTEG... | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Name |
What are the vocal types used in song 'Badlands'? | CREATE TABLE songs (songid VARCHAR)CREATE TABLE vocals (songid VARCHAR) | SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Badlands" |
When winston reid category:articles with hcards is the player what is the club? | CREATE TABLE table_30453 ("Player" text,"Cap(s)" real,"Goal(s)" real,"International Debut" text,"Club(s)" text) | SELECT "Club(s)" FROM table_30453 WHERE "Player" = 'Winston Reid Category:Articles with hCards' |
What is the sum of Against, when Status is 'Six Nations', and when Date is '30/03/2003'? | CREATE TABLE table_59748 ("Opposing Teams" text,"Against" real,"Date" text,"Venue" text,"Status" text) | SELECT SUM("Against") FROM table_59748 WHERE "Status" = 'six nations' AND "Date" = '30/03/2003' |
how many patients whose admission type is newborn and diagnoses long title is esophageal reflux? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "NEWBORN" AND diagnoses.long_title = "Esophageal reflux" |
how many hours have passed since the first time patient 28447 was given a d5w intake on the current intensive care unit visit? | CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 28447) AND icustays.outtime IS NULL)... |
What is the amount of money that a +5 to par with a score of 76-69-70-70=285? | CREATE TABLE table_37618 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT COUNT("Money ( $ )") FROM table_37618 WHERE "To par" = '+5' AND "Score" = '76-69-70-70=285' |
was patient 26156 heart rate ever less than 83.0 on the last intensive care unit visit? | 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 admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,... | 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 = 26156) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid IN (SELE... |
Who directed hamateur night? | CREATE TABLE table_name_2 (director VARCHAR,title VARCHAR) | SELECT director FROM table_name_2 WHERE title = "hamateur night" |
What is the total erp w of class c3, which has a frequency mhz less than 89.9? | CREATE TABLE table_name_58 (erp_w VARCHAR,class VARCHAR,frequency_mhz VARCHAR) | SELECT COUNT(erp_w) FROM table_name_58 WHERE class = "c3" AND frequency_mhz < 89.9 |
List the description of the outcomes for all projects. | CREATE TABLE research_staff (staff_id number,employer_organisation_id number,staff_details text)CREATE TABLE research_outcomes (outcome_code text,outcome_description text)CREATE TABLE staff_roles (role_code text,role_description text)CREATE TABLE project_outcomes (project_id number,outcome_code text,outcome_details tex... | SELECT T1.outcome_description FROM research_outcomes AS T1 JOIN project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code |
how many patients are discharged to home health care and the admission year is before 2110? | 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.discharge_location = "HOME HEALTH CARE" AND demographic.admityear < "2110" |
Name the high points for 30-23 | CREATE TABLE table_2853 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High points" FROM table_2853 WHERE "Record" = '30-23' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.