instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
please list all DL flights from KANSAS CITY to SALT LAKE CITY | CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE flight_stop (flight_id int,stop_number int,... | 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 = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name =... |
what is the number of patients who have had a po oral intake since 6 years ago? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'po oral' AND intakeoutput.cellpath LIKE '%input%' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-6 year')) |
When was the last time, since December 14, 1986, that the attendance was lower than 47,096? | CREATE TABLE table_name_51 (week INTEGER,date VARCHAR,attendance VARCHAR) | SELECT MAX(week) FROM table_name_51 WHERE date = "december 14, 1986" AND attendance < 47 OFFSET 096 |
How many points did the away team score at Arden Street Oval? | CREATE TABLE table_57724 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team score" FROM table_57724 WHERE "Venue" = 'arden street oval' |
What is the nickname of the University of Alabama? | CREATE TABLE table_73942 ("School" text,"Location" text,"Founded" real,"Affiliation" text,"Enrollment" real,"Nickname" text) | SELECT "Nickname" FROM table_73942 WHERE "School" = 'University of Alabama' |
what is subject name and gender 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 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 demographic.name, demographic.gender FROM demographic WHERE demographic.subject_id = "2560" |
How many Kent State University's are there? | CREATE TABLE table_3543 ("Institution" text,"Location" text,"Founded" real,"Affiliation" text,"Enrollment" real,"Team Nickname" text,"Primary conference" text) | SELECT COUNT("Location") FROM table_3543 WHERE "Institution" = 'Kent State University' |
Name the last title for 2012 | CREATE TABLE table_73676 ("Club" text,"Home city" text,"Stadium" text,"First season in the Serie A" real,"First season in current spell" real,"Last title" text) | SELECT "Last title" FROM table_73676 WHERE "First season in current spell" = '2012' |
provide the number of patients whose discharge location is dead/expired and admission year is less than 2145? | 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 WHERE demographic.discharge_location = "DEAD/EXPIRED" AND demographic.admityear < "2145" |
When was Dickinson College founded? | CREATE TABLE table_73795 ("Institution" text,"Location" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" real,"Nickname" text,"US News Ranking 2014 for Liberal Arts" text,"Football?" text) | SELECT "Founded" FROM table_73795 WHERE "Institution" = 'Dickinson College' |
Name the total number of popular votes for mn attorney general in 1994 | CREATE TABLE table_name_74 (popular_votes VARCHAR,office VARCHAR,year VARCHAR) | SELECT COUNT(popular_votes) FROM table_name_74 WHERE office = "mn attorney general" AND year = 1994 |
Find the ids of the problems that are reported by the staff whose last name is Bosco. | CREATE TABLE problems (problem_id VARCHAR,reported_by_staff_id VARCHAR)CREATE TABLE staff (staff_id VARCHAR,staff_last_name VARCHAR) | SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = "Bosco" |
Original airdate for #6 with 1.246 viewers? | CREATE TABLE table_51166 ("Episode" real,"Original airdate" text,"Timeslot (approx.)" text,"Viewers (millions)" real,"Nightly rank" text) | SELECT "Original airdate" FROM table_51166 WHERE "Nightly rank" = '#6' AND "Viewers (millions)" = '1.246' |
List all opponents from the 4-4 scoring game. | CREATE TABLE table_26931 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Wildcats points" real,"Opponents" real,"Record" text) | SELECT "Opponent" FROM table_26931 WHERE "Record" = '4-4' |
Name the year for points less than 20 and chassis of dallara 3087 | CREATE TABLE table_name_62 (year VARCHAR,points VARCHAR,chassis VARCHAR) | SELECT year FROM table_name_62 WHERE points < 20 AND chassis = "dallara 3087" |
Name the gene name for methylobacterium nodulans | CREATE TABLE table_27155678_2 (gene_name VARCHAR,genus_species VARCHAR) | SELECT gene_name FROM table_27155678_2 WHERE genus_species = "Methylobacterium nodulans" |
What is the set 1 score when the total is 85 101? | CREATE TABLE table_name_92 (set_1 VARCHAR,total VARCHAR) | SELECT set_1 FROM table_name_92 WHERE total = "85–101" |
Which Seats have a Share of votes of 18%, and a Share of seats of 3%, and a General election larger than 1992? | CREATE TABLE table_name_62 (seats INTEGER,general_election VARCHAR,share_of_votes VARCHAR,share_of_seats VARCHAR) | SELECT MAX(seats) FROM table_name_62 WHERE share_of_votes = "18%" AND share_of_seats = "3%" AND general_election > 1992 |
have normal or only mildly impaired kidney function defined as a calculated gfr greater than 60 ml / min / 1.73 m2 | CREATE TABLE table_train_240 ("id" int,"anemia" bool,"gender" string,"systolic_blood_pressure_sbp" int,"hemoglobin_a1c_hba1c" float,"estimated_glomerular_filtration_rate_egfr" int,"diastolic_blood_pressure_dbp" int,"insulin_requirement" float,"kidney_disease" bool,"body_mass_index_bmi" float,"hypertension" bool,"NOUSE"... | SELECT * FROM table_train_240 WHERE kidney_disease = 1 OR estimated_glomerular_filtration_rate_egfr > 60 |
how many national parks were established after 1990 ? | CREATE TABLE table_204_143 (id number,"national park" text,"region" text,"land area (km2)" number,"established" number,"visitation (2009)" number,"coordinates" text) | SELECT COUNT("national park") FROM table_204_143 WHERE "established" > 1990 |
what is the first year on the chart ? | CREATE TABLE table_204_879 (id number,"year" number,"host / location" text,"division i overall" text,"division i undergraduate" text,"division ii overall" text,"division ii community college" text) | SELECT "year" FROM table_204_879 WHERE id = 1 |
What are all the metropolis / municipality where mayor is helen c. De castro | CREATE TABLE table_73803 ("City / Municipality" text,"No. of s Barangay" real,"District" real,"Area (km\u00b2)" text,"Population (2010)" real,"Income class (2007)" text,"ZIP code" real,"Mayor" text) | SELECT "City / Municipality" FROM table_73803 WHERE "Mayor" = 'Helen C. De Castro' |
Who is the listed opponent in Week 2? | CREATE TABLE table_name_24 (opponent VARCHAR,week VARCHAR) | SELECT opponent FROM table_name_24 WHERE week = 2 |
What is the slowest 50m split time for a total of 53.74 in a lane of less than 3? | CREATE TABLE table_74579 ("Lane" real,"Name" text,"Nationality" text,"Split (50m)" real,"Time" real) | SELECT MAX("Split (50m)") FROM table_74579 WHERE "Time" = '53.74' AND "Lane" < '3' |
What was the complement associated with 0 off 3 men killed and 0 off 2 men wounded? | CREATE TABLE table_28219 ("Unit" text,"Commander" text,"Complement" text,"Killed" text,"Wounded" text,"Missing" text) | SELECT "Complement" FROM table_28219 WHERE "Killed" = '0 off 3 men' AND "Wounded" = '0 off 2 men' |
What is the sum of top-25s for events with more than 1 top-5? | CREATE TABLE table_41732 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real) | SELECT SUM("Top-25") FROM table_41732 WHERE "Top-5" > '1' |
What are the mm dimensions of the Plustek Mobileoffice D28 Corporate? | CREATE TABLE table_20790 ("product" text,"dimensions (mm)" text,"dpi" real,"pages per minute (color)" real,"max page size" text,"interface" text) | SELECT "dimensions (mm)" FROM table_20790 WHERE "product" = 'Plustek MobileOffice D28 Corporate' |
All my answers sort score , viewcount, creationDate. All my answers on the site | CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostNotices (Id number,Post... | SELECT * FROM (SELECT q.Id AS aid, a.Id AS "post_link", CASE WHEN q.AcceptedAnswerId = a.Id THEN 'Accepted' END AS Accepted, a.Score FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId WHERE a.OwnerUserId = @UserId AND a.PostTypeId = 2) AS AA INNER JOIN (SELECT DISTINCT Question.Id AS bid, Question.CreationDate ... |
Find the average unit price of tracks from the Rock genre. | CREATE TABLE playlist (playlistid number,name text)CREATE TABLE invoice (invoiceid number,customerid number,invoicedate time,billingaddress text,billingcity text,billingstate text,billingcountry text,billingpostalcode text,total number)CREATE TABLE mediatype (mediatypeid number,name text)CREATE TABLE invoiceline (invoi... | SELECT AVG(T2.unitprice) FROM genre AS T1 JOIN track AS T2 ON T1.genreid = T2.genreid WHERE T1.name = "Rock" |
Show the number of the musical nominee with award 'Bob Fosse' or 'Cleavant Derricks'. | CREATE TABLE musical (Musical_ID int,Name text,Year int,Award text,Category text,Nominee text,Result text)CREATE TABLE actor (Actor_ID int,Name text,Musical_ID int,Character text,Duration text,age int) | SELECT Nominee, COUNT(Nominee) FROM musical WHERE Award = "Tony Award" OR Award = "Cleavant Derricks" GROUP BY Nominee |
what is the top three most frequent microbiology tests that followed in the same month for patients who received chest x-ray? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'chest x-ray') AS t1 JOIN (SELECT patient.uni... |
What Nationality of the person who has a Rank of 4 | CREATE TABLE table_name_59 (nationality VARCHAR,lane VARCHAR,rank VARCHAR) | SELECT nationality FROM table_name_59 WHERE lane < 4 AND rank = 4 |
calculate the maximum age of male patients with angioedema as primary disease. | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "ANGIOEDEMA" |
How many papers are in NLP ? | CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE field (fieldid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numcit... | SELECT DISTINCT COUNT(DISTINCT paper.paperid) FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'NLP' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid |
What is the rank for the city of sewri? | CREATE TABLE table_64653 ("Rank" real,"Name" text,"Status" text,"City" text,"Floors" real) | SELECT COUNT("Rank") FROM table_64653 WHERE "City" = 'sewri' |
How many weeks had an attendance larger than 84,816? | CREATE TABLE table_74774 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT COUNT("Week") FROM table_74774 WHERE "Attendance" > '84,816' |
What is the round of club be ej? | CREATE TABLE table_46715 ("Season" text,"Competition" text,"Round" text,"Club" text,"1st Leg" text) | SELECT "Round" FROM table_46715 WHERE "Club" = 'bečej' |
What is the number of each winning aircraft? Visualize by bar chart, and show from low to high by the total number. | CREATE TABLE airport (Airport_ID int,Airport_Name text,Total_Passengers real,%_Change_2007 text,International_Passengers real,Domestic_Passengers real,Transit_Passengers real,Aircraft_Movements real,Freight_Metric_Tonnes real)CREATE TABLE aircraft (Aircraft_ID int(11),Aircraft varchar(50),Description varchar(50),Max_Gr... | SELECT Aircraft, COUNT(Aircraft) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY Aircraft ORDER BY COUNT(Aircraft) |
What is the Rank that has Passengers larger than 70,921, and 2.8 % Change? | CREATE TABLE table_5232 ("Rank" real,"Airport" text,"Passengers" real,"% Change" text,"Carriers" text) | SELECT SUM("Rank") FROM table_5232 WHERE "Passengers" > '70,921' AND "% Change" = '2.8' |
What is the lane number of the swimmer with a time of 55.69? | CREATE TABLE table_name_21 (lane VARCHAR,time VARCHAR) | SELECT lane FROM table_name_21 WHERE time = 55.69 |
calculate the stool output of patient 015-59552 on this month/26. | 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 medication (medicationid number,patientunitstayid num... | 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 = '015-59552')) AND intakeoutput.celllabel = 'stool... |
what is the number of patients whose insurance is medicaid and procedure short title is conduit left ventr-aorta? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.short_title = "Conduit left ventr-aorta" |
What is minimum hours of the students playing in different position? | CREATE TABLE player (pid number,pname text,ycard text,hs number)CREATE TABLE college (cname text,state text,enr number)CREATE TABLE tryout (pid number,cname text,ppos text,decision text) | SELECT MIN(T2.hs), T1.ppos FROM tryout AS T1 JOIN player AS T2 ON T1.pid = T2.pid GROUP BY T1.ppos |
Perguntas de Score Alto & Respostas de Score Alto. | CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount numb... | SELECT P.Id AS "post_link", P.Score AS "SCORE PERG.", A.Score AS "SCORE RESP." FROM Posts AS P JOIN (SELECT Id, Score FROM Posts GROUP BY Id, Score) AS A ON P.AcceptedAnswerId = A.Id WHERE P.Score > @Score AND A.Score > @Score |
What was the winning team when mikhail goikhberg was the winning driver? | CREATE TABLE table_27988 ("Rnd" text,"Circuit" text,"Location" text,"Date" text,"Pole position" text,"Fastest lap" text,"Most laps led" text,"Winning driver" text,"Winning team" text,"Supporting" text) | SELECT "Winning team" FROM table_27988 WHERE "Winning driver" = 'Mikhail Goikhberg' |
A bar chart about what is minimum hours of the students playing in different position?, show Y in asc order. | CREATE TABLE Player (pID numeric(5,0),pName varchar(20),yCard varchar(3),HS numeric(5,0))CREATE TABLE College (cName varchar(20),state varchar(2),enr numeric(5,0))CREATE TABLE Tryout (pID numeric(5,0),cName varchar(20),pPos varchar(8),decision varchar(3)) | SELECT pPos, MIN(T2.HS) FROM Tryout AS T1 JOIN Player AS T2 ON T1.pID = T2.pID GROUP BY pPos ORDER BY MIN(T2.HS) |
What is the song in the volume with the maximum weeks on top? | CREATE TABLE music_festival (id number,music_festival text,date_of_ceremony text,category text,volume number,result text)CREATE TABLE volume (volume_id number,volume_issue text,issue_date text,weeks_on_top number,song text,artist_id number)CREATE TABLE artist (artist_id number,artist text,age number,famous_title text,f... | SELECT song FROM volume ORDER BY weeks_on_top DESC LIMIT 1 |
how did in 2105 patient 86209 last enter the hospital? | 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 labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE diagnoses_icd (row_id number... | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 86209 AND STRFTIME('%y', admissions.admittime) = '2105' ORDER BY admissions.admittime DESC LIMIT 1 |
How many points did landskrona bois get when they were ranked below 18? | CREATE TABLE table_54782 ("Rank" real,"Club" text,"Gold" real,"Big Silver" real,"Small Silver" real,"Bronze" real,"Points" real) | SELECT COUNT("Points") FROM table_54782 WHERE "Club" = 'landskrona bois' AND "Rank" < '18' |
How many airports haven't the pilot 'Thompson' driven an aircraft? | CREATE TABLE flight (id VARCHAR,airport_id VARCHAR,pilot VARCHAR)CREATE TABLE airport (id VARCHAR,airport_id VARCHAR,pilot VARCHAR) | SELECT COUNT(*) FROM airport WHERE NOT id IN (SELECT airport_id FROM flight WHERE pilot = 'Thompson') |
Who was the runner-up on 5 aug 1990? | CREATE TABLE table_34802 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner-up" text) | SELECT "Runner-up" FROM table_34802 WHERE "Date" = '5 aug 1990' |
count the number of patients whose diagnoses icd9 code is 5589 and lab test fluid is blood? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "5589" AND lab.fluid = "Blood" |
Who was the builder for the USS cambridge? | CREATE TABLE table_66046 ("Hull Number" text,"Name" text,"Builder" text,"Laid down" text,"Launched" text,"Completed" text) | SELECT "Builder" FROM table_66046 WHERE "Name" = 'uss cambridge' |
List the forenames of all distinct drivers in alphabetical order? | CREATE TABLE drivers (forename VARCHAR) | SELECT DISTINCT forename FROM drivers ORDER BY forename |
what was the name of the specimen test that was first given to patient 031-15417 since 116 months ago? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,c... | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15417')) AND DATETIME(microlab.culturetakentime) >= DATETIME(CURRE... |
provide the number of patients with delta abnormal lab test status who have benign neoplasm of pituitary gland and craniopharyngeal duct diagnoses. | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Benign neoplasm of pituitary gland and craniopharyngeal duct" AND lab.flag = "delta" |
give the duration of hospital stay for subject id 8440. | 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 demographic.days_stay FROM demographic WHERE demographic.subject_id = "8440" |
What day(s) did the team play indiana? | CREATE TABLE table_21592 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Date" FROM table_21592 WHERE "Team" = 'Indiana' |
Name the ERP W for glens falls, new york | CREATE TABLE table_name_56 (erp_w VARCHAR,city_of_license VARCHAR) | SELECT erp_w FROM table_name_56 WHERE city_of_license = "glens falls, new york" |
what was the first drug that patient 016-9636 had been prescribed via ngt route in this month? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636')) AND medication.routeadmin = 'ngt' AND DATETIME(medicati... |
Let me know on which date the patient Brian Taylor died. | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT demographic.dod FROM demographic WHERE demographic.name = "Brian Taylor" |
How large of a crowd can the Brunswick Street Oval hold? | CREATE TABLE table_53425 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT COUNT("Crowd") FROM table_53425 WHERE "Venue" = 'brunswick street oval' |
How many games did Robert Peare play? | CREATE TABLE table_28693349_2 (games INTEGER,player VARCHAR) | SELECT MAX(games) FROM table_28693349_2 WHERE player = "Robert Peare" |
What is the name when the local board is albert eden, and a Decile of 9? | CREATE TABLE table_78445 ("Name" text,"Gender" text,"Local board" text,"Suburb" text,"Authority" text,"Decile" text,"Roll" real) | SELECT "Name" FROM table_78445 WHERE "Local board" = 'albert–eden' AND "Decile" = '9' |
Which Record has an Event of cage rage 23? | CREATE TABLE table_name_35 (record VARCHAR,event VARCHAR) | SELECT record FROM table_name_35 WHERE event = "cage rage 23" |
What crew's EVA started on 20 February 20:09? | CREATE TABLE table_50370 ("Start Date/Time" text,"Duration" text,"End Time" text,"Spacecraft" text,"Crew" text) | SELECT "Crew" FROM table_50370 WHERE "Start Date/Time" = '20 february 20:09' |
What are all the AAA classes in the school years of 2004-05? | CREATE TABLE table_19446 ("School Year" text,"Class A" text,"Class AA" text,"Class AAA" text,"Class AAAA" text,"Class AAAAA" text) | SELECT "Class AAA" FROM table_19446 WHERE "School Year" = '2004-05' |
What date did Ted Horn win Lakewood Race 2? | CREATE TABLE table_name_46 (date VARCHAR,winner VARCHAR,race_name VARCHAR) | SELECT date FROM table_name_46 WHERE winner = "ted horn" AND race_name = "lakewood race 2" |
List all headquarters and the number of companies in each headquarter. | CREATE TABLE company (headquarters VARCHAR) | SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters |
what was the name of the procedure, which patient 006-70268 was first received this year? | 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 intakeoutput (intakeoutputid number,patientunits... | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-70268')) AND DATETIME(treatment.treatmenttime, 'start of year... |
What is the sum of All-Time, when Amateur Era is less than 0? | CREATE TABLE table_46742 ("Country" text,"Amateur Era" real,"Open Era" real,"All-time" real,"First title" real,"Last title" real) | SELECT SUM("All-time") FROM table_46742 WHERE "Amateur Era" < '0' |
What courses should I take before BCS 439 ? | CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch... | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'BCS' AND number = 439 |
what is death status and diagnoses icd9 code of subject name bruce harris? | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT demographic.expire_flag, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Bruce Harris" |
What was the points with 7 races? | CREATE TABLE table_32253 ("Season" real,"Series" text,"Team" text,"Races" text,"Wins" text,"Poles" text,"Podiums" text,"Points" text,"Final Placing" text) | SELECT "Points" FROM table_32253 WHERE "Races" = '7' |
Who did Edmonton Oilers get for their draft pick? | CREATE TABLE table_30818 ("Pick" text,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "Player" FROM table_30818 WHERE "NHL team" = 'Edmonton Oilers' |
Which Outcome has a Score in the final of 4 6, 5 7? | CREATE TABLE table_name_96 (outcome VARCHAR,score_in_the_final VARCHAR) | SELECT outcome FROM table_name_96 WHERE score_in_the_final = "4–6, 5–7" |
what is the number of the chosen club where the hc dukla tren n (slovakia) is from | CREATE TABLE table_30511 ("Pick" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT COUNT("Pick") FROM table_30511 WHERE "College/junior/club team" = 'HC Dukla Trenčín (Slovakia)' |
Name the least capacity for persons hour for 1983 | CREATE TABLE table_17814458_1 (capacity_in_persons_hour INTEGER,construction_year_s_ VARCHAR) | SELECT MIN(capacity_in_persons_hour) FROM table_17814458_1 WHERE construction_year_s_ = "1983" |
when was the first time that patient 027-139111 had a maximum systemicsystolic on 07/06/2103. | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiasto... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-139111')) AND NOT vitalperiodic.systemicsystoli... |
were there more than four episodes that featured cynthia ? | CREATE TABLE table_204_903 (id number,"title" text,"character" text,"broadcaster" text,"episodes" number,"date" number) | SELECT (SELECT "episodes" FROM table_204_903 WHERE "character" = 'cynthia') > 4 |
creatinine > 1.6 mg / dl | CREATE TABLE table_train_152 ("id" int,"systolic_blood_pressure_sbp" int,"creatinine_clearance_cl" float,"diastolic_blood_pressure_dbp" int,"total_cholesterol" int,"urine_protein" int,"proteinuria" int,"NOUSE" float) | SELECT * FROM table_train_152 WHERE creatinine_clearance_cl > 1.6 |
Top 50 users from Auckland. | CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicRea... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%auckland%' OR UPPER(Location) LIKE '%AUCKLAND' ORDER BY Reputation DESC LIMIT 50 |
Questions from a user with no accepted answer. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body te... | SELECT questions.Id AS "post_link", COUNT(*) AS "AnswerCount" FROM Posts AS questions JOIN Posts AS answers ON answers.ParentId = questions.Id WHERE questions.OwnerUserId = '##UserId##' AND questions.PostTypeId = 1 AND questions.AcceptedAnswerId IS NULL GROUP BY questions.Id |
Count the number of distinct channel owners. | CREATE TABLE program (program_id number,name text,origin text,launch number,owner text)CREATE TABLE broadcast_share (channel_id number,program_id number,date text,share_in_percent number)CREATE TABLE channel (channel_id number,name text,owner text,share_in_percent number,rating_in_percent number)CREATE TABLE broadcast ... | SELECT COUNT(DISTINCT owner) FROM channel |
Who was the winner when the General classification was held by Miguel Indurain, the Points classification held by Mario Cipollini, the Mountains classification held by Claudio Chiappucci, and the Young RIder classification held by Pavel Tonkov? | CREATE TABLE table_name_10 (winner VARCHAR,young_rider_classification VARCHAR,mountains_classification VARCHAR,general_classification VARCHAR,points_classification VARCHAR) | SELECT winner FROM table_name_10 WHERE general_classification = "miguel indurain" AND points_classification = "mario cipollini" AND mountains_classification = "claudio chiappucci" AND young_rider_classification = "pavel tonkov" |
Name the builder for wd number being 22 | CREATE TABLE table_20236726_2 (builder VARCHAR,wd_no VARCHAR) | SELECT builder FROM table_20236726_2 WHERE wd_no = 22 |
On what Route is the mountain with a Rank less than 33 and an Elevation of 11,312 feet 3448 m? | CREATE TABLE table_name_60 (route INTEGER,rank VARCHAR,elevation VARCHAR) | SELECT MAX(route) FROM table_name_60 WHERE rank < 33 AND elevation = "11,312 feet 3448 m" |
What is the venue of game 3? | CREATE TABLE table_76493 ("Game" real,"Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" text) | SELECT "Venue" FROM table_76493 WHERE "Game" = '3' |
What Player's had a To par of +1 and a Score of 73-71-73=217? | CREATE TABLE table_name_12 (player VARCHAR,to_par VARCHAR,score VARCHAR) | SELECT player FROM table_name_12 WHERE to_par = "+1" AND score = 73 - 71 - 73 = 217 |
What is the minimum and maximum number of bathrooms of all the apartments? | CREATE TABLE view_unit_status (apt_id number,apt_booking_id number,status_date time,available_yn others)CREATE TABLE apartments (apt_id number,building_id number,apt_type_code text,apt_number text,bathroom_count number,bedroom_count number,room_count text)CREATE TABLE guests (guest_id number,gender_code text,guest_firs... | SELECT MIN(bathroom_count), MAX(bathroom_count) FROM apartments |
What was the score for a game with the odds of p + 2 after 1847? | CREATE TABLE table_4962 ("Date" real,"Opponent" text,"Result" text,"Odds" text,"Location" text,"Score" text) | SELECT "Score" FROM table_4962 WHERE "Odds" = 'p + 2' AND "Date" > '1847' |
Find the list of page size which have more than 3 product listed | CREATE TABLE store_district (store_id number,district_id number)CREATE TABLE product (product_id number,product text,dimensions text,dpi number,pages_per_minute_color number,max_page_size text,interface text)CREATE TABLE district (district_id number,district_name text,headquartered_city text,city_population number,city... | SELECT max_page_size FROM product GROUP BY max_page_size HAVING COUNT(*) > 3 |
Who directed the episode that was written by Jackson Gillis and Originally aired on May 21, 1955? | CREATE TABLE table_72729 ("Series #" real,"Season #" real,"Title" text,"Directed by:" text,"Written by:" text,"Original air date" text) | SELECT "Directed by:" FROM table_72729 WHERE "Written by:" = 'Jackson Gillis' AND "Original air date" = 'May 21, 1955' |
What is Auckland thats got Otago of 184 R.C. Blunt & W. Hawksworth V (C) 1931/32? | CREATE TABLE table_71138 ("Auckland" text,"Canterbury" text,"Central Districts" text,"Otago" text,"Wellington" text) | SELECT "Auckland" FROM table_71138 WHERE "Otago" = '184 r.c. blunt & w. hawksworth v (c) 1931/32' |
show me patient 013-17922's daily maximum mchc since 160 months ago. | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-17922')) AND lab.labname = 'mchc' AND DATETIME(lab.labresulttime) >= DATETIME(... |
In what Round was Grant Long Drafted? | CREATE TABLE table_44814 ("Round" real,"Pick" real,"Player" text,"Position" text,"Nationality" text,"School/Club Team" text) | SELECT MIN("Round") FROM table_44814 WHERE "Player" = 'grant long' |
had patient 27146 received meds since 12/2105? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,a... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27146) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-12' |
Which professor will be teaching HJCS 477 next semester ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE stude... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester... |
What Tournament was the 2010 Olympic Games? | CREATE TABLE table_name_58 (tournament VARCHAR) | SELECT tournament FROM table_name_58 WHERE 2010 = "olympic games" |
On the ANTHRCUL 500 -level which courses are for 17 -credits ? | CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)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 ta (campus_job_id int,student_id int,locati... | SELECT DISTINCT department, name, number FROM course WHERE credits = 17 AND department = 'ANTHRCUL' AND number < 500 + 100 AND number >= 500 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.