instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
i'd like to find a nonstop flight from BOSTON to ATLANTA that leaves sometime in the afternoon and arrives in ATLANTA before evening | CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE code_description (... | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.arrival_time < 1800 AND flight.to_airport = AIRPORT_SERVICE_1.airpo... |
Return the names of songs for which format is mp3 and resolution is below 1000. | CREATE TABLE genre (g_name text,rating text,most_popular_in text)CREATE TABLE song (song_name text,artist_name text,country text,f_id number,genre_is text,rating number,languages text,releasedate time,resolution number)CREATE TABLE files (f_id number,artist_name text,file_size text,duration text,formats text)CREATE TAB... | SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = "mp3" INTERSECT SELECT song_name FROM song WHERE resolution < 1000 |
Name the best uk team for university of birmingham | CREATE TABLE table_22958 ("Year" text,"Location" text,"Class 1" text,"Best UK team" text,"Class 1-200" text,"Class 3" text,"Class 1a" text) | SELECT COUNT("Best UK team") FROM table_22958 WHERE "Class 1-200" = 'University of Birmingham' |
how many patient have died after they were diagnosed with ch ob asthma w stat asth in the same month? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx t... | 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... |
has patient 028-55503 ever received a diagnosis since 1 year ago? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-55503')) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(... |
Tell me the Laps for time/retired of +8 laps | CREATE TABLE table_name_35 (laps VARCHAR,time_retired VARCHAR) | SELECT laps FROM table_name_35 WHERE time_retired = "+8 laps" |
What is the lens zoom and aperture for the coolpix 5400? | CREATE TABLE table_name_79 (lens__35mm_equiv__zoom VARCHAR,_aperture VARCHAR,model VARCHAR) | SELECT lens__35mm_equiv__zoom, _aperture FROM table_name_79 WHERE model = "coolpix 5400" |
how many districts have more than 100,000 people in this city ? | CREATE TABLE table_204_739 (id number,"districts" text,"ubigeo" number,"area\n(km2)" number,"population" number,"population density\n(/km2)" number,"created" text,"postal\ncode" number) | SELECT COUNT("districts") FROM table_204_739 WHERE "population" > 100000 |
What is the status of Author Del Corro? | CREATE TABLE table_name_84 (status VARCHAR,authors VARCHAR) | SELECT status FROM table_name_84 WHERE authors = "del corro" |
Name the least series number with production code of 717 and season number less than 17 | CREATE TABLE table_name_41 (series__number INTEGER,production_code VARCHAR,season__number VARCHAR) | SELECT MIN(series__number) FROM table_name_41 WHERE production_code = 717 AND season__number < 17 |
During melbourne's home game, who was the away team? | CREATE TABLE table_77788 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_77788 WHERE "Home team" = 'melbourne' |
What was the original title for the film used in nomination of keep smiling? | CREATE TABLE table_name_36 (original_title VARCHAR,film_title_used_in_nomination VARCHAR) | SELECT original_title FROM table_name_36 WHERE film_title_used_in_nomination = "keep smiling" |
what is the last product represented in the chart ? | CREATE TABLE table_204_870 (id number,"product" text,"main functionality" text,"input format" text,"output format" text,"platform" text,"license and cost" text,"notes" text) | SELECT "product" FROM table_204_870 ORDER BY id DESC LIMIT 1 |
How many appearances were made by people that had 5 goals and less than 7 rank? | CREATE TABLE table_name_95 (appearances VARCHAR,goals VARCHAR,rank VARCHAR) | SELECT COUNT(appearances) FROM table_name_95 WHERE goals = 5 AND rank < 7 |
what is the number of patients whose admission location is clinic referral/premature and primary disease is celo-vessicle fistula? | 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.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "CELO-VESSICLE FISTULA" |
How many times was the high assists andre miller (7)? | CREATE TABLE table_27734769_8 (date VARCHAR,high_assists VARCHAR) | SELECT COUNT(date) FROM table_27734769_8 WHERE high_assists = "Andre Miller (7)" |
What was the place when the score was 65-70-72=207? | CREATE TABLE table_name_35 (place VARCHAR,score VARCHAR) | SELECT place FROM table_name_35 WHERE score = 65 - 70 - 72 = 207 |
What was the highest crowd at the venue MCG? | CREATE TABLE table_58045 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT MAX("Crowd") FROM table_58045 WHERE "Venue" = 'mcg' |
what is the total number of monarchs that ascended the throne in 2010 ? | CREATE TABLE table_203_298 (id number,"rank" number,"name" text,"nation(s)" text,"born" text,"ascended" text,"years reigned" text) | SELECT COUNT("name") FROM table_203_298 WHERE "ascended" = 2010 |
What are the region names affected by the storm with a number of deaths of least 10? | CREATE TABLE affected_region (region_id number,storm_id number,number_city_affected number)CREATE TABLE region (region_id number,region_code text,region_name text)CREATE TABLE storm (storm_id number,name text,dates_active text,max_speed number,damage_millions_usd number,number_deaths number) | SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T3.number_deaths >= 10 |
tell me the name of the output patient 018-95228 had for the last time on the first icu visit? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-95228') AND NOT patient.unitdischargetime IS NULL ORDER ... |
What city is east region venue University Hall (University of Virginia) in? | CREATE TABLE table_40696 ("Region" text,"Host" text,"Venue" text,"City" text,"State" text) | SELECT "City" FROM table_40696 WHERE "Region" = 'east' AND "Venue" = 'university hall (university of virginia)' |
What date that was the league position was 1st, and the result F A was 5 0? | CREATE TABLE table_name_29 (date VARCHAR,league_position VARCHAR,result_f___a VARCHAR) | SELECT date FROM table_name_29 WHERE league_position = "1st" AND result_f___a = "5 – 0" |
What score has 1/22 as the date? | CREATE TABLE table_36709 ("Date" text,"Opponent" text,"Score" text,"Record" text,"Television" text) | SELECT "Score" FROM table_36709 WHERE "Date" = '1/22' |
male or female 50 to 90 of age inclusive. | CREATE TABLE table_train_77 ("id" int,"gender" string,"pregnancy_or_lactation" bool,"language" string,"hiv_aids" bool,"age" float,"NOUSE" float) | SELECT * FROM table_train_77 WHERE (gender = 'male' OR gender = 'female') AND (age >= 50 AND age <= 90) |
Name the number of episodes that jim barnes wrote for 1.82 million viewers | CREATE TABLE table_31089 ("No." real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT COUNT("No.") FROM table_31089 WHERE "Written by" = 'Jim Barnes' AND "U.S. viewers (million)" = '1.82' |
What was the gas storage status for the nation that had 'yes' for alternative fuel? | CREATE TABLE table_24565 ("Country" text,"% of imports from Russia" text,"% cut" text,"Diversification" text,"Gas storage" text,"Alternative fuel" text) | SELECT "Gas storage" FROM table_24565 WHERE "Alternative fuel" = 'Yes' |
What is the highest overall number one(s)? | CREATE TABLE table_19542477_8 (number_one_s_ INTEGER) | SELECT MAX(number_one_s_) FROM table_19542477_8 |
What is the Base Fare in the senior/disabled category? | CREATE TABLE table_54999 ("Fare Categories" text,"Base Fares" text,"Day Pass" text,"7-Day Pass" text,"30-Day Pass" text) | SELECT "Base Fares" FROM table_54999 WHERE "Fare Categories" = 'senior/disabled' |
Name the highest Played of Goals Scored smaller than 18 and a Lost larger than 10? | CREATE TABLE table_61253 ("Team" text,"Played" real,"Draw" real,"Lost" real,"Goals Scored" real,"Goals Conceded" real,"Points" text) | SELECT MAX("Played") FROM table_61253 WHERE "Goals Scored" < '18' AND "Lost" > '10' |
What is 03-04, when 95-96 is 337,660? | CREATE TABLE table_40392 ("School year" text,"95-96" text,"99-00" text,"00-01" text,"01-02" text,"02-03" text,"03-04" text,"04-05" text,"05-06" text,"06-07" text) | SELECT "03-04" FROM table_40392 WHERE "95-96" = '337,660' |
What is the Launched which is on 3 may 2001? | CREATE TABLE table_name_31 (launched VARCHAR,date_of_commission VARCHAR) | SELECT launched FROM table_name_31 WHERE date_of_commission = "3 may 2001" |
Unanswered Inactive Questions for a Specific Tag. Inactive questions with no answers for a specific tag (ViewCount ASC) | CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,Is... | SELECT Id AS "post_link", Tags, ViewCount, CreationDate FROM Posts WHERE ParentId IS NULL AND AnswerCount = 0 AND Tags LIKE '<batch-file>' ORDER BY ViewCount LIMIT 100 |
How many wins were there in 2004-05? | CREATE TABLE table_54365 ("Season" text,"Winner" text,"Team" text,"Position" text,"Win #" real) | SELECT "Win #" FROM table_54365 WHERE "Season" = '2004-05' |
What is the winning coach total number if the top team in regular season (points) is the Kansas City Spurs (110 points)? | CREATE TABLE table_26311 ("Year" real,"Winner (number of titles)" text,"Runners-up" text,"Top Team in Regular Season (points)" text,"Top Scorer (points)" text,"Winning Coach" text) | SELECT COUNT("Winning Coach") FROM table_26311 WHERE "Top Team in Regular Season (points)" = 'Kansas City Spurs (110 points)' |
What are the classes that can be taken as PreMajor next semester ? | CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE instructor (instructor... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.prog... |
Bring the number of patients who had laryngoscopy and other tracheoscopy procedures. | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Laryngoscopy and other tracheoscopy" |
can you show me the available flights from BALTIMORE to DALLAS with economy fares | CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE airline (airline_code varchar,airline_name text,note text)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_... | 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, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND fare_basis.economy = 'YES' AND fare.fare_basis... |
What is the location/attendance of the game with a 3-1 record? | CREATE TABLE table_45569 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location/Attendance" text,"Record" text) | SELECT "Location/Attendance" FROM table_45569 WHERE "Record" = '3-1' |
Show the number of cities in each country with a bar chart, sort in asc by the Y please. | CREATE TABLE city (City_ID int,County_ID int,Name text,White real,Black real,Amerindian real,Asian real,Multiracial real,Hispanic real)CREATE TABLE county_public_safety (County_ID int,Name text,Population int,Police_officers int,Residents_per_officer int,Case_burden int,Crime_rate real,Police_force text,Location text) | SELECT T2.Name, COUNT(T2.Name) FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID GROUP BY T2.Name ORDER BY COUNT(T2.Name) |
What is Constellation, when Date Sent is 'September 4, 2001', and when Distance ( ly ) is less than 57.4? | CREATE TABLE table_name_71 (constellation VARCHAR,date_sent VARCHAR,distance___ly__ VARCHAR) | SELECT constellation FROM table_name_71 WHERE date_sent = "september 4, 2001" AND distance___ly__ < 57.4 |
What's the average goal ratio with Goals larger than 1, Games larger than 161, and a Debut in Europe smaller than 1985? | CREATE TABLE table_name_71 (goal_ratio INTEGER,debut_in_europe VARCHAR,goals VARCHAR,games VARCHAR) | SELECT AVG(goal_ratio) FROM table_name_71 WHERE goals > 1 AND games > 161 AND debut_in_europe < 1985 |
Group by all home, show the team id and school id in a scatter plot. | 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_Home |
in 2100 what are the top four most commonly prescribed drugs? | CREATE TABLE diagnoses_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,valueuom text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE charteve... | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE STRFTIME('%y', prescriptions.startdate) = '2100' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 4 |
What information is there on albums from 2010? | CREATE TABLE vocals (songid number,bandmate number,type text)CREATE TABLE performance (songid number,bandmate number,stageposition text)CREATE TABLE band (id number,firstname text,lastname text)CREATE TABLE instruments (songid number,bandmateid number,instrument text)CREATE TABLE tracklists (albumid number,position num... | SELECT * FROM albums WHERE year = 2010 |
The new entries this round was shown to be 12, in which phase would you find this? | CREATE TABLE table_72342 ("Phase" text,"Round" text,"Clubs remaining" real,"Clubs involved" real,"Winners from previous round" text,"New entries this round" text,"Leagues entering at this round" text) | SELECT "Phase" FROM table_72342 WHERE "New entries this round" = '12' |
how many uci europe tour competitions are recorded in the chart ? | CREATE TABLE table_204_4 (id number,"date" text,"race" text,"competition" text,"rider" text,"country" text,"location" text) | SELECT COUNT(*) FROM table_204_4 WHERE "competition" = 'uci europe tour' |
When the total points are 22 how many total touchdowns have been made? | CREATE TABLE table_14342592_5 (touchdowns VARCHAR,points VARCHAR) | SELECT touchdowns FROM table_14342592_5 WHERE points = 22 |
What was the intermediate sprint classification for the race whose winner was Daniel Martin? | CREATE TABLE table_30282 ("Stage" real,"Winner" text,"General classification \u017b\u00f3\u0142ta koszulka" text,"Mountains classification Klasyfikacja g\u00f3rska" text,"Intermediate Sprints Classification Klasyfikacja najaktywniejszych" text,"Points classification Klasyfikacja punktowa" text,"Teams classification" te... | SELECT "Intermediate Sprints Classification Klasyfikacja najaktywniejszych" FROM table_30282 WHERE "Winner" = 'Daniel Martin' |
how many patients were given the drug medium chain triglycerides? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Medium Chain Triglycerides" |
Which Silver has a Nation of china, and a Bronze smaller than 7? | CREATE TABLE table_74951 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Silver") FROM table_74951 WHERE "Nation" = 'china' AND "Bronze" < '7' |
Show the country names and the corresponding number of players in a pie chart. | CREATE TABLE country (Country_id int,Country_name text,Capital text,Official_native_language text)CREATE TABLE player (Player_ID int,Player text,Years_Played text,Total_WL text,Singles_WL text,Doubles_WL text,Team int)CREATE TABLE match_season (Season real,Player text,Position text,Country int,Team int,Draft_Pick_Numbe... | SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name |
When goals conceded is greater than 17 with 37 points, what is the greatest played? | CREATE TABLE table_13095 ("Place" real,"Team" text,"Played" real,"Draw" real,"Lost" real,"Goals Scored" real,"Goals Conceded" real,"Points" real) | SELECT MAX("Played") FROM table_13095 WHERE "Points" = '37' AND "Goals Conceded" > '17' |
What is H/A/N, when Score is 104-109? | CREATE TABLE table_50110 ("Date" text,"H/A/N" text,"Opponent" text,"Score" text,"Record" text) | SELECT "H/A/N" FROM table_50110 WHERE "Score" = '104-109' |
Find the number of the names of swimmers who has a result of 'win', rank by the y-axis in ascending. | CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)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 swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te... | SELECT name, COUNT(name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID WHERE Result = 'Win' GROUP BY name ORDER BY COUNT(name) |
Say the frequency of 1290 khz | CREATE TABLE table_31962 ("Calls" text,"Frequency" text,"Branding" text,"Format" text,"Timeslot" text,"Group owner" text) | SELECT "Format" FROM table_31962 WHERE "Frequency" = '1290 khz' |
Find the number of records of each policy type and its type code Visualize by bar chart, I want to order from high to low by the y axis. | CREATE TABLE Staff (Staff_ID INTEGER,Staff_Details VARCHAR(255))CREATE TABLE Claims_Processing_Stages (Claim_Stage_ID INTEGER,Next_Claim_Stage_ID INTEGER,Claim_Status_Name VARCHAR(255),Claim_Status_Description VARCHAR(255))CREATE TABLE Policies (Policy_ID INTEGER,Customer_ID INTEGER,Policy_Type_Code CHAR(15),Start_Date... | SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code ORDER BY COUNT(*) DESC |
provide me the number of male patients who have lab test item id 51144. | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.itemid = "51144" |
tell me the amount of deliver 2.0 that patient 27703 has received on last month/05. | CREATE TABLE d_labitems (row_id number,itemid number,label 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 number,itemid number,charttime ti... | 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 = 27703)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... |
What is the Format of the September 22, 2008 release with Catalog number RTRADCD491? | CREATE TABLE table_name_41 (format VARCHAR,catalog VARCHAR,date VARCHAR) | SELECT format FROM table_name_41 WHERE catalog = "rtradcd491" AND date = "september 22, 2008" |
calculate the number of patients diagnosed with b-complex defic nec | 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 WHERE diagnoses.short_title = "B-complex defic NEC" |
What team won when the race time was 3:12:30? | CREATE TABLE table_2491 ("Year" real,"Date" text,"Driver" text,"Team" text,"Manufacturer" text,"Laps" text,"Miles (km)" text,"Race Time" text,"Average Speed (mph)" text,"Report" text) | SELECT "Team" FROM table_2491 WHERE "Race Time" = '3:12:30' |
Which location has the most corresponding counties? | CREATE TABLE county_public_safety (county_id number,name text,population number,police_officers number,residents_per_officer number,case_burden number,crime_rate number,police_force text,location text)CREATE TABLE city (city_id number,county_id number,name text,white number,black number,amerindian number,asian number,m... | SELECT location FROM county_public_safety GROUP BY location ORDER BY COUNT(*) DESC LIMIT 1 |
how many patients younger than 85 years of age lab tested for other cells? | 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.age < "85" AND lab.label = "Other Cells" |
Name the number in the series for when the viewers is 7.78 | CREATE TABLE table_72673 ("No. in series" text,"No. in season" text,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (millions)" text) | SELECT "No. in series" FROM table_72673 WHERE "U.S. viewers (millions)" = '7.78' |
what is the maximum bush# with others% being 1.57% | CREATE TABLE table_13608101_1 (bush_number INTEGER,others_percentage VARCHAR) | SELECT MAX(bush_number) FROM table_13608101_1 WHERE others_percentage = "1.57%" |
Find all the campuses opened in 1958. | CREATE TABLE discipline_enrollments (campus number,discipline number,year number,undergraduate number,graduate number)CREATE TABLE enrollments (campus number,year number,totalenrollment_ay number,fte_ay number)CREATE TABLE faculty (campus number,year number,faculty number)CREATE TABLE campuses (id number,campus text,lo... | SELECT campus FROM campuses WHERE year = 1958 |
tell me the age and death status of patient jerry deberry. | 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 demographic.age, demographic.expire_flag FROM demographic WHERE demographic.name = "Jerry Deberry" |
Which rank has 1 silver medal and more than 1 gold medal? | CREATE TABLE table_76047 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT "Rank" FROM table_76047 WHERE "Silver" = '1' AND "Gold" > '1' |
Search number of comments given by keyword.. | 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 c.Text, c.Id AS "comment_link", CreationDate FROM Comments AS c WHERE c.Text LIKE '%##keyword##%' AND LENGTH(c.Text) <= 25 ORDER BY CreationDate DESC LIMIT 100 |
What is the id of the appointment that started most recently? | CREATE TABLE prescribes (physician number,patient number,medication number,date time,appointment number,dose text)CREATE TABLE undergoes (patient number,procedures number,stay number,dateundergoes time,physician number,assistingnurse number)CREATE TABLE trained_in (physician number,treatment number,certificationdate ti... | SELECT appointmentid FROM appointment ORDER BY start DESC LIMIT 1 |
Who was the GTU winning team when the TO winning team was Steve Ross? | CREATE TABLE table_850 ("Rnd" real,"Circuit" text,"GTO Winning Team" text,"GTU Winning Team" text,"TO Winning Team" text,"TU Winning Team" text,"Results" text) | SELECT "GTU Winning Team" FROM table_850 WHERE "TO Winning Team" = 'Steve Ross' |
what is the number of patients whose marital status is single and procedure long title is single internal mammary-coronary artery bypass? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.long_title = "Single internal mammary-coronary artery bypass" |
A bar chart for finding the number of the parties associated with the delegates from district 1 Who served as governors of the parties?, show in desc by the y-axis. | CREATE TABLE party (Party_ID int,Year real,Party text,Governor text,Lieutenant_Governor text,Comptroller text,Attorney_General text,US_Senate text)CREATE TABLE election (Election_ID int,Counties_Represented text,District int,Delegate text,Party int,First_Elected real,Committee text)CREATE TABLE county (County_Id int,Co... | SELECT Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor ORDER BY COUNT(Governor) DESC |
give me the number of patients whose days of hospital stay is greater than 6 and lab test category is blood gas? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "6" AND lab."CATEGORY" = "Blood Gas" |
What is the date when the away team is essendon? | CREATE TABLE table_52959 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_52959 WHERE "Away team" = 'essendon' |
what are the three most commonly ordered laboratory tests for patients who were previously diagnosed with abdmnal pain oth spcf st in the same month, this year? | 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_icd_diagnoses (row_id ... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, 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.i... |
how many hometowns for faisal aden? | CREATE TABLE table_29598261_1 (hometown VARCHAR,name VARCHAR) | SELECT COUNT(hometown) FROM table_29598261_1 WHERE name = "Faisal Aden" |
Name the artist for 7 points | CREATE TABLE table_21378339_5 (artist VARCHAR,televote_points VARCHAR) | SELECT COUNT(artist) FROM table_21378339_5 WHERE televote_points = 7 |
what was the first time until 29 months ago patient 30235 received a bilirubin, total lab test? | 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 d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id numb... | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bilirubin, total') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30235) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME()... |
What are the enrollment dates of all the tests that have result 'Pass', and count them by a bar chart | 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 Student_Tests_Taken (registration_id INTEGER,date_test_... | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" |
How many grids have a Manufacturer of honda, a Rider of yuki takahashi, and more than 22 laps? | CREATE TABLE table_name_8 (grid VARCHAR,laps VARCHAR,manufacturer VARCHAR,rider VARCHAR) | SELECT COUNT(grid) FROM table_name_8 WHERE manufacturer = "honda" AND rider = "yuki takahashi" AND laps > 22 |
Which study included autoimmune disease and inflammation? | CREATE TABLE table_13339 ("Name" text,"Platform" text,"Indication" text,"Status" text,"Collaboration" text) | SELECT "Name" FROM table_13339 WHERE "Indication" = 'autoimmune disease and inflammation' |
Which higher secondary school listing has the lowest total and an Aided amount larger than 14? | CREATE TABLE table_32958 ("Institution" text,"Government" real,"Aided" real,"Unaided" real,"Total" real) | SELECT MIN("Total") FROM table_32958 WHERE "Institution" = 'higher secondary school' AND "Aided" > '14' |
What is From Club, when Player is 'Robinho'? | CREATE TABLE table_name_80 (from_club VARCHAR,player VARCHAR) | SELECT from_club FROM table_name_80 WHERE player = "robinho" |
How many call signs does the location masinloc, zambales have? | CREATE TABLE table_3798 ("Branding" text,"Callsign" text,"Frequency" text,"Power (kW)" text,"Location" text) | SELECT COUNT("Callsign") FROM table_3798 WHERE "Location" = 'Masinloc, Zambales' |
Papers written by kurtis heimerl | CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE field (fieldid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE cite (... | SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'kurtis heimerl' AND writes.authorid = author.authorid |
What is the minimum population of the region in which Roskilde is the largest city? | CREATE TABLE table_20641 ("Danish name" text,"English name" text,"Seat of administration" text,"Largest city" text,"Population (January 1,2008)" real,"Area (km\u00b2)" real,"Pop. density (per km\u00b2)" text) | SELECT MIN("Population (January 1, 2008)") FROM table_20641 WHERE "Largest city" = 'Roskilde' |
what was the maximum value for respiration for patient 022-187132 during yesterday? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,obs... | SELECT MAX(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-187132')) AND NOT vitalperiodic.respiration IS... |
What was the event for vinny magalh es? | CREATE TABLE table_name_74 (event VARCHAR,opponent VARCHAR) | SELECT event FROM table_name_74 WHERE opponent = "vinny magalhães" |
What is the Money of the Player in Place 5? | CREATE TABLE table_name_37 (money___ INTEGER,place VARCHAR) | SELECT SUM(money___) AS $__ FROM table_name_37 WHERE place = "5" |
How many flights with price higher than 300 for each destination city? Return a bar chart, I want to show X-axis from high to low order. | CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),departure_date date,arrival_date date,price number(7,2),aid number(9,0))CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,0))CREATE TABLE certificate (eid number(9,0),aid number(9,0))CREATE T... | SELECT destination, COUNT(destination) FROM flight WHERE price > 300 GROUP BY destination ORDER BY destination DESC |
what is the total number of runner ups listed on the chart ? | CREATE TABLE table_204_724 (id number,"outcome" text,"no." number,"date" text,"tournament" text,"surface" text,"partner" text,"opponents in the final" text,"score in the final" text) | SELECT COUNT(*) FROM table_204_724 WHERE "outcome" = 'runner-up' |
Which Semifinalists have a Finalist of andrei chesnokov? | CREATE TABLE table_50565 ("Tournament" text,"Surface" text,"Week" text,"Winner and score" text,"Finalist" text,"Semifinalists" text) | SELECT "Semifinalists" FROM table_50565 WHERE "Finalist" = 'andrei chesnokov' |
What is the Player that has a To standard of 4, and a Score of 74-70-68=212? | CREATE TABLE table_8461 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Player" FROM table_8461 WHERE "To par" = '–4' AND "Score" = '74-70-68=212' |
How many Games Started are there for Hugh White ? | CREATE TABLE table_1005 ("Player" text,"Position" text,"Games started" text,"Hometown" text,"Height" text,"Weight" real,"Class" text,"Prior experience" text) | SELECT "Games started" FROM table_1005 WHERE "Player" = 'Hugh White' |
What is the call frequency sign of cjjc-fm? | CREATE TABLE table_31719 ("Frequency" text,"Call sign" text,"Branding" text,"Format" text,"Owner" text) | SELECT "Frequency" FROM table_31719 WHERE "Call sign" = 'cjjc-fm' |
If the opponent is the Stampeders, what is the record? | CREATE TABLE table_2968 ("Week" real,"Date" text,"Opponent" text,"Location" text,"Final Score" text,"Attendance" real,"Record" text) | SELECT "Record" FROM table_2968 WHERE "Opponent" = 'Stampeders' |
What are the first names of students studying in room 107? | CREATE TABLE list (firstname VARCHAR,classroom VARCHAR) | SELECT DISTINCT firstname FROM list WHERE classroom = 107 |
how many days have elapsed since patient 5828 was admitted to the intensive care unit currently? | 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 d_items (row_id number,itemid number,label te... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828) AND icustays.outtime IS NULL |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.