instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Visualize a bar chart for what are the district names and city populations for all districts that between 200,000 and 2,000,000 residents?, show by the City_Population in ascending. | CREATE TABLE district (District_ID int,District_name text,Headquartered_City text,City_Population real,City_Area real)CREATE TABLE store_product (Store_ID int,Product_ID int)CREATE TABLE store_district (Store_ID int,District_ID int)CREATE TABLE store (Store_ID int,Store_Name text,Type text,Area_size real,Number_of_prod... | SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000 ORDER BY City_Population |
What are the high rebounds in the 45 game? | CREATE TABLE table_27734577_8 (high_rebounds VARCHAR,game VARCHAR) | SELECT high_rebounds FROM table_27734577_8 WHERE game = 45 |
In what round was the loss at ufc 118? | CREATE TABLE table_name_92 (round VARCHAR,res VARCHAR,event VARCHAR) | SELECT round FROM table_name_92 WHERE res = "loss" AND event = "ufc 118" |
when did patient 3516 receive the first calculated total co2 lab test until 42 months ago? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id... | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3516) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIM... |
let me know the number of patients who had other open incisional hernia repair with graft or prosthesis and blood lab test. | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Other open incisional hernia repair with graft or prosthesis" AND lab.fluid = "Blood" |
calculate the number of patients on elective admission who had a lab test for lactate | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Lactate" |
What Year has a Rank of 12.0 12? | CREATE TABLE table_name_52 (year INTEGER,rank VARCHAR) | SELECT AVG(year) FROM table_name_52 WHERE rank = "12.0 12" |
Copy editor' and 'Strunk & White' badges progress. You need 500 edited posts to get 'Copy editor' badge and 80 edits to get 'Strunk & White' badge | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE CloseA... | SELECT PostId FROM PostHistory LEFT JOIN Posts AS Post ON PostHistory.PostId = Post.Id WHERE UserId = @user AND Post.OwnerUserId != @user GROUP BY PostId |
What was the overall record in the season where average attendance was 16720? | CREATE TABLE table_3839 ("Season" text,"Overall Record" text,"SEC Record" text,"Overall Attendance" real,"Average Attendance" real,"Rank Nationally" text) | SELECT "Overall Record" FROM table_3839 WHERE "Average Attendance" = '16720' |
Find the number of rooms for each bed type Visualize by bar chart, and could you list by the bedType in desc? | CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER)CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT) | SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY bedType DESC |
How many points for maserati v12 engines in 1968? | CREATE TABLE table_51711 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT COUNT("Points") FROM table_51711 WHERE "Engine" = 'maserati v12' AND "Year" = '1968' |
tell me the age and birth date of patient john gartman. | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT demographic.age, demographic.dob FROM demographic WHERE demographic.name = "John Gartman" |
What is the percentage for manhattan 45,901? | CREATE TABLE table_16446 ("1973 Democratic initial primary" text,"Manhattan" text,"The Bronx" text,"Brooklyn" text,"Queens" text,"Richmond [Staten Is.]" text,"Total" real,"%" text) | SELECT COUNT("%") FROM table_16446 WHERE "Manhattan" = '45,901' |
What is the largest area in Alaska with a population of 39 and rank over 19? | CREATE TABLE table_75330 ("Rank" real,"Island's Name" text,"Area (sqmi)" real,"Area (km 2)" real,"Location" text,"Population (2000)" text) | SELECT MAX("Area (km 2 )") FROM table_75330 WHERE "Location" = 'alaska' AND "Population (2000)" = '39' AND "Rank" > '19' |
Give me the comparison about Team_ID over the All_Home , and group by attribute ACC_Home by a bar chart, and order bars in desc order. | 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 All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home DESC |
What is the navigator for James? | CREATE TABLE table_63884 ("Driver" text,"Navigator" text,"Vehicle" text,"Class" text,"Capacity" real,"Total Time" text,"Margin" text) | SELECT "Navigator" FROM table_63884 WHERE "Driver" = 'james' |
For which country does Keith Fergus play? | CREATE TABLE table_1515346_2 (country VARCHAR,player VARCHAR) | SELECT country FROM table_1515346_2 WHERE player = "Keith Fergus" |
What are the details of the project with no outcomes? | CREATE TABLE staff_roles (role_code text,role_description text)CREATE TABLE research_outcomes (outcome_code text,outcome_description text)CREATE TABLE organisations (organisation_id number,organisation_type text,organisation_details text)CREATE TABLE research_staff (staff_id number,employer_organisation_id number,staff... | SELECT project_details FROM projects WHERE NOT project_id IN (SELECT project_id FROM project_outcomes) |
What were the high points for the game played at the MCI Center? | CREATE TABLE table_22687 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location" text,"Record" text) | SELECT COUNT("High points") FROM table_22687 WHERE "Location" = 'MCI Center' |
\What is the class of the station with the call sign w254ah? | CREATE TABLE table_71453 ("Call sign" text,"Frequency MHz" real,"City of license" text,"ERP W" real,"Class" text,"FCC info" text) | SELECT "Class" FROM table_71453 WHERE "Call sign" = 'w254ah' |
What is the average high temperature for each day of week? | CREATE TABLE station (id number,network_name text,services text,local_authority text)CREATE TABLE train (id number,train_number number,name text,origin text,destination text,time text,interval text)CREATE TABLE weekly_weather (station_id number,day_of_week text,high_temperature number,low_temperature number,precipitati... | SELECT AVG(high_temperature), day_of_week FROM weekly_weather GROUP BY day_of_week |
What is the highest Cycle, when the Number of Constestants is 11, and when Premiere Date is September 3, 2012? | CREATE TABLE table_name_57 (cycle INTEGER,number_of_contestants VARCHAR,premiere_date VARCHAR) | SELECT MAX(cycle) FROM table_name_57 WHERE number_of_contestants = "11" AND premiere_date = "september 3, 2012" |
What was the state with the total electricity generated is 38380 gw-h? | CREATE TABLE table_27480 ("Rank" real,"Rank w/o Hydropower" real,"State" text,"% Renewable" text,"% Renewable w/o Hydro" text,"Renewable electricity (GW\u00b7h)" real,"Renewable electricity w/o Hydro (GW\u00b7h)" real,"Total electricity (GW\u00b7h)" real) | SELECT "State" FROM table_27480 WHERE "Total electricity (GW\u00b7h)" = '38380' |
where are some restaurants good for arabic food in mountain view ? | CREATE TABLE restaurant (id int,name varchar,food_type varchar,city_name varchar,rating "decimal)CREATE TABLE location (restaurant_id int,house_number int,street_name varchar,city_name varchar)CREATE TABLE geographic (city_name varchar,county varchar,region varchar) | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 |
What kansas vs. that has w 2 as the current streak, and 31 as games played? | CREATE TABLE table_7616 ("Kansas State vs." text,"Games played" text,"Overall Record" text,"Last 5 Meetings" text,"Last 10 Meetings" text,"Current Streak" text,"Last Meeting" text) | SELECT "Kansas State vs." FROM table_7616 WHERE "Current Streak" = 'w 2' AND "Games played" = '31' |
what is the number of patients whose marital status is single and ethnicity is american indian/alaska native? | 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 text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" |
What Investing Dragons had a request of 100,000? | CREATE TABLE table_name_87 (investing_dragon_s_ VARCHAR,money_requested__£_ VARCHAR) | SELECT investing_dragon_s_ FROM table_name_87 WHERE money_requested__£_ = "100,000" |
What was the date of the game that was played against the away team of York City? | CREATE TABLE table_38642 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Attendance" text) | SELECT "Attendance" FROM table_38642 WHERE "Away team" = 'york city' |
so whats the first weight of patient 033-32465 during the first hospital encounter? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,... | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-32465' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY p... |
Which channels are not owned by CCTV? Give me the channel names. | CREATE TABLE broadcast (channel_id number,program_id number,time_of_day text)CREATE TABLE program (program_id number,name text,origin text,launch number,owner text)CREATE TABLE channel (channel_id number,name text,owner text,share_in_percent number,rating_in_percent number)CREATE TABLE broadcast_share (channel_id numbe... | SELECT name FROM channel WHERE owner <> 'CCTV' |
Which Attendance has an Opponent of crawley town? | CREATE TABLE table_39193 ("Round" text,"Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real) | SELECT "Attendance" FROM table_39193 WHERE "Opponent" = 'crawley town' |
What was her lowest final score with a qualifying score of 74.075? | CREATE TABLE table_79564 ("Year" real,"Competition Description" text,"Location" text,"Apparatus" text,"Rank-Final" text,"Score-Final" real,"Rank-Qualifying" text,"Score-Qualifying" real) | SELECT MIN("Score-Final") FROM table_79564 WHERE "Score-Qualifying" = '74.075' |
For each headquarter, what are the headquarter and how many companies are centered there Visualize by bar chart, and order names in descending order. | CREATE TABLE company (Company_ID int,Rank int,Company text,Headquarters text,Main_Industry text,Sales_billion real,Profits_billion real,Assets_billion real,Market_Value real)CREATE TABLE station_company (Station_ID int,Company_ID int,Rank_of_the_Year int)CREATE TABLE gas_station (Station_ID int,Open_Year int,Location t... | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters DESC |
is patient 027-24468's heartrate measured at 2102-07-26 22:17:35 greater than measured at 2102-07-26 22:12:35? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE cost (costid number,uniquepid text,patientheal... | SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-24468')) AND NOT vitalperiodic.heartrate IS N... |
What intelligent systems courses are prerequisites for 590 ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE semester (semester_id int,semester varchar,year int... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.pre_course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.course_id INNER JOIN area ON COURSE_0.course_id = area.course_id ... |
What is the total silver when bronze is smaller than 0? | CREATE TABLE table_6348 ("Country" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT COUNT("Silver") FROM table_6348 WHERE "Bronze" < '0' |
Who were the starting actors in the time frame of tuesday 22:00~22:54 8 april 2008 to 17 june 2008? | CREATE TABLE table_73024 ("Japanese Title" text,"Romaji Title" text,"TV Station" text,"Time Frame" text,"Starring Actors" text,"Theme Song(s)" text,"Episodes" real,"Average Ratings" text) | SELECT "Starring Actors" FROM table_73024 WHERE "Time Frame" = 'Tuesday 22:00~22:54 8 April 2008 to 17 June 2008' |
how many patients are staying at ward 490 until 2104? | 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(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 490 AND STRFTIME('%y', patient.unitadmittime) <= '2104' |
How many documents can one grant have at most? List the grant id and number. | CREATE TABLE project_staff (staff_id number,project_id number,role_code text,date_from time,date_to time,other_details text)CREATE TABLE organisations (organisation_id number,organisation_type text,organisation_details text)CREATE TABLE organisation_types (organisation_type text,organisation_type_description text)CREAT... | SELECT grant_id, COUNT(*) FROM documents GROUP BY grant_id ORDER BY COUNT(*) DESC LIMIT 1 |
what is the number of singles that went gold ? | CREATE TABLE table_203_799 (id number,"year" number,"date" text,"title" text,"format(s)" text,"award description(s)" text,"result(s)" text) | SELECT COUNT("title") FROM table_203_799 WHERE "award description(s)" = 'gold' |
give me the number of patients whose primary disease is neoplasm of uncertain behavior of other lymphatic and hematopoietic tissues\bone marrow transplant and year of death is less than or equal to 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.diagnosis = "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT" AND demographic.dod_year <= "2112.0" |
give me the number of patients whose drug name is hydrocortisone oint 0.5%? | 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 = "Hydrocortisone Oint 0.5%" |
What Chassis did Team BMS Scuderia Italia use with G Tyres and a Ferrari 037 3.5 v12 engine? | CREATE TABLE table_15557 ("Year" real,"Team" text,"Chassis" text,"Engine" text,"Tyres" text,"Points" real) | SELECT "Chassis" FROM table_15557 WHERE "Team" = 'bms scuderia italia' AND "Tyres" = 'g' AND "Engine" = 'ferrari 037 3.5 v12' |
What are the averge score of students in NC and in NY? | CREATE TABLE finrev_fed_key_17 (state_code number,state text,#_records text)CREATE TABLE finrev_fed_17 (state_code number,idcensus number,school_district text,nces_id text,yr_data number,t_fed_rev number,c14 number,c25 number)CREATE TABLE ndecoreexcel_math_grade8 (year number,state text,all_students text,average_scale_... | SELECT average_scale_score FROM ndecoreexcel_math_grade8 WHERE state = "North Carolina" UNION SELECT average_scale_score FROM ndecoreexcel_math_grade8 WHERE state = "New York" |
name only the stations that have connections to other lines . | CREATE TABLE table_203_273 (id number,"name" text,"japanese" text,"distance\n(km)" number,"connections" text,"location" text) | SELECT "name" FROM table_203_273 WHERE NOT "connections" IS NULL |
Comments where Users can't spell my Alias. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName ... | SELECT C.Id, C.Text FROM dbo.Posts AS P JOIN dbo.Comments AS C ON P.Id = C.PostId JOIN dbo.Users AS U ON P.OwnerUserId = U.Id WHERE C.CreationDate >= '20180101' AND U.DisplayName != 'Lamu' AND C.Text LIKE '%@Lamu%' AND NOT EXISTS(SELECT 1 FROM dbo.Comments AS Csq JOIN dbo.Users AS Usq ON Csq.UserId = Usq.Id WHERE U.Dis... |
What is the 2011 value of the paris masters, which had A in 2008, A in 2012, A in 2009? | CREATE TABLE table_name_34 (tournament VARCHAR) | SELECT 2011 FROM table_name_34 WHERE 2008 = "a" AND 2012 = "a" AND 2009 = "a" AND tournament = "paris masters" |
What shows at 9:00 am that has a 3:30 pm of passions? | CREATE TABLE table_61200 ("7:00 am" text,"7:30 am" text,"8:00 am" text,"9:00 am" text,"11:00 am" text,"noon" text,"12:30 pm" text,"1:00 pm" text,"1:30 pm" text,"2:00 pm" text,"3:00 pm" text,"3:30 pm" text,"4:00 pm" text,"4:30 pm" text,"5:00 pm" text,"6:30 pm" text) | SELECT "9:00 am" FROM table_61200 WHERE "3:30 pm" = 'passions' |
Show the countries that have managers of age above 50 or below 46, and count them by a bar chart | CREATE TABLE train (Train_ID int,Train_Num text,Name text,From text,Arrival text,Railway_ID int)CREATE TABLE railway (Railway_ID int,Railway text,Builder text,Built text,Wheels text,Location text,ObjectNumber text)CREATE TABLE railway_manage (Railway_ID int,Manager_ID int,From_Year text)CREATE TABLE manager (Manager_ID... | SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country |
What is the number of Games for the player in Rank 3? | CREATE TABLE table_name_21 (games INTEGER,rank VARCHAR) | SELECT MAX(games) FROM table_name_21 WHERE rank = 3 |
What is the highest Total for Australia? | CREATE TABLE table_14481 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real) | SELECT MAX("Total") FROM table_14481 WHERE "Country" = 'australia' |
when 69 is the episode number what is the air date? | CREATE TABLE table_28967275_3 (original_air_date VARCHAR,episode__number VARCHAR) | SELECT original_air_date FROM table_28967275_3 WHERE episode__number = 69 |
what flights go from PHILADELPHIA to SAN FRANCISCO with a stopover in DALLAS | CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,gro... | 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, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT... |
What was the result in the Tennessee 6 district election? | CREATE TABLE table_18625 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Result" FROM table_18625 WHERE "District" = 'Tennessee 6' |
What episode number in the series originally aired on April 27, 1999? | CREATE TABLE table_25511 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text) | SELECT MAX("No. in series") FROM table_25511 WHERE "Original air date" = 'April 27, 1999' |
What are the different card types, and how many transactions have been made with each Visualize by bar chart, I want to order in desc by the Y-axis. | CREATE TABLE Customers_Cards (card_id INTEGER,customer_id INTEGER,card_type_code VARCHAR(15),card_number VARCHAR(80),date_valid_from DATETIME,date_valid_to DATETIME,other_card_details VARCHAR(255))CREATE TABLE Customers (customer_id INTEGER,customer_first_name VARCHAR(20),customer_last_name VARCHAR(20),customer_address... | SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code ORDER BY COUNT(*) DESC |
when has patient 25814 been prescribed medication for the first time since 11/2102 via ir route? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)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... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25814) AND prescriptions.route = 'ir' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2102-11' ORDER BY prescriptions.startdate LIMIT 1 |
What is the country/region for the releases from Beat Records? | CREATE TABLE table_name_9 (country_region VARCHAR,label VARCHAR) | SELECT country_region FROM table_name_9 WHERE label = "beat records" |
what was the three most frequent specimen test performed until 2103? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE microlab (microlabid number,patientunitstayid nu... | SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) <= '2103' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 3 |
What state has colony as a status and shippensburg university as the school? | CREATE TABLE table_name_71 (state VARCHAR,status VARCHAR,school VARCHAR) | SELECT state FROM table_name_71 WHERE status = "colony" AND school = "shippensburg university" |
has tpn d17.5 been administered to patient 29666 in 04/this year? | 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 number,chargetime time,cost number)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE transfers (row_id number,subject_id number,... | 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 = 29666)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn d17.... |
how many patients are below 51 years of age and admitted before the year 2177? | 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.age < "51" AND demographic.admityear < "2177" |
What is the name of the Loser when the winner was new england patriots, and a Location of giants stadium, and a Result of 30 28? | CREATE TABLE table_name_46 (loser VARCHAR,result VARCHAR,winner VARCHAR,location VARCHAR) | SELECT loser FROM table_name_46 WHERE winner = "new england patriots" AND location = "giants stadium" AND result = "30–28" |
How many draws took place for team Corinthians with more than 5 losses? | CREATE TABLE table_name_81 (drawn VARCHAR,team VARCHAR,lost VARCHAR) | SELECT COUNT(drawn) FROM table_name_81 WHERE team = "corinthians" AND lost > 5 |
list the number of newborn patients who are female. | 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.gender = "F" AND demographic.diagnosis = "NEWBORN" |
What was the season that the runner -up was Tenley Molzahn? | CREATE TABLE table_name_34 (season INTEGER,runner_s__up VARCHAR) | SELECT SUM(season) FROM table_name_34 WHERE runner_s__up = "tenley molzahn" |
For those records from the products and each product's manufacturer, give me the comparison about the average of manufacturer over the founder , and group by attribute founder by a bar chart, and could you sort Y-axis in ascending order? | 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 Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Manufacturer) |
What was the score when 2441 people were in attendance? | CREATE TABLE table_name_17 (score VARCHAR,attendance VARCHAR) | SELECT score FROM table_name_17 WHERE attendance = 2441 |
what is the scoreboard when karen was 4.5 | CREATE TABLE table_19744915_3 (scoreboard VARCHAR,karen VARCHAR) | SELECT scoreboard FROM table_19744915_3 WHERE karen = "4.5" |
Which name is 51.89 (2.043) long? | CREATE TABLE table_name_57 (name VARCHAR,length VARCHAR) | SELECT name FROM table_name_57 WHERE length = "51.89 (2.043)" |
what is days of hospital stay of subject id 1121? | 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 text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT demographic.days_stay FROM demographic WHERE demographic.subject_id = "1121" |
what is the number of days elapsed since patient 033-22108's intensive care unit admission? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientuni... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '033-22108' AND patient.unitdischargetime IS NULL |
What was the highest crowd size at Windy Hill? | CREATE TABLE table_4845 ("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_4845 WHERE "Venue" = 'windy hill' |
What is the sum of Rank, when Bronze is less than 1, when Nation is Switzerland (SUI), and when Total is less than 2? | CREATE TABLE table_49089 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Rank") FROM table_49089 WHERE "Bronze" < '1' AND "Nation" = 'switzerland (sui)' AND "Total" < '2' |
Where was the shot pct 78? | CREATE TABLE table_21093403_1 (locale VARCHAR,shot_pct VARCHAR) | SELECT locale FROM table_21093403_1 WHERE shot_pct = 78 |
What is the average grid that has a Constructor of brm, tony maggs, and a Laps larger than 102? | CREATE TABLE table_51848 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT AVG("Grid") FROM table_51848 WHERE "Constructor" = 'brm' AND "Driver" = 'tony maggs' AND "Laps" > '102' |
Which label is dated February 14, 2002? | CREATE TABLE table_79941 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text) | SELECT "Label" FROM table_79941 WHERE "Date" = 'february 14, 2002' |
In the district called Tennessee 6, how many in total of first elected are there? | CREATE TABLE table_18244 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT COUNT("First elected") FROM table_18244 WHERE "District" = 'Tennessee 6' |
Give the number of patietns whose religion is Romanian East. Orth and who were born before the year the 2078. | 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.religion = "ROMANIAN EAST. ORTH" AND demographic.dob_year < "2078" |
What is the total round with an overall of 199 with sweden? | CREATE TABLE table_name_65 (round INTEGER,nationality VARCHAR,overall VARCHAR) | SELECT SUM(round) FROM table_name_65 WHERE nationality = "sweden" AND overall = 199 |
what are the hospital admission times of patient 015-100195 in 2105? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayi... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '015-100195' AND STRFTIME('%y', patient.hospitaladmittime) = '2105' |
Which mountains classification is listed under stage 3? | CREATE TABLE table_29314 ("Stage" real,"Stage winner" text,"General classification" text,"Points classification" text,"Mountains classification" text,"Asian rider classification" text,"Team classification" text) | SELECT "Mountains classification" FROM table_29314 WHERE "Stage" = '3' |
Name the 20 questions for 8-04 | CREATE TABLE table_20248 ("Date" text,"Cover model" text,"Centerfold model" text,"Interview subject" text,"20 Questions" text,"Pictorials" text) | SELECT "20 Questions" FROM table_20248 WHERE "Date" = '8-04' |
Which Outcome has a Score in the final of 3 6, 1 6? | CREATE TABLE table_13030 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score in the final" text) | SELECT "Outcome" FROM table_13030 WHERE "Score in the final" = '3–6, 1–6' |
Who was the player who was pick number 147? | CREATE TABLE table_77289 ("Round" real,"Pick" real,"Player" text,"Position" text,"School" text) | SELECT "Player" FROM table_77289 WHERE "Pick" = '147' |
have an hba1c lvel < 9 % at screening | CREATE TABLE table_train_227 ("id" int,"gender" string,"diabetic" string,"allergic_to_study_products" bool,"hba1c" float,"a1c" float,"age" float,"NOUSE" float) | SELECT * FROM table_train_227 WHERE hba1c < 9 |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a line chart about the change of manager_id over hire_date . | CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE jobs (JOB_ID v... | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
What are the dates in which the mean sea level pressure was between 303 and 31, and count them by a bar chart, order in ascending by the Y-axis. | CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time TEXT)CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_i... | SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date) |
What country has deltamac (hk) as the publisher? | CREATE TABLE table_6005 ("Release date" text,"Country" text,"Classifaction" text,"Publisher" text,"Format" text,"Region" text,"Language" text,"Sound" text,"Subtitles" text) | SELECT "Country" FROM table_6005 WHERE "Publisher" = 'deltamac (hk)' |
What's the most league cup apps for Jimmy Lawson having 0 league cup goals? | CREATE TABLE table_name_74 (league_cup_apps INTEGER,league_cup_goals VARCHAR,name VARCHAR) | SELECT MAX(league_cup_apps) FROM table_name_74 WHERE league_cup_goals = 0 AND name = "jimmy lawson" |
Mame the reg season for 2001 | CREATE TABLE table_2511876_1 (reg_season VARCHAR,year VARCHAR) | SELECT reg_season FROM table_2511876_1 WHERE year = 2001 |
How many election results are there from the 19th district? | CREATE TABLE table_72454 ("District" text,"Incumbent" text,"Party" text,"Elected" real,"Status" text,"2007 Result" text) | SELECT COUNT("2007 Result") FROM table_72454 WHERE "District" = '19th' |
What is Marplan, when Gallup is 1.5% | CREATE TABLE table_name_55 (marplan VARCHAR,gallup VARCHAR) | SELECT marplan FROM table_name_55 WHERE gallup = "1.5%" |
What is the name of the element with isotopic mass of 158.925 34(2)? | CREATE TABLE table_15366768_1 (element VARCHAR,isotopic_mass___u__ VARCHAR) | SELECT element FROM table_15366768_1 WHERE isotopic_mass___u__ = "158.925 34(2)" |
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTME... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
how old is patient 006-50368 on their first hospital encounter? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text... | SELECT patient.age FROM patient WHERE patient.uniquepid = '006-50368' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1 |
When did crawfordsville join? | CREATE TABLE table_name_10 (year_joined INTEGER,location VARCHAR) | SELECT MAX(year_joined) FROM table_name_10 WHERE location = "crawfordsville" |
In what season did Bob Pratt play? | CREATE TABLE table_name_86 (season VARCHAR,player VARCHAR) | SELECT season FROM table_name_86 WHERE player = "bob pratt" |
Name the least bronze for silver being less than 0 | CREATE TABLE table_69735 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MIN("Bronze") FROM table_69735 WHERE "Silver" < '0' |
What is the area in kilometers squared the population density is 137.61? | CREATE TABLE table_991 ("Name" text,"Population (2002 census)" real,"Population (2007 estimation)" real,"Population (2011 census)" real,"Area (km\u00b2)" text,"Density (pop/km\u00b2)" text) | SELECT "Area (km\u00b2)" FROM table_991 WHERE "Density (pop/km\u00b2)" = '137.61' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.