instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
give me the number of patients whose primary disease is syncope;telemetry and procedure short title is partial glossectomy? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "SYNCOPE;TELEMETRY" AND procedures.short_title = "Partial glossectomy" |
Which Number of households has a County of cook, and Population smaller than 5,176? | CREATE TABLE table_name_98 (number_of_households INTEGER,county VARCHAR,population VARCHAR) | SELECT AVG(number_of_households) FROM table_name_98 WHERE county = "cook" AND population < 5 OFFSET 176 |
Unanswered [tsql] questions created in the last week. | CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId nu... | SELECT p.Id AS "post_link", p.Tags, DATEDIFF(DAY, p.LastActivityDate, GETDATE()) AS DaysSinceActivity, COUNT(DISTINCT a.Id) AS Answers FROM Posts AS p JOIN PostTypes AS ptype ON p.PostTypeId = ptype.Id JOIN PostTags AS ptags ON p.Id = ptags.PostId JOIN Tags ON ptags.TagId = Tags.Id LEFT JOIN Posts AS a ON a.ParentId = ... |
When rashard lewis (24) has the highest amount of points who is the team? | CREATE TABLE table_23249053_11 (team VARCHAR,high_points VARCHAR) | SELECT team FROM table_23249053_11 WHERE high_points = "Rashard Lewis (24)" |
Give me the comparison about School_ID over the All_Home , and group by attribute ACC_Road, and show bar in asc order. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home |
What is the largest crowd for North Melbourne home games? | CREATE TABLE table_name_48 (crowd INTEGER,home_team VARCHAR) | SELECT MAX(crowd) FROM table_name_48 WHERE home_team = "north melbourne" |
what is the number of songs produced by k def on the album ? | CREATE TABLE table_204_906 (id number,"#" number,"title" text,"songwriters" text,"producer(s)" text,"performer" text) | SELECT COUNT(*) FROM table_204_906 WHERE "songwriters" = 'k-def' |
What is the Date with a Result of 8 2, and a Score with 6 2? | CREATE TABLE table_name_99 (date VARCHAR,result VARCHAR,score VARCHAR) | SELECT date FROM table_name_99 WHERE result = "8–2" AND score = "6–2" |
Who was the opponent when the attendance was 31,002? | CREATE TABLE table_43834 ("Date" text,"Opponent" text,"Site" text,"Result" text,"Attendance" text) | SELECT "Opponent" FROM table_43834 WHERE "Attendance" = '31,002' |
Which Tournament has a Semi finalists of martina hingis joannette kruger? | CREATE TABLE table_name_62 (tournament VARCHAR,semi_finalists VARCHAR) | SELECT tournament FROM table_name_62 WHERE semi_finalists = "martina hingis joannette kruger" |
Show different teams of technicians and the number of technicians in each team. Show a pie chart. | 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 (repair_ID int,name text,Launch_Date text,Notes text)CREATE TABLE technician (technician_id real,Name text,Team text,Starting_Year real,Age int)CREATE TABLE repair_assignm... | SELECT Team, COUNT(*) FROM technician GROUP BY Team |
how many lanes were there ? | CREATE TABLE table_204_547 (id number,"rank" number,"lane" number,"name" text,"nationality" text,"time" number,"notes" text) | SELECT COUNT("lane") FROM table_204_547 |
is there a flight from PHILADELPHIA to OAKLAND with a stop in DALLAS | CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_dis... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND CITY_2.ci... |
what is the number of unmarried patients who had white blood cells lab test? | 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.marital_status = "SINGLE" AND lab.label = "White Blood Cells" |
which image frame has the largest crop factor ? | CREATE TABLE table_203_356 (id number,"type" text,"diagonal (mm)" text,"width (mm)" text,"height (mm)" text,"area (mm2)" text,"stops (area)" number,"crop factor" text) | SELECT "type" FROM table_203_356 ORDER BY "crop factor" DESC LIMIT 1 |
What is the least value for week? | CREATE TABLE table_73592 ("Week" real,"Date" text,"Opponent" text,"Location" text,"Final Score" text,"Attendance" real,"Record" text) | SELECT MIN("Week") FROM table_73592 |
If the title is The Way Through The Woods, what is the release date? | CREATE TABLE table_23603 ("Title" text,"Author" text,"Reader" text,"Format" text,"Company" text,"Release Date" text,"Notes" text) | SELECT "Release Date" FROM table_23603 WHERE "Title" = 'The Way Through the Woods' |
Who is the Incumbent of the Democratic Party at an election after 1992 in the New York 1 District who was Re-elected? | CREATE TABLE table_name_45 (incumbent VARCHAR,district VARCHAR,first_elected VARCHAR,party VARCHAR,results VARCHAR) | SELECT incumbent FROM table_name_45 WHERE party = "democratic" AND results = "re-elected" AND first_elected > 1992 AND district = "new york 1" |
I want the D 45 and D 42 of r 22 | CREATE TABLE table_77508 ("D 49" text,"D 48" text,"D 47" text,"D 46" text,"D 45" text,"D 44" text,"D 43" text,"D 42" text,"D 41" text,"D 40" text) | SELECT "D 45" FROM table_77508 WHERE "D 42" = 'r 22' |
Name the 2011 for 2009 being 2r at wimbledon | CREATE TABLE table_58550 ("Tournament" text,"2009" text,"2011" text,"2012" text,"2013" text) | SELECT "2011" FROM table_58550 WHERE "2009" = '2r' AND "Tournament" = 'wimbledon' |
Which 2005 has a G zel aml s Lost Panther of green fairy? | CREATE TABLE table_53535 ("G\u00fczel\u00e7aml\u0131\u2019nin Kay\u0131p Panteri" text,"G\u00fczel\u00e7aml\u0131\u2019s Lost Panther" text,"Collection of Short Stories" text,"Can Yay\u0131nlar\u0131" text,"2005" real) | SELECT "2005" FROM table_53535 WHERE "G\u00fczel\u00e7aml\u0131\u2019s Lost Panther" = 'green fairy' |
What day did episode number 4 air originally? | CREATE TABLE table_24648983_1 (original_air_date VARCHAR,№ VARCHAR) | SELECT original_air_date FROM table_24648983_1 WHERE № = 4 |
in total, count the number of patients who have been prescribed ecotrin until 2103. | 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 vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'ecotrin' AND STRFTIME('%y', medication.drugstarttime) <= '2103') |
What is the average total for Dave Stockton? | CREATE TABLE table_59776 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real) | SELECT AVG("Total") FROM table_59776 WHERE "Player" = 'dave stockton' |
display job Title, the difference between minimum and maximum salaries for those jobs which max salary within the range 12000 to 18000. | CREATE TABLE countries (country_id text,country_name text,region_id number)CREATE TABLE job_history (employee_id number,start_date time,end_date time,job_id text,department_id number)CREATE TABLE jobs (job_id text,job_title text,min_salary number,max_salary number)CREATE TABLE locations (location_id number,street_addre... | SELECT job_title, max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000 |
When is the latest year that an entrant has toro rosso str1 chassis and under 1 point? | CREATE TABLE table_name_4 (year INTEGER,chassis VARCHAR,points VARCHAR) | SELECT MAX(year) FROM table_name_4 WHERE chassis = "toro rosso str1" AND points < 1 |
Which Player has a Nationality of united states, a Position of forward, and a School/Club Team of notre dame? | CREATE TABLE table_7448 ("Player" text,"Nationality" text,"Position" text,"Years in Orlando" text,"School/Club Team" text) | SELECT "Player" FROM table_7448 WHERE "Nationality" = 'united states' AND "Position" = 'forward' AND "School/Club Team" = 'notre dame' |
What year did Zone Rouge first air? | CREATE TABLE table_79978 ("Country" text,"Name" text,"Host" text,"Channel" text,"Prize" text,"First year aired" text) | SELECT "First year aired" FROM table_79978 WHERE "Name" = 'zone rouge' |
Find the directors of all movies featuring ' Kate Winslet | CREATE TABLE classification (id int,msid int,gid int)CREATE TABLE tags (id int,msid int,kid int)CREATE TABLE movie (mid int,title text,release_year int,title_aka text,budget text)CREATE TABLE tv_series (sid int,title text,release_year int,num_of_seasons int,num_of_episodes int,title_aka text,budget text)CREATE TABLE ac... | SELECT director.name FROM actor, cast, directed_by, director, movie WHERE actor.name = 'Kate Winslet' AND cast.aid = actor.aid AND director.did = directed_by.did AND movie.mid = cast.msid AND movie.mid = directed_by.msid |
As an undergrad , can I take 571 ? | CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREAT... | SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 571 |
What are the name and os of web client accelerators that do not work with only a 'Broadband' type connection? | CREATE TABLE browser (id number,name text,market_share number)CREATE TABLE accelerator_compatible_browser (accelerator_id number,browser_id number,compatible_since_year number)CREATE TABLE web_client_accelerator (id number,name text,operating_system text,client text,connection text) | SELECT name, operating_system FROM web_client_accelerator WHERE connection <> 'Broadband' |
What is the rate of 17 years? | CREATE TABLE table_name_55 (rate VARCHAR,year VARCHAR) | SELECT rate FROM table_name_55 WHERE year = "17 years" |
Who was the home team when Geelong was the away team? | CREATE TABLE table_33473 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team" FROM table_33473 WHERE "Away team" = 'geelong' |
how many patients on oral route of drug administration have been diagnosed with unspecified cerebral artery occlusion with cerebral infarction? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Crbl art ocl NOS w infrc" AND prescriptions.route = "ORAL" |
What is the goal Difference at Position 5? | CREATE TABLE table_name_53 (difference VARCHAR,position VARCHAR) | SELECT difference FROM table_name_53 WHERE position = 5 |
the heart rate of patient 10624 was ever less than 75.0 on 09/04/last year? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime 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 d_icd_procedures (row_id number,icd9_code text,short_title text,l... | 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 = 10624)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d... |
Name the college for nate binder | CREATE TABLE table_27273 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text) | SELECT "College" FROM table_27273 WHERE "Player" = 'Nate Binder' |
Report the number of students in each classroom. | CREATE TABLE list (classroom VARCHAR) | SELECT classroom, COUNT(*) FROM list GROUP BY classroom |
Of the 1978 winners, who had finish totals smaller than 292? | CREATE TABLE table_name_55 (finish VARCHAR,total VARCHAR,year_s__won VARCHAR) | SELECT finish FROM table_name_55 WHERE total < 292 AND year_s__won = "1978" |
Tell me the rider that had round 1 points of 7.465 and total more than 16.615 | CREATE TABLE table_name_65 (rider VARCHAR,total VARCHAR,round_1_points VARCHAR) | SELECT rider FROM table_name_65 WHERE total > 16.615 AND round_1_points = "7.465" |
What is the power of an engine of 1972? | CREATE TABLE table_name_73 (power VARCHAR,years VARCHAR) | SELECT power FROM table_name_73 WHERE years = "1972" |
Find the names of users who did not leave any review. | CREATE TABLE review (a_id number,u_id number,i_id number,rating number,rank number)CREATE TABLE trust (source_u_id number,target_u_id number,trust number)CREATE TABLE useracct (u_id number,name text)CREATE TABLE item (i_id number,title text) | SELECT name FROM useracct WHERE NOT u_id IN (SELECT u_id FROM review) |
Calculate the number of patients who have been diagnosed with hypospadias that have a delta lab test status. | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | 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 = "Hypospadias" AND lab.flag = "delta" |
What country or territory is ma gorzata ro niecka from? | CREATE TABLE table_name_33 (country_territory VARCHAR,miss_international VARCHAR) | SELECT country_territory FROM table_name_33 WHERE miss_international = "małgorzata rożniecka" |
Find the id of the item whose title is 'orange'. | CREATE TABLE review (a_id number,u_id number,i_id number,rating number,rank number)CREATE TABLE item (i_id number,title text)CREATE TABLE useracct (u_id number,name text)CREATE TABLE trust (source_u_id number,target_u_id number,trust number) | SELECT i_id FROM item WHERE title = "orange" |
What is the gpa of the top 5 students with highest gpa? Show me a pie chart. | CREATE TABLE CLASS (CLASS_CODE varchar(5),CRS_CODE varchar(10),CLASS_SECTION varchar(2),CLASS_TIME varchar(20),CLASS_ROOM varchar(8),PROF_NUM int)CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CODE varchar(8),EMP_NUM int,DEPT_ADDRESS varchar(20),DEPT_EXTENSION varchar(4))CREATE TABLE COURSE... | SELECT STU_FNAME, STU_GPA FROM STUDENT ORDER BY STU_GPA DESC LIMIT 5 |
Who was the guest when attendance was 3? | CREATE TABLE table_5525 ("Venue" text,"Home" text,"Guest" text,"Score" text,"Attendance" real) | SELECT "Guest" FROM table_5525 WHERE "Attendance" = '3' |
Which home team corresponds to an away team score of 5.10 (40)? | CREATE TABLE table_33036 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team" FROM table_33036 WHERE "Away team score" = '5.10 (40)' |
How many opengl have the ironlake ( clarkdale ) code name? | CREATE TABLE table_28156 ("Graphics" text,"Launch" real,"Market" text,"CPU" text,"Code name" text,"Device ID" real,"Core clock (MHz)" text,"Execution units" real,"Shader model" text,"DirectX" text,"OpenGL" text,"OpenCL" text,"Memory bandwidth (GB/s)" text,"DVMT (MB)" real,"CVT HD" text,"QSV" text) | SELECT COUNT("OpenGL") FROM table_28156 WHERE "Code name" = 'Ironlake ( Clarkdale )' |
Who were the incumbent(s) when the result was a retired democratic-republican hold and the first elected representative was in 1816> | CREATE TABLE table_2668336_19 (incumbent VARCHAR,result VARCHAR,first_elected VARCHAR) | SELECT incumbent FROM table_2668336_19 WHERE result = "Retired Democratic-Republican hold" AND first_elected = "1816" |
provide the number of patients whose religion is protestant quaker and procedure short title is int insert 1-cham, rate? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.religion = "PROTESTANT QUAKER" AND procedures.short_title = "Int insert 1-cham, rate" |
Name the No. 5 which has a No. 6 of ethan, and a No. 4 of william, and a No. 9 of john? | CREATE TABLE table_43788 ("Region (year)" text,"No. 1" text,"No. 2" text,"No. 3" text,"No. 4" text,"No. 5" text,"No. 6" text,"No. 7" text,"No. 8" text,"No. 9" text,"No. 10" text) | SELECT "No. 5" FROM table_43788 WHERE "No. 6" = 'ethan' AND "No. 4" = 'william' AND "No. 9" = 'john' |
How many documents for each document type description? Visualize by a bar chart, and could you show Y-axis from high to low order? | CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR(15),Budget_Type_Description VARCHAR(255))CREATE TABLE Documents (Document_ID INTEGER,Document_Type_Code CHAR(15),Project_ID INTEGER,Document_Date DATETIME,Document_Name VARCHAR(255),Document_Description VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Projects (P... | SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description ORDER BY COUNT(Document_Type_Description) DESC |
Which Pick # is the highest and has the Rd # is under 1? | CREATE TABLE table_name_9 (pick__number INTEGER,rd__number INTEGER) | SELECT MAX(pick__number) FROM table_name_9 WHERE rd__number < 1 |
Which player has $450 and a score of 76-74-74-72=296? | CREATE TABLE table_13148 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real,"Money ($)" text) | SELECT "Player" FROM table_13148 WHERE "Money ( $ )" = '450' AND "Score" = '76-74-74-72=296' |
What was the score for Hawthorn when they were the away team? | CREATE TABLE table_name_56 (away_team VARCHAR) | SELECT away_team AS score FROM table_name_56 WHERE away_team = "hawthorn" |
What is Record, when Opponent is San Francisco Warriors? | CREATE TABLE table_name_78 (record VARCHAR,opponent VARCHAR) | SELECT record FROM table_name_78 WHERE opponent = "san francisco warriors" |
let me know the long title of diagnoses for patient with patient id 21796. | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "21796" |
What was the location and it's attendance when the Bobcats played against Washington? | CREATE TABLE table_25808 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Location Attendance" FROM table_25808 WHERE "Team" = 'Washington' |
Which Report includes Monaco? | CREATE TABLE table_55707 ("Race" text,"Date" text,"Location" text,"Pole Position" text,"Fastest Lap" text,"Race Winner" text,"Constructor" text,"Report" text) | SELECT "Report" FROM table_55707 WHERE "Location" = 'monaco' |
What was the pick for the game at the College of Kentucky with the team Washington Capitols? | CREATE TABLE table_12079 ("Round" text,"Pick" text,"Position" text,"Team" text,"College" text) | SELECT "Pick" FROM table_12079 WHERE "College" = 'kentucky' AND "Team" = 'washington capitols' |
what were the number of times san marino was an opponent ? | CREATE TABLE table_203_6 (id number,"#" number,"date" text,"venue" text,"opponent" text,"score" text,"result" text,"competition" text) | SELECT COUNT(*) FROM table_203_6 WHERE "opponent" = 'san marino' |
What is the total of wins when the cuts made is 76 and the events greater than 115? | CREATE TABLE table_name_3 (wins INTEGER,cuts_made VARCHAR,events VARCHAR) | SELECT SUM(wins) FROM table_name_3 WHERE cuts_made = 76 AND events > 115 |
Tell me the driver for 58 laps | CREATE TABLE table_name_18 (driver VARCHAR,laps VARCHAR) | SELECT driver FROM table_name_18 WHERE laps = 58 |
What's the series number of the episode originally viewed by 4.1 million people and written by Douglas Lieblein? | CREATE TABLE table_1807 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Prod. code" text,"Viewers (millions)" text) | SELECT "No. in series" FROM table_1807 WHERE "Viewers (millions)" = '4.1' AND "Written by" = 'Douglas Lieblein' |
What is Anders Forsbrand's Place? | CREATE TABLE table_76937 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real) | SELECT "Place" FROM table_76937 WHERE "Player" = 'anders forsbrand' |
Loss of kendrick (11 8) had what record? | CREATE TABLE table_name_54 (record VARCHAR,loss VARCHAR) | SELECT record FROM table_name_54 WHERE loss = "kendrick (11–8)" |
Which Second has a Third of athanassios pantios? | CREATE TABLE table_39138 ("Nation" text,"Skip" text,"Third" text,"Second" text,"Lead" text) | SELECT "Second" FROM table_39138 WHERE "Third" = 'athanassios pantios' |
Name the result for arrowhead stadium | CREATE TABLE table_67784 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" real) | SELECT "Result" FROM table_67784 WHERE "Game site" = 'arrowhead stadium' |
This query gets a list of user links who have at least 5 Posts with a score of -5 or lower ordered by the amount of Posts that meet the above criteria.. This query gets a list of user links who have at least 5 Posts with a score of -5 or lower ordered by the amount of Posts that meet the above criteria. | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,Co... | SELECT CONCAT('http://stackoverflow.com/users/', p.OwnerUserId) AS "User Link", COUNT(p.Id) AS PostCount FROM Posts AS p JOIN PostTypes AS pt ON pt.Id = p.PostTypeId WHERE p.Score < -5 AND pt.Name IN ('Answer', 'Question') AND NOT p.OwnerUserId IS NULL GROUP BY p.OwnerUserId HAVING COUNT(p.Id) > 5 ORDER BY PostCount DE... |
The player for which country had a score of 66-72=138? | CREATE TABLE table_78696 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Country" FROM table_78696 WHERE "Score" = '66-72=138' |
Who was the opponent when there was 117 rushing yards? | CREATE TABLE table_28309 ("Rank" real,"Player" text,"Year" real,"Opponent" text,"Passing yards" real,"Rushing yards" real,"Total offense" real) | SELECT "Opponent" FROM table_28309 WHERE "Rushing yards" = '117' |
how much was the total intake of d5ns patient 12775 had received today? | 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 inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount... | SELECT SUM(inputevents_cv.amount) 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 = 12775)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... |
since 2101 what were the top three most common procedures that patients received during the same hospital encounter after getting a antiemetic - anticholinergic? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname tex... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antie... |
What was the venue when the away team was Hawthorn? | CREATE TABLE table_53581 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Venue" FROM table_53581 WHERE "Away team" = 'hawthorn' |
What is the average PI GP when the pick is smaller tha 70 and the reg GP is 97? | CREATE TABLE table_54555 ("Rd #" real,"Pick #" real,"Player" text,"Team (League)" text,"Reg GP" real,"Pl GP" real) | SELECT AVG("Pl GP") FROM table_54555 WHERE "Reg GP" = '97' AND "Pick #" < '70' |
what year did david whitfield win | CREATE TABLE table_name_14 (year VARCHAR,artist VARCHAR) | SELECT year FROM table_name_14 WHERE artist = "david whitfield" |
What was the '{\mathrm{h,cc}} = \frac{c_{\mathrm{aq}}}{c_{\mathrm{gas}}}' if '_{\mathrm{h,cp}} = \frac{c_\mathrm{aq}}{p}' is 7.8 10 4? | CREATE TABLE table_26347 ("equation:" text,"k_{\\mathrm{H,pc}} = \\frac{p}{c_\\mathrm{aq}}" text,"k_{\\mathrm{H,cp}} = \\frac{c_\\mathrm{aq}}{p}" text,"k_{\\mathrm{H,px}} = \\frac{p}{x}" text,"k_{\\mathrm{H,cc}} = \\frac{c_{\\mathrm{aq}}}{c_{\\mathrm{gas}}}" text) | SELECT "k_{\\mathrm{H,cc}} = \\frac{c_{\\mathrm{aq}}}{c_{\\mathrm{gas}}}" FROM table_26347 WHERE "k_{\\mathrm{H,cp}} = \\frac{c_\\mathrm{aq}}{p}" = '7.8 × 10−4' |
What is the total PL G of player pennant, who has less than 7 CL G, less than 7 CL apps, and a FA YC of 0? | CREATE TABLE table_name_74 (pl_g VARCHAR,player VARCHAR,fa_yc VARCHAR,cl_g VARCHAR,cl_apps VARCHAR) | SELECT COUNT(pl_g) FROM table_name_74 WHERE cl_g < 7 AND cl_apps < 7 AND fa_yc = 0 AND player = "pennant" |
since 5 years ago has ciprofloxacin hcl, senna or d5 1/2ns been prescribed for patient 3929? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE microbiologyevents (ro... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3929) AND prescriptions.drug IN ('ciprofloxacin hcl', 'senna', 'd5 1/2ns') AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-5 year') |
What is the lowest match for goals larger than 36? | CREATE TABLE table_name_42 (matches INTEGER,goals INTEGER) | SELECT MIN(matches) FROM table_name_42 WHERE goals > 36 |
What constructor has under 62 laps, a Time/Retired of gearbox, a Grid larger than 1, and pedro diniz driving? | CREATE TABLE table_78407 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT "Constructor" FROM table_78407 WHERE "Laps" < '62' AND "Time/Retired" = 'gearbox' AND "Grid" > '1' AND "Driver" = 'pedro diniz' |
What is the largest decile with a Roll larger than 34, a Gender of coed, and an Authority of state integrated, and an Area of georgetown? | CREATE TABLE table_name_47 (decile INTEGER,area VARCHAR,authority VARCHAR,roll VARCHAR,gender VARCHAR) | SELECT MAX(decile) FROM table_name_47 WHERE roll > 34 AND gender = "coed" AND authority = "state integrated" AND area = "georgetown" |
Show the names of countries and the average speed of roller coasters from each country Plot them as bar chart, and sort in asc by the bars. | CREATE TABLE country (Country_ID int,Name text,Population int,Area int,Languages text)CREATE TABLE roller_coaster (Roller_Coaster_ID int,Name text,Park text,Country_ID int,Length real,Height real,Speed text,Opened text,Status text) | SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name ORDER BY T1.Name |
give me the number of patients whose primary disease is aortic valve insuffiency\aortic valve replacement /sda and lab test category is hematology? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND lab."CATEGORY" = "Hematology" |
Bar chart x axis participant type code y axis the number of participant type code, and sort in ascending by the x axis. | CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Event_Details VARCHAR(255))CREATE TABLE Services (Service_ID INTEGER,Service_Type_Code CHAR(15))CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participa... | SELECT Participant_Type_Code, COUNT(Participant_Type_Code) FROM Participants GROUP BY Participant_Type_Code ORDER BY Participant_Type_Code |
Manager of lyman lamb / marty berghammer is in what league? | CREATE TABLE table_name_59 (league VARCHAR,manager VARCHAR) | SELECT league FROM table_name_59 WHERE manager = "lyman lamb / marty berghammer" |
Show all statement id and the number of accounts for each statement in a scatter chart | CREATE TABLE Documents_with_Expenses (Document_ID INTEGER,Budget_Type_Code CHAR(15),Document_Details VARCHAR(255))CREATE TABLE Statements (Statement_ID INTEGER,Statement_Details VARCHAR(255))CREATE TABLE Projects (Project_ID INTEGER,Project_Details VARCHAR(255))CREATE TABLE Accounts (Account_ID INTEGER,Statement_ID INT... | SELECT Statement_ID, COUNT(*) FROM Accounts GROUP BY Statement_ID |
has patient 035-11300 been prescribed a drug during this year? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayi... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-11300')) AND DATETIME(medication.drugstarttime, 'start of year') = DAT... |
What is the lane total when rank is 2? | CREATE TABLE table_66091 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" text) | SELECT SUM("Lane") FROM table_66091 WHERE "Rank" = '2' |
How many against points for 16 matches? | CREATE TABLE table_31878 ("Played in" text,"Matches" text,"Lost" text,"Drawn" text,"Points for" text,"Points against" text) | SELECT "Points against" FROM table_31878 WHERE "Matches" = '16' |
Name the moving to for fra | CREATE TABLE table_name_22 (moving_to VARCHAR,country VARCHAR) | SELECT moving_to FROM table_name_22 WHERE country = "fra" |
What is every team with location attendance of Philips Arena 12,140? | CREATE TABLE table_3874 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Team" FROM table_3874 WHERE "Location Attendance" = 'Philips Arena 12,140' |
Which country did the Director(s) of kota nagaoka come from and win 300,000? | CREATE TABLE table_name_59 (country VARCHAR,prize VARCHAR,director_s_ VARCHAR) | SELECT country FROM table_name_59 WHERE prize = "¥300,000" AND director_s_ = "kota nagaoka" |
WHAT IS THE PLACE THAT HAS SCORE OF 65 OR BETTER, FOR ROCCO MEDIATE? | CREATE TABLE table_name_30 (place VARCHAR,score VARCHAR,player VARCHAR) | SELECT place FROM table_name_30 WHERE score > 65 AND player = "rocco mediate" |
Breakdown of answers by score. | 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 Score, COUNT(Id) FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = '##uid?28111##' GROUP BY Score ORDER BY Score DESC |
For engines of Maserati Straight-6 and entrants of H H Gould, what is the latest year? | CREATE TABLE table_name_14 (year INTEGER,engine VARCHAR,entrant VARCHAR) | SELECT MAX(year) FROM table_name_14 WHERE engine = "maserati straight-6" AND entrant = "h h gould" |
how many patients posses self pay insurance and were diagnosed with blood in stool? | 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 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.insurance = "Self Pay" AND diagnoses.long_title = "Blood in stool" |
What is the smallest total number of medals for rank 11 and more than 0 silver medals? | CREATE TABLE table_42386 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MIN("Total") FROM table_42386 WHERE "Rank" = '11' AND "Silver" > '0' |
What is the attendance amount of the race with a time of 2:07? | CREATE TABLE table_name_38 (attendance INTEGER,time VARCHAR) | SELECT MAX(attendance) FROM table_name_38 WHERE time = "2:07" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.