instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
In the Spring-Summer 2007 in the afternoon is 351 offered ? | 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 program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE comment_instructor (instruc... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time >= '12:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 351 AND semester.semester = 'Spring-Summer' AND semester.semester_id = course_offering.semester AND semester.year ... |
what is the title of the next track after kreditz ? | CREATE TABLE table_203_37 (id number,"#" number,"title" text,"producer(s)" text,"performer(s)" text,"length" text) | SELECT "title" FROM table_203_37 WHERE "#" = (SELECT "#" FROM table_203_37 WHERE "title" = '"kreditz"') + 1 |
For each reviewer id, show their corresponding rating for the movie in a scatter chart. | CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Movie (mID int,title text,year int,director text) | SELECT rID, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID |
Which Home team score has an Away team of st kilda? | CREATE TABLE table_54730 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_54730 WHERE "Away team" = 'st kilda' |
what is the 2nd garfield episode for garfield episode 1 twice told tale | CREATE TABLE table_22391 ("Episode" text,"Garfield Episode 1" text,"U.S. Acres Episode" text,"Garfield Episode 2" text,"Original Airdate" text) | SELECT "Garfield Episode 2" FROM table_22391 WHERE "Garfield Episode 1" = 'Twice Told Tale' |
what is the lowest appearance when goals is more than 0? | CREATE TABLE table_76234 ("Season" text,"Appearance" real,"Tries" real,"Goals" real,"Points" real) | SELECT MIN("Appearance") FROM table_76234 WHERE "Goals" > '0' |
what's the top three most common output events in 2102? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventt... | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) = '2102' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 3 |
What Elector has the Title of Titulus S. Cecilia? | CREATE TABLE table_name_13 (elector VARCHAR,title VARCHAR) | SELECT elector FROM table_name_13 WHERE title = "titulus s. cecilia" |
how many consecutive years did w. harold browne coach | CREATE TABLE table_204_95 (id number,"name" text,"title" text,"first year\nin this position" number,"years at nebraska" text,"alma mater" text) | SELECT "years at nebraska" - "years at nebraska" FROM table_204_95 WHERE "name" = 'w. harold browne' |
Name the number which has language of other | CREATE TABLE table_70374 ("Language" text,"Number" text,"percentage (%)" text,"males" text,"females" text) | SELECT "Number" FROM table_70374 WHERE "Language" = 'other' |
How many jehovah's witness patients have lab test item id 51514? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "JEHOVAH'S WITNESS" AND lab.itemid = "51514" |
what is the difference between the population of san juan and sanchez ramirez ? | CREATE TABLE table_203_152 (id number,"province" text,"capital" text,"area (km2)" number,"population" number,"density" number) | SELECT (SELECT "population" FROM table_203_152 WHERE "province" = 'san juan') - (SELECT "population" FROM table_203_152 WHERE "province" = 'sanchez ramirez') |
How many total players came from the school/club team of De La Salle? | CREATE TABLE table_41727 ("Name" text,"Position" text,"Number" real,"School/Club Team" text,"Season" text,"Acquisition via" text) | SELECT COUNT("Number") FROM table_41727 WHERE "School/Club Team" = 'de la salle' |
Return a pie chart about the proportion of ACC_Regular_Season and Team_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 ACC_Regular_Season, Team_ID FROM basketball_match |
until 10/26/2103, when was the first time that patient 017-70504 had a drainage total output? | 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 = '017-70504')) AND intakeoutput.cellpath LIKE '%output%... |
Which character was in the sexiest female category of the British Soap Awards? | CREATE TABLE table_name_59 (character VARCHAR,category VARCHAR,award VARCHAR) | SELECT character FROM table_name_59 WHERE category = "sexiest female" AND award = "british soap awards" |
Who's the partner that played against Alicia Molik Mara Santangelo on clay? | CREATE TABLE table_9882 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score in the final" text) | SELECT "Partner" FROM table_9882 WHERE "Surface" = 'clay' AND "Opponents in the final" = 'alicia molik mara santangelo' |
Most viewed questions that were not in the HNQ. | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTask... | SELECT q.Id AS "post_link", ViewCount, Score, AnswerCount FROM Posts AS q WHERE (q.CreationDate >= '##Date1?2019-03-01##') AND (q.CreationDate <= '##Date2?2021-01-01##') AND q.Id NOT IN (SELECT PostId FROM PostHistory WHERE PostHistoryTypeId = 52) ORDER BY ViewCount DESC LIMIT 500 |
Which Density (2005) has an Area (km ) of 340086.7, and a Population (2005) smaller than 5926300? | CREATE TABLE table_48072 ("State" text,"Abbreviation" text,"Capital" text,"Area (km\u00b2)" real,"Population (2005)" real,"Density (2005)" real,"GDP (% total) (2004)" text,"GDP per capita (US$) (2004)" real,"HDI (2005)" real,"Literacy (2003)" text,"Infant Mortality (2002)" text,"Life Expectancy (2004)" real) | SELECT SUM("Density (2005)") FROM table_48072 WHERE "Area (km\u00b2)" = '340086.7' AND "Population (2005)" < '5926300' |
Give me a bar chart that the X-axis is the date_moved_in and the Y-axis is Count them, could you show by the bar in ascending please? | CREATE TABLE Properties (property_id INTEGER,property_type_code CHAR(15),property_address VARCHAR(255),other_details VARCHAR(255))CREATE TABLE Residents (resident_id INTEGER,property_id INTEGER,date_moved_in DATETIME,date_moved_out DATETIME,other_details VARCHAR(255))CREATE TABLE Customer_Event_Notes (Customer_Event_No... | SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in ORDER BY date_moved_in |
Show the county name and population of all counties. | CREATE TABLE county (County_name VARCHAR,Population VARCHAR) | SELECT County_name, Population FROM county |
What is the lightweight value with no information model and the flexible value is unknown? | CREATE TABLE table_31598 ("Schemas" text,"Flexible" text,"Semantic verification" text,"Dictionary" text,"Information Model" text,"Synonyms and homonyms" text,"Dialecting" text,"Web standard" text,"Transformations" text,"Lightweight" text,"Human readable" text) | SELECT "Lightweight" FROM table_31598 WHERE "Information Model" = 'no' AND "Flexible" = 'unknown' |
what's the competition where 1st leg is 4-1 (h) | CREATE TABLE table_72104 ("Season" text,"Competition" text,"Round" text,"Opponents" text,"1st leg" text,"2nd leg" text,"Aggregate" text) | SELECT "Competition" FROM table_72104 WHERE "1st leg" = '4-1 (h)' |
WHAT SCORE WAS ON 1999-05-31? | CREATE TABLE table_47634 ("Opponent" text,"Res." text,"Class" text,"Score" text,"Date" text,"Competition" text,"Notes" text) | SELECT "Score" FROM table_47634 WHERE "Date" = '1999-05-31' |
What was the tries again llanishen rfc? | CREATE TABLE table_name_35 (tries_against VARCHAR,club VARCHAR) | SELECT tries_against FROM table_name_35 WHERE club = "llanishen rfc" |
How many teams have a head coach named mahdi ali? | CREATE TABLE table_27631756_2 (team VARCHAR,head_coach VARCHAR) | SELECT COUNT(team) FROM table_27631756_2 WHERE head_coach = "Mahdi Ali" |
What Date has the Region Europe and a Catalog of 74321 45851 2? | CREATE TABLE table_name_33 (date VARCHAR,region VARCHAR,catalog VARCHAR) | SELECT date FROM table_name_33 WHERE region = "europe" AND catalog = "74321 45851 2" |
What hardware courses in the Winter or Fall of 2002 are offered ? | CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement var... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%hardw... |
Name the party a for m. s. k. sathiyendran runner up | CREATE TABLE table_25276 ("Constituency" text,"Winner" text,"Party" text,"Margin" real,"Runner-up a" text,"Party a" text) | SELECT "Party a" FROM table_25276 WHERE "Runner-up a" = 'M. S. K. Sathiyendran' |
What is the genitive for the ergative shen? | CREATE TABLE table_46629 ("Nominative" text,"Ergative" text,"Dative" text,"Genitive" text,"Instrumental" text,"Adverbial" text) | SELECT "Genitive" FROM table_46629 WHERE "Ergative" = 'shen' |
What is the Order and Title with a Nationality with roman, and an Elector with matteo orsini rosso? | CREATE TABLE table_name_6 (order_and_title VARCHAR,nationality VARCHAR,elector VARCHAR) | SELECT order_and_title FROM table_name_6 WHERE nationality = "roman" AND elector = "matteo orsini rosso" |
How many total points were earned with ferrari 125 Chassis after 1952? | CREATE TABLE table_name_77 (points INTEGER,chassis VARCHAR,year VARCHAR) | SELECT SUM(points) FROM table_name_77 WHERE chassis = "ferrari 125" AND year > 1952 |
Who was the wenning witcher when ezequiel astacio was the losing pitcher? | CREATE TABLE table_13710464_1 (winning_pitcher VARCHAR,losing_pitcher VARCHAR) | SELECT winning_pitcher FROM table_13710464_1 WHERE losing_pitcher = "Ezequiel Astacio" |
What is the height of the person that weighs 320 pounds? | CREATE TABLE table_16392 ("Round" real,"Choice" real,"Player name" text,"Position" text,"Height" text,"Weight" real,"College" text) | SELECT "Height" FROM table_16392 WHERE "Weight" = '320' |
What was the score when Richmond was the opponent? | CREATE TABLE table_31666 ("Year" text,"Competition" text,"Opponent" text,"Score" text,"Venue" text) | SELECT "Score" FROM table_31666 WHERE "Opponent" = 'richmond' |
tell me the number of patients who had c4 lab test and were hospitalized for more than 9 days. | 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.days_stay > "9" AND lab.label = "C4" |
what is the record when the year is after 1992, manager is tom kotchman and finish is 2nd? | CREATE TABLE table_48338 ("Year" real,"MLB Club" text,"Record" text,"Finish" text,"Manager" text) | SELECT "Record" FROM table_48338 WHERE "Year" > '1992' AND "Manager" = 'tom kotchman' AND "Finish" = '2nd' |
what country uses the mitsubishi l200 by their military ? | CREATE TABLE table_204_430 (id number,"model" text,"origin" text,"type" text,"version" text,"in service" text,"notes" text) | SELECT "origin" FROM table_204_430 WHERE "model" = 'mitsubishi l200' |
What is the Total of the Player with a Finish of 1? | CREATE TABLE table_name_2 (total VARCHAR,finish VARCHAR) | SELECT COUNT(total) FROM table_name_2 WHERE finish = "1" |
Name the episode for travis brown | CREATE TABLE table_73280 ("Season" real,"Episode" real,"Episode Summary" text,"Premier date" text,"External Link" text,"Coach" text) | SELECT "Episode" FROM table_73280 WHERE "Coach" = 'Travis Brown' |
Which Effic is the average one that has an Avg/G larger than 3.7, and a GP-GS of 13, and a Cmp-Att-Int of 318-521-15? | CREATE TABLE table_name_9 (effic INTEGER,cmp_att_int VARCHAR,avg_g VARCHAR,gp_gs VARCHAR) | SELECT AVG(effic) FROM table_name_9 WHERE avg_g > 3.7 AND gp_gs = "13" AND cmp_att_int = "318-521-15" |
tell me, what is the top three most common diagnosis until 2100? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,ob... | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) <= '2100' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3 |
how much does patient 006-43795 change in weight measured at 2103-12-18 05:43:00 compared to the value measured at 2103-08-01 17:39:00? | 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 lab (labid number,patientunitstayid num... | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-43795') AND NOT patient.admissionweight IS NULL AND patient.unitadmittime = '2103-12-18 05:43:00') - (SELECT patient.admissionweight FROM p... |
Who was the artist of the single that spent 9 weeks on top? | CREATE TABLE table_name_28 (artist VARCHAR,weeks_on_top VARCHAR) | SELECT artist FROM table_name_28 WHERE weeks_on_top = "9 ¶" |
when was the first time that patient 015-91239 on this month/31 had the minimum heartrate value. | 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 lab (labid number,patientunitstayid number,labname text,labres... | 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 = '015-91239')) AND NOT vitalperiodic.heartrate IS NUL... |
what is the sum of wins for the ottawa hockey club when the games played is less than 10? | CREATE TABLE table_name_53 (wins INTEGER,team VARCHAR,games_played VARCHAR) | SELECT SUM(wins) FROM table_name_53 WHERE team = "ottawa hockey club" AND games_played < 10 |
What's the tenure of 3rd son of tadatsune? | CREATE TABLE table_name_14 (tenure VARCHAR,lineage VARCHAR) | SELECT tenure FROM table_name_14 WHERE lineage = "3rd son of tadatsune" |
What was the purse when the trainer was Aidan O'Brien? | CREATE TABLE table_6130 ("Year" real,"Winner" text,"Jockey" text,"Trainer" text,"Owner" text,"Time" text,"Purse" text) | SELECT "Purse" FROM table_6130 WHERE "Trainer" = 'aidan o''brien' |
What is the highest season that had rank under 1? | CREATE TABLE table_42229 ("Rank" real,"Celebrity" text,"Professional Partner" text,"Season" real,"Average" real) | SELECT MAX("Season") FROM table_42229 WHERE "Rank" < '1' |
What capital has an S.Number under 7, and a Name of janapada of Punia? | CREATE TABLE table_name_89 (capital VARCHAR,sno VARCHAR,name_of_janapada VARCHAR) | SELECT capital FROM table_name_89 WHERE sno < 7 AND name_of_janapada = "punia" |
Name the number of team for 35 runs margin and india winner | CREATE TABLE table_1594772_2 (team__b_ VARCHAR,margin VARCHAR,winner VARCHAR) | SELECT COUNT(team__b_) FROM table_1594772_2 WHERE margin = "35 runs" AND winner = "India" |
When the Points 1 were 44 and the Goals For were larger than 65, what was the total number of Goals Against? | CREATE TABLE table_46704 ("Position" real,"Team" text,"Played" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Difference" text,"Points 1" real) | SELECT COUNT("Goals Against") FROM table_46704 WHERE "Points 1" = '44' AND "Goals For" > '65' |
which date has the most attendance ? | CREATE TABLE table_203_405 (id number,"week" number,"date" text,"opponent" text,"result" text,"attendance" number) | SELECT "date" FROM table_203_405 ORDER BY "attendance" DESC LIMIT 1 |
What is the power for the years 1975-84? | CREATE TABLE table_name_40 (power VARCHAR,years VARCHAR) | SELECT power FROM table_name_40 WHERE years = "1975-84" |
Which incumbent's democratic candidate was mike carroll? | CREATE TABLE table_42000 ("District" real,"Incumbent" text,"2008 Status" text,"Democratic" text,"Republican" text) | SELECT "Incumbent" FROM table_42000 WHERE "Democratic" = 'mike carroll' |
How many tries took place on 06/07/1996? | CREATE TABLE table_name_16 (tries VARCHAR,date VARCHAR) | SELECT tries FROM table_name_16 WHERE date = "06/07/1996" |
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday. | CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
What is the date of birth for basket baller called ido kozikaro | CREATE TABLE table_26233 ("No" real,"Player" text,"Height (m)" text,"Height (f)" text,"Position" text,"Year born" real,"Current Club" text) | SELECT MAX("Year born") FROM table_26233 WHERE "Player" = 'Ido Kozikaro' |
which games did they not score under 30 points ? | CREATE TABLE table_204_227 (id number,"week" number,"date" text,"opponent" text,"score" text,"result" text,"record" text) | SELECT COUNT(*) FROM table_204_227 WHERE "score" >= 30 |
creatinine clearance < 75 ml / min / 1.73 m2 | CREATE TABLE table_train_250 ("id" int,"gender" string,"waist_to_hip_ratio" float,"creatinine_clearance_cl" float,"panel_reactive_antibodies" int,"insulin_requirement" float,"serum_creatinine" float,"NOUSE" float) | SELECT * FROM table_train_250 WHERE creatinine_clearance_cl < 75 |
What is the average number of wins of the year with less than 5 top 10s, a winning of $39,190 and less than 2 starts? | CREATE TABLE table_39031 ("Year" real,"Starts" real,"Wins" real,"Top 5" real,"Top 10" real,"Poles" real,"Avg. Start" real,"Avg. Finish" real,"Winnings" text,"Position" text) | SELECT AVG("Wins") FROM table_39031 WHERE "Top 10" < '5' AND "Winnings" = '$39,190' AND "Starts" < '2' |
What name is associated with League 142? | CREATE TABLE table_14962287_2 (name VARCHAR,league VARCHAR) | SELECT name FROM table_14962287_2 WHERE league = 142 |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find hire_date and the average of department_id bin hire_date by time, and visualize them by a bar chart. | CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME va... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
fraction of negatively-scored Qs per tag. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Comments ... | SELECT Tags.TagName, CAST(SUM(CASE WHEN Posts.Score < 0 THEN 1 ELSE 0 END) AS FLOAT) / CAST(COUNT(*) AS FLOAT) AS fraction_of_negative_Qs FROM (PostTags INNER JOIN Tags ON PostTags.TagId = Tags.Id) INNER JOIN Posts ON Posts.Id = PostTags.PostId WHERE Tags.Count > 9 GROUP BY Tags.TagName ORDER BY fraction_of_negative_Qs... |
What is the surface of the match with Brian Gottfried as the runner-up? | CREATE TABLE table_name_47 (surface VARCHAR,runner_up VARCHAR) | SELECT surface FROM table_name_47 WHERE runner_up = "brian gottfried" |
What was the score of the game that had a round of Rd 26, 2001? | CREATE TABLE table_name_90 (score VARCHAR,round VARCHAR) | SELECT score FROM table_name_90 WHERE round = "rd 26, 2001" |
What are the classes required to declare a major in TURKISH ? | CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%TURKISH%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id |
What's the sum of points for the 1963 season when there are more than 30 games? | CREATE TABLE table_name_8 (points INTEGER,season VARCHAR,games VARCHAR) | SELECT SUM(points) FROM table_name_8 WHERE season = "1963" AND games > 30 |
What is the top losses that with Club of cd toledo and Points more than 56? | CREATE TABLE table_name_23 (losses INTEGER,club VARCHAR,points VARCHAR) | SELECT MAX(losses) FROM table_name_23 WHERE club = "cd toledo" AND points > 56 |
What is the least amount of appearances by new zealand when they scored 4 goals? | CREATE TABLE table_42067 ("Name" text,"Nationality" text,"Position" text,"Appearances" real,"Goals" real) | SELECT MIN("Appearances") FROM table_42067 WHERE "Goals" = '4' AND "Nationality" = 'new zealand' |
In 1962, what was the total number of points, when the Engine was Ferrari v6? | CREATE TABLE table_71422 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT COUNT("Points") FROM table_71422 WHERE "Engine" = 'ferrari v6' AND "Year" = '1962' |
WHich Coat of Cash' Wearing Celebrity has a Episode Number larger than 1 and with amy macdonald ( mr rock & roll )? | CREATE TABLE table_name_92 (episode_number VARCHAR,musical_guest__song_performed_ VARCHAR) | SELECT "coat_of_cash" AS _wearing_celebrity FROM table_name_92 WHERE episode_number > 1 AND musical_guest__song_performed_ = "amy macdonald ( mr rock & roll )" |
What is the title of the series # 8? | CREATE TABLE table_74173 ("Series #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"U.S. viewers (million)" text) | SELECT "Title" FROM table_74173 WHERE "Series #" = '8' |
what is the maximum hospital cost that includes a procedure known as wound care during the last year? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'wound care')) AND DATETIME(cost.chargetime, ... |
What is High Rebounds, when High Assists is 'Rafer Alston , Rashard Lewis , Hedo T rko lu (3)'? | CREATE TABLE table_name_80 (high_rebounds VARCHAR,high_assists VARCHAR) | SELECT high_rebounds FROM table_name_80 WHERE high_assists = "rafer alston , rashard lewis , hedo türkoğlu (3)" |
Release date of 2008 q3, and a Part number(s) of nu80579ez009c has what Release price ( USD )? | CREATE TABLE table_name_3 (release_price___usd__ VARCHAR,release_date VARCHAR,part_number_s_ VARCHAR) | SELECT release_price___usd__ FROM table_name_3 WHERE release_date = "2008 q3" AND part_number_s_ = "nu80579ez009c" |
known sensitivity to quinidine or dextromethorphan. | CREATE TABLE table_train_140 ("id" int,"gender" string,"mini_mental_state_examination_mmse" int,"allergy_to_quinidine" bool,"systolic_blood_pressure_sbp" int,"postural_syncope" bool,"hypotension" bool,"unexplained_syncope" bool,"allergy_to_dextromethorphan" bool,"allergy_to_drug" bool,"alcohol_abuse" bool,"drug_abuse" ... | SELECT * FROM table_train_140 WHERE allergy_to_quinidine = 1 OR allergy_to_dextromethorphan = 1 |
what are the three most commonly prescribed medications for patients that have been prescribed with glucagon (human recombinant) 1 mg inj recon soln previously during the same hospital visit in 2104? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE allergy (... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'glucagon (human ... |
Visualize a bar chart for what are the total enrollments of universities of each affiliation type? | 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 Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation |
How many silvers have a gold greater than 2, a bronze less than 35, china as the nation, with a total greater than 26? | CREATE TABLE table_name_43 (silver VARCHAR,total VARCHAR,nation VARCHAR,gold VARCHAR,bronze VARCHAR) | SELECT COUNT(silver) FROM table_name_43 WHERE gold > 2 AND bronze < 35 AND nation = "china" AND total > 26 |
What was the penalty for the gymnast with average above 9.662 and total is more than 9.706? | CREATE TABLE table_name_13 (penalty VARCHAR,average VARCHAR,total VARCHAR) | SELECT penalty FROM table_name_13 WHERE average > 9.662 AND total > 9.706 |
how many patients whose drug type is main? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug_type = "MAIN" |
When the power kw is 5kw, what is the frequency? | CREATE TABLE table_26827 ("Branding" text,"Callsign" text,"Frequency" text,"Power kW" text,"Coverage" text) | SELECT "Frequency" FROM table_26827 WHERE "Power kW" = '5kW' |
Tell me the shuttle run with grade c | CREATE TABLE table_78264 ("Grade" text,"Points" real,"Sit-up (reps)" text,"Standing Broad Jump (cm)" text,"Chin-up (reps)" text,"Shuttle Run (sec)" text,"2.4km Run (min:sec)" text) | SELECT "Shuttle Run (sec)" FROM table_78264 WHERE "Grade" = 'c' |
what is the diagnosis of icd9 code 7885? | 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 diagnoses.short_title FROM diagnoses WHERE diagnoses.icd9_code = "7885" |
How many female patients are diagnosed with ulcer of heel & mid foot? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Ulcer of heel & midfoot" |
in which year did she have the least amount of awards or nominations ? | CREATE TABLE table_203_757 (id number,"year" number,"award ceremony" text,"category" text,"film/show" text,"result" text) | SELECT "year" FROM table_203_757 GROUP BY "year" ORDER BY COUNT(*) LIMIT 1 |
What is Peter Jacobsen's Place? | CREATE TABLE table_name_8 (place VARCHAR,player VARCHAR) | SELECT place FROM table_name_8 WHERE player = "peter jacobsen" |
What Lane has a 0.209 React entered with a Rank entry that is larger than 6? | CREATE TABLE table_79306 ("Rank" real,"Lane" real,"Athlete" text,"Nationality" text,"Time" real,"React" real) | SELECT "Lane" FROM table_79306 WHERE "React" > '0.209' AND "Rank" > '6' |
what is the total number of dates where the scorer is gordon : 32 | CREATE TABLE table_11964047_7 (date VARCHAR,leading_scorer VARCHAR) | SELECT COUNT(date) FROM table_11964047_7 WHERE leading_scorer = "Gordon : 32" |
What is the rank for the 3 silver medals? | CREATE TABLE table_44261 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT "Rank" FROM table_44261 WHERE "Silver" = '3' |
who was the only opponent they played which resulted in a tie game ? | CREATE TABLE table_203_775 (id number,"week" number,"date" text,"opponent" text,"result" text,"game site" text,"attendance" number) | SELECT "opponent" FROM table_203_775 WHERE "result" = 't' |
What Decile has State Authority and Raumati South Area? | CREATE TABLE table_71027 ("Name" text,"Years" text,"Gender" text,"Area" text,"Authority" text,"Decile" real,"Roll" real) | SELECT "Decile" FROM table_71027 WHERE "Authority" = 'state' AND "Area" = 'raumati south' |
Tell me the sum of bronze for gold being 27 and silver more than 30 | CREATE TABLE table_name_35 (bronze INTEGER,gold VARCHAR,silver VARCHAR) | SELECT SUM(bronze) FROM table_name_35 WHERE gold = 27 AND silver > 30 |
count the number of patients whose marital status is single and item id is 51265? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.itemid = "51265" |
What is the Order # when the song choice was ' you're so vain '? | CREATE TABLE table_41968 ("Week #" text,"Theme" text,"Song choice" text,"Original artist" text,"Order #" text,"Result" text) | SELECT "Order #" FROM table_41968 WHERE "Song choice" = ' you''re so vain ' |
what is the maximum total hospital cost that includes the protein c since 4 years ago? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicm... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'protein c')) AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(... |
User avg reputation by year and month. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,Appr... | SELECT AVG(Reputation * 1.0), TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%m') FROM Users GROUP BY TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%m') ORDER BY TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%m') |
Which team has 26 points? | CREATE TABLE table_name_73 (team VARCHAR,points VARCHAR) | SELECT team FROM table_name_73 WHERE points = "26" |
What is the Shirt No for Henry Bell Cisnero whose height is less than 190? | CREATE TABLE table_name_24 (shirt_no INTEGER,height VARCHAR,player VARCHAR) | SELECT MAX(shirt_no) FROM table_name_24 WHERE height < 190 AND player = "henry bell cisnero" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.