instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Reputation of top users. | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance... | SELECT Id, Reputation FROM Users ORDER BY Reputation DESC LIMIT 50000 |
What's the type of the school in New London, Connecticut? | CREATE TABLE table_23270 ("Institution" text,"Location" text,"Nickname" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" real) | SELECT "Type" FROM table_23270 WHERE "Location" = 'New London, Connecticut' |
Posts with accepted answer answered after a week. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate ti... | SELECT COUNT(*) FROM Posts AS a LEFT JOIN Posts AS b ON a.AcceptedAnswerId = b.Id WHERE NOT a.AcceptedAnswerId IS NULL AND DATEDIFF(day, a.CreationDate, CreationDate) > 6 |
Show the number of the facility codes of apartments with more than 4 bedrooms, and could you show by the Y in asc? | CREATE TABLE Apartment_Facilities (apt_id INTEGER,facility_code CHAR(15))CREATE TABLE View_Unit_Status (apt_id INTEGER,apt_booking_id INTEGER,status_date DATETIME,available_yn BIT)CREATE TABLE Apartment_Bookings (apt_booking_id INTEGER,apt_id INTEGER,guest_id INTEGER,booking_status_code CHAR(15),booking_start_date DATE... | SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) |
Visualize the relationship between Team_ID and ACC_Percent , and group by attribute ACC_Regular_Season. | 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 Team_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Regular_Season |
Find the number of departments in each school Plot them as bar chart, could you list in ascending by the X? | CREATE TABLE STUDENT (STU_NUM int,STU_LNAME varchar(15),STU_FNAME varchar(15),STU_INIT varchar(1),STU_DOB datetime,STU_HRS int,STU_CLASS varchar(2),STU_GPA float(8),STU_TRANSFER numeric,DEPT_CODE varchar(18),STU_PHONE varchar(4),PROF_NUM int)CREATE TABLE PROFESSOR (EMP_NUM int,DEPT_CODE varchar(10),PROF_OFFICE varchar(... | SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_NAME) FROM DEPARTMENT ORDER BY SCHOOL_CODE |
give me the number of patients whose diagnoses long title is family history of other specified malignant neoplasm? | 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 demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Family history of other specified malignant neoplasm" |
Who wrote the episode that has a production code 3x7557? | CREATE TABLE table_24936 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT "Written by" FROM table_24936 WHERE "Production code" = '3X7557' |
What's the lowest number of draws when the wins are less than 15, and against is 1228? | CREATE TABLE table_name_98 (draws INTEGER,wins VARCHAR,against VARCHAR) | SELECT MIN(draws) FROM table_name_98 WHERE wins < 15 AND against = 1228 |
what is the minimum district with incumbent being tom reynolds | CREATE TABLE table_13833770_3 (district INTEGER,incumbent VARCHAR) | SELECT MIN(district) FROM table_13833770_3 WHERE incumbent = "Tom Reynolds" |
What is the total number of games played with 3 losses, 1 or more drawns and 10 or fewer points? | CREATE TABLE table_39942 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real) | SELECT SUM("Played") FROM table_39942 WHERE "Lost" = '3' AND "Drawn" > '1' AND "Points" < '10' |
What is the crime rate for Eden Street area? | CREATE TABLE greatermanchestercrime (crimeid text,crimets time,location text,lsoa text,type text,outcome text) | SELECT COUNT(*) FROM greatermanchestercrime WHERE location LIKE "%Eden Street%" |
What is the number in attendance at Los Angeles Memorial Coliseum? | CREATE TABLE table_12594 ("Year" real,"Date" text,"Home Team" text,"Result" text,"Visiting Team" text,"Venue" text,"Attendance" real) | SELECT COUNT("Attendance") FROM table_12594 WHERE "Venue" = 'los angeles memorial coliseum' |
Name the number of class aa for bridgeport and 1999-2000 | CREATE TABLE table_19418 ("School Year" text,"Class A" text,"Class AA" text,"Class AAA" text,"Class AAAA" text,"Class AAAAA" text) | SELECT COUNT("Class AA") FROM table_19418 WHERE "Class AAA" = 'Bridgeport' AND "School Year" = '1999-2000' |
How many totals have golds of 3, silvers of 3, and bronzes under 3? | CREATE TABLE table_9500 ("Rank" text,"Nation" text,"Gold" text,"Silver" text,"Bronze" real,"Total" real) | SELECT SUM("Total") FROM table_9500 WHERE "Gold" = '3' AND "Bronze" < '3' AND "Silver" = '3' |
Is 401 offered to undergrads ? | CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE area (course_id int,area varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program_requirement (program_id int... | SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 401 |
What is the name of the player who is Sco and moving to greenock morton in the summer? | CREATE TABLE table_name_83 (name VARCHAR,moving_to VARCHAR,nat VARCHAR,transfer_window VARCHAR) | SELECT name FROM table_name_83 WHERE nat = "sco" AND transfer_window = "summer" AND moving_to = "greenock morton" |
Name the most FA cup for championship of 18 and total of 19 | CREATE TABLE table_14569 ("Name" text,"Championship" real,"FA Cup" real,"League Cup" real,"Total" real) | SELECT MAX("FA Cup") FROM table_14569 WHERE "Championship" = '18' AND "Total" = '19' |
provide the number of patients whose diagnoses long title is hemiplegia, unspecified, affecting dominant side? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Hemiplegia, unspecified, affecting dominant side" |
what is the five year survival rate of patients who were prescribed lactulose after being diagnosed with digestive neoplasm nos? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime t... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... |
Which season has a .354 Win%? | CREATE TABLE table_6853 ("Season" text,"Team" text,"Conference (Conf.)" text,"Division (Div.)" text,"Win%" text,"Awards" text) | SELECT "Season" FROM table_6853 WHERE "Win%" = '.354' |
Return the unit of measure for 'Herb' products. | CREATE TABLE ref_characteristic_types (characteristic_type_code text,characteristic_type_description text)CREATE TABLE products (product_id number,color_code text,product_category_code text,product_name text,typical_buying_price text,typical_selling_price text,product_description text,other_product_details text)CREATE ... | SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs" |
What is the overall pick number for the player who was picked on round 8? | CREATE TABLE table_name_91 (overall INTEGER,round VARCHAR) | SELECT MIN(overall) FROM table_name_91 WHERE round = 8 |
What is the total gdp world rank when the gdp per capita was listed at $1,163? | CREATE TABLE table_25056 ("African rank" real,"World rank" real,"Nation" text,"GDP per capita" text,"Total GDP world rank" real) | SELECT MIN("Total GDP world rank") FROM table_25056 WHERE "GDP per capita" = '$1,163' |
give me the number of divorced patients who belong to white-russian ethnic background. | 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 WHERE demographic.marital_status = "DIVORCED" AND demographic.ethnicity = "WHITE - RUSSIAN" |
Which manufacturer has a time of +10.142? | CREATE TABLE table_50727 ("Rider" text,"Manufacturer" text,"Laps" real,"Time" text,"Grid" real) | SELECT "Manufacturer" FROM table_50727 WHERE "Time" = '+10.142' |
what is the district where the incumbent is richard kelly? | CREATE TABLE table_18336 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "District" FROM table_18336 WHERE "Incumbent" = 'Richard Kelly' |
what's the people-task orientation scale where extroverted, relationship-oriented is team type | CREATE TABLE table_16608 ("Date" text,"Founder" text,"Extroversion Scales" text,"People-task orientation scale" text,"Introverted,Task-Oriented" text,"Extroverted,Task-Oriented" text,"Extroverted,Relationship-Oriented" text,"Introverted,Relationship Oriented" text,"Moderate" text) | SELECT "People-task orientation scale" FROM table_16608 WHERE "Extroverted, Relationship-Oriented" = 'Team Type' |
How many judges were there when the result is safe with a vote percentage of 10.7%? | CREATE TABLE table_28639 ("Rank" real,"Couple" text,"Judges" real,"Public" real,"Total" real,"Vote percentage" text,"Result" text) | SELECT MIN("Judges") FROM table_28639 WHERE "Result" = 'Safe' AND "Vote percentage" = '10.7%' |
Which driver had a grid number of 18? | CREATE TABLE table_58111 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" text) | SELECT "Driver" FROM table_58111 WHERE "Grid" = '18' |
what was claudia roll 's time ? | CREATE TABLE table_204_886 (id number,"rank" number,"swimmer" text,"country" text,"time" text,"note" text) | SELECT "time" FROM table_204_886 WHERE "swimmer" = 'claudia poll' |
what is the number of patients whose admission location is transfer from hosp/extram and procedure long title is closed [needle] biopsy of tongue? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.long_title = "Closed [needle] biopsy of tongue" |
How many were in attendance against the Oakland Raiders after week 7? | CREATE TABLE table_40656 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT SUM("Attendance") FROM table_40656 WHERE "Opponent" = 'oakland raiders' AND "Week" > '7' |
How many Picks have a Round larger than 8, and a College of fresno state? | CREATE TABLE table_38344 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT COUNT("Pick #") FROM table_38344 WHERE "Round" > '8' AND "College" = 'fresno state' |
what are all the circuit for gtc winner graeme mundy jamie smyth and pole position bradley ellis alex mortimer | CREATE TABLE table_17972 ("Round" real,"Circuit" text,"Date" text,"Length" text,"Pole Position" text,"GT3 Winner" text,"GTC Winner" text) | SELECT "Circuit" FROM table_17972 WHERE "GTC Winner" = 'Graeme Mundy Jamie Smyth' AND "Pole Position" = 'Bradley Ellis Alex Mortimer' |
Name the entrant for benedicto campos | CREATE TABLE table_21977704_1 (entrant VARCHAR,driver VARCHAR) | SELECT entrant FROM table_21977704_1 WHERE driver = "Benedicto Campos" |
How many total wins for Leopold that had fewer than 1706 against? | CREATE TABLE table_name_99 (wins INTEGER,against VARCHAR,geelong_fl VARCHAR) | SELECT SUM(wins) FROM table_name_99 WHERE against < 1706 AND geelong_fl = "leopold" |
when did patient 52898 receive a test in the lab for the last time this month? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE diagnoses_icd (row_id n... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY labevents.charttime DESC LIMIT 1 |
What is the company where Eduardo Martins is a customer? | CREATE TABLE media_types (id number,name text)CREATE TABLE playlists (id number,name text)CREATE TABLE genres (id number,name text)CREATE TABLE sqlite_sequence (name text,seq text)CREATE TABLE playlist_tracks (playlist_id number,track_id number)CREATE TABLE invoice_lines (id number,invoice_id number,track_id number,uni... | SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins" |
What CCM Chart had 18 total weeks? | CREATE TABLE table_name_94 (ccm_chart VARCHAR,total_wks VARCHAR) | SELECT ccm_chart FROM table_name_94 WHERE total_wks = 18 |
What is the average value for Lost, when the value for Goals Scored is greater than 20, and when the value for Played is less than 18? | CREATE TABLE table_69124 ("Place" real,"Team" text,"Played" real,"Draw" real,"Lost" real,"Goals Scored" real,"Goals Conceded" real,"Points" real) | SELECT AVG("Lost") FROM table_69124 WHERE "Goals Scored" > '20' AND "Played" < '18' |
What is the Score when the 1st prize was 63,000, and a Winner of keith fergus (1)? | CREATE TABLE table_34394 ("Date" text,"Tournament" text,"Location" text,"Winner" text,"Score" text,"1st prize ($)" text) | SELECT "Score" FROM table_34394 WHERE "1st prize ( $ )" = '63,000' AND "Winner" = 'keith fergus (1)' |
Questions asked per day in Sun-Sat week periods. | 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 PostHistory (Id number,PostHistoryTypeId number,PostId number,R... | SELECT CAST(DATEADD(DAY, 1 - DATEPART(WEEKDAY, CreationDate), CreationDate) AS DATE) AS "week_of", ROUND(CAST(COUNT(*) AS FLOAT) / 7, 2) FROM Posts WHERE PostTypeId = 1 AND CAST(CreationDate AS DATE) < '2013-01-01' GROUP BY CAST(DATEADD(DAY, 1 - DATEPART(WEEKDAY, CreationDate), CreationDate) AS DATE) ORDER BY CAST(DATE... |
For all employees who have the letters D or S in their first name, give me the comparison about the average of department_id over the job_id , and group by attribute job_id by a bar chart, rank by the total number in asc. | CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CO... | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID) |
retrieve the patient identifications of patients that were diagnosed with swollen extremity, etiology unknown - right lower extremity in 2105. | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text... | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'swollen extremity, etiology unknown - right lower extremity' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') |
How many Malaysia Cups have a Total larger than 3, and a Player of ivan yusoff, and a League smaller than 2? | CREATE TABLE table_37021 ("Player" text,"League" real,"Malaysia Cup" real,"FA Cup" real,"Total" real) | SELECT COUNT("Malaysia Cup") FROM table_37021 WHERE "Total" > '3' AND "Player" = 'ivan yusoff' AND "League" < '2' |
What is the first name of the staff who did not give any lesson? | CREATE TABLE customer_payments (customer_id number,datetime_payment time,payment_method_code text,amount_payment number)CREATE TABLE staff (staff_id number,staff_address_id number,nickname text,first_name text,middle_name text,last_name text,date_of_birth time,date_joined_staff time,date_left_staff time)CREATE TABLE cu... | SELECT first_name FROM staff EXCEPT SELECT T2.first_name FROM lessons AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id |
What is the league for season 1955-56? | CREATE TABLE table_60209 ("Season" text,"League" text,"Teams" text,"Home" text,"Away" text) | SELECT "League" FROM table_60209 WHERE "Season" = '1955-56' |
what is the maximum number of patients diagnosed with ami inferior wall, init daily until 4 years ago? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_icd_diagnoses (row_id ... | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ami inferior wall, init') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-4 year')... |
What is the year when the performance is 60.73m and the age (years) is more than 45? | CREATE TABLE table_name_85 (year VARCHAR,performance VARCHAR,age__years_ VARCHAR) | SELECT COUNT(year) FROM table_name_85 WHERE performance = "60.73m" AND age__years_ > 45 |
What is the original name of the film that used the title Olympics 40 in nomination? | CREATE TABLE table_14751 ("Country" text,"Film title used in nomination" text,"Language" text,"Original name" text,"Director" text) | SELECT "Original name" FROM table_14751 WHERE "Film title used in nomination" = 'olympics 40' |
What year had a 1st round playoff in the NASL indoor league? | CREATE TABLE table_name_6 (year VARCHAR,playoffs VARCHAR,league VARCHAR) | SELECT year FROM table_name_6 WHERE playoffs = "1st round" AND league = "nasl indoor" |
how many patients had been diagnosed with ventral hernia nos until 2103? | CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,l... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ventral hernia nos') AND STRFTIME('%y', diagnoses_icd.char... |
How many rooms are located for each block code? | CREATE TABLE physician (employeeid number,name text,position text,ssn number)CREATE TABLE prescribes (physician number,patient number,medication number,date time,appointment number,dose text)CREATE TABLE undergoes (patient number,procedures number,stay number,dateundergoes time,physician number,assistingnurse number)CR... | SELECT COUNT(*), T1.blockcode FROM block AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockcode |
What is the total number of golds having a total of 1, bronzes of 0, and from West Germany? | CREATE TABLE table_name_61 (gold VARCHAR,nation VARCHAR,total VARCHAR,bronze VARCHAR) | SELECT COUNT(gold) FROM table_name_61 WHERE total = 1 AND bronze < 1 AND nation = "west germany" |
What is the week 13 result where the week 14 resulted in Maryland (10-1)? | CREATE TABLE table_name_18 (week_13_nov_26 VARCHAR,week_14_dec_3 VARCHAR) | SELECT week_13_nov_26 FROM table_name_18 WHERE week_14_dec_3 = "maryland (10-1)" |
If the 2011 population is 3685681, what is the name of the headquarters? | CREATE TABLE table_24550 ("District" text,"Headquarters" text,"Area (km\u00b2)" real,"Population (2011)" real,"Division" text) | SELECT "Headquarters" FROM table_24550 WHERE "Population (2011)" = '3685681' |
Which is the smallest evening gown score when the interview score was more than 9.164, the swimsuit stat was less than 9.35, and the average is less than 9.233? | CREATE TABLE table_name_63 (evening_gown INTEGER,average VARCHAR,interview VARCHAR,swimsuit VARCHAR) | SELECT MIN(evening_gown) FROM table_name_63 WHERE interview > 9.164 AND swimsuit < 9.35 AND average < 9.233 |
provide the number of hispanic/latino or puerto rican patients who had insertion of one vascular stent? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND procedures.long_title = "Insertion of one vascular stent" |
What is the score where the away team is Exeter City? | CREATE TABLE table_41719 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text,"Attendance" text) | SELECT "Score" FROM table_41719 WHERE "Away team" = 'exeter city' |
when was last time the sao2 of patient 027-132801 was greater than 99.0 on this month/04? | 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 cost (costid number,uniquepid text,pati... | 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-132801')) AND vitalperiodic.sao2 > 99.0 AND NOT... |
npm new questions with accepted answers by year. | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayN... | SELECT CAST(TIME_TO_STR(CreationDate, '%Y/%m/%d') AS TEXT(10)) AS datepart, COUNT(*) AS "new_stackoverflow_q_today" FROM Posts GROUP BY CAST(TIME_TO_STR(CreationDate, '%Y/%m/%d') AS TEXT(10)) ORDER BY datepart DESC |
Which position has a School/club team of jacksonville? | CREATE TABLE table_57181 ("Round" real,"Pick" real,"Player" text,"Pos." text,"Nationality" text,"Team" text,"School/club team" text) | SELECT "Pos." FROM table_57181 WHERE "School/club team" = 'jacksonville' |
Top 100 Answerers for a Given Tag. | 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 ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId nu... | SELECT Users.DisplayName, Tags.TagName, SUM(Answers.Score) AS Score FROM Users JOIN Posts AS Answers ON Answers.OwnerUserId = Users.Id JOIN Posts ON Posts.Id = Answers.ParentId JOIN PostTags ON PostTags.PostId = Posts.Id JOIN Tags ON Tags.Id = PostTags.TagId WHERE Users.DisplayName IN (SELECT Users.DisplayName FROM Tag... |
What was Footscray's score when it played as the home team? | CREATE TABLE table_name_2 (home_team VARCHAR) | SELECT home_team AS score FROM table_name_2 WHERE home_team = "footscray" |
Who was the developer of Resident Evil 4? | CREATE TABLE table_name_4 (developer_s_ VARCHAR,game VARCHAR) | SELECT developer_s_ FROM table_name_4 WHERE game = "resident evil 4" |
What is the highest number of points the cosworth straight-4 engine scored? | CREATE TABLE table_68886 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Pts." real) | SELECT MAX("Pts.") FROM table_68886 WHERE "Engine" = 'cosworth straight-4' |
what is the party for the district south carolina 4? | CREATE TABLE table_18118 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text,"Candidates" text) | SELECT "Party" FROM table_18118 WHERE "District" = 'South Carolina 4' |
was the value of calcium of patient 028-11360 last measured on the first hospital visit less than it was second to last measured on the first hospital visit? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,d... | SELECT (SELECT 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 = '028-11360' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... |
Which 3rd run has rank of 1? | CREATE TABLE table_name_97 (rank VARCHAR) | SELECT 3 AS rd_run FROM table_name_97 WHERE rank = 1 |
how many people attended the 2000 animeiowa ? | CREATE TABLE table_204_991 (id number,"name" text,"first\nheld" number,"country" text,"earliest attendance figure known" text,"1998 attendance" number,"2000 attendance" number,"2002 attendance" number,"2004 attendance" number,"2006 attendance" number,"2008 attendance" number,"2010 attendance" number,"2012 attendance" n... | SELECT "2000 attendance" FROM table_204_991 WHERE "name" = 'animeiowa' |
Which Tie # that has an Attendance of 14 november 1998, and an Away team of hayes? | CREATE TABLE table_6497 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Attendance" text) | SELECT "Tie no" FROM table_6497 WHERE "Attendance" = '14 november 1998' AND "Away team" = 'hayes' |
What is the id and name of the aircraft that can cover the maximum distance? | CREATE TABLE aircraft (aid number,name text,distance number)CREATE TABLE certificate (eid number,aid number)CREATE TABLE employee (eid number,name text,salary number)CREATE TABLE flight (flno number,origin text,destination text,distance number,departure_date time,arrival_date time,price number,aid number) | SELECT aid, name FROM aircraft ORDER BY distance DESC LIMIT 1 |
what the difference was in the hgb value of patient 007-16517 last measured on the current hospital visit compared to the value first measured on the current hospital visit? | 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 (SELECT 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 = '007-16517' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'hgb' ... |
Visualize a bar chart about the distribution of ACC_Road and School_ID , and group by attribute ACC_Home, and sort from low to high by the y-axis. | 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 ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY School_ID |
find the number of patients with elective admission type whose procedure title is other conversion of cardiac rhythm. | 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.admission_type = "ELECTIVE" AND procedures.long_title = "Other conversion of cardiac rhythm" |
What aorist has bude in present tense? | CREATE TABLE table_29406 ("Pronoun" text,"Present" text,"1st" text,"2nd" text,"perfect" text,"aorist" text,"imperfect" text,"pluperfect" text) | SELECT "aorist" FROM table_29406 WHERE "Present" = 'bude' |
What is the score having a runner-up of Magdalena Maleeva? | CREATE TABLE table_name_45 (score VARCHAR,runner_up VARCHAR) | SELECT score FROM table_name_45 WHERE runner_up = "magdalena maleeva" |
How many entries for start of stage occur in the year 2006? | CREATE TABLE table_275506_1 (start_of_stage VARCHAR,year VARCHAR) | SELECT COUNT(start_of_stage) FROM table_275506_1 WHERE year = "2006" |
Show the institution type with the largest number of institutions. | CREATE TABLE protein (common_name text,protein_name text,divergence_from_human_lineage number,accession_number text,sequence_length number,sequence_identity_to_human_protein text,institution_id text)CREATE TABLE institution (institution_id text,institution text,location text,founded number,type text,enrollment number,t... | SELECT type FROM institution GROUP BY type ORDER BY COUNT(*) DESC LIMIT 1 |
What team was the away team when the tie no is 40? | CREATE TABLE table_name_67 (away_team VARCHAR,tie_no VARCHAR) | SELECT away_team FROM table_name_67 WHERE tie_no = "40" |
When 14.85 kilometers squared is the land area what is the name? | CREATE TABLE table_22729 ("Name" text,"Population (2011)" real,"Population (2006)" real,"Change (%)" text,"Land area (km\u00b2)" text,"Population density (per km\u00b2)" text) | SELECT "Name" FROM table_22729 WHERE "Land area (km\u00b2)" = '14.85' |
What is the total number of wins when casey mears ranked 36th and had more than 0 top fives? | CREATE TABLE table_name_62 (wins VARCHAR,rank VARCHAR,top_fives VARCHAR) | SELECT COUNT(wins) FROM table_name_62 WHERE rank = "36th" AND top_fives > 0 |
Who recorded a time or retired time of 52:56.4653? | CREATE TABLE table_name_1 (name VARCHAR,time_retired VARCHAR) | SELECT name FROM table_name_1 WHERE time_retired = "52:56.4653" |
Who was the builder in 1920? | CREATE TABLE table_10066 ("Railway" text,"Builder" text,"Built" text,"Wheels" text,"Location" text,"ObjectNumber" text) | SELECT "Builder" FROM table_10066 WHERE "Built" = '1920' |
What other classes must I take prior to studying MUSED 595 ? | CREATE TABLE area (course_id int,area varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement v... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... |
how many patients whose primary disease is rash and year of death is less than or equal to 2154? | 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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RASH" AND demographic.dod_year <= "2154.0" |
how did patient 021-155303 first get admitted in the hospital until 2104? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number... | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '021-155303' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104' ORDER BY patient.hospitaladmittime LIMIT 1 |
What is Result, when Director is Mirza Idrizovi category:articles with hcards? | CREATE TABLE table_41273 ("Year (Ceremony)" text,"Film title used in nomination" text,"Original title" text,"Director" text,"Result" text) | SELECT "Result" FROM table_41273 WHERE "Director" = 'mirza idrizović category:articles with hcards' |
Who had the fastest lap when the winning team was Tom's Racing? | CREATE TABLE table_20945 ("Round" real,"Circuit" text,"Date" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Winning Team" text) | SELECT "Fastest Lap" FROM table_20945 WHERE "Winning Team" = 'TOM''S Racing' |
Top Answers for Negative Questions. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,Pare... | WITH q AS (SELECT * FROM dbo.Posts WHERE PostTypeId = 1) SELECT q.Id AS q_id, 'https://mi.yodeya.com/questions/' + CAST(q.Id AS TEXT(255)) AS q_url, q.Title AS q_title, q.Score AS q_score, A.Id AS a_id, 'https://mi.yodeya.com/a/' + CAST(a.Id AS TEXT(255)) AS a_url, a.Score AS a_score FROM q INNER JOIN dbo.Posts AS a ON... |
What is the series 4 with sarah newman in series 1? | CREATE TABLE table_12147 ("Seat" real,"Series 1" text,"Series 3" text,"Series 4" text,"Series 5" text) | SELECT "Series 4" FROM table_12147 WHERE "Series 1" = 'sarah newman' |
Which Format has a Label of eagle records, and a Catalogue number(s) of edgcd391? | CREATE TABLE table_60542 ("Country" text,"Date" text,"Label" text,"Format" text,"Catalogue number(s)" text) | SELECT "Format" FROM table_60542 WHERE "Label" = 'eagle records' AND "Catalogue number(s)" = 'edgcd391' |
What is the average react of athlete muna lee, who is ranked greater than 3? | CREATE TABLE table_name_4 (react INTEGER,athlete VARCHAR,rank VARCHAR) | SELECT AVG(react) FROM table_name_4 WHERE athlete = "muna lee" AND rank > 3 |
WHAT IS THE NUMBER OF LOSSES WITH A LONG SMALLER THAN 24, AND GAIN BIGGER THAN 116? | CREATE TABLE table_name_15 (loss VARCHAR,long VARCHAR,gain VARCHAR) | SELECT COUNT(loss) FROM table_name_15 WHERE long < 24 AND gain > 116 |
Name the points for Engine of chevrolet 265c | CREATE TABLE table_67307 ("Year" real,"Team" text,"Chassis" text,"Engine" text,"Rank" text,"Points" real) | SELECT "Points" FROM table_67307 WHERE "Engine" = 'chevrolet 265c' |
what is the number of patients whose days of hospital stay is greater than 6 and lab test name is asparate aminotransferase (ast)? | 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,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "6" AND lab.label = "Asparate Aminotransferase (AST)" |
What celebrity finished 6th? | CREATE TABLE table_6579 ("Celebrity" text,"Famous for" text,"Entered" text,"Exited" text,"Finished" text) | SELECT "Celebrity" FROM table_6579 WHERE "Finished" = '6th' |
I want to see trend of the number of creation by creation, could you list in descending by the X? | CREATE TABLE head (head_ID int,name text,born_state text,age real)CREATE TABLE department (Department_ID int,Name text,Creation text,Ranking int,Budget_in_Billions real,Num_Employees real)CREATE TABLE management (department_ID int,head_ID int,temporary_acting text) | SELECT Creation, COUNT(Creation) FROM department GROUP BY Creation ORDER BY Creation DESC |
What is the relationship between Team_ID and School_ID ? | 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 Team_ID, School_ID FROM basketball_match |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.