instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What place did Jerry Barber of the United States come in at? | CREATE TABLE table_48605 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real) | SELECT "Place" FROM table_48605 WHERE "Country" = 'united states' AND "Player" = 'jerry barber' |
Return a bar chart showing the minimum room count of apartments in different type, and show by the total number from low to high. | CREATE TABLE Apartment_Bookings (apt_booking_id INTEGER,apt_id INTEGER,guest_id INTEGER,booking_status_code CHAR(15),booking_start_date DATETIME,booking_end_date DATETIME)CREATE TABLE Apartments (apt_id INTEGER,building_id INTEGER,apt_type_code CHAR(15),apt_number CHAR(10),bathroom_count INTEGER,bedroom_count INTEGER,r... | SELECT apt_type_code, MIN(room_count) FROM Apartments GROUP BY apt_type_code ORDER BY MIN(room_count) |
Who were the writers of episode/s first aired in the US on June 9, 2012? | CREATE TABLE table_30934 ("Series #" real,"Production Code" real,"Title" text,"Directed by" text,"Written by" text,"United States Original Airdate" text,"Canada Original Airdate" text) | SELECT "Written by" FROM table_30934 WHERE "United States Original Airdate" = 'June 9, 2012' |
Which player's results were T6 in the PGA Ch., T4 in the Masters and T8 at the U.S. Open? | CREATE TABLE table_1506950_9 (player VARCHAR,us_open VARCHAR,pga_ch VARCHAR,masters VARCHAR) | SELECT player FROM table_1506950_9 WHERE pga_ch = "T6" AND masters = "T4" AND us_open = "T8" |
Who did the team lose to on September 8? | CREATE TABLE table_name_52 (loss VARCHAR,date VARCHAR) | SELECT loss FROM table_name_52 WHERE date = "september 8" |
what was the first game released ? | CREATE TABLE table_204_236 (id number,"title" text,"release date" text,"developer(s)" text,"publisher(s)" text,"genre(s)" text) | SELECT "title" FROM table_204_236 ORDER BY "release date" LIMIT 1 |
count the number of patients whose admission locations is phys referral/normal deli and diagnosis long title is diverticulitis of colon (without mention of hemorrhage). | 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 WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND diagnoses.long_title = "Diverticulitis of colon (without mention of hemorrhage)" |
How many people voted for Obama in the county where McCain got 72.75% of the votes? | CREATE TABLE table_20799587_1 (obama_number INTEGER,mccain_percentage VARCHAR) | SELECT MIN(obama_number) FROM table_20799587_1 WHERE mccain_percentage = "72.75%" |
how long was her was her champoinship and olympice career ? | CREATE TABLE table_204_503 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text) | SELECT MAX("year") - MIN("year") FROM table_204_503 |
is normal for patient 4401's sao2 on the last icu visit? | CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime... | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4401) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid IN (SELEC... |
What are the names and locations of all tracks? | CREATE TABLE track (track_id number,name text,location text,seating number,year_opened number)CREATE TABLE race (race_id number,name text,class text,date text,track_id text) | SELECT name, location FROM track |
The times that International Security , Norms and Cooperation will be offered are what ? | CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE program_require... | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o... |
what is procedure short title of subject id 21796? | 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,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT procedures.short_title FROM procedures WHERE procedures.subject_id = "21796" |
Which Matches have a Rank smaller than 5, a Years of 1995 2003, and a Goals smaller than 104? | CREATE TABLE table_41790 ("Rank" real,"Name" text,"Years" text,"Matches" real,"Goals" real) | SELECT AVG("Matches") FROM table_41790 WHERE "Rank" < '5' AND "Years" = '1995–2003' AND "Goals" < '104' |
was there a phosphate test done on patient 9833 until 73 months ago? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE diagnoses_icd (row_id number,subject_id... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phosphate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9833) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-73 month') |
What is the format of code pro-cd-4662? | CREATE TABLE table_name_98 (format VARCHAR,code VARCHAR) | SELECT format FROM table_name_98 WHERE code = "pro-cd-4662" |
when is patient 31473's po intake the first time on the first intensive care unit visit? | CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title tex... | SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31473) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND inputevents_cv... |
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the headquarter , and group by attribute headquarter, order in ascending by the y axis. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code |
What home team played the away team of Richmond? | CREATE TABLE table_name_75 (home_team VARCHAR,away_team VARCHAR) | SELECT home_team FROM table_name_75 WHERE away_team = "richmond" |
what are the three most frequently prescribed medications for patients who have had entral infus nutrit sub previously in the same hospital visit, the previous year? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREAT... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... |
What is the calling at for the 09.50 departure? | CREATE TABLE table_22270 ("Departure" text,"Going to" text,"Calling at" text,"Arrival" text,"Operator" text) | SELECT "Calling at" FROM table_22270 WHERE "Departure" = '09.50' |
Episode of 9 in which performer 3 had? | CREATE TABLE table_name_82 (performer_3 VARCHAR,episode VARCHAR) | SELECT performer_3 FROM table_name_82 WHERE episode = 9 |
Return ids of all the products that are supplied by supplier id 2 and are more expensive than the average price of all products. | CREATE TABLE product_suppliers (product_id VARCHAR,supplier_id VARCHAR)CREATE TABLE products (product_id VARCHAR,product_price INTEGER) | SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 2 AND T2.product_price > (SELECT AVG(product_price) FROM products) |
what was the name of the drug that patient 006-76924 was prescribed within 2 days after having been diagnosed with a acute respiratory failure - drug related during this month? | 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 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 = '006-76924') AND diagnosis.diagnos... |
What is the date of the k-league cup, which has less than 28 goals, at the jeonju venue? | CREATE TABLE table_name_93 (date VARCHAR,competition VARCHAR,venue VARCHAR,goals VARCHAR) | SELECT date FROM table_name_93 WHERE venue = "jeonju" AND goals < 28 AND competition = "k-league cup" |
What is the Latitude of the Alajen Vallis named after 1997? | CREATE TABLE table_name_86 (latitude VARCHAR,year_named VARCHAR,name VARCHAR) | SELECT latitude FROM table_name_86 WHERE year_named > 1997 AND name = "alajen vallis" |
What is the average grid of driver Christian Vietoris who has less than 12 laps? | CREATE TABLE table_name_79 (grid INTEGER,driver VARCHAR,laps VARCHAR) | SELECT AVG(grid) FROM table_name_79 WHERE driver = "christian vietoris" AND laps < 12 |
How many people went to the game that lasted 2:37 after game 2? | CREATE TABLE table_69036 ("Game" real,"Date" text,"Location" text,"Time" text,"Attendance" real) | SELECT SUM("Attendance") FROM table_69036 WHERE "Game" > '2' AND "Time" = '2:37' |
Top 10 SO Users from Mysore. Top 10 SO Users from Mysore, Karnataka, India | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId n... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%mysore%' OR UPPER(Location) LIKE '%MYSORE%' OR Location LIKE '%mysore%' AND Reputation >= 1000 ORDER BY Reputation DESC LIMIT 10 |
What is the release price for the GPU frequency of standard power, embedded? | CREATE TABLE table_name_96 (release_price___usd__ VARCHAR,gpu_frequency VARCHAR) | SELECT release_price___usd__ FROM table_name_96 WHERE gpu_frequency = "standard power, embedded" |
How many winning drivers in the kraco twin 125 (r2) race were there? | CREATE TABLE table_10706879_3 (winning_driver VARCHAR,name VARCHAR) | SELECT COUNT(winning_driver) FROM table_10706879_3 WHERE name = "Kraco Twin 125 (R2)" |
Show all main industry and total market value in each industry by a bar chart, display x-axis from high to low order. | CREATE TABLE gas_station (Station_ID int,Open_Year int,Location text,Manager_Name text,Vice_Manager_Name text,Representative_Name text)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 TABL... | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY Main_Industry DESC |
How many house colours are associated with house names of Hillary? | CREATE TABLE table_23003 ("House name" text,"House mascot" text,"House colour" text,"Year opened" real,"House leader" text) | SELECT COUNT("House colour") FROM table_23003 WHERE "House name" = 'Hillary' |
what is discharge location of subject id 24425? | 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 demographic.discharge_location FROM demographic WHERE demographic.subject_id = "24425" |
what was patient 5395 diagnosed with on their last hospital encounter for the last time? | CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_labitems (row_id number,itemid number,l... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5395 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DE... |
What is the result of the match in round 1r against tunisia and on a hard surface? | CREATE TABLE table_60098 ("Edition" text,"Round" text,"Date" text,"Against" text,"Surface" text,"Opponent" text,"Result" text) | SELECT "Result" FROM table_60098 WHERE "Round" = '1r' AND "Surface" = 'hard' AND "Against" = 'tunisia' |
Who was the team who played home team woking? | CREATE TABLE table_60695 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Away team" FROM table_60695 WHERE "Home team" = 'woking' |
What genre is the song recorded in 1929? | CREATE TABLE table_name_26 (genre VARCHAR,year_recorded VARCHAR) | SELECT genre FROM table_name_26 WHERE year_recorded = "1929" |
What is 2009, when 2000 is 1R, and when 1998 is 3R? | CREATE TABLE table_41954 ("Tournament" text,"1993" text,"1994" text,"1995" text,"1996" text,"1997" text,"1998" text,"1999" text,"2000" text,"2001" text,"2002" text,"2003" text,"2004" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text) | SELECT "2009" FROM table_41954 WHERE "2000" = '1r' AND "1998" = '3r' |
What is the number of years that the event was foil team and took place in Los Angeles? | CREATE TABLE table_39106 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text) | SELECT COUNT("Year") FROM table_39106 WHERE "Venue" = 'los angeles' AND "Event" = 'foil team' |
Which track has a title : Just a little bit | CREATE TABLE table_52160 ("Track" real,"Recorded" text,"Original Issue" text,"Song Title" text,"Time" text) | SELECT MIN("Track") FROM table_52160 WHERE "Song Title" = 'just a little bit' |
Which Country has a Score smaller than 70, and a Place of t3, and a Player of andr s romero? | CREATE TABLE table_name_4 (country VARCHAR,player VARCHAR,score VARCHAR,place VARCHAR) | SELECT country FROM table_name_4 WHERE score < 70 AND place = "t3" AND player = "andrés romero" |
What is the wheel arrangement for the train in Riverdale, Georgia? | CREATE TABLE table_1057316_1 (wheel_arrangement___whyte_notation__ VARCHAR,disposition VARCHAR) | SELECT wheel_arrangement___whyte_notation__ FROM table_1057316_1 WHERE disposition = "Riverdale, Georgia" |
what airlines have flights from BOSTON to PHILADELPHIA that leave before 630 | CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE month (month_number int,month_name text)CREATE TABLE food_service (meal_co... | SELECT DISTINCT airline.airline_code FROM airline, 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 = 'PHILADELPHIA' AND flight.departure_time < 630 AND flight.to_airport = AIRPOR... |
what is minimum days of hospital stay of patients whose marital status is single? | 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 MIN(demographic.days_stay) FROM demographic WHERE demographic.marital_status = "SINGLE" |
Total number of questions posted in a given year.. | CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationI... | SELECT COUNT(*) FROM Posts WHERE CreationDate BETWEEN '2018-01-01' AND '2018-12-31' AND Tags LIKE '%python%' |
What time of the day does BCS 439 start next semester ? | CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varchar,has_lab varchar,has_projects varchar,has_exams varchar,num_reviews int,clarity_score i... | SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'BCS' AND course.num... |
What is the title of the production with a number of 1039? | CREATE TABLE table_name_83 (title VARCHAR,production_number VARCHAR) | SELECT title FROM table_name_83 WHERE production_number = "1039" |
What was Laura Diaz's score for place t9? | CREATE TABLE table_65905 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Score" FROM table_65905 WHERE "Place" = 't9' AND "Player" = 'laura diaz' |
What is the Nationality of the Player with Jersey Number 6? | CREATE TABLE table_45743 ("Player" text,"Nationality" text,"Jersey Number(s)" real,"Position" text,"Years" text,"From" text) | SELECT "Nationality" FROM table_45743 WHERE "Jersey Number(s)" = '6' |
Who were the candidates when Jack Fields was the incumbent? | CREATE TABLE table_1341577_44 (candidates VARCHAR,incumbent VARCHAR) | SELECT candidates FROM table_1341577_44 WHERE incumbent = "Jack Fields" |
How many Bangladeshi citizens live in the borough ranked at number 14? | CREATE TABLE table_22850 ("Rank" real,"London Borough" text,"Indian Population" real,"Pakistani Population" real,"Bangladeshi Population" real,"Chinese Population" real,"Other Asian Population" real,"Total Asian Population" real) | SELECT MAX("Bangladeshi Population") FROM table_22850 WHERE "Rank" = '14' |
What is the name of the free transfer fee with a transfer status and an ENG country? | CREATE TABLE table_76832 ("Name" text,"Country" text,"Status" text,"Transfer window" text,"Transfer fee" text) | SELECT "Name" FROM table_76832 WHERE "Transfer fee" = 'free' AND "Status" = 'transfer' AND "Country" = 'eng' |
What is the sum of attendance when the result was l 16-13? | CREATE TABLE table_name_54 (attendance INTEGER,result VARCHAR) | SELECT SUM(attendance) FROM table_name_54 WHERE result = "l 16-13" |
Which mean rank had a silver number smaller than 0? | CREATE TABLE table_54982 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT AVG("Rank") FROM table_54982 WHERE "Silver" < '0' |
What is T5 Place Vijay Singh's To par? | CREATE TABLE table_name_60 (to_par VARCHAR,place VARCHAR,player VARCHAR) | SELECT to_par FROM table_name_60 WHERE place = "t5" AND player = "vijay singh" |
Who is the team captain when the club is k.f.c. germinal beerschot? | CREATE TABLE table_29451 ("Club" text,"Chairman" text,"Current manager" text,"Team captain" text,"Kitmaker" text,"Shirt sponsor" text) | SELECT "Team captain" FROM table_29451 WHERE "Club" = 'K.F.C. Germinal Beerschot' |
Who plays f position for depauw? | CREATE TABLE table_56544 ("Round" text,"Player" text,"Position" text,"Team" text,"College" text) | SELECT "Player" FROM table_56544 WHERE "Position" = 'f' AND "College" = 'depauw' |
monte carlo simulation papers published after 2011 | CREATE TABLE field (fieldid int)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE cite (... | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'monte carlo simulation' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year > 2011 |
give me the number of patients whose admission type is urgent and diagnoses long title is antifungal antibiotics causing adverse effects in therapeutic use? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Antifungal antibiotics causing adverse effects in therapeutic use" |
Where was the game that had an attendance of 39,889? | CREATE TABLE table_52559 ("Week" text,"Date" text,"Opponent" text,"Result" text,"Kickoff [a ]" text,"Game site" text,"Attendance" text,"Record" text) | SELECT "Game site" FROM table_52559 WHERE "Attendance" = '39,889' |
For Posts Created in 2017, Avg time between Question created and Accepted Ans. | CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId n... | SELECT CreationDate FROM PostFeedback WHERE CAST(CreationDate AS DATETIME) BETWEEN '2017-01-01 00:00:00' AND '2017-12-31 23:59:59' |
What was the score where Olga Lugina played in the Tournament of poitiers , france itf $25,000? | CREATE TABLE table_59448 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score in the final" text) | SELECT "Score in the final" FROM table_59448 WHERE "Partner" = 'olga lugina' AND "Tournament" = 'poitiers , france itf $25,000' |
Score of 2 1 has what record? | CREATE TABLE table_74908 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Attendance" real,"Record" text,"Points" real) | SELECT "Record" FROM table_74908 WHERE "Score" = '2–1' |
If I want to be prepared for WOMENSTD 444 , what course should I take ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_cr... | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'WOMENSTD' AND number = 444 |
Display a bar chart for what is the name of each aircraft and how many flights does each one complete?, and sort in ascending by the y-axis. | CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,0))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 certificate (eid number(9,0),aid number(9,0))CREATE T... | SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY COUNT(*) |
Which League that has a Open Cup of 1st round, and a Year of 2009? | CREATE TABLE table_name_99 (league VARCHAR,open_cup VARCHAR,year VARCHAR) | SELECT league FROM table_name_99 WHERE open_cup = "1st round" AND year = 2009 |
what's the result with dbeingtrict being florida 4 | CREATE TABLE table_1342013_9 (result VARCHAR,district VARCHAR) | SELECT result FROM table_1342013_9 WHERE district = "Florida 4" |
Name the most abama number for mccain being 29266 | CREATE TABLE table_20468206_1 (obama_number INTEGER,mccain_number VARCHAR) | SELECT MAX(obama_number) FROM table_20468206_1 WHERE mccain_number = 29266 |
What does STRATEGY 564 entail ? | CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE course_offering (offering_id int,course_id int,semes... | SELECT DISTINCT description, name FROM course WHERE department = 'STRATEGY' AND number = 564 |
For those records from the products and each product's manufacturer, show me about the distribution of name and revenue , and group by attribute headquarter in a bar chart, display by the bars in asc. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name |
what is the yearly minimum intake of volume (ml) dopamine that patient 006-78314 is getting? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid numbe... | SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-78314')) AND intakeoutput.celllabel = 'volum... |
EECS 174 has what kind of workload ? | CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_prerequisite (... | SELECT DISTINCT program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number = 174 AND program_course.course_id = course.course_id |
What are the scores for games played on september 9? | CREATE TABLE table_21318 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location/Attendance" text,"Record" text) | SELECT "Score" FROM table_21318 WHERE "Date" = 'September 9' |
Tell me the league apps with league goals less than 2 and position of df and FA cup apps of 5 | CREATE TABLE table_name_35 (league_apps VARCHAR,fa_cup_apps VARCHAR,league_goals VARCHAR,position VARCHAR) | SELECT league_apps FROM table_name_35 WHERE league_goals < 2 AND position = "df" AND fa_cup_apps = "5" |
Who is the outgoing manager when they were replaced by pablo centrone? | CREATE TABLE table_64529 ("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_64529 WHERE "Replaced by" = 'pablo centrone' |
What date did Virginia Commonwealth Rams win? | CREATE TABLE table_name_14 (date_s_ VARCHAR,winner VARCHAR) | SELECT date_s_ FROM table_name_14 WHERE winner = "virginia commonwealth rams" |
What district is F. Edward Hebert the incumbent in? | CREATE TABLE table_1341843_19 (district VARCHAR,incumbent VARCHAR) | SELECT district FROM table_1341843_19 WHERE incumbent = "F. Edward Hebert" |
what was the total input amount that patient 006-157753 has received on the current icu visit? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,ag... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753') AND patient.unitdischargetime IS NU... |
what is SA | CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE restriction (restriction_code... | SELECT DISTINCT day_name FROM days WHERE days_code = 'SA' |
find the language of subject id 52118. | 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 lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT demographic.language FROM demographic WHERE demographic.subject_id = "52118" |
For the match ending in a score of 66-20, what was the stadium? | CREATE TABLE table_name_92 (stadium VARCHAR,score VARCHAR) | SELECT stadium FROM table_name_92 WHERE score = "66-20" |
Give me the comparison about the average of monthly_rental over the date_address_from bin date_address_from by time. | CREATE TABLE Ref_Address_Types (address_type_code VARCHAR(15),address_type_description VARCHAR(80))CREATE TABLE Teachers (teacher_id INTEGER,address_id INTEGER,first_name VARCHAR(80),middle_name VARCHAR(80),last_name VARCHAR(80),gender VARCHAR(1),cell_mobile_number VARCHAR(40),email_address VARCHAR(40),other_details VA... | SELECT date_address_from, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC |
What is total number of show times per dat for each cinema Show bar chart, sort from high to low by the show times per day please. | CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price float)CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_code text)CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Locatio... | SELECT Name, SUM(T1.Show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.Cinema_ID = T2.Cinema_ID GROUP BY T1.Cinema_ID ORDER BY SUM(T1.Show_times_per_day) DESC |
During which years did player number 35 play for Jazz? | CREATE TABLE table_11545282_10 (years_for_jazz VARCHAR,no VARCHAR) | SELECT years_for_jazz FROM table_11545282_10 WHERE no = "35" |
Tell me the format for european union | CREATE TABLE table_32161 ("Region" text,"Date" real,"Label" text,"Format" text,"Catalog" text) | SELECT "Format" FROM table_32161 WHERE "Region" = 'european union' |
What's the number of the player from Boise State? | CREATE TABLE table_15869 ("Player" text,"No." real,"Nationality" text,"Position" text,"Years in Toronto" text,"School/Club Team" text) | SELECT "No." FROM table_15869 WHERE "School/Club Team" = 'Boise State' |
Which county had a Bush number of votes of 566? | CREATE TABLE table_50585 ("County" text,"Kerry%" text,"Kerry#" real,"Bush%" text,"Bush#" real,"Others%" text,"Others#" real) | SELECT "County" FROM table_50585 WHERE "Bush#" = '566' |
A bar chart shows the distribution of ACC_Road and the average of School_ID , and group by attribute ACC_Road, list Y-axis in asc order. | 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 ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(School_ID) |
Are there any RCNSCI classes that meet on any day but Friday ? | CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requireme... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.friday = 'N' AND course.department = 'RCNSCI' AND semester.semester = 'WN' AND... |
what are the ways to consume gabapentin 300 mg po caps? | 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 DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'gabapentin 300 mg po caps' |
on the first icu visit, what was the daily minimum intake of ivpb of patient 007-1517? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio... | SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-1517') AND NOT patient.unitdischargetime IS ... |
Which title is 3:38 long? | CREATE TABLE table_53354 ("Track" real,"Title" text,"Author(s)" text,"Recorded" text,"Length" text) | SELECT "Title" FROM table_53354 WHERE "Length" = '3:38' |
Top 10000 users on Stack Overflow. | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,Ab... | SELECT * FROM Users ORDER BY Reputation DESC LIMIT 10000 |
in a year before, what is the three most frequently taken lab test for patients of 30s? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABL... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) AND DATETIME(labevents.chartti... |
What is the episode title for the episode numbered #1.4? | CREATE TABLE table_19958 ("Episode No." text,"Episode Title" text,"UK Broadcast Date" text,"Presenter" text,"Details of Journey" text,"Countries Visited" text) | SELECT "Episode Title" FROM table_19958 WHERE "Episode No." = '#1.4' |
What school did the guard who began playing in 1991 come from? | CREATE TABLE table_33639 ("Player" text,"Nationality" text,"Position" text,"From" text,"School/Country" text) | SELECT "School/Country" FROM table_33639 WHERE "Position" = 'guard' AND "From" = '1991' |
Which Gold Coast has Auckland no, Adelaide yes, and Melbourne no? | CREATE TABLE table_name_24 (gold_coast VARCHAR,melbourne VARCHAR,auckland VARCHAR,adelaide VARCHAR) | SELECT gold_coast FROM table_name_24 WHERE auckland = "no" AND adelaide = "yes" AND melbourne = "no" |
How many products are in the 'Spices' category and have a typical price of over 1000? | CREATE TABLE ref_characteristic_types (characteristic_type_code text,characteristic_type_description text)CREATE TABLE characteristics (characteristic_id number,characteristic_type_code text,characteristic_data_type text,characteristic_name text,other_characteristic_details text)CREATE TABLE ref_product_categories (pro... | SELECT COUNT(*) FROM products WHERE product_category_code = "Spices" AND typical_buying_price > 1000 |
What was Johnny Rutherford's fastest lap while Al Unser was the pole position? | CREATE TABLE table_16148 ("Rd" real,"Name" text,"Pole Position" text,"Fastest Lap" text,"Winning driver" text,"Winning team" text,"Report" text) | SELECT "Fastest Lap" FROM table_16148 WHERE "Winning driver" = 'Johnny Rutherford' AND "Pole Position" = 'Al Unser' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.