instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
how many patient admitted urgently in hospital have been prescribed the drug with code clin1000i? | 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 demographic.admission_type = "URGENT" AND prescriptions.formulary_drug_cd = "CLIN1000I" |
What is the score of player mark hayes? | CREATE TABLE table_10055 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Score" FROM table_10055 WHERE "Player" = 'mark hayes' |
how many hours does it have been since the first time patient 007-15837 stayed in ward 428 on the current hospital encounter? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosag... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '007-15837' AND patient.wardid = 428 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1 |
what is the mascot of st. paul's school? | CREATE TABLE table_2439728_1 (mascot VARCHAR,school VARCHAR) | SELECT mascot FROM table_2439728_1 WHERE school = "St. Paul's school" |
What is the 9am program on the channel that shows Power Rangers in Space at 4pm? | CREATE TABLE table_12248 ("7:00 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_12248 WHERE "4:00 pm" = 'power rangers in space' |
What was the Tyre for 19 January? | CREATE TABLE table_name_95 (tyre VARCHAR,date VARCHAR) | SELECT tyre FROM table_name_95 WHERE date = "19 january" |
what were the three most frequent laboratory tests since 2100 for patients with age 50s? | 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 diagnosis (diagnosisid number,patientunitstayi... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND STRFTIME('%y', lab.labresulttime) >= '2100' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 3 |
What film was the director william a. wellman, later than 1931 with a leading man of george brent, and a Role of joan gordon, aka francine la rue? | CREATE TABLE table_name_54 (film VARCHAR,role VARCHAR,leading_man VARCHAR,director VARCHAR,year VARCHAR) | SELECT film FROM table_name_54 WHERE director = "william a. wellman" AND year > 1931 AND leading_man = "george brent" AND role = "joan gordon, aka francine la rue" |
In how many locations was the episode with the Bailey family filmed? | CREATE TABLE table_23390 ("No. in series" text,"No. in season" real,"Family/families" text,"Location(s)" text,"Original air date" text) | SELECT COUNT("Location(s)") FROM table_23390 WHERE "Family/families" = 'The Bailey Family' |
What number episode in the season was titled 'Shattered'? | CREATE TABLE table_4237 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT MAX("Season #") FROM table_4237 WHERE "Title" = 'Shattered' |
What was the highest number of losses for a position less than 6, with more than 11 wins and 36 points, with a played entry of more than 30? | CREATE TABLE table_name_59 (losses INTEGER,played VARCHAR,points VARCHAR,position VARCHAR,wins VARCHAR) | SELECT MAX(losses) FROM table_name_59 WHERE position < 6 AND wins > 11 AND points = 36 AND played > 30 |
How many have been replaced where the appointment date is 10 December 2007 and the manner of departure is quit? | CREATE TABLE table_11713303_2 (replaced_by VARCHAR,date_of_appointment VARCHAR,manner_of_departure VARCHAR) | SELECT COUNT(replaced_by) FROM table_11713303_2 WHERE date_of_appointment = "10 December 2007" AND manner_of_departure = "Quit" |
how many patients who primarily diagnosed for coronary artery disease or coronary artery bypass graft /sda died in or before the year 2112? | 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 WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.dod_year <= "2112.0" |
What was the result of the fight when Tetsuji Kato's record was 19-9? | CREATE TABLE table_49095 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Location" text) | SELECT "Res." FROM table_49095 WHERE "Record" = '19-9' |
Sources and edits with <i>. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostI... | SELECT PostHistoryTypeId, PostId AS "post_link", CreationDate, Comment, Text FROM PostHistory WHERE PostHistoryTypeId IN (2, 5) AND Text LIKE '%<i>%' ORDER BY CreationDate DESC |
Name the package/option for number being 543 | CREATE TABLE table_15887683_8 (package_option VARCHAR,n° VARCHAR) | SELECT package_option FROM table_15887683_8 WHERE n° = 543 |
what is age of subject id 2560? | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT demographic.age FROM demographic WHERE demographic.subject_id = "2560" |
What is the sum of tonnage with a time at 00:10 and less than 42 casualties? | CREATE TABLE table_7356 ("Date" text,"Time" text,"Name" text,"Flag" text,"Casualties" real,"Tonnage (GRT)" real,"Cargo" text,"Sunk by..." text) | SELECT SUM("Tonnage (GRT)") FROM table_7356 WHERE "Time" = '00:10' AND "Casualties" < '42' |
show me the top five most commonly prescribed drugs for patients over the age of 60 or above in this year? | CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE admissions (row_id n... | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0... |
what is lab test abnormal status of subject id 2560? | 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 lab.flag FROM lab WHERE lab.subject_id = "2560" |
What is the Att-Cmp-Int for the player with a efficiency of 117.4? | CREATE TABLE table_name_72 (att_cmp_int VARCHAR,effic VARCHAR) | SELECT att_cmp_int FROM table_name_72 WHERE effic = 117.4 |
What is the original air date of the episode directed by Terrence Nightingall? | CREATE TABLE table_17356205_1 (original_air_date VARCHAR,directed_by VARCHAR) | SELECT original_air_date FROM table_17356205_1 WHERE directed_by = "Terrence Nightingall" |
What's the mountains classification when the points classification is Alessandro Petacchi and the general classification is Danilo Di Luca? | CREATE TABLE table_13638 ("Stage" text,"Winner" text,"General classification" text,"Points classification" text,"Mountains classification" text,"Young rider classification" text) | SELECT "Mountains classification" FROM table_13638 WHERE "Points classification" = 'alessandro petacchi' AND "General classification" = 'danilo di luca' |
how many counties have a population greater than 500,000 ? | CREATE TABLE table_204_778 (id number,"code" number,"county" text,"former province" text,"area (km2)" number,"population\ncensus 2009" number,"capital" text) | SELECT COUNT("county") FROM table_204_778 WHERE "population\ncensus 2009" > 500000 |
what's the win with points for being 376 | CREATE TABLE table_12828723_3 (won VARCHAR,points_for VARCHAR) | SELECT won FROM table_12828723_3 WHERE points_for = "376" |
When did Masthead Studios release their game? | CREATE TABLE table_43620 ("Developer(s)" text,"Release date" text,"Required OS" text,"Genre" text,"Type" text) | SELECT "Release date" FROM table_43620 WHERE "Developer(s)" = 'masthead studios' |
Which manager was replaced by Thomas Thomasberg? | CREATE TABLE table_29968 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text,"Position in table" text) | SELECT "Outgoing manager" FROM table_29968 WHERE "Replaced by" = 'Thomas Thomasberg' |
In what week(s) did the Broncos go up against the Cleveland Browns? | CREATE TABLE table_name_99 (week INTEGER,opponent VARCHAR) | SELECT SUM(week) FROM table_name_99 WHERE opponent = "cleveland browns" |
Number of Questions after introducing bounties to SO. | CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time... | SELECT COUNT(Id) FROM Posts WHERE CreationDate >= '2009-01-27' AND PostTypeId = 1 |
Who played hte home team when the score was 2:1? | CREATE TABLE table_44023 ("Date" text,"Home" text,"Score" text,"Away" text,"Attendance" real) | SELECT "Home" FROM table_44023 WHERE "Score" = '2:1' |
What is the average of all the years when the notes are electronics brand? | CREATE TABLE table_33724 ("Year" real,"Kit Supplier" text,"Sponsor" text,"Shirt Printing" text,"Notes" text) | SELECT AVG("Year") FROM table_33724 WHERE "Notes" = 'electronics brand' |
Questions per month, container stuff. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREAT... | SELECT *, COUNT(*) FROM (SELECT DATE(CAST(TIME_TO_STR(CreationDate, '%Y') AS TEXT) + '-' + CAST(TIME_TO_STR(CreationDate, '%m') AS TEXT) + '-01') AS Month, t.TagName FROM (SELECT p.Id, p.CreationDate FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId) AS pp JOIN PostTags AS pt ON ... |
Name the team for 48 game | CREATE TABLE table_53796 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Team" FROM table_53796 WHERE "Game" = '48' |
What was the date when the against was 3? | CREATE TABLE table_50208 ("Opposing Team" text,"Against" real,"Date" text,"Venue" text,"Round" text) | SELECT "Date" FROM table_50208 WHERE "Against" = '3' |
What is the lowest Silver in the Total Sport has less than 1 Gold and more than 1 Bronze? | CREATE TABLE table_name_77 (silver INTEGER,gold VARCHAR,bronze VARCHAR,sport VARCHAR) | SELECT MIN(silver) FROM table_name_77 WHERE bronze > 1 AND sport = "total" AND gold < 1 |
Who was the leading scorer on 23 February 2008? | CREATE TABLE table_53435 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" real,"Record" text) | SELECT "Leading scorer" FROM table_53435 WHERE "Date" = '23 february 2008' |
tell me the name of the drug that patient 010-32430 was prescribed with in the same day after being diagnosed until 60 months ago with acute coronary syndrome? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime ti... | SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-32430') AND diagnosis.diagnos... |
is the heartrate of patient 035-11300 normal in the first hospital encounter? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid n... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-11300' AND NOT patient.hospitaldischargetime IS NULL ORDER BY pa... |
what is the to par when the place is t10 and the score is 72-74-71-69=286? | CREATE TABLE table_49336 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT "To par" FROM table_49336 WHERE "Place" = 't10' AND "Score" = '72-74-71-69=286' |
how many losing bonus with won being 10 and points against being 283 | CREATE TABLE table_13758945_3 (losing_bonus VARCHAR,won VARCHAR,points_against VARCHAR) | SELECT COUNT(losing_bonus) FROM table_13758945_3 WHERE won = "10" AND points_against = "283" |
Who lost on August 27? | CREATE TABLE table_80047 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Time" text,"Att." text,"Record" text) | SELECT "Loss" FROM table_80047 WHERE "Date" = 'august 27' |
What was the position for the Josef Kaufmann Racing team? | CREATE TABLE table_21427 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"FLaps" real,"Podiums" real,"Points" real,"Position" text) | SELECT "Position" FROM table_21427 WHERE "Team" = 'Josef Kaufmann Racing' |
what is the distance for mj kollen? | CREATE TABLE table_62744 ("Name" text,"Feature" text,"Latitude" text,"Longitude" text,"Distance" text,"Bearing" text) | SELECT "Distance" FROM table_62744 WHERE "Name" = 'mjåkollen' |
how many female patients had an emergency admission type? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admission_type = "EMERGENCY" |
Which Multi 1 has a Frequency of 2300mhz, and a Release date of q3 2008 and a Model number of turion x2 ultra zm-84? | CREATE TABLE table_name_7 (multi_1 VARCHAR,model_number VARCHAR,frequency VARCHAR,release_date VARCHAR) | SELECT multi_1 FROM table_name_7 WHERE frequency = "2300mhz" AND release_date = "q3 2008" AND model_number = "turion x2 ultra zm-84" |
If 70+ is 2554, what is the 25 to 29 amount? | CREATE TABLE table_20830 ("Children/Women over 15" real,"Oblast\\Age of women" text,"15 to 17" real,"18 to 19" real,"20 to 24" real,"25 to 29" real,"30 to 34" real,"35 to 39" real,"40 to 44" real,"45 to 49" real,"50 to 54" real,"55 to 59" real,"60 to 64" real,"65 to 69" real,"70+" real) | SELECT "25 to 29" FROM table_20830 WHERE "70+" = '2554' |
calculate patient 010-19726's stay length of the last stay in the icu. | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,tempe... | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-19726') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 |
What is the largest village that had 103279 houses affected? | CREATE TABLE table_20403667_2 (village INTEGER,house_affected VARCHAR) | SELECT MAX(village) FROM table_20403667_2 WHERE house_affected = 103279 |
How many years did the soap opera run in which the character Clemens Richter was included? | CREATE TABLE table_name_2 (duration VARCHAR,character VARCHAR) | SELECT duration FROM table_name_2 WHERE character = "clemens richter" |
What position does krylja sovetov (russia) play? | CREATE TABLE table_2781227_9 (position VARCHAR,college_junior_club_team VARCHAR) | SELECT position FROM table_2781227_9 WHERE college_junior_club_team = "Krylja Sovetov (Russia)" |
What is 3rd Place, when Runner-Up is 'Simon Ehne', and when Prize is $100,000? | CREATE TABLE table_name_70 (runner_up VARCHAR,prize VARCHAR) | SELECT 3 AS rd_place FROM table_name_70 WHERE runner_up = "simon ehne" AND prize = "$100,000" |
Which college has the player Rushel Shell? | CREATE TABLE table_17078 ("Player" text,"Position" text,"School" text,"Hometown" text,"College" text) | SELECT "College" FROM table_17078 WHERE "Player" = 'Rushel Shell' |
What is the status of the player who is moving to Nantes? | CREATE TABLE table_name_72 (status VARCHAR,moving_to VARCHAR) | SELECT status FROM table_name_72 WHERE moving_to = "nantes" |
calculate the number of patients who have been prescribed belatacept study drug (*ind*) since 2105. | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE microbiologyevents (row_id number,subject_id nu... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'belatacept study drug (*ind*)' AND STRFTIME('%y', prescriptions.startdate) >= '2105') |
Name the broadcast for davis-wade stadium starkville ms | CREATE TABLE table_29063 ("Date" text,"Time" text,"Visiting team" text,"Home team" text,"Site" text,"Broadcast" text,"Result" text,"Attendance" real) | SELECT "Broadcast" FROM table_29063 WHERE "Site" = 'Davis-Wade Stadium • Starkville MS' |
How many users are there? | CREATE TABLE user_profiles (Id VARCHAR) | SELECT COUNT(*) FROM user_profiles |
what were the drugs which were added to patient 90663 today compared to the ones yesterday? | 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 prescriptions (row_id number,subject_id number,hadm_id number,... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 90663) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE... |
What are the numbers of races for each constructor id. Show the correlation. | CREATE TABLE lapTimes (raceId INTEGER,driverId INTEGER,lap INTEGER,position INTEGER,time TEXT,milliseconds INTEGER)CREATE TABLE races (raceId INTEGER,year INTEGER,round INTEGER,circuitId INTEGER,name TEXT,date TEXT,time TEXT,url TEXT)CREATE TABLE seasons (year INTEGER,url TEXT)CREATE TABLE pitStops (raceId INTEGER,driv... | SELECT COUNT(*), constructorId FROM constructorStandings GROUP BY constructorId |
How many points did Donald Green score? | CREATE TABLE table_28061 ("Player" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real) | SELECT COUNT("Points") FROM table_28061 WHERE "Player" = 'Donald Green' |
Who wrote episode number 81 in the series? | CREATE TABLE table_25604014_5 (written_by VARCHAR,no_in_series VARCHAR) | SELECT written_by FROM table_25604014_5 WHERE no_in_series = 81 |
show me all DAILY flights from MILWAUKEE to ORLANDO | CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE code_description (code varchar,description text)CREATE TABLE flight_leg (flight_id int,leg_number int,l... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORL... |
What was date of appointment for Erg n Penbe? | CREATE TABLE table_27091128_2 (date_of_appointment VARCHAR,replaced_by VARCHAR) | SELECT date_of_appointment FROM table_27091128_2 WHERE replaced_by = "Ergün Penbe" |
Which model number does bombardier manufacture? | CREATE TABLE table_5854 ("Designation" text,"Car numbers" text,"Manufacturer" text,"Model No." text,"First used" text,"Quantity" real) | SELECT "Model No." FROM table_5854 WHERE "Manufacturer" = 'bombardier' |
What is tom cassidy's nationality? | CREATE TABLE table_name_25 (nationality VARCHAR,player VARCHAR) | SELECT nationality FROM table_name_25 WHERE player = "tom cassidy" |
How many residence cities have an English name of Province of Viborg and Nyslott? | CREATE TABLE table_2166 ("Map number" real,"English name" text,"Finnish name" text,"Swedish name" text,"Residence city" text,"Dates of existence" text,"Notes" text) | SELECT COUNT("Residence city") FROM table_2166 WHERE "English name" = 'Province of Viborg and Nyslott' |
how much heparin sodium was prescribed on the last hospital visit for the last time to patient 14621? | 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 diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,chartti... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14621 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'heparin sodium' ORDER BY prescriptions.startdate DE... |
WHAT YEAR HAS A TO PAR SMALLER THAN 16, TOTAL 151? | CREATE TABLE table_name_86 (year_s__won VARCHAR,to_par VARCHAR,total VARCHAR) | SELECT year_s__won FROM table_name_86 WHERE to_par < 16 AND total = 151 |
What is the Number of dances is 11 and competition finish is larger than 2.0 total | CREATE TABLE table_1354805_3 (total VARCHAR,number_of_dances VARCHAR,competition_finish VARCHAR) | SELECT total FROM table_1354805_3 WHERE number_of_dances = 11 AND competition_finish > 2.0 |
What is the lowest round number for the fight that had a time of 1:09? | CREATE TABLE table_name_12 (round INTEGER,time VARCHAR) | SELECT MIN(round) FROM table_name_12 WHERE time = "1:09" |
COunt the EBIT (US $m) which has a Revenue (US $million) larger than 434.8 and a Net profit (US $m) larger than 96.4? | CREATE TABLE table_name_35 (ebit__us_ VARCHAR,revenue__us_$million_ VARCHAR,net_profit__us_$m_ VARCHAR) | SELECT COUNT(ebit__us_) AS $m_ FROM table_name_35 WHERE revenue__us_$million_ > 434.8 AND net_profit__us_$m_ > 96.4 |
What is Lee Westwood's score? | CREATE TABLE table_79155 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money (\u00a3)" real) | SELECT "Score" FROM table_79155 WHERE "Player" = 'lee westwood' |
what is the number of patients on ih route of drug administration who have regional enteritis of unspecified site diagnoses? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | 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 = "Regional enteritis of unspecified site" AND prescriptions.route = "IH" |
For all players playing at the center, list the height in feet. | CREATE TABLE table_26231 ("No" real,"Player" text,"Height (m)" text,"Height (f)" text,"Position" text,"Year born" real,"Current Club" text) | SELECT "Height (f)" FROM table_26231 WHERE "Position" = 'Center' |
What is the game that has the phoenix suns as the opponent played against? | CREATE TABLE table_37345 ("Date" text,"Opponent" text,"Result" text,"Score" text,"Record" text,"Streak" text) | SELECT "Result" FROM table_37345 WHERE "Opponent" = 'phoenix suns' |
Who was the winning driver for Hendrick Motorsports in a Chevrolet Impala SS? | CREATE TABLE table_21877 ("Season" real,"Date" text,"Winning Driver" text,"Car #" real,"Sponsor" text,"Make" text,"Team" text,"Avg Speed" text,"Margin of Victory" text) | SELECT "Winning Driver" FROM table_21877 WHERE "Team" = 'Hendrick Motorsports' AND "Make" = 'Chevrolet Impala SS' |
A scatter chart about what are ids and total number of hours played for each game? | CREATE TABLE SportsInfo (StuID INTEGER,SportName VARCHAR(32),HoursPerWeek INTEGER,GamesPlayed INTEGER,OnScholarship VARCHAR(1))CREATE TABLE Video_Games (GameID INTEGER,GName VARCHAR(40),GType VARCHAR(40))CREATE TABLE Plays_Games (StuID INTEGER,GameID INTEGER,Hours_Played INTEGER)CREATE TABLE Student (StuID INTEGER,LNam... | SELECT GameID, SUM(Hours_Played) FROM Plays_Games GROUP BY GameID |
What did the home team score when Carlton played as the Away team? | CREATE TABLE table_58259 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_58259 WHERE "Away team" = 'carlton' |
I want the venue for 23 july 1992 | CREATE TABLE table_name_64 (venue VARCHAR,date VARCHAR) | SELECT venue FROM table_name_64 WHERE date = "23 july 1992" |
Name the district for hugh glasgow | CREATE TABLE table_3614 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text,"Candidates" text) | SELECT "District" FROM table_3614 WHERE "Incumbent" = 'Hugh Glasgow' |
for how many years was the encyclopedia printed ? | CREATE TABLE table_204_843 (id number,"volume" number,"year" text,"names" text,"articles" number,"pages" number,"images" number,"maps" number,"number of copies" number) | SELECT COUNT("year") FROM table_204_843 |
how many patients whose ethnicity is asian and procedure short title is open reduc-int fix femur? | 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 lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "ASIAN" AND procedures.short_title = "Open reduc-int fix femur" |
Who was the opponent when there was 117 rushing yards? | CREATE TABLE table_26108103_2 (opponent VARCHAR,rushing_yards VARCHAR) | SELECT opponent FROM table_26108103_2 WHERE rushing_yards = 117 |
What are the highest number of laps for grid 8? | CREATE TABLE table_54220 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT MAX("Laps") FROM table_54220 WHERE "Grid" = '8' |
What school/club team did Amal McCaskill play for? | CREATE TABLE table_40722 ("Player" text,"Nationality" text,"Position" text,"Years in Orlando" text,"School/Club Team" text) | SELECT "School/Club Team" FROM table_40722 WHERE "Player" = 'amal mccaskill' |
did patient 63676 undergo a opn reduct malar/zygo fx procedure during this year? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,disch... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'opn reduct malar/zygo fx') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 63676) AND DATETIME(pr... |
What was the average number of laps completed by KTM riders, with times of +56.440 and grid values under 11? | CREATE TABLE table_40256 ("Rider" text,"Manufacturer" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT AVG("Laps") FROM table_40256 WHERE "Manufacturer" = 'ktm' AND "Time/Retired" = '+56.440' AND "Grid" < '11' |
A stacked bar about the number of faults for different fault description and fault status of all the faults recoreded in the logs. | CREATE TABLE Parts (part_id INTEGER,part_name VARCHAR(255),chargeable_yn VARCHAR(1),chargeable_amount VARCHAR(20),other_part_details VARCHAR(255))CREATE TABLE Engineer_Skills (engineer_id INTEGER,skill_id INTEGER)CREATE TABLE Staff (staff_id INTEGER,staff_name VARCHAR(255),gender VARCHAR(1),other_staff_details VARCHAR(... | SELECT fault_status, COUNT(fault_status) FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY fault_description, fault_status |
Limiting Posts by Date - Questions Only (Tutorial). | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId num... | SELECT Title, Id, PostTypeId FROM Posts WHERE CreationDate BETWEEN '2014-07-01' AND '2014-07-31' AND PostTypeId = 1 |
A bar chart for returning the number of the categories of music festivals that have the result 'Awarded', and I want to rank y-axis in desc order please. | CREATE TABLE music_festival (ID int,Music_Festival text,Date_of_ceremony text,Category text,Volume int,Result text)CREATE TABLE artist (Artist_ID int,Artist text,Age int,Famous_Title text,Famous_Release_date text)CREATE TABLE volume (Volume_ID int,Volume_Issue text,Issue_Date text,Weeks_on_Top real,Song text,Artist_ID ... | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY COUNT(Category) DESC |
what is the amount of profits in billions for companies with a market value of 204.9 billion? | CREATE TABLE table_1682026_6 (profits__billion_$_ VARCHAR,market_value__billion_$_ VARCHAR) | SELECT profits__billion_$_ FROM table_1682026_6 WHERE market_value__billion_$_ = "204.9" |
If the equation is 6 9 + 6 9 + 6, what is the 2nd throw? | CREATE TABLE table_21443 ("1st throw" real,"2nd throw" real,"3rd throw" real,"Equation" text,"Result" real) | SELECT MAX("2nd throw") FROM table_21443 WHERE "Equation" = '6 × 9² + 6 × 9 + 6' |
What status has 10 as the population? | CREATE TABLE table_9035 ("Official Name" text,"Status" text,"Area km 2" real,"Population" real,"Census Ranking" text) | SELECT "Status" FROM table_9035 WHERE "Population" = '10' |
What is the highest Wins, when Rank is greater than 2, and when Played is less than 5? | CREATE TABLE table_48750 ("Rank" real,"Team" text,"Played" real,"Wins" real,"Ties" real,"Losses" real,"Points" real) | SELECT MAX("Wins") FROM table_48750 WHERE "Rank" > '2' AND "Played" < '5' |
What are the top 3 artists with the largest number of songs in the language Bangla? | CREATE TABLE genre (g_name text,rating text,most_popular_in text)CREATE TABLE artist (artist_name text,country text,gender text,preferred_genre 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 file... | SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = "bangla" GROUP BY T2.artist_name ORDER BY COUNT(*) DESC LIMIT 3 |
Draw a bar chart of nationality versus the average of age | CREATE TABLE event (Event_ID int,Date text,Venue text,Name text,Event_Attendance int)CREATE TABLE journalist (journalist_ID int,Name text,Nationality text,Age text,Years_working int)CREATE TABLE news_report (journalist_ID int,Event_ID int,Work_Type text) | SELECT Nationality, AVG(Age) FROM journalist GROUP BY Nationality |
What is the lightest Weight (kg), when the Jersey # is greater than 22, when the Position is F, and when the Birthdate is March 19, 1980? | CREATE TABLE table_name_62 (weight__kg_ INTEGER,birthdate VARCHAR,jersey__number VARCHAR,position VARCHAR) | SELECT MIN(weight__kg_) FROM table_name_62 WHERE jersey__number > 22 AND position = "f" AND birthdate = "march 19, 1980" |
On what date was there a record of 76-72? | CREATE TABLE table_name_6 (date VARCHAR,record VARCHAR) | SELECT date FROM table_name_6 WHERE record = "76-72" |
Comments on questions containing the substring 'close'. | CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation numbe... | SELECT c.Id AS "comment_link", c.CreationDate, c.Score FROM Comments AS c INNER JOIN Posts AS q ON q.Id = c.PostId WHERE (LOWER(Text) LIKE '%close%' AND q.PostTypeId = 1) ORDER BY c.CreationDate DESC |
What school did P Jay Gehrke of the Kansas City Royals attend? | CREATE TABLE table_66314 ("Pick" real,"Player" text,"Team" text,"Position" text,"School" text) | SELECT "School" FROM table_66314 WHERE "Position" = 'p' AND "Team" = 'kansas city royals' AND "Player" = 'jay gehrke' |
Compare the smallest enrollment of schools in each state using a bar chart, order by the Y-axis in descending please. | CREATE TABLE Tryout (pID numeric(5,0),cName varchar(20),pPos varchar(8),decision varchar(3))CREATE TABLE College (cName varchar(20),state varchar(2),enr numeric(5,0))CREATE TABLE Player (pID numeric(5,0),pName varchar(20),yCard varchar(3),HS numeric(5,0)) | SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr) DESC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.