instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
what is patient 030-47098's average value of cortisol until 29 months ago? | 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 AVG(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 = '030-47098')) AND lab.labname = 'cortisol' AND DATETIME(lab.labresulttime) <= DATET... |
In the circuit of Madonie, what was the date that had the winning constructor Bugatti? | CREATE TABLE table_name_17 (date VARCHAR,circuit VARCHAR,winning_constructor VARCHAR) | SELECT date FROM table_name_17 WHERE circuit = "madonie" AND winning_constructor = "bugatti" |
What day did they play on week 4? | CREATE TABLE table_name_25 (date VARCHAR,week VARCHAR) | SELECT date FROM table_name_25 WHERE week = 4 |
Which title has a translation in it of 1000 lies? | CREATE TABLE table_34769 ("Title" text,"Translation" text,"Lyricist" text,"Composer" text,"Duration" text) | SELECT "Title" FROM table_34769 WHERE "Translation" = '1000 lies' |
Which Centerfold model has a Cover model of irina voronina? | CREATE TABLE table_name_81 (centerfold_model VARCHAR,cover_model VARCHAR) | SELECT centerfold_model FROM table_name_81 WHERE cover_model = "irina voronina" |
Stat language trends over time by month. | CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId nu... | SELECT tmp.yearmon AS YEARMON, tmp.TagName AS TAGNAME, COUNT(*) AS COUNT FROM (SELECT DATE(CAST(TIME_TO_STR(CreationDate, '%Y') AS TEXT) + '-' + CAST(TIME_TO_STR(CreationDate, '%m') AS TEXT) + '-01') AS yearmon, t.TagName AS tagname FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.Tag... |
How many times was the vote percentage 15.0%? | CREATE TABLE table_28640 ("Rank" real,"Couple" text,"Judges" real,"Public" real,"Total" real,"Vote percentage" text,"Result" text) | SELECT COUNT("Total") FROM table_28640 WHERE "Vote percentage" = '15.0%' |
which week -lrb- s -rrb- did not have more than 75,000 in attendance ? | CREATE TABLE table_203_114 (id number,"week" number,"date" text,"tv time" text,"opponent" text,"result" text,"game site" text,"record" text,"attendance" number,"bye" text) | SELECT "week" FROM table_203_114 WHERE "attendance" <= 75000 |
count the number of patients whose year of death is less than or equal to 2133 and item id is 51384? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2133.0" AND lab.itemid = "51384" |
What country was Jay Haas representing? | CREATE TABLE table_name_77 (country VARCHAR,player VARCHAR) | SELECT country FROM table_name_77 WHERE player = "jay haas" |
Which County has a Number of households larger than 17,741, and a Median family income of $37,072? | CREATE TABLE table_13015 ("County" text,"Per capita income" text,"Median household income" text,"Median family income" text,"Population" real,"Number of households" real) | SELECT "County" FROM table_13015 WHERE "Number of households" > '17,741' AND "Median family income" = '$37,072' |
when is the last time that patient 006-113829 has been prescribed calcium carbonate antacid 500 mg po chew and potassium chloride er at the same time in 06/2103? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime ti... | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'calcium carbonate antacid 500 mg po chew' AND patient.uniquepid = '006-113829' AND STRFTIME('%y-%m', medication.drugstart... |
who are the candidates when the incumbent is lindsey graham? | CREATE TABLE table_18120 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text,"Candidates" text) | SELECT "Candidates" FROM table_18120 WHERE "Incumbent" = 'Lindsey Graham' |
How many countries were sampled for the Prosperity Index (2008)? | CREATE TABLE table_19948664_1 (countries_sampled INTEGER,index__year_ VARCHAR) | SELECT MAX(countries_sampled) FROM table_19948664_1 WHERE index__year_ = "Prosperity Index (2008)" |
how many married patients have diagnoses icd9 code 59080? | 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 WHERE demographic.marital_status = "MARRIED" AND diagnoses.icd9_code = "59080" |
what is the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft /sda and year of birth is less than 2071? | 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 text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.dob_year < "2071" |
Who was the offensive award winner the week when Bob Watson was given the overall award? | CREATE TABLE table_14132239_3 (offensive VARCHAR,overall VARCHAR) | SELECT offensive FROM table_14132239_3 WHERE overall = "Bob Watson" |
What is the least apparent magnitude for all constellations from hydra? | CREATE TABLE table_56182 ("NGC number" real,"Object type" text,"Constellation" text,"Right ascension (J2000)" text,"Declination (J2000)" text,"Apparent magnitude" real) | SELECT MIN("Apparent magnitude") FROM table_56182 WHERE "Constellation" = 'hydra' |
count the number of patients whose discharge location is short term hospital and age is less than 67? | 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.discharge_location = "SHORT TERM HOSPITAL" AND demographic.age < "67" |
What is the sum of participants in 2013 for Russia when there were 5 in 2010 and less than 4 in 2012? | CREATE TABLE table_7827 ("Country" text,"2010" real,"2011" real,"2012" real,"2013" real) | SELECT SUM("2013") FROM table_7827 WHERE "2010" = '5' AND "Country" = 'russia' AND "2012" < '4' |
What's the lowest Col ranked less than 6 with an Island of Moloka i? | CREATE TABLE table_65789 ("Rank" real,"Summit" text,"Country" text,"Island" text,"Col (m)" real) | SELECT MIN("Col (m)") FROM table_65789 WHERE "Island" = 'island of molokaʻi' AND "Rank" < '6' |
Name the least 10,000+ places for louisville | CREATE TABLE table_22916979_5 (_places VARCHAR,principal_city VARCHAR) | SELECT MIN(10), 000 + _places FROM table_22916979_5 WHERE principal_city = "Louisville" |
What is the Country of origin of PIck 6? | CREATE TABLE table_66031 ("Pick" real,"Player" text,"Country of origin*" text,"PBA team" text,"College" text) | SELECT "Country of origin*" FROM table_66031 WHERE "Pick" = '6' |
when was the last time patient 016-9636 today had per iv flush: antecubital l 20 gauge intake? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE allergy (allergyid number,patientunitstayid numbe... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636')) AND intakeoutput.cellpath LIKE '%intake%'... |
body mass index ( bmi ) of 18.5 to 45 kg / m2; and a total body weight > 50 kg ( 110 lbs ) . | CREATE TABLE table_dev_55 ("id" int,"gender" string,"serum_potassium_abnormality" float,"hemoglobin_a1c_hba1c" float,"body_weight" float,"renal_disease" bool,"serum_creatinine" float,"body_mass_index_bmi" float,"NOUSE" float) | SELECT * FROM table_dev_55 WHERE body_mass_index_bmi >= 18.5 AND body_mass_index_bmi <= 45 AND body_weight > 50 |
What is the total height of the player with a birthdate on September 2, 1973? | CREATE TABLE table_name_65 (height__cm_ VARCHAR,birthdate VARCHAR) | SELECT COUNT(height__cm_) FROM table_name_65 WHERE birthdate = "september 2, 1973" |
What is the population of the Parish, Plumbland, that had a former local authority of Cockermouth Rural District? | CREATE TABLE table_name_5 (population VARCHAR,former_local_authority VARCHAR,name VARCHAR) | SELECT COUNT(population) FROM table_name_5 WHERE former_local_authority = "cockermouth rural district" AND name = "plumbland" |
Top Perl users from India. | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CRE... | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... |
What is the Score of an Opponent\ in the final of jordi arrese lex corretja? | CREATE TABLE table_name_25 (score VARCHAR,opponents_in_the_final VARCHAR) | SELECT score FROM table_name_25 WHERE opponents_in_the_final = "jordi arrese àlex corretja" |
How many hours were flown in each of the years where more than 64379058.0 kilometers were flown? | CREATE TABLE table_52 ("Year" real,"Aircraft kilometers" real,"Departures" real,"Flying hours" real,"Passengers" real,"Seat factor" text,"Employees" real,"Profit/loss" text) | SELECT "Flying hours" FROM table_52 WHERE "Aircraft kilometers" > '64379058.0' |
Answer counts for questions where accepted answer is not top-voted. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ... | WITH TopAnswerScore AS (SELECT q.Id AS question, MAX(a.Score) AS topscore FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id GROUP BY q.Id) SELECT COALESCE(p.AnswerCount, 0), COUNT(*) AS N FROM Posts AS p INNER JOIN TopAnswerScore ON question = p.Id WHERE EXISTS(SELECT a.Id FROM Posts AS a WHERE a.Id = p.Accept... |
did patient 006-36108 suffer from any type of allergy in the last month? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patie... | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-36108')) AND DATETIME(allergy.allergytime, 'start of month') = DATETIME(CURR... |
How many breadth entries are there when propulsion is jet? | CREATE TABLE table_30296 ("Vessel" text,"Built" real,"Max Speed" text,"Length" text,"Breadth" text,"Flag" text,"Propulsion" text) | SELECT COUNT("Breadth") FROM table_30296 WHERE "Propulsion" = 'Jet' |
what is the current version with license gpl v3? | CREATE TABLE table_name_77 (current_version VARCHAR,license VARCHAR) | SELECT current_version FROM table_name_77 WHERE license = "gpl v3" |
What's the Opponent with a Week that's larger than 16? | CREATE TABLE table_74947 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Game Site" text,"TV Time" text,"Attendance" text) | SELECT "Opponent" FROM table_74947 WHERE "Week" > '16' |
what is the yearly minimum amount of platelet count of patient 88441? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88441) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count') GROUP BY STRFTIME('%y', labevents.charttime) |
Which rider had a time/retired od +19.909? | CREATE TABLE table_76649 ("Rider" text,"Manufacturer" text,"Laps" text,"Time/Retired" text,"Grid" text) | SELECT "Rider" FROM table_76649 WHERE "Time/Retired" = '+19.909' |
what are the methods of consumption of potassium chloride 20 meq/50 ml iv piggy back 50 ml bag? | 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 medication (medicationid number,patientunitstayid number,drugname text,dosage text... | SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'potassium chloride 20 meq/50 ml iv piggy back 50 ml bag' |
What is the team that has a shooting guard that played for the Grizzlies in 2000-2001? | CREATE TABLE table_name_98 (school_club_team VARCHAR,position VARCHAR,years_for_grizzlies VARCHAR) | SELECT school_club_team FROM table_name_98 WHERE position = "shooting guard" AND years_for_grizzlies = "2000-2001" |
How many Games have a Drawn larger than 0, and a Lost of 1? | CREATE TABLE table_38421 ("Games" real,"Drawn" real,"Lost" real,"Points difference" text,"Points" real) | SELECT COUNT("Games") FROM table_38421 WHERE "Drawn" > '0' AND "Lost" = '1' |
blood pressure ( measured after the participant is sitting / resting quietly for 5 minutes ) between 90 and 140 millimeter of mercury ( mmhg ) systolic | CREATE TABLE table_train_276 ("id" int,"hbv" bool,"systolic_blood_pressure_sbp" int,"hiv_infection" bool,"hcv" bool,"diastolic_blood_pressure_dbp" int,"body_mass_index_bmi" float,"hypertension" bool,"NOUSE" float) | SELECT * FROM table_train_276 WHERE systolic_blood_pressure_sbp >= 90 AND systolic_blood_pressure_sbp <= 140 |
Find all posts with only the 'theology' tag. | CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)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... | SELECT Id, Title, Tags FROM Posts AS "post_link" WHERE NOT Title IS NULL AND Tags = '<theology>' |
What is the average, maximum, and minimum for the number of hours spent training? | CREATE TABLE college (cname text,state text,enr number)CREATE TABLE tryout (pid number,cname text,ppos text,decision text)CREATE TABLE player (pid number,pname text,ycard text,hs number) | SELECT AVG(hs), MAX(hs), MIN(hs) FROM player |
how many drivers driving toyota corolla | CREATE TABLE table_20090682_4 (driver VARCHAR,vehicle VARCHAR) | SELECT COUNT(driver) FROM table_20090682_4 WHERE vehicle = "Toyota Corolla" |
Got most rep by negatively scored questions. | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResu... | WITH Raw AS (SELECT Posts.Id AS PostId, MIN(Posts.OwnerUserId) AS UserId, SUM(34 - 12 * Votes.VoteTypeId) AS QRep FROM Posts, Votes WHERE Posts.Id = Votes.PostId AND Votes.VoteTypeId BETWEEN 2 AND 3 AND Posts.PostTypeId = 1 AND Posts.Score < 0 AND Posts.OwnerUserId > 0 GROUP BY Posts.Id) SELECT UserId AS "user_link", U... |
What is every score in the final for opponent in final John Mcenroe at US Open? | CREATE TABLE table_23235767_1 (score_in_the_final VARCHAR,opponent_in_the_final VARCHAR,championship VARCHAR) | SELECT score_in_the_final FROM table_23235767_1 WHERE opponent_in_the_final = "John McEnroe" AND championship = "US Open" |
What is the To par of the Player with a Score of 71-74-72-72=289? | CREATE TABLE table_name_25 (to_par VARCHAR,score VARCHAR) | SELECT to_par FROM table_name_25 WHERE score = 71 - 74 - 72 - 72 = 289 |
give me the number of patients whose language is cape and admission location is clinic referral/premature? | 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 WHERE demographic.language = "CAPE" AND demographic.admission_location = "CLINIC REFERRAL/PREMATURE" |
What is Choreographer(s), when Chosen By is Mary Murphy, and when Couple is Katee Shean Stephen 'Twitch' Boss? | CREATE TABLE table_6859 ("Couple" text,"Style" text,"Music" text,"Choreographer(s)" text,"Chosen by" text) | SELECT "Choreographer(s)" FROM table_6859 WHERE "Chosen by" = 'mary murphy' AND "Couple" = 'katee shean stephen "twitch" boss' |
For all employees who have the letters D or S in their first name, what is the relationship between employee_id and salary ? | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_D... | SELECT EMPLOYEE_ID, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
Which mean total had Tim Sills as a player? | CREATE TABLE table_77796 ("Player" text,"Club" text,"League" real,"Play-offs" real,"FA Cup" real,"FA Trophy" real,"Total" real) | SELECT AVG("Total") FROM table_77796 WHERE "Player" = 'tim sills' |
On what surface was the Australian Open (6) played on? | CREATE TABLE table_29163303_1 (surface VARCHAR,championship VARCHAR) | SELECT surface FROM table_29163303_1 WHERE championship = "Australian Open (6)" |
Record of 44 18 8 involves which score? | CREATE TABLE table_35024 ("Game" real,"March" real,"Opponent" text,"Score" text,"Record" text,"Points" real) | SELECT "Score" FROM table_35024 WHERE "Record" = '44–18–8' |
How many wins? | CREATE TABLE table_22568 ("Position" real,"Team" text,"Played" real,"Wins" real,"Draws P.K. Wins / P.K. Losses" text,"Losses" real,"Scored" real,"Conceded" real,"Points" real) | SELECT MAX("Wins") FROM table_22568 |
Tell me the least season with level less than 1 | CREATE TABLE table_name_5 (season INTEGER,level INTEGER) | SELECT MIN(season) FROM table_name_5 WHERE level < 1 |
Can you tell me the sum of Gain that has the Name of kass, rob, and the Avg/g smaller than 1.9? | CREATE TABLE table_48412 ("Name" text,"Gain" real,"Loss" real,"Long" real,"Avg/g" real) | SELECT SUM("Gain") FROM table_48412 WHERE "Name" = 'kass, rob' AND "Avg/g" < '1.9' |
List all years in Orlando where Jeryl Sasser was a player. | CREATE TABLE table_15621965_17 (years_in_orlando VARCHAR,player VARCHAR) | SELECT years_in_orlando FROM table_15621965_17 WHERE player = "Jeryl Sasser" |
What was the second qualification time with a first qualification time of 1:02.813? | CREATE TABLE table_43614 ("Name" text,"Team" text,"Qual 1" text,"Qual 2" text,"Best" text) | SELECT "Qual 2" FROM table_43614 WHERE "Qual 1" = '1:02.813' |
What are the classes that Dr. Patrick Seitzer has taught ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,en... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour... |
Was Magoffin a starting player? | CREATE TABLE table_28038 ("Player" text,"Position" text,"Starter" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real) | SELECT "Starter" FROM table_28038 WHERE "Player" = 'Magoffin' |
How many TDs for the player averaging over 7, and over 39 yards? | CREATE TABLE table_57993 ("Player" text,"Car." real,"Yards" real,"Avg." real,"TD's" real,"Long" real) | SELECT MIN("TD's") FROM table_57993 WHERE "Avg." > '7' AND "Yards" > '39' |
On June 30, 2008 who what was the Republican: Jeff Sessions percentage? | CREATE TABLE table_21040 ("Poll Source" text,"Dates administered" text,"Democrat: Vivian Davis Figures" text,"Republican: Jeff Sessions" text,"Lead Margin" real) | SELECT "Republican: Jeff Sessions" FROM table_21040 WHERE "Dates administered" = 'June 30, 2008' |
Which class was made in 1880? | CREATE TABLE table_name_34 (class VARCHAR,year_made VARCHAR) | SELECT class FROM table_name_34 WHERE year_made = "1880" |
What college did Louis LeBlanc attend? | CREATE TABLE table_59310 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/junior/club team (league)" text) | SELECT "College/junior/club team (league)" FROM table_59310 WHERE "Player" = 'louis leblanc' |
How many wins are associated with a position of under 6, over 8 top 5s, and 1793 points? | CREATE TABLE table_37055 ("Position" real,"Driver" text,"Wins" real,"Poles" real,"Top 5's" real,"Points" real) | SELECT SUM("Wins") FROM table_37055 WHERE "Position" < '6' AND "Top 5's" = '8' AND "Points" = '1793' |
What are the names of the technicians that are assigned to repair machines with more point values than 70, and count them by a bar chart, and sort in ascending by the x-axis. | CREATE TABLE technician (technician_id real,Name text,Team text,Starting_Year real,Age int)CREATE TABLE repair_assignment (technician_id int,repair_ID int,Machine_ID int)CREATE TABLE machine (Machine_ID int,Making_Year int,Class text,Team text,Machine_series text,value_points real,quality_rank int)CREATE TABLE repair (... | SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70 GROUP BY Name ORDER BY Name |
What is the largest start for a player with 14 conv, 10 tries and more than 22 pens? | CREATE TABLE table_10150 ("Player" text,"Span" text,"Start" real,"Tries" real,"Conv" real,"Pens" real,"Drop" real) | SELECT MAX("Start") FROM table_10150 WHERE "Conv" = '14' AND "Tries" = '10' AND "Pens" > '22' |
What are the ids and details of events that have more than one participants? | CREATE TABLE participants (participant_id number,participant_type_code text,participant_details text)CREATE TABLE participants_in_events (event_id number,participant_id number)CREATE TABLE events (event_id number,service_id number,event_details text)CREATE TABLE services (service_id number,service_type_code text) | SELECT T1.event_id, T1.event_details FROM events AS T1 JOIN participants_in_events AS T2 ON T1.event_id = T2.event_id GROUP BY T1.event_id HAVING COUNT(*) > 1 |
what was the first time that patient 5828 had an intake in a day before? | CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (r... | 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 = 5828)) AND DATETIME(inputevents_cv.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'st... |
What is the lowest profits (billion $) for the rank 6? | CREATE TABLE table_7917 ("Rank" real,"Company" text,"Headquarters" text,"Industry" text,"Sales (billion $)" real,"Profits (billion $)" real,"Assets (billion $)" real,"Market Value (billion $)" real) | SELECT MIN("Profits (billion $)") FROM table_7917 WHERE "Rank" = '6' |
Who were the cover models in the edition that included Benicio Del Toro as the interview subject? | CREATE TABLE table_1305 ("Date" text,"Cover model" text,"Centerfold model" text,"Interview subject" text,"20 Questions" text,"Pictorials" text) | SELECT "Cover model" FROM table_1305 WHERE "Interview subject" = 'Benicio del Toro' |
What Catalog came out on August 20, 1965? | CREATE TABLE table_name_21 (catalog VARCHAR,date VARCHAR) | SELECT catalog FROM table_name_21 WHERE date = "august 20, 1965" |
What is the type of the king title? | CREATE TABLE table_name_2 (type VARCHAR,title VARCHAR) | SELECT type FROM table_name_2 WHERE title = "king" |
what is the number of patients who were discharged from the hospital until 2103? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE medication (medicationid number,patient... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) <= '2103' |
What date has a Crowd larger than 12,000, and an Away team score of 9.16 (70)? | CREATE TABLE table_58280 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_58280 WHERE "Crowd" > '12,000' AND "Away team score" = '9.16 (70)' |
Show me a bar chart for how many invoices were billed from each state?, could you sort Y-axis in asc order? | CREATE TABLE media_types (id INTEGER,name VARCHAR(120))CREATE TABLE tracks (id INTEGER,name VARCHAR(200),album_id INTEGER,media_type_id INTEGER,genre_id INTEGER,composer VARCHAR(220),milliseconds INTEGER,bytes INTEGER,unit_price NUMERIC(10,2))CREATE TABLE playlist_tracks (playlist_id INTEGER,track_id INTEGER)CREATE TAB... | SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) |
What was the result when the opponent was Arsenal? | CREATE TABLE table_name_56 (result VARCHAR,opponent VARCHAR) | SELECT result FROM table_name_56 WHERE opponent = "arsenal" |
How long is the rollar coaster on Kemah Boardwalk | CREATE TABLE table_2665085_1 (length__ft_ VARCHAR,park VARCHAR) | SELECT length__ft_ FROM table_2665085_1 WHERE park = "Kemah Boardwalk" |
What is the round for a year earlier than 1987? | CREATE TABLE table_name_19 (round VARCHAR,year INTEGER) | SELECT round FROM table_name_19 WHERE year < 1987 |
A bar chart about what are the memories and carriers of phones?, and display by the bars from high to low. | CREATE TABLE market (Market_ID int,District text,Num_of_employees int,Num_of_shops real,Ranking int)CREATE TABLE phone_market (Market_ID int,Phone_ID text,Num_of_stock int)CREATE TABLE phone (Name text,Phone_ID int,Memory_in_G int,Carrier text,Price real) | SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY Carrier DESC |
What is name of the drive with a Time of +13.315? | CREATE TABLE table_34923 ("Team" text,"Driver" text,"Laps" real,"Time" text,"Grid" real) | SELECT "Driver" FROM table_34923 WHERE "Time" = '+13.315' |
what is the name of the insurance in patient 57050 on this hospital encounter? | 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 chartevents (row_id number,subject_id number,hadm_id number,ic... | SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 57050 AND admissions.dischtime IS NULL |
Users with their own Bronze Tag Badges. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,T... | SELECT B.Name, B.UserId AS "user_link" FROM Badges AS B WHERE Class = 3 AND TagBased = 1 AND (SELECT COUNT(B2.Name) FROM Badges AS B2 WHERE B2.Name = B.Name AND B2.Class = 3 AND B2.TagBased = 1) = 1 GROUP BY B.Name, B.UserId ORDER BY B.Name |
how many total row entries are there ? | CREATE TABLE table_203_364 (id number,"year" number,"driver" text,"nation of citizenship" text,"racing series" text,"type of vehicle" text) | SELECT COUNT(*) FROM table_203_364 |
find the female patients who have procedure icd9 code 3727. | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "3727" |
Give me the comparison about ID over the meter_400 by a bar chart, could you sort x axis in ascending order? | CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadiu... | SELECT meter_400, ID FROM swimmer ORDER BY meter_400 |
For the courses in computing infrastructure who are the teachers ? | CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE semester (semester_id int,semester varchar,year ... | 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 area ON course_offering.course_id = area.course_id WHERE area.area LIKE '%... |
What Object Type has a 21h01m37.7s Right Ascension (J2000) and 6995 or greater NGC? | CREATE TABLE table_name_81 (object_type VARCHAR,ngc_number VARCHAR,right_ascension___j2000__ VARCHAR) | SELECT object_type FROM table_name_81 WHERE ngc_number > 6995 AND right_ascension___j2000__ = "21h01m37.7s" |
What year was the margin of victory 9 strokes and the purse under $2,750,000? | CREATE TABLE table_35808 ("Year" real,"Dates" text,"Venue" text,"Champion" text,"Country" text,"Score" real,"To par" text,"Margin of victory" text,"Runner(s)-up" text,"Purse ($)" real,"Winner's share ($)" real) | SELECT AVG("Year") FROM table_35808 WHERE "Margin of victory" = '9 strokes' AND "Purse ( $ )" < '2,750,000' |
What was the high points when the team was Washington? | CREATE TABLE table_27755603_10 (high_points VARCHAR,team VARCHAR) | SELECT high_points FROM table_27755603_10 WHERE team = "Washington" |
What is the Week when the winner was mary joe fern ndez 6 4, 7 5? | CREATE TABLE table_name_88 (week_of VARCHAR,winner VARCHAR) | SELECT week_of FROM table_name_88 WHERE winner = "mary joe fernández 6–4, 7–5" |
flights from MEMPHIS to LAS VEGAS on sunday | 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 aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body var... | 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VEGAS' AND date_day.day_number = 27 AND date_day.month_number = 8 AND... |
Which Brazil scorers have a Result of w, and a Competition of world cup qualifying, and a Date of february 28, 1954? | CREATE TABLE table_34795 ("Date" text,"Result" text,"Score" text,"Brazil scorers" text,"Competition" text) | SELECT "Brazil scorers" FROM table_34795 WHERE "Result" = 'w' AND "Competition" = 'world cup qualifying' AND "Date" = 'february 28, 1954' |
count the number of patients for whom neostigmine was prescribed in the same month after having been diagnosed during the previous year with atherosclerosis nec. | CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE microbiologyevents (row... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'atherosclerosis ne... |
What is the number eliminated when kelly and brendan are safe? | CREATE TABLE table_12305325_4 (eliminated VARCHAR,safe VARCHAR) | SELECT COUNT(eliminated) FROM table_12305325_4 WHERE safe = "Kelly and Brendan" |
Which team has an away team score of 9.11 (65)? | CREATE TABLE table_11864 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_11864 WHERE "Away team score" = '9.11 (65)' |
Which team has 5 as a game? | CREATE TABLE table_23285761_11 (team VARCHAR,game VARCHAR) | SELECT team FROM table_23285761_11 WHERE game = 5 |
Who sponsored the bill that was introduced on June 2, 2009? | CREATE TABLE table_name_55 (sponsor_s_ VARCHAR,date_introduced VARCHAR) | SELECT sponsor_s_ FROM table_name_55 WHERE date_introduced = "june 2, 2009" |
What is the value of D 43 O that has a corresponding R 53 + value of r 8? | CREATE TABLE table_78138 ("D 41 O" text,"D 42 O" text,"D 43 O" text,"D 44 O" text,"D 45 +" text,"R 55 +" text,"R 54 +" text,"R 53 +" text,"R 52 O" text,"R 51 O" text) | SELECT "D 43 O" FROM table_78138 WHERE "R 53 +" = 'r 8' |
What is Greg Norman's place? | CREATE TABLE table_name_89 (place VARCHAR,player VARCHAR) | SELECT place FROM table_name_89 WHERE player = "greg norman" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.