instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Show all locations and the total number of platforms for all train stations in each location in a pie chart. | CREATE TABLE train_station (Train_ID int,Station_ID int)CREATE TABLE station (Station_ID int,Name text,Annual_entry_exit real,Annual_interchanges real,Total_Passengers real,Location text,Main_Services text,Number_of_Platforms int)CREATE TABLE train (Train_ID int,Name text,Time text,Service text) | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location |
how much was enoxaparin sodium first prescribed to patient 27362 in 06/2104? | CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE d_icd_diagn... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27362) AND prescriptions.drug = 'enoxaparin sodium' AND STRFTIME('%y-%m', prescriptions.startdate) = '2104-06' ORDER BY prescriptions.startdate LIMIT 1 |
What was the game date when the opponent was Houston? | CREATE TABLE table_name_8 (date VARCHAR,opponent VARCHAR) | SELECT date FROM table_name_8 WHERE opponent = "houston" |
What Film Festival had participants/recipients of Isao Tomita? | CREATE TABLE table_26282750_1 (film_festival VARCHAR,participants_recipients VARCHAR) | SELECT film_festival FROM table_26282750_1 WHERE participants_recipients = "Isao Tomita" |
What was the surface that Laura Golarsa and her opponent played on in the final? | CREATE TABLE table_name_67 (surface VARCHAR,opponent_in_the_final VARCHAR) | SELECT surface FROM table_name_67 WHERE opponent_in_the_final = "laura golarsa" |
had patient 8888 excreted gastric gastric tube in 12/2105? | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE icustays (row_id number,subject_id number,hadm_id nu... | SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8888)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gastric gastric... |
How many weeks has the opponent been san francisco 49ers? | CREATE TABLE table_name_65 (week VARCHAR,opponent VARCHAR) | SELECT COUNT(week) FROM table_name_65 WHERE opponent = "san francisco 49ers" |
Who 's this Spring 's CZECH 142 teacher ? | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE ... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester... |
Languages having most negative rated questions. | CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number... | SELECT P.Tags, SUM(P.Score) AS "Suma" FROM Posts AS P GROUP BY P.Tags ORDER BY Suma |
count the number of patients whose ethnicity is american indian/alaska native and primary disease is femoral artery thrombosis. | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS" |
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, order 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 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 decima... | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) |
How many patients were admitted with transfer from hosp/extram and diagnosed with the primary disease hyperglcemia hyponatremia? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA" |
When was roshan mahanama born? | CREATE TABLE table_77940 ("Player" text,"Date of Birth" text,"Batting Style" text,"Bowling Style" text,"First Class Team" text) | SELECT "Date of Birth" FROM table_77940 WHERE "Player" = 'roshan mahanama' |
Avg Q & A' AVERAGE SCORES YEARLY comparison. | CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE Tags (Id number,TagName... | SELECT YEAR(CreationDate) AS "postyear", CAST(SUM(CASE WHEN PostTypeId = 1 THEN Score ELSE 0 END) AS FLOAT) / SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS "q", CAST(SUM(CASE WHEN PostTypeId = 2 THEN Score ELSE 0 END) AS FLOAT) / SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS "a", CAST(SUM(Score) AS FLOAT) / S... |
Name the position of glenn goldup | CREATE TABLE table_2088 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "Position" FROM table_2088 WHERE "Player" = 'Glenn Goldup' |
What is listed for the Hand that has a 1 credit of 1? | CREATE TABLE table_35140 ("Hand" text,"1 credit" text,"2 credits" text,"3 credits" text,"4 credits" text,"5 credits" text) | SELECT "Hand" FROM table_35140 WHERE "1 credit" = '1' |
Find the altitude (or elevation) of the airports in the city of New York with a bar chart, and I want to rank in descending by the bar. | CREATE TABLE airlines (alid integer,name text,iata varchar(2),icao varchar(3),callsign text,country text,active varchar(2))CREATE TABLE airports (apid integer,name text,city text,country text,x real,y real,elevation bigint,iata character varchar(3),icao character varchar(4))CREATE TABLE routes (rid integer,dst_apid int... | SELECT name, elevation FROM airports WHERE city = 'New York' ORDER BY name DESC |
how many patients whose admission location is transfer from hosp/extram and days of hospital stay is greater than 34? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.days_stay > "34" |
What is the points for a team with more than 9 wins and more than 40 goals? | CREATE TABLE table_52780 ("Place (Posici\u00f3n)" real,"Team (Equipo)" text,"Played (PJ)" real,"Won (PG)" real,"Draw (PE)" real,"Lost (PP)" real,"Goals Scored (GF)" real,"Goals Conceded (GC)" real,"+/- (Dif.)" real,"Points (Pts.)" real) | SELECT SUM("Points (Pts.)") FROM table_52780 WHERE "Won (PG)" > '9' AND "Goals Scored (GF)" > '40' |
What date is the visitor Ottawa? | CREATE TABLE table_37378 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Date" FROM table_37378 WHERE "Visitor" = 'ottawa' |
Who had the lowest field goals if they had 12 touchdowns and more than 72 points? | CREATE TABLE table_name_40 (field_goals INTEGER,touchdowns VARCHAR,points VARCHAR) | SELECT MIN(field_goals) FROM table_name_40 WHERE touchdowns = 12 AND points > 72 |
count the number of patients whose age is less than 81 and drug route is ivpca? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "81" AND prescriptions.route = "IVPCA" |
what is minimum age of patients whose marital status is divorced and admission type is elective? | 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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admission_type = "ELECTIVE" |
how many different meanings does Wednesday have? | CREATE TABLE table_2624098_1 (english_day_name_meaning VARCHAR,modern_english_day_name VARCHAR) | SELECT COUNT(english_day_name_meaning) FROM table_2624098_1 WHERE modern_english_day_name = "Wednesday" |
provide the number of patients whose drug code is rosi8? | 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 text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "ROSI8" |
For what competition was the game played on 28 March 2009? | CREATE TABLE table_name_28 (competition VARCHAR,date VARCHAR) | SELECT competition FROM table_name_28 WHERE date = "28 march 2009" |
What is the Region of Catalog 885 973-4? | CREATE TABLE table_34056 ("Date" text,"Label" text,"Region" text,"Format" text,"Catalog" text) | SELECT "Region" FROM table_34056 WHERE "Catalog" = '885 973-4' |
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by weekday, and rank in asc by the Y. | 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 countries (COUNTRY_ID varchar(2),COUN... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY COUNT(HIRE_DATE) |
how many patients were prescribed with 2 ml : ondansetron hcl 4 mg/2ml iv soln in the same hospital encounter until 4 years ago after the procedure of analgesics - oral analgesics? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime ti... | 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 = 'analgesics - oral analgesics' AND DATETIME(treatment.treatmenttime) <= DA... |
What date did the team play on week 8? | CREATE TABLE table_26723 ("Week" real,"Date" text,"Kickoff" text,"Opponent" text,"Final score" text,"Team record" text,"Game site" text,"Attendance" real) | SELECT "Date" FROM table_26723 WHERE "Week" = '8' |
What is the total number of ties a team with less than 3 losses have? | CREATE TABLE table_name_98 (ties VARCHAR,losses INTEGER) | SELECT COUNT(ties) FROM table_name_98 WHERE losses < 3 |
Report all advisors that advise more than 2 students. | CREATE TABLE STUDENT (Advisor VARCHAR) | SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2 |
What episode number has 2j5352 as a production code? | CREATE TABLE table_24625467_1 (no VARCHAR,production_code VARCHAR) | SELECT no FROM table_24625467_1 WHERE production_code = "2J5352" |
when is the first procedure patient 29971 received until 2103? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE T... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29971) AND STRFTIME('%y', procedures_icd.charttime) <= '2103' ORDER BY procedures_icd.charttime LIMIT 1 |
who is the only player who is not a fly half ? | CREATE TABLE table_203_871 (id number,"#" number,"player" text,"pos" text,"pts" number,"tries" number,"conv" number,"pens" number,"drop" number,"opposition" text,"venue" text,"date" text) | SELECT "player" FROM table_203_871 WHERE "pos" <> 'fly-half' |
what airline is US | CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE code_description (code varchar,description text)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,depa... | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'US' |
Who scored 74-70-67=211 and placed t5? | CREATE TABLE table_name_6 (player VARCHAR,place VARCHAR,score VARCHAR) | SELECT player FROM table_name_6 WHERE place = "t5" AND score = 74 - 70 - 67 = 211 |
how much is the daily minimum weight of patient 006-71495 until 02/2104? | 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 medication (medicationid number,patientunitstayid number,drugname text,dos... | SELECT MIN(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-71495') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) <= '2104-02' GROUP BY STRFTIME('%y-%m-%d', patien... |
What is the lowest Postion, when Bike No is greater than 10, when Driver / Passenger is Nicky Pulinx / Ondrej Cermak, and when Points is greater than 244? | CREATE TABLE table_48573 ("Position" real,"Driver / Passenger" text,"Equipment" text,"Bike No" real,"Points" real) | SELECT MIN("Position") FROM table_48573 WHERE "Bike No" > '10' AND "Driver / Passenger" = 'nicky pulinx / ondrej cermak' AND "Points" > '244' |
What is the PA when the PF is 73? | CREATE TABLE table_29565601_2 (pa INTEGER,pf VARCHAR) | SELECT MIN(pa) FROM table_29565601_2 WHERE pf = 73 |
how many patients with medicaid insurance underwent the lab test for prostate specific antigen? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Medicaid" AND lab.label = "Prostate Specific Antigen" |
when did patient 031-4987 first receive a nasopharynx microbiological test since 91 months ago? | 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 patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid... | 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-4987')) AND microlab.culturesite = 'nasopharynx' AND DATETIME... |
Is the only Gender and Social Science professor Prof. Joyce ? | CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREAT... | SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Gender and Social Science%' AND NOT instructor.name LIKE '%Joyce%' AND offering_instructor.instructor_id ... |
What season has a regionalliga s d league, a 1-0 home, and an away of 2-3? | CREATE TABLE table_78844 ("Season" text,"League" text,"Teams" text,"Home" text,"Away" text) | SELECT "Season" FROM table_78844 WHERE "League" = 'regionalliga süd' AND "Home" = '1-0' AND "Away" = '2-3' |
How many laps did Jo Bonnier driver when the grid number was smaller than 11? | CREATE TABLE table_51480 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT SUM("Laps") FROM table_51480 WHERE "Driver" = 'jo bonnier' AND "Grid" < '11' |
Show the id and details for the investors who have the top 3 number of transactions by a bar chart. | CREATE TABLE Transactions_Lots (transaction_id INTEGER,lot_id INTEGER)CREATE TABLE Ref_Transaction_Types (transaction_type_code VARCHAR(10),transaction_type_description VARCHAR(80))CREATE TABLE Investors (investor_id INTEGER,Investor_details VARCHAR(255))CREATE TABLE Lots (lot_id INTEGER,investor_id INTEGER,lot_details... | SELECT T1.Investor_details, T1.investor_id FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3 |
Which Segment C has a Segment B of fish food? | CREATE TABLE table_name_54 (segment_c VARCHAR,segment_b VARCHAR) | SELECT segment_c FROM table_name_54 WHERE segment_b = "fish food" |
count the number of patients whose insurance is private and procedure short title is hemodialysis? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Hemodialysis" |
What country speaks Vietnamese? | CREATE TABLE table_54970 ("Country/Region" text,"Languages" text,"Premiere" text,"Seasons" text,"Status" text) | SELECT "Country/Region" FROM table_54970 WHERE "Languages" = 'vietnamese' |
What is the score if the Tie no is 32? | CREATE TABLE table_59162 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Score" FROM table_59162 WHERE "Tie no" = '32' |
Name the general classification of stage 15 | CREATE TABLE table_17566 ("Stage" text,"Winner" text,"General classification" text,"Points classification" text,"Mountains classification" text,"Young rider classification" text,"Trofeo Fast Team" text) | SELECT COUNT("General classification") FROM table_17566 WHERE "Stage" = '15' |
RCIDIV 302 has been in the course listings for how long ? | 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 course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'RCIDIV' AND course.number = 302 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1 |
Stacked bar chart of how many nationality for with each Type in each nationality | CREATE TABLE mission (Mission_ID int,Ship_ID int,Code text,Launched_Year int,Location text,Speed_knots int,Fate text)CREATE TABLE ship (Ship_ID int,Name text,Type text,Nationality text,Tonnage int) | SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Type, Nationality |
What year were the first/second year reps Katie Pautler and Devery North? | CREATE TABLE table_24985 ("Year" text,"Chairman" text,"Artistic Director" text,"Performance Liaison" text,"Secretary" text,"Business manager" text,"Production Stagemanager" text,"Dramaturge" text,"Public Relations" text,"First/Second Year Rep." text,"Male Rep." text) | SELECT "Year" FROM table_24985 WHERE "First/Second Year Rep." = 'Katie Pautler and Devery North' |
What percentage of users were using Firefox during the period in which *0.77% were using Netscape? | CREATE TABLE table_name_8 (firefox VARCHAR,netscape VARCHAR) | SELECT firefox FROM table_name_8 WHERE netscape = "*0.77%" |
count the number of patients who have had a social work consult procedure within 2 months after having been diagnosed until 1 year ago with depression. | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,all... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'depression' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t1 JOIN (SELECT... |
Which sign had a yellow background and a triangular shape? | CREATE TABLE table_57201 ("Type of sign" text,"Shape" text,"Border" text,"Background colour" text,"Text/Symbol" text) | SELECT "Border" FROM table_57201 WHERE "Background colour" = 'yellow' AND "Shape" = 'triangular' |
How many platinum points were awarded for 5th place? | CREATE TABLE table_11254821_2 (points_awarded__platinum_ INTEGER,finishing_position VARCHAR) | SELECT MAX(points_awarded__platinum_) FROM table_11254821_2 WHERE finishing_position = "5th" |
how many patients whose gender is m and drug code is clin1000i? | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.formulary_drug_cd = "CLIN1000I" |
What is the nominal GDP per capita when the population is 63.056 million? | CREATE TABLE table_20566 ("Year" real,"GDP Nominal ($ billions)" text,"GDP Adjusted ($ billions)" text,"Population (millions)" text,"GDP per capita Nominal ($)" real,"GDP per capita Adjusted ($)" real) | SELECT MIN("GDP per capita Nominal ($)") FROM table_20566 WHERE "Population (millions)" = '63.056' |
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the average of code , and group by attribute name, display from low to high by the x-axis. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name |
What is the average weight of the player with a height of 180 cm and plays the d position? | CREATE TABLE table_41587 ("Position" text,"Jersey number" real,"Name v t e" text,"Height (cm)" real,"Weight (kg)" real,"Birthplace" text,"2008-09 team" text,"NHL rights,if any" text) | SELECT AVG("Weight (kg)") FROM table_41587 WHERE "Height (cm)" = '180' AND "Position" = 'd' |
what was patient 004-64091's last output since 12/29/2105? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,c... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091')) AND intakeoutput.cellpath LIKE '%output%' AND S... |
what is the combined wins of the clubs in the top 3 positions ? | 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 SUM("wins") FROM table_204_256 WHERE "position" <= 3 |
How many years of nasl years did the accolades read 'captained england to victory at the 1966 world cup'? | CREATE TABLE table_2931 ("Player" text,"Position" text,"NASL years" text,"NASL club(s)" text,"Accolades (Pre-NASL)" text) | SELECT COUNT("NASL years") FROM table_2931 WHERE "Accolades (Pre-NASL)" = 'Captained England to victory at the 1966 World Cup' |
Ever Protected Questions, simple search. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ... | SELECT ph.PostId AS "post_link", ph.CreationDate AS "protected_date", CASE ph.UserId WHEN NULL THEN ph.UserDisplayName ELSE ph.UserId END AS "user_link" FROM PostHistory AS ph WHERE ph.PostHistoryTypeId = 19 ORDER BY ph.PostId, ph.CreationDate |
What chassis did Gordon Johncock use with his cosworth engine? | CREATE TABLE table_4606 ("Team" text,"Chassis" text,"Engine" text,"Tires" text,"Drivers" text) | SELECT "Chassis" FROM table_4606 WHERE "Engine" = 'cosworth' AND "Drivers" = 'gordon johncock' |
In 2004 Spring , EEB 801 will have how many professors teaching it ? | 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 jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE student (student_id int,lastname va... | SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EEB' AND course.number = 801 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offeri... |
which patients have metl25 drug code? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "METL25" |
tell me the maximum sao2 in patient 4368 on 05/24/this year? | 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 prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text... | SELECT MAX(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 = 4368)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2'... |
Show the number of documents created in each day and bin document date by year interval with a line chart, display in desc by the Document_Date please. | CREATE TABLE Documents_with_Expenses (Document_ID INTEGER,Budget_Type_Code CHAR(15),Document_Details VARCHAR(255))CREATE TABLE Accounts (Account_ID INTEGER,Statement_ID INTEGER,Account_Details VARCHAR(255))CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR(15),Budget_Type_Description VARCHAR(255))CREATE TABLE Ref_Doc... | SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code ORDER BY Document_Date DESC |
Let me know the number of patients with diagnoses icd9 code 49320 who had a urine test. | 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 text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "49320" AND lab.fluid = "Urine" |
How many Gold medals did Great Britain with a Total of more than 2 medals receive? | CREATE TABLE table_43387 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MIN("Gold") FROM table_43387 WHERE "Nation" = 'great britain' AND "Total" > '2' |
Name the pinyin for 657 date | CREATE TABLE table_20574 ("Date (CE)" text,"Text" text,"Simplified characters" text,"Traditional characters" text,"Pinyin" text,"Wade-Giles" text,"Literal meaning" text) | SELECT "Pinyin" FROM table_20574 WHERE "Date (CE)" = '657' |
How many wins has a podiums greater than 1 and 9 as the races with a season after 1984? | CREATE TABLE table_70169 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Podiums" real) | SELECT COUNT("Wins") FROM table_70169 WHERE "Podiums" > '1' AND "Races" = '9' AND "Season" > '1984' |
Show the amount for all the payments processed with Visa distributing the payment date with a bar chart, display in descending by the Date_Payment_Made please. | CREATE TABLE Settlements (Settlement_ID INTEGER,Claim_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settled DATE,Amount_Claimed INTEGER,Amount_Settled INTEGER,Customer_Policy_ID INTEGER)CREATE TABLE Customers (Customer_ID INTEGER,Customer_Details VARCHAR(255))CREATE TABLE Claims (Claim_ID INTEGER,Policy_ID INTEGER,Date_Cl... | SELECT Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY Date_Payment_Made DESC |
What was the finish for the golfer with a total of 285? | CREATE TABLE table_50675 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text) | SELECT "Finish" FROM table_50675 WHERE "Total" = '285' |
For the Tie number of 14 who was the away team? | CREATE TABLE table_name_46 (away_team VARCHAR,tie_no VARCHAR) | SELECT away_team FROM table_name_46 WHERE tie_no = "14" |
What 2009 has statistics by surface in 2012? | CREATE TABLE table_9537 ("Tournament" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text) | SELECT "2009" FROM table_9537 WHERE "2012" = 'statistics by surface' |
For those employees who did not have any job in the past, give me the comparison about the average of department_id over the job_id , and group by attribute job_id. | 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 regions (REGION_ID decimal(5,0),REGIO... | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID |
What is the sexual abuse rate where the conflict is the Burundi Civil War? | CREATE TABLE table_72689 ("Conflict" text,"United Nations Mission" text,"Sexual abuse 1" real,"Murder 2" real,"Extortion/Theft 3" text) | SELECT MAX("Sexual abuse 1") FROM table_72689 WHERE "Conflict" = 'Burundi Civil War' |
What is the highest number of viewers for a rating greater than 9.4? | CREATE TABLE table_51415 ("Air Date" text,"Timeslot (EST)" text,"Season" text,"Rating" real,"Share" real,"18-49 (Rating/Share)" text,"Viewers (m)" real,"Weekly Rank (#)" text) | SELECT MAX("Viewers (m)") FROM table_51415 WHERE "Rating" > '9.4' |
What was the score when the home team was Stockport County? | CREATE TABLE table_47602 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Score" FROM table_47602 WHERE "Home team" = 'stockport county' |
What is the average round of the match in the Hero's 9 event with a time of 5:00? | CREATE TABLE table_15518 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT AVG("Round") FROM table_15518 WHERE "Time" = '5:00' AND "Event" = 'hero''s 9' |
Who won that game on 24 July 2010? | CREATE TABLE table_51453 ("Opponent" text,"Result" text,"Score" text,"Date" text,"Venue" text) | SELECT "Result" FROM table_51453 WHERE "Date" = '24 july 2010' |
What is the total number of ends when the transfer fee was dkk 14m? | CREATE TABLE table_name_80 (ends VARCHAR,transfer_fee VARCHAR) | SELECT COUNT(ends) FROM table_name_80 WHERE transfer_fee = "dkk 14m" |
Which Event has the Opponent, Jason Yee? | CREATE TABLE table_10881 ("Result" text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Location" text) | SELECT "Event" FROM table_10881 WHERE "Opponent" = 'jason yee' |
What did South Melbourne score when they were the Away team? | CREATE TABLE table_name_21 (away_team VARCHAR) | SELECT away_team AS score FROM table_name_21 WHERE away_team = "south melbourne" |
What is the 2007 value with NMS in 2011? | CREATE TABLE table_11462 ("Tournament" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text) | SELECT "2007" FROM table_11462 WHERE "2011" = 'nms' |
How many kinds of roles are there for the staff? | CREATE TABLE projects (project_id number,organisation_id number,project_details text)CREATE TABLE staff_roles (role_code text,role_description text)CREATE TABLE organisations (organisation_id number,organisation_type text,organisation_details text)CREATE TABLE organisation_types (organisation_type text,organisation_typ... | SELECT COUNT(DISTINCT role_code) FROM project_staff |
when was the first time that patient 007-849 on the last intensive care unit visit had systemicmean less than 215.0? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT 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 = '007-849') AND NOT patient.unitdischargetime IS NULL... |
show me the flights from SAN FRANCISCO to DALLAS | CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)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)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,... | 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... |
how many novelists are listed ? | CREATE TABLE table_203_449 (id number,"name" text,"lifetime" text,"nationality" text,"notable as" text,"notes" text) | SELECT COUNT(*) FROM table_203_449 WHERE "notable as" = 'novelist' |
What is every score at the location of Verizon Center and points of 68? | CREATE TABLE table_23486853_8 (score VARCHAR,location VARCHAR,points VARCHAR) | SELECT score FROM table_23486853_8 WHERE location = "Verizon Center" AND points = 68 |
What is the average wickets that have overs greater than 44, danish kaneria as the player, with an average greater than 13.8? | CREATE TABLE table_59626 ("Player" text,"Team" text,"Matches" real,"Overs" real,"Runs" real,"Wickets" real,"Best" text,"Econ" real,"S/Rate" real,"4/inns" real,"5+/inns" real,"Average" real) | SELECT AVG("Wickets") FROM table_59626 WHERE "Overs" > '44' AND "Player" = 'danish kaneria' AND "Average" > '13.8' |
how many patients are admitted before the year 2170 and used the drug clobetasol propionate 0.05% oinment? | 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 demographic.admityear < "2170" AND prescriptions.drug = "Clobetasol Propionate 0.05% Ointment" |
What is High Points, when Game is less than 10, and when High Assists is 'Chauncey Billups (8)'? | CREATE TABLE table_76273 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High points" FROM table_76273 WHERE "Game" < '10' AND "High assists" = 'chauncey billups (8)' |
What was Carlton's score when they were the away team? | CREATE TABLE table_33047 ("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_33047 WHERE "Away team" = 'carlton' |
How many centerfold models were there when the cover model was Torrie Wilson? | CREATE TABLE table_1566852_4 (centerfold_model VARCHAR,cover_model VARCHAR) | SELECT COUNT(centerfold_model) FROM table_1566852_4 WHERE cover_model = "Torrie Wilson" |
Who took the loss on May 25? | CREATE TABLE table_71210 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Loss" FROM table_71210 WHERE "Date" = 'may 25' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.