instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
How many winners have st kilda score at 14.11.95? | CREATE TABLE table_74256 ("Year" real,"Round" real,"Winner" text,"Hawthorn score" text,"St Kilda score" text,"Attendance" real,"Venue" text,"Silk-Miller Medallist" text) | SELECT COUNT("Winner") FROM table_74256 WHERE "St Kilda score" = '14.11.95' |
For those employees who do not work in departments with managers that have ids between 100 and 200, find email and salary , and visualize them by a bar chart, and display by the Y-axis from low to high. | 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 decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE... | SELECT EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY |
What is the score from the winner Keith Clearwater (1)? | CREATE TABLE table_75273 ("Date" text,"Tournament" text,"Location" text,"Winner" text,"Score" text,"1st prize ($)" real) | SELECT "Score" FROM table_75273 WHERE "Winner" = 'keith clearwater (1)' |
How many of the prerequisites for ASIANPAM 389 have I met ? | CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comm... | SELECT COUNT(DISTINCT COURSE_1.department, COURSE_0.number) FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'ASIANPAM' AND COURSE_1.number = 389 ... |
Tell me the security forces for 849 total | CREATE TABLE table_57140 ("Year" text,"Security Forces" text,"Insurgents" text,"Civilians" text,"Total:" text) | SELECT "Security Forces" FROM table_57140 WHERE "Total:" = '849' |
what was the score on june 29? | CREATE TABLE table_name_83 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_83 WHERE date = "june 29" |
uncontrolled arterial hypertension according to investigator decision | CREATE TABLE table_test_2 ("id" int,"loss_of_consciousness" bool,"gender" string,"bleeding" int,"systolic_blood_pressure_sbp" int,"stroke" bool,"renal_disease" bool,"hemorrhagic_diathesis" bool,"transient_ischemic_attack" bool,"creatinine_clearance_cl" float,"dementia" bool,"glasgow_come_score_gcs" int,"prior_creatinin... | SELECT * FROM table_test_2 WHERE hypertension = 1 |
what's the runners-up with nation being malaysia | CREATE TABLE table_17603 ("#" real,"Nation" text,"Winners" real,"Runners-up" real,"3rd Place" real,"4th Place" real) | SELECT "Runners-up" FROM table_17603 WHERE "Nation" = 'Malaysia' |
so whats the last weight of patient 4718 until 30 months ago? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)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 prescriptions (row_id number,subject_id number,hadm_id number,sta... | SELECT 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 = 4718)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' ... |
What was the earliest year that Yvette Alexander took office and was up for reelection after 2016? | CREATE TABLE table_name_70 (took_office INTEGER,name VARCHAR,up_for_reelection VARCHAR) | SELECT MIN(took_office) FROM table_name_70 WHERE name = "yvette alexander" AND up_for_reelection > 2016 |
Which score has an Opponent of white sox, and a Record of 2-0? | CREATE TABLE table_72049 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Score" FROM table_72049 WHERE "Opponent" = 'white sox' AND "Record" = '2-0' |
What rank did the United States swimmer come in who posted 11.26 seconds in the 100-meter youth female division? | CREATE TABLE table_name_71 (rank VARCHAR,fastest_time__s_ VARCHAR,nation VARCHAR) | SELECT COUNT(rank) FROM table_name_71 WHERE fastest_time__s_ = "11.26" AND nation = "united states" |
when did patient 031-16123 first receive since 98 months ago a blood, venipuncture microbiology test? | 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 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-16123')) AND microlab.culturesite = 'blood, venipuncture' AND... |
For the station opened after 1876 at 604.53km from Wellington, what is the height above sea level? | CREATE TABLE table_name_22 (height_above_sea_level__m_ VARCHAR,opened VARCHAR,distance_from_wellington VARCHAR) | SELECT height_above_sea_level__m_ FROM table_name_22 WHERE opened > 1876 AND distance_from_wellington = "604.53km" |
Who had 0 total votes in the purple team? | CREATE TABLE table_name_18 (status VARCHAR,total_votes VARCHAR,couples_team VARCHAR) | SELECT status FROM table_name_18 WHERE total_votes = "0" AND couples_team = "purple team" |
what is the team nickname that joined tschl after 2010? | CREATE TABLE table_10082 ("Institution" text,"Location" text,"Team Nickname" text,"Joined TSCHL" real,"Home Arena" text,"Capacity" real,"Team Website" text) | SELECT "Team Nickname" FROM table_10082 WHERE "Joined TSCHL" > '2010' |
what are the four most commonly prescribed medications for patients that have been prescribed with nateglinide previously during the same month the last 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 patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREA... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'nateglinide' AND DATETIME(prescriptions.startdate, 'start of year... |
what is discharge time of subject name dawn cooper? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT demographic.dischtime FROM demographic WHERE demographic.name = "Dawn Cooper" |
Users with the most reputation. | 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 CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwne... | SELECT * FROM (SELECT Id, Reputation FROM Users ORDER BY Reputation DESC LIMIT 50000) AS a ORDER BY Id |
what's the pts with position being nc | CREATE TABLE table_19145 ("Season" real,"Class" text,"Team" text,"Motorcycle" text,"Type" text,"Races" real,"Wins" real,"Podiums" real,"Poles" real,"Fastest Laps" real,"Pts" text,"Position" text) | SELECT "Pts" FROM table_19145 WHERE "Position" = 'NC' |
Which Player has a Score of 72-68-78-71=289? | CREATE TABLE table_name_91 (player VARCHAR,score VARCHAR) | SELECT player FROM table_name_91 WHERE score = 72 - 68 - 78 - 71 = 289 |
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the average of department_id bin hire_date by weekday, and order in asc by the the average of department id. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))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 regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE dep... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(DEPARTMENT_ID) |
What is the title of the production with a number of 1039? | CREATE TABLE table_14117 ("Title" text,"Series" text,"Director" text,"Production Number" text,"Release date" text,"reissue?" text) | SELECT "Title" FROM table_14117 WHERE "Production Number" = '1039' |
Name the most attendance for 19 february 2005 | CREATE TABLE table_name_62 (attendance INTEGER,date VARCHAR) | SELECT MAX(attendance) FROM table_name_62 WHERE date = "19 february 2005" |
tell me the cost for the cholecystitis - acute diagnosis? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosa... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'cholecystitis - acute') |
Who leads the general classification in stage 3? | CREATE TABLE table_26010857_13 (general_classification VARCHAR,stage VARCHAR) | SELECT general_classification FROM table_26010857_13 WHERE stage = 3 |
what is russia 's total number of non gold medals ? | CREATE TABLE table_203_374 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "silver" + "bronze" FROM table_203_374 WHERE "nation" = 'russia' |
what is the number of patients whose year of death is less than or equal to 2179 and diagnoses long title is psychogenic paranoid psychosis? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2179.0" AND diagnoses.long_title = "Psychogenic paranoid psychosis" |
How many yards for the RB with over 4 carries, 2 TDs, and a long greater than 8? | CREATE TABLE table_11824 ("Player" text,"Car." real,"Yards" real,"Avg." real,"TD's" real,"Long" real) | SELECT COUNT("Yards") FROM table_11824 WHERE "Car." > '4' AND "TD's" = '2' AND "Long" > '8' |
What is the highest total medals won by a nation that had 7 bronze but more than 12 silver medals? | CREATE TABLE table_69261 ("Rank" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MAX("Total") FROM table_69261 WHERE "Bronze" = '7' AND "Silver" > '12' |
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by weekday, sort Y-axis in ascending order. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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),DEPARTME... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID) |
What is the weekday of birth of professors teaching course ACCT-211? Show a bar chart. | 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 DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCH... | SELECT EMP_DOB, COUNT(EMP_DOB) FROM EMPLOYEE AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = "ACCT-211" |
give me the number of patients whose marital status is divorced and lab test category is hematology? | 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 = "DIVORCED" AND lab."CATEGORY" = "Hematology" |
First users to cast close votes on a closed post. Returns the user Id of the first user to cast a close vote on recently closed questions, ordered by closure timestamp. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)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,L... | SELECT PostHistory.PostId AS "post_link", PostHistory.CreationDate AS PostClosureDate, PostHistory.UserId AS "user_link", PostHistory.Comment AS PostClosureComment, CAST(SUBSTRING(PostHistory.Text, STR_POSITION(PostHistory.Text, 'Voters') + 15, STR_POSITION(PostHistory.Text, 'Display') - STR_POSITION(PostHistory.Text, ... |
give me the number of patients whose drug name is nitroglycerin ointment 2%? | 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 = "Nitroglycerin Ointment 2%" |
What is Country, when Place is 'T8', and when Score is '70-67=137'? | CREATE TABLE table_60487 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Country" FROM table_60487 WHERE "Place" = 't8' AND "Score" = '70-67=137' |
Where do I comment about 'testfor'. | CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId... | SELECT PostId AS "post_link", Text FROM Comments WHERE UserId = '##UserId##' AND Text LIKE '%testfor%' |
What is Median Family Income, when Median Household Income is '$50,717'? | CREATE TABLE table_60726 ("County" text,"Per capita income" text,"Median household income" text,"Median family income" text,"Population" real,"Number of households" real) | SELECT "Median family income" FROM table_60726 WHERE "Median household income" = '$50,717' |
what is the position for the nhl team toronto maple leafs? | CREATE TABLE table_74030 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "Position" FROM table_74030 WHERE "NHL team" = 'Toronto Maple Leafs' |
What is the name of the entry that has a developer entry of Yes and a personal sites entry of No? | CREATE TABLE table_60938 ("Name" text,"Public" text,"Intranet" text,"Extranet" text,"Personal Sites" text,"Team Sites" text,"Developer" text) | SELECT "Name" FROM table_60938 WHERE "Developer" = 'yes' AND "Personal Sites" = 'no' |
What is the class for the position of lg? | CREATE TABLE table_35143 ("Position" text,"Number" real,"Name" text,"Height" text,"Weight" text,"Class" text,"Hometown" text,"Games\u2191" real) | SELECT "Class" FROM table_35143 WHERE "Position" = 'lg' |
What club scored 143 goals? | CREATE TABLE table_name_71 (club VARCHAR,goals VARCHAR) | SELECT club FROM table_name_71 WHERE goals = "143" |
What is the name of the restaurant originally named Essence? | CREATE TABLE table_name_93 (restaurant_name VARCHAR,original_name VARCHAR) | SELECT restaurant_name FROM table_name_93 WHERE original_name = "essence" |
Give me a bar chart that bins the year into day of the week interval, and return the average number of times the team Boston Red Stockings won in the postseasons. | CREATE TABLE fielding (player_id TEXT,year INTEGER,stint INTEGER,team_id TEXT,league_id TEXT,pos TEXT,g INTEGER,gs NUMERIC,inn_outs NUMERIC,po NUMERIC,a NUMERIC,e NUMERIC,dp NUMERIC,pb NUMERIC,wp NUMERIC,sb NUMERIC,cs NUMERIC,zr NUMERIC)CREATE TABLE player_award_vote (award_id TEXT,year INTEGER,league_id TEXT,player_id... | SELECT year, AVG(COUNT(*)) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' |
Which FA Cup Apps have League Apps of 21? | CREATE TABLE table_name_28 (fa_cup_apps VARCHAR,league_apps VARCHAR) | SELECT fa_cup_apps FROM table_name_28 WHERE league_apps = "21" |
What is the average game that has December 17 as the date? | CREATE TABLE table_47066 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"Location Attendance" text,"Record" text) | SELECT AVG("Game") FROM table_47066 WHERE "Date" = 'december 17' |
Who directed the episode with production code ip03010? | CREATE TABLE table_29273182_1 (directed_by VARCHAR,production_code VARCHAR) | SELECT directed_by FROM table_29273182_1 WHERE production_code = "IP03010" |
Name the total number of nba drafts that went to east side high school | CREATE TABLE table_17113 ("Player" text,"Height" text,"School" text,"Hometown" text,"College" text,"NBA Draft" text) | SELECT COUNT("NBA Draft") FROM table_17113 WHERE "School" = 'East Side High School' |
tell me the total amount of input that patient 035-3496 had received since 1066 days ago? | 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 patient (... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-3496')) AND intakeoutput.cellpath LIKE '%int... |
How many sections of PORTUG 235 are there ? | CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,heavy_assignments int,respected int,participation int,heavy_reading int,tough_grade... | SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PORTUG' AND course.number = 235 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
What is the directed/undirected for mfinder, which has a network-centric basis? | CREATE TABLE table_name_83 (directed___undirected VARCHAR,name VARCHAR,basis VARCHAR) | SELECT directed___undirected FROM table_name_83 WHERE name = "mfinder" AND basis = "network-centric" |
What courses are taught by Prof. Sarah Miller ? | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course (course_... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Sarah Miller%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = ... |
type ii diabetes | CREATE TABLE table_train_146 ("id" int,"lymphocyte_count" int,"c_peptide_level" float,"vitamin_d_deficiency" bool,"diabetic" string,"vitamin_d" int,"NOUSE" float) | SELECT * FROM table_train_146 WHERE diabetic = 'ii' |
Find the name of all customers whose name contains 'Alex'. | CREATE TABLE customers (customer_name VARCHAR) | SELECT customer_name FROM customers WHERE customer_name LIKE "%Alex%" |
What is the number of games for Roger Merrett? | CREATE TABLE table_67020 ("Rank" text,"Games" text,"Player" text,"Club" text,"Career span" text) | SELECT "Games" FROM table_67020 WHERE "Player" = 'roger merrett' |
give me the number of patients whose year of birth is less than 2180? | 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 demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2180" |
What is yejin choi 's latest paper ? | CREATE TABLE writes (paperid int,authorid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE ... | SELECT DISTINCT writes.paperid FROM author, paper, writes WHERE author.authorname = 'yejin choi' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year DESC |
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, a bar chart shows the distribution of hire_date and the average of manager_id bin hire_date by time, list total number from high to low order. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))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 locations (LOCATION_ID decimal(4,0),STREET_ADDRESS... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID) DESC |
which album was released later , beautiful , or j' adore ? | CREATE TABLE table_203_276 (id number,"album#" text,"english title" text,"chinese (traditional)" text,"chinese (simplified)" text,"release date" text,"label" text) | SELECT "english title" FROM table_203_276 WHERE "english title" IN ('beautiful', "j'adore") ORDER BY "release date" DESC LIMIT 1 |
What is the average price of the products for each category, list y axis from low to high order. | CREATE TABLE Customers (customer_id INTEGER,customer_type_code VARCHAR(20),address_line_1 VARCHAR(80),address_line_2 VARCHAR(80),town_city VARCHAR(80),state VARCHAR(80),email_address VARCHAR(255),phone_number VARCHAR(80))CREATE TABLE Products (product_id INTEGER,parent_product_id INTEGER,product_category_code VARCHAR(2... | SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY AVG(product_price) |
What is the # for the episode with a Production code of 3T7057? | CREATE TABLE table_13183076_3 (_number VARCHAR,production_code VARCHAR) | SELECT _number FROM table_13183076_3 WHERE production_code = "3T7057" |
How many patients categorized under a hematology lab test stayed in hospital for more than 4 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 > "4" AND lab."CATEGORY" = "Hematology" |
what club scored the only a total of 79 points ? | CREATE TABLE table_204_256 (id number,"position" number,"club" text,"played" number,"points" number,"wins" number,"draws" number,"losses" number,"goals for" number,"goals against" number,"goal difference" number) | SELECT "club" FROM table_204_256 WHERE "points" = 79 |
What are the names of parties that do not have delegates in election? | CREATE TABLE election (Party VARCHAR,Party_ID VARCHAR)CREATE TABLE party (Party VARCHAR,Party_ID VARCHAR) | SELECT Party FROM party WHERE NOT Party_ID IN (SELECT Party FROM election) |
What is the Winning score when the To par was 21? | CREATE TABLE table_42729 ("Date" text,"Tournament" text,"Winning score" text,"To par" text,"Margin of victory" text,"Runner(s)-up" text) | SELECT "Winning score" FROM table_42729 WHERE "To par" = '−21' |
how many of the competitions that took place were based in a venue in the united states ? | CREATE TABLE table_203_763 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text) | SELECT COUNT("competition") FROM table_203_763 WHERE "venue" = 'united states' |
Which Score has a Place of t6, and a Country of paraguay? | CREATE TABLE table_name_20 (score VARCHAR,place VARCHAR,country VARCHAR) | SELECT score FROM table_name_20 WHERE place = "t6" AND country = "paraguay" |
Name the mens singles for lee eun-sil moon hyun-jung | CREATE TABLE table_28138035_4 (mens_singles VARCHAR,womens_doubles VARCHAR) | SELECT mens_singles FROM table_28138035_4 WHERE womens_doubles = "Lee Eun-Sil Moon Hyun-Jung" |
Which is the total number of evening gowns for swimsui less than 9.36 and average less than 9.23? | CREATE TABLE table_57531 ("Country" text,"Interview" real,"Swimsuit" real,"Evening Gown" real,"Average" real) | SELECT COUNT("Evening Gown") FROM table_57531 WHERE "Swimsuit" < '9.36' AND "Average" < '9.23' |
What position is the round higher than 15 and has an overall of 411. | CREATE TABLE table_name_82 (position VARCHAR,round VARCHAR,overall VARCHAR) | SELECT position FROM table_name_82 WHERE round > 15 AND overall = 411 |
How many sections of AAPTIS 102 are after 10 A.M. ? | CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree... | SELECT COUNT(*) FROM course, course_offering, semester WHERE course_offering.start_time > '10:00:00' AND course.course_id = course_offering.course_id AND course.department = 'AAPTIS' AND course.number = 102 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
Who was the opponent in games over 58, after Feb 16, and having a record of 40-20-4? | CREATE TABLE table_36417 ("Game" real,"February" real,"Opponent" text,"Score" text,"Record" text) | SELECT "Opponent" FROM table_36417 WHERE "Game" > '58' AND "February" > '16' AND "Record" = '40-20-4' |
Which country had a release of 1 VCD titled Martial Law: Substitutes? | CREATE TABLE table_name_93 (country VARCHAR,notes VARCHAR,release_title VARCHAR) | SELECT country FROM table_name_93 WHERE notes = "1 vcd" AND release_title = "martial law: substitutes" |
Return a bar chart showing the number of each company whose office is located in the building, and order in desc by the bar. | CREATE TABLE Office_locations (building_id int,company_id int,move_in_year int)CREATE TABLE buildings (id int,name text,City text,Height int,Stories int,Status text)CREATE TABLE Companies (id int,name text,Headquarters text,Industry text,Sales_billion real,Profits_billion real,Assets_billion real,Market_Value_billion t... | SELECT T3.name, COUNT(T3.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T3.name ORDER BY T3.name DESC |
what is the district where the incumbent is richard kelly? | CREATE TABLE table_1341672_10 (district VARCHAR,incumbent VARCHAR) | SELECT district FROM table_1341672_10 WHERE incumbent = "Richard Kelly" |
How many season numbers are there for the episodes written by Art Everett? | CREATE TABLE table_2226817_6 (no_in_season VARCHAR,written_by VARCHAR) | SELECT COUNT(no_in_season) FROM table_2226817_6 WHERE written_by = "Art Everett" |
What year had a total of 2 and LA matches of 0? | CREATE TABLE table_61288 ("Name of ground" text,"Location" text,"Year" text,"FC matches" text,"LA matches" text,"T20 matches" text,"Total" text) | SELECT "Year" FROM table_61288 WHERE "Total" = '2' AND "LA matches" = '0' |
When was the last final lost of the club with 7 wins? | CREATE TABLE table_name_49 (last_final_lost VARCHAR,wins VARCHAR) | SELECT last_final_lost FROM table_name_49 WHERE wins = "7" |
which team has the highest rank among those listed ? | CREATE TABLE table_204_219 (id number,"date" text,"time" text,"opponent#" text,"rank#" text,"site" text,"tv" text,"result" text,"attendance" number) | SELECT "opponent#" FROM table_204_219 ORDER BY "rank#" LIMIT 1 |
What are the sum of points in 1989 with 0 wins? | CREATE TABLE table_name_85 (points INTEGER,wins VARCHAR,year VARCHAR) | SELECT SUM(points) FROM table_name_85 WHERE wins = 0 AND year = 1989 |
In which Age Category is Marco Manenti? | CREATE TABLE table_name_44 (age_category VARCHAR,name VARCHAR) | SELECT age_category FROM table_name_44 WHERE name = "marco manenti" |
What is the least amount of blank ends for a skip who has 44 PF? | CREATE TABLE table_29546030_2 (blank_ends INTEGER,pf VARCHAR) | SELECT MIN(blank_ends) FROM table_29546030_2 WHERE pf = 44 |
How many students are affected by each allergy type Visualize by bar chart, could you display total number in descending order please? | CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20))CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20))CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3)) | SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType ORDER BY COUNT(*) DESC |
i need a flight from MONTREAL QUEBEC to SAN DIEGO CALIFORNIA leaving this sunday | CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description tex... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight, state AS STATE_0, state AS STATE_1 WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND date_day.day_number = ... |
how many patients admitted before 2111 have been discharged to home health care facility? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.admityear < "2111" |
what is the number of patients whose year of birth is less than 2078 and item id is 50981? | 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 text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2078" AND lab.itemid = "50981" |
When was the opponent Poland and the match type EC -qualifier? | CREATE TABLE table_67567 ("Date" text,"Location" text,"Opponenent" text,"Result" text,"Match type" text) | SELECT "Date" FROM table_67567 WHERE "Opponenent" = 'poland' AND "Match type" = 'ec -qualifier' |
What is the course CSP 100 ? | CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE course_offering (offering_id int,course_id int,semes... | SELECT DISTINCT name FROM course WHERE department = 'CSP' AND number = 100 |
What is the total number that 0 silver? | CREATE TABLE table_name_14 (total VARCHAR,silver INTEGER) | SELECT COUNT(total) FROM table_name_14 WHERE silver < 0 |
What is the fewest gold medals when the bronze medals is greater than 5? | CREATE TABLE table_name_49 (gold INTEGER,bronze INTEGER) | SELECT MIN(gold) FROM table_name_49 WHERE bronze > 5 |
What are the names of the upper-level BIOPHYS classes that can be taken in the Winter ? | 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 DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'BIOPHYS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Win... |
which spanish tribunal had 36 executions in persona and 47 executions in effigie during this time period ? | CREATE TABLE table_203_303 (id number,"tribunal" text,"number of autos da fe" number,"executions in persona" number,"executions in effigie" number,"penanced" number,"total" number) | SELECT "tribunal" FROM table_203_303 WHERE "executions in persona" = 36 AND "executions in effigie" = 47 |
How old was the conservative party member that left the house in 2001? | CREATE TABLE table_57251 ("Born" text,"Became oldest MP" text,"Left House" text,"Age on leaving" text,"Died" text,"Political Party" text) | SELECT "Age on leaving" FROM table_57251 WHERE "Political Party" = 'conservative' AND "Left House" = '2001' |
What event had a short course in 2010? | CREATE TABLE table_name_77 (event VARCHAR,long_course_short_course VARCHAR,year_set VARCHAR) | SELECT event FROM table_name_77 WHERE long_course_short_course = "short course" AND year_set = 2010 |
Who won the race with Tom Zirbel as Mountains Classification and Thomas Soladay as Points Classification? | CREATE TABLE table_25678 ("Stage" real,"Winner" text,"General classification" text,"Mountains classification" text,"Points classification" text,"Youth classification" text,"Team Classification" text) | SELECT "Winner" FROM table_25678 WHERE "Mountains classification" = 'Tom Zirbel' AND "Points classification" = 'Thomas Soladay' |
What was the score when the opposing team was from Belgium? | CREATE TABLE table_72979 ("Outcome" text,"Edition" real,"Round" text,"Opponent Team" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Score" FROM table_72979 WHERE "Opponent Team" = 'Belgium' |
What are the names of all movies directed by Steven Spielberg? | CREATE TABLE reviewer (rid number,name text)CREATE TABLE movie (mid number,title text,year number,director text)CREATE TABLE rating (rid number,mid number,stars number,ratingdate time) | SELECT title FROM movie WHERE director = 'Steven Spielberg' |
Can you tell me the total number of Zone than has the Station users 2007-08 larger than 243,800, and the Year opened of 1855? | CREATE TABLE table_41902 ("Station" text,"Year opened" text,"Metropolitan borough [c ]" text,"Zone" real,"Station users 2006\u201307" real,"Station users 2007\u201308" real) | SELECT COUNT("Zone") FROM table_41902 WHERE "Station users 2007\u201308" > '243,800' AND "Year opened" = '1855' |
Find the id and first name of the student that has the most number of assessment notes? | CREATE TABLE Assessment_Notes (student_id VARCHAR)CREATE TABLE Students (first_name VARCHAR,student_id VARCHAR) | SELECT T1.student_id, T2.first_name FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 |
show me a list of flights from BOSTON to WASHINGTON arriving before 900 on 7 22 | CREATE TABLE code_description (code varchar,description text)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE ground_service (city_code text,airpo... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((((flight.arrival_time < flight.departure_time) AND flight.arrival_time < 900) AND date_day.day_number = 21 AND date_day.month_number = 7 AND d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.