instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
how many consecutive singles were released under the epic label ? | CREATE TABLE table_203_123 (id number,"year" number,"title" text,"b-side" text,"mediums" text,"label (catalog)" text) | SELECT COUNT("title") FROM table_203_123 WHERE "label (catalog)" = 'epic' |
How much Silver has a Rank of 7? | CREATE TABLE table_79715 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT COUNT("Silver") FROM table_79715 WHERE "Rank" = '7' |
What score has devin brown (24) as the leading scorer? | CREATE TABLE table_35676 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Record" text) | SELECT "Score" FROM table_35676 WHERE "Leading scorer" = 'devin brown (24)' |
What was the date of the friendly competition with a score of 4-0? | CREATE TABLE table_5408 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Date" FROM table_5408 WHERE "Competition" = 'friendly' AND "Score" = '4-0' |
what is the nickname founded in 1902? | CREATE TABLE table_1715730_2 (nickname VARCHAR,founded VARCHAR) | SELECT nickname FROM table_1715730_2 WHERE founded = 1902 |
when patient 031-23605 received a microbiology test for a blood, venipuncture for the last time until 12/2104? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND microlab.culturesite = 'blood, venipuncture' AND... |
What kind of Wind has an Athlete of kerron stewart? | CREATE TABLE table_12667 ("Rank" real,"Result" text,"Wind" text,"Athlete" text,"Date" text,"Location" text) | SELECT "Wind" FROM table_12667 WHERE "Athlete" = 'kerron stewart' |
What was the date of the game with a decision of Niittymaki and when the Flyers had a record of 30 21 5? | CREATE TABLE table_51443 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text) | SELECT "Date" FROM table_51443 WHERE "Decision" = 'niittymaki' AND "Record" = '30–21–5' |
what are the three most commonly ordered procedures for patients in the age of 30s until 3 years ago? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid numb... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-3 yea... |
When batavo is the main sponsor and olympikus is the kit manufacturer who are the minor sponsors? | CREATE TABLE table_1949 ("Period" text,"Kit manufacturer" text,"Main sponsor" text,"Secondary sponsor" text,"Minor sponsors" text) | SELECT "Minor sponsors" FROM table_1949 WHERE "Kit manufacturer" = 'Olympikus' AND "Main sponsor" = 'Batavo' |
who was the only player picked above joe reekie ? | CREATE TABLE table_203_824 (id number,"pick #" number,"player" text,"position" text,"nationality" text,"nhl team" text,"college/junior/club team" text) | SELECT "player" FROM table_203_824 WHERE "pick #" < (SELECT "pick #" FROM table_203_824 WHERE "player" = 'joe reekie') |
What is the result for the nomination at the Laurence Olivier award in 2009 for best actress in a musical? | CREATE TABLE table_47076 ("Year" real,"Award" text,"Category" text,"Nominated Work" text,"Result" text) | SELECT "Result" FROM table_47076 WHERE "Category" = 'best actress in a musical' AND "Award" = 'laurence olivier award' AND "Year" = '2009' |
What is the University of Southern California's highest Round? | CREATE TABLE table_name_92 (round INTEGER,school VARCHAR) | SELECT MAX(round) FROM table_name_92 WHERE school = "university of southern california" |
What are the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa, and count them by a line chart, rank from high to low by the payment_date please. | CREATE TABLE store (store_id TINYINT UNSIGNED,manager_staff_id TINYINT UNSIGNED,address_id SMALLINT UNSIGNED,last_update TIMESTAMP)CREATE TABLE address (address_id SMALLINT UNSIGNED,address VARCHAR(50),address2 VARCHAR(50),district VARCHAR(20),city_id SMALLINT UNSIGNED,postal_code VARCHAR(10),phone VARCHAR(20),last_upd... | SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' GROUP BY payment_date ORDER BY payment_date DESC |
body mass index should be less than 26 | CREATE TABLE table_dev_5 ("id" int,"anemia" bool,"gender" string,"hiv_infection" bool,"hemoglobin_a1c_hba1c" float,"panel_reactive_antibodies" int,"psa" int,"body_mass_index_bmi" float,"NOUSE" float) | SELECT * FROM table_dev_5 WHERE body_mass_index_bmi < 26 |
WHich Regular Season Champions has a Year of 1943 44? | CREATE TABLE table_34741 ("Year" text,"Regular Season Champion(s)" text,"Record" text,"Tournament Champion" text,"Tournament venue" text,"Tournament city" text) | SELECT "Regular Season Champion(s)" FROM table_34741 WHERE "Year" = '1943–44' |
anemia ( haemoglobin < 8.5 mg / dl ) | CREATE TABLE table_test_27 ("id" int,"anemia" bool,"bleeding" int,"left_ventricular_ejection_fraction_lvef" int,"intra_aortic_balloon_pump_iabp" bool,"systolic_blood_pressure_sbp" int,"left_main_stem_coronary_artery_stenosis" int,"haemoglobin" float,"renal_disease" bool,"creatinine_clearance_cl" float,"estimated_glomer... | SELECT * FROM table_test_27 WHERE anemia = 1 OR haemoglobin < 8.5 |
Name Event of Medal of gold and a Name of duncan white? | CREATE TABLE table_name_18 (event VARCHAR,medal VARCHAR,name VARCHAR) | SELECT event FROM table_name_18 WHERE medal = "gold" AND name = "duncan white" |
Who were the MLB draft with the hometown Opa-locka, Fl? | CREATE TABLE table_290 ("Player" text,"Position" text,"School" text,"Hometown" text,"MLB Draft" text) | SELECT "MLB Draft" FROM table_290 WHERE "Hometown" = 'Opa-locka, FL' |
Top users by accepted percentage of answers. | CREATE TABLE PostTypes (Id number,Name text)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 SuggestedEdits (Id ... | WITH UserAnswerStats AS (SELECT Answers.OwnerUserId AS UserId, SUM(CASE WHEN AcceptingQuestions.AcceptedAnswerId IS NULL THEN 0 ELSE 1 END) AS AcceptedAnswers, COUNT(*) AS TotalAnswers FROM Posts AS Answers LEFT JOIN Posts AS AcceptingQuestions ON AcceptingQuestions.AcceptedAnswerId = Answers.Id WHERE Answers.PostTypeI... |
What is the Year Commissioned of the power stationo with a Gross head of less than 18? | CREATE TABLE table_name_58 (year_commissioned INTEGER,gross_head__metres_ INTEGER) | SELECT AVG(year_commissioned) FROM table_name_58 WHERE gross_head__metres_ < 18 |
What is the relationship between School_ID and All_Games_Percent , and group by attribute ACC_Home? | 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 School_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Home |
What is the % Won of Team of durham | CREATE TABLE table_name_12 (_percentage_won VARCHAR,team VARCHAR) | SELECT _percentage_won FROM table_name_12 WHERE team = "durham" |
Where was the season that ended on June 25 located? | CREATE TABLE table_23024 ("No." real,"Country" text,"Local title" text,"Format" text,"Start Date" text,"End Date" text,"Episodes" text,"Premiere/Air Dates" text) | SELECT "Country" FROM table_23024 WHERE "End Date" = 'June 25' |
What is the Netflix episode that has a series episode of 6-02? | CREATE TABLE table_36075 ("Series Ep." text,"Episode" real,"Netflix" text,"Segment A" text,"Segment B" text,"Segment C" text,"Segment D" text) | SELECT "Netflix" FROM table_36075 WHERE "Series Ep." = '6-02' |
Give me a pie to show school_id from different acc regular season. | 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_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT ACC_Regular_Season, School_ID FROM basketball_match |
Which chassis-engine had 77 laps? | CREATE TABLE table_name_9 (chassis___engine VARCHAR,laps VARCHAR) | SELECT chassis___engine FROM table_name_9 WHERE laps = 77 |
control subjects with a normal a1c and fasting glucose | CREATE TABLE table_train_177 ("id" int,"hemoglobin_a1c_hba1c" float,"renal_disease" bool,"diabetic" string,"creatinine_clearance_cl" float,"urine_protein" int,"proteinuria" int,"fasting_glucose" int,"NOUSE" float) | SELECT * FROM table_train_177 WHERE fasting_glucose = 1 |
Who has a Rank larger than 3 with a speed of 119.838mph? | CREATE TABLE table_5891 ("Rank" real,"Rider" text,"Team" text,"Speed" text,"Time" text) | SELECT "Rider" FROM table_5891 WHERE "Rank" > '3' AND "Speed" = '119.838mph' |
Name the principal of Northfield Junior-Senior High School. | CREATE TABLE table_23352 ("School" text,"City / Town" text,"Website" text,"Size" real,"Principal" text,"Grades" text,"IDOE Profile" text) | SELECT "Principal" FROM table_23352 WHERE "School" = 'Northfield Junior-Senior High School' |
Which team had 2 wins and a season later than 1986? | CREATE TABLE table_8698 ("Season" real,"Champion" text,"Motorcycle" text,"Wins" real,"Team" text) | SELECT "Team" FROM table_8698 WHERE "Wins" = '2' AND "Season" > '1986' |
Who had the most assists and how many did they have on January 5? | CREATE TABLE table_29556461_7 (high_assists VARCHAR,date VARCHAR) | SELECT high_assists FROM table_29556461_7 WHERE date = "January 5" |
How many points for were scored by the team that won exactly 22? | CREATE TABLE table_74081 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Points" text) | SELECT "Points for" FROM table_74081 WHERE "Won" = '22' |
Which team had game 3? | CREATE TABLE table_name_73 (team VARCHAR,game VARCHAR) | SELECT team FROM table_name_73 WHERE game = 3 |
Score per view by tag. Question tags ordered by score per view | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Badges (Id number,UserId number,N... | SELECT t.TagName, q.* FROM Tags AS t JOIN LATERAL (SELECT SUM(ViewCount) AS "total_views", SUM(TotalScore) AS "total_answers_score", CAST(SUM(TotalScore) * 1000.0 / SUM(ViewCount) AS FLOAT(8, 2)) AS "score_per_thousand_views" FROM PostTags AS pt JOIN Posts AS pq ON pq.Id = pt.PostId AND pq.PostTypeId = 1 JOIN LATERAL (... |
How many patients underwent annuloplasty procedure and died in or before the year 2183? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2183.0" AND procedures.long_title = "Annuloplasty" |
Find the total credits of courses provided by different department Plot them as bar chart, and order by the dept_name in descending. | CREATE TABLE advisor (s_ID varchar(5),i_ID varchar(5))CREATE TABLE instructor (ID varchar(5),name varchar(20),dept_name varchar(20),salary numeric(8,2))CREATE TABLE time_slot (time_slot_id varchar(4),day varchar(1),start_hr numeric(2),start_min numeric(2),end_hr numeric(2),end_min numeric(2))CREATE TABLE prereq (course... | SELECT dept_name, SUM(credits) FROM course GROUP BY dept_name ORDER BY dept_name DESC |
What was the Category before 1995? | CREATE TABLE table_name_19 (category VARCHAR,year INTEGER) | SELECT category FROM table_name_19 WHERE year < 1995 |
a current diagnosis of acute severe, or unstable asthmatic condition ( e.g., severe chronic obstructive pulmonary disease ( copd ) | CREATE TABLE table_train_121 ("id" int,"depression" bool,"suicidality" bool,"neurodegenerative_disease" bool,"unstable_asthmatic_condition" bool,"vitamin_k_deficiency" bool,"renal_disease" bool,"cerebrovascular_disease" bool,"hepatic_disease" bool,"liver_disease" bool,"cardiac_disease" bool,"acute_severe" bool,"chronic... | SELECT * FROM table_train_121 WHERE acute_severe = 1 OR (unstable_asthmatic_condition = 1 OR chronic_obstructive_pulmonary_disease_copd = 1) |
When Patrick Carpentier is driving and has less than 19 points with 90 laps, what team is racing? | CREATE TABLE table_48728 ("Driver" text,"Team" text,"Laps" real,"Time/Retired" text,"Grid" real,"Points" real) | SELECT "Team" FROM table_48728 WHERE "Laps" = '90' AND "Points" < '19' AND "Driver" = 'patrick carpentier' |
who has a 2011 population less than 224,000 ? | CREATE TABLE table_203_860 (id number,"rank" number,"city" text,"population (2011)" number,"population (2001)" number,"state/territory" text) | SELECT "city" FROM table_203_860 WHERE "population (2011)" < 224000 |
What was the average number of attendance for the game on November 29, 1981 played after week 13? | CREATE TABLE table_77188 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT AVG("Attendance") FROM table_77188 WHERE "Date" = 'november 29, 1981' AND "Week" > '13' |
provide the number of patients whose gender is f and item id is 50831? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.itemid = "50831" |
Who is the alternate for the team for which Monika Wagner is the third? | CREATE TABLE table_34774 ("Nation" text,"Skip" text,"Third" text,"Second" text,"Lead" text,"Alternate" text) | SELECT "Alternate" FROM table_34774 WHERE "Third" = 'monika wagner' |
What is the branding for callsign DWFM? | CREATE TABLE table_12656 ("Branding" text,"Callsign" text,"Frequency" text,"Power (kW)" text,"Location" text) | SELECT "Branding" FROM table_12656 WHERE "Callsign" = 'dwfm' |
Who is the opponent when the attendance is n/a? | CREATE TABLE table_21350934_2 (opponent VARCHAR,attendance VARCHAR) | SELECT opponent FROM table_21350934_2 WHERE attendance = "N/A" |
What shows for Playoffs when the Open Cup shows as did not qualify, and a Regular Season was 3rd, south atlantic? | CREATE TABLE table_name_52 (playoffs VARCHAR,open_cup VARCHAR,regular_season VARCHAR) | SELECT playoffs FROM table_name_52 WHERE open_cup = "did not qualify" AND regular_season = "3rd, south atlantic" |
What is the Result of Goal number 3? | CREATE TABLE table_name_21 (result VARCHAR,goal VARCHAR) | SELECT result FROM table_name_21 WHERE goal = 3 |
What are the number of floors for the building of td building redevelopment (office)? | CREATE TABLE table_77852 ("Building" text,"Height" text,"Floors" real,"Year" real,"Status" text) | SELECT AVG("Floors") FROM table_77852 WHERE "Building" = 'td building redevelopment (office)' |
In what place did the golfer that scored 68-70-69=207 finish? | CREATE TABLE table_name_59 (place VARCHAR,score VARCHAR) | SELECT place FROM table_name_59 WHERE score = 68 - 70 - 69 = 207 |
A bar chart shows the distribution of meter_200 and the average of ID , and group by attribute meter_200, I want to rank by the bars in descending. | CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Ev... | SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 DESC |
Name the class 1-200 for university of hertfordshire for university of warwick | CREATE TABLE table_22959 ("Year" text,"Location" text,"Class 1" text,"Best UK team" text,"Class 1-200" text,"Class 3" text,"Class 1a" text) | SELECT "Class 1-200" FROM table_22959 WHERE "Best UK team" = 'University of Hertfordshire' AND "Class 1a" = 'University of Warwick' |
Deleted users by number of posts. | 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,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans... | SELECT p.OwnerDisplayName, COUNT(*) AS Cnt, MAX(p.CreationDate) AS LastDate, MAX(p.Id) AS "Post Link" FROM Posts AS p WHERE p.OwnerUserId IS NULL GROUP BY p.OwnerDisplayName ORDER BY COUNT(*) DESC |
Name the wins for best finish being 2nd | CREATE TABLE table_1697190_1 (wins VARCHAR,best_finish VARCHAR) | SELECT wins FROM table_1697190_1 WHERE best_finish = "2nd" |
what's the total number of episodes with a US air date of january 15, 2005? | CREATE TABLE table_17621 ("Number in series" real,"Broadcast Order" text,"Title" text,"Villain/s" text,"U.S. Air Date" text,"Production Code" text) | SELECT COUNT("Production Code") FROM table_17621 WHERE "U.S. Air Date" = 'January 15, 2005' |
What is the score on March 18? | CREATE TABLE table_name_97 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_97 WHERE date = "march 18" |
How many years ago was CLCIV 388 first offered ? | CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_d... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'CLCIV' AND course.number = 388 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1 |
how many 1 seeds are there ? | CREATE TABLE table_203_200 (id number,"region" text,"seed" number,"team" text,"coach" text,"finished" text,"final opponent" text,"score" text) | SELECT COUNT(*) FROM table_203_200 WHERE "seed" = 1 |
How many providers have a destination of Blackpool? | CREATE TABLE table_3005999_1 (provider VARCHAR,destination VARCHAR) | SELECT COUNT(provider) FROM table_3005999_1 WHERE destination = "Blackpool" |
how many athletes had times under 8 minutes ? | CREATE TABLE table_204_893 (id number,"rank" number,"name" text,"nationality" text,"time" text,"notes" text) | SELECT COUNT("name") FROM table_204_893 WHERE "time" < 8 |
what is the five diagnoses which have the lowest four year survival rate? | 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,long_title text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wa... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt... |
What is the record on March 16? | CREATE TABLE table_name_66 (record VARCHAR,date VARCHAR) | SELECT record FROM table_name_66 WHERE date = "march 16" |
what is the number of patients whose diagnoses icd9 code is 1173 and drug route is ih? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "1173" AND prescriptions.route = "IH" |
Percentage of the total rep of users with 'monica' substring. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PendingFlags (Id num... | WITH Monica AS (SELECT SUM(Reputation) AS Monica FROM Users WHERE LOWER(DisplayName) LIKE '%monica%'), SumRep AS (SELECT SUM(Reputation) AS SumRep FROM Users) SELECT Monica.Monica, SumRep.SumRep, 100.0 * Monica.Monica / SumRep.SumRep AS Pct FROM Monica, SumRep |
Whose attendance was the highest when the team played Arsenal? | CREATE TABLE table_name_95 (attendance INTEGER,opponent VARCHAR) | SELECT MAX(attendance) FROM table_name_95 WHERE opponent = "arsenal" |
what was the last intake of patient 26793 for the patient on 02/08/this year? | 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 time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE patients (ro... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 26793)) AND DATETIME(inputevents_cv.... |
Give me a histogram for what are the name and level of catalog structure with level number between 5 and 10, list by the x axis in desc. | CREATE TABLE Catalogs (catalog_id INTEGER,catalog_name VARCHAR(50),catalog_publisher VARCHAR(80),date_of_publication DATETIME,date_of_latest_revision DATETIME)CREATE TABLE Attribute_Definitions (attribute_id INTEGER,attribute_name VARCHAR(30),attribute_data_type VARCHAR(10))CREATE TABLE Catalog_Contents (catalog_entry_... | SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10 ORDER BY catalog_level_name DESC |
How many students are in each department Visualize by bar chart, could you show by the total number in ascending please? | CREATE TABLE COURSE (CRS_CODE varchar(10),DEPT_CODE varchar(10),CRS_DESCRIPTION varchar(35),CRS_CREDIT float(8))CREATE TABLE PROFESSOR (EMP_NUM int,DEPT_CODE varchar(10),PROF_OFFICE varchar(50),PROF_EXTENSION varchar(4),PROF_HIGH_DEGREE varchar(5))CREATE TABLE CLASS (CLASS_CODE varchar(5),CRS_CODE varchar(10),CLASS_SEC... | SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE ORDER BY COUNT(*) |
Which Release price (USD ) has a GPU frequency of 650 1150 mhz and a sSpec number of sr0pq(e1)? | CREATE TABLE table_name_20 (release_price___usd__ VARCHAR,gpu_frequency VARCHAR,sspec_number VARCHAR) | SELECT release_price___usd__ FROM table_name_20 WHERE gpu_frequency = "650–1150 mhz" AND sspec_number = "sr0pq(e1)" |
are there any flights from DENVER to PITTSBURGH with stops in ATLANTA | CREATE TABLE time_interval (period text,begin_time int,end_time int)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_discounts text)C... | 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 = 'PITTSBURGH' AND CITY_2... |
Who directed episode 12 in season 3? | CREATE TABLE table_20912 ("No. in series" text,"No. in season" text,"Title" text,"Directed by" text,"Written by" text,"Original airdate" text,"Production code" text) | SELECT "Directed by" FROM table_20912 WHERE "No. in season" = '12' |
How many spikes have 28.09.1981 as the date of birth, with a block greater than 318? | CREATE TABLE table_name_78 (spike INTEGER,date_of_birth VARCHAR,block VARCHAR) | SELECT SUM(spike) FROM table_name_78 WHERE date_of_birth = "28.09.1981" AND block > 318 |
How many teams have a head coach named mahdi ali? | CREATE TABLE table_29692 ("Team" text,"Chairman" text,"Head Coach" text,"Captain" text,"Kitmaker" text,"Shirt sponsor" text) | SELECT COUNT("Team") FROM table_29692 WHERE "Head Coach" = 'Mahdi Ali' |
How many answers have I posted in the past 14 months by tag. | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CRE... | SELECT TagName, COUNT(DISTINCT Posts.ParentId) AS UniqueAnswers FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id WHERE Posts.OwnerUserId = @UserId AND Votes.CreationDate >= DATEADD(month, -14, CURRENT_TIMESTAMP()) ... |
Who was the driver of the Officine Alfieri Maserati with a Tyre of P? | CREATE TABLE table_10436 ("Entrant" text,"Constructor" text,"Chassis" text,"Engine" text,"Tyre" text,"Driver" text,"Rounds" text) | SELECT "Driver" FROM table_10436 WHERE "Tyre" = 'p' AND "Entrant" = 'officine alfieri maserati' |
What is the name of the First Class Team in which the player has a bowling style of left arm orthodox spin? | CREATE TABLE table_10705 ("Player" text,"Date of Birth" text,"Batting Style" text,"Bowling Style" text,"First Class Team" text) | SELECT "First Class Team" FROM table_10705 WHERE "Bowling Style" = 'left arm orthodox spin' |
How many goals against were scored when the goals for is less than 48 with 0 ties? | CREATE TABLE table_name_65 (goals_against VARCHAR,goals_for VARCHAR,ties VARCHAR) | SELECT COUNT(goals_against) FROM table_name_65 WHERE goals_for < 48 AND ties < 0 |
How many gold medals were awarded to teams ranked higher than 19? | CREATE TABLE table_7331 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT COUNT("Gold") FROM table_7331 WHERE "Rank" > '19' |
If two years is 159, what is the amount for one year? | CREATE TABLE table_1697 ("Year" real,"Total" text,"Less than a year" real,"One year" real,"Two years" real,"Three years" real,"Four years" real,"5\u20139 years" real,"10\u201314 years" real,"15\u201319 years" real,"20\u201324 years" real,"25 and more" real,"Unknown" real) | SELECT MIN("One year") FROM table_1697 WHERE "Two years" = '159' |
What's the release date of Upswept Hare? | CREATE TABLE table_name_28 (release_date VARCHAR,title VARCHAR) | SELECT release_date FROM table_name_28 WHERE title = "upswept hare" |
What is the population of each community with city status? | CREATE TABLE table_171361_1 (population VARCHAR,status VARCHAR) | SELECT population FROM table_171361_1 WHERE status = "City" |
indicate the yearly average arterial bp [systolic] of patient 20207 until 56 months ago. | CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number... | SELECT AVG(chartevents.valuenum) 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 = 20207)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... |
provide the number of patients whose primary disease is left internal jugular vein thrombosis;left arm edema? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title 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 text,flag text,value_unit text,label text,fluid ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" |
in which tournament did he have the biggest margin of victory ? | CREATE TABLE table_204_621 (id number,"no." number,"date" text,"tournament" text,"winning score" text,"margin\nof victory" text,"runner(s)-up" text) | SELECT "tournament" FROM table_204_621 ORDER BY "margin\nof victory" DESC LIMIT 1 |
How long does student Linda Smith spend on the restaurant in total? | CREATE TABLE Student (Spent INTEGER)CREATE TABLE Visits_Restaurant (Spent INTEGER) | SELECT SUM(Spent) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" |
What is the singular for the Meaning of night? | CREATE TABLE table_name_28 (singular VARCHAR,meaning VARCHAR) | SELECT singular FROM table_name_28 WHERE meaning = "night" |
Which Series has Poles of 0, and Races of 17? | CREATE TABLE table_name_72 (series VARCHAR,poles VARCHAR,races VARCHAR) | SELECT series FROM table_name_72 WHERE poles = "0" AND races = "17" |
count the number of patients diagnosed with hyperlipidemia within the same hospital visit after receiving antihypertensives the last year. | 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 treatment (treatmentid number,patientunitstayid number,treatmentname text,... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antihypertensives' AND DATETIME(treatment.treatmenttime, 'start of year')... |
What are the clubs with 46 matches? | CREATE TABLE table_75457 ("Round" text,"Date" text,"Matches" real,"Clubs" text,"New entries this round" text,"Prize money" text) | SELECT "Clubs" FROM table_75457 WHERE "Matches" = '46' |
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, draw a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by time, and I want to display y axis from low to high order. | 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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID deci... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(EMPLOYEE_ID) |
what is the marital status of patient 43735 on the first hospital encounter. | CREATE TABLE labevents (row_id number,subject_id number,hadm_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_labitems (row_id number,itemid number,label text)CREATE TABLE chartevents (row_id ... | SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 43735 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 |
what was patient 51577's first diagnosis of crnry athrscl natve vssl time during their first hospital visit? | 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 diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'crnry athrscl natve vssl') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51577 AND NOT adm... |
has patient 006-76924 been prescribed with insulin (regular) 100 units in 1, levofloxacin 750 mg po tabs or magnesium sulfate 1 g in d5w 100ml **locked dose on the current hospital visit? | 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 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 = '006-76924' AND patient.hospitaldischargetime IS NULL)) AND medication.drug... |
What away team played at Kardinia Park? | CREATE TABLE table_78090 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team score" FROM table_78090 WHERE "Venue" = 'kardinia park' |
Which Silver has a Rank of 6, and a Bronze smaller than 3? | CREATE TABLE table_79717 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MIN("Silver") FROM table_79717 WHERE "Rank" = '6' AND "Bronze" < '3' |
What is the lowest round for Georgia Tech? | CREATE TABLE table_name_2 (round INTEGER,school VARCHAR) | SELECT MIN(round) FROM table_name_2 WHERE school = "georgia tech" |
, show X-axis from high to low order. | CREATE TABLE airport (id int,City text,Country text,IATA text,ICAO text,name text)CREATE TABLE flight (id int,Vehicle_Flight_number text,Date text,Pilot text,Velocity real,Altitude real,airport_id int,company_id int)CREATE TABLE operate_company (id int,name text,Type text,Principal_activities text,Incorporated_in text,... | SELECT Country, COUNT(*) FROM airport GROUP BY Country ORDER BY Country DESC |
Show me a scatter plot of avg(stu gpa) and minimal stu gpa for . | CREATE TABLE PROFESSOR (EMP_NUM int,DEPT_CODE varchar(10),PROF_OFFICE varchar(50),PROF_EXTENSION varchar(4),PROF_HIGH_DEGREE varchar(5))CREATE TABLE COURSE (CRS_CODE varchar(10),DEPT_CODE varchar(10),CRS_DESCRIPTION varchar(35),CRS_CREDIT float(8))CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCH... | SELECT AVG(STU_GPA), MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE |
how many times were new zealand the opposing team ? | CREATE TABLE table_204_329 (id number,"no." number,"score" number,"player" text,"team" text,"balls" number,"inns." number,"opposing team" text,"date" text,"result" text) | SELECT COUNT(*) FROM table_204_329 WHERE "opposing team" = 'new zealand' |
What Home city has the home ground Klepp stadion? | CREATE TABLE table_2522473_1 (home_city VARCHAR,home_ground VARCHAR) | SELECT home_city FROM table_2522473_1 WHERE home_ground = "Klepp Stadion" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.