table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int... | Create a pie chart showing how many country across country. | SELECT Country, COUNT(Country) FROM artist GROUP BY Country |
CREATE TABLE table_78850 (
"Main contestant" text,
"Co-contestant (Yaar vs. Pyaar)" text,
"Date performed" text,
"Scores by each individual judge" text,
"Total score/week" text,
"Position" text,
"Status" text
) | Who is the main contestant with scores by each individual judge of 8 + 7 + 7 = 21? | SELECT "Main contestant" FROM table_78850 WHERE "Scores by each individual judge" = '8 + 7 + 7 = 21' |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | show me the number of white ethnic background patients who have the diagnoses of portal hypertension. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.short_title = "Portal hypertension" |
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Draft_Class text,
College text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
... | Group and count the years played to draw a bar chart, list y axis in descending order. | SELECT Years_Played, COUNT(Years_Played) FROM player GROUP BY Years_Played ORDER BY COUNT(Years_Played) DESC |
CREATE TABLE table_54229 (
"Year" real,
"Date" text,
"Winner" text,
"Result" text,
"Loser" text,
"Location" text
) | Who was the loser at Municipal Stadium after 1970? | SELECT "Loser" FROM table_54229 WHERE "Location" = 'municipal stadium' AND "Year" > '1970' |
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
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and manufacturer , and group by attribute headquarter, show y-axis from high to low order. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Manufacturer DESC |
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 demographic (
subject_id text,
hadm_id t... | get me the number of patients with procedure icd9 code 8854 who were admitted before the year 2170. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2170" AND procedures.icd9_code = "8854" |
CREATE TABLE table_name_50 (
attendance VARCHAR,
visitor VARCHAR
) | Name the total number in attendance for when the bulls visited | SELECT COUNT(attendance) FROM table_name_50 WHERE visitor = "bulls" |
CREATE TABLE table_61692 (
"Date From" text,
"Date To" text,
"Position" text,
"Name" text,
"From" text
) | What is the date for Watford and player Lionel Ainsworth? | SELECT "Date To" FROM table_61692 WHERE "From" = 'watford' AND "Name" = 'lionel ainsworth' |
CREATE TABLE table_dev_60 (
"id" int,
"systolic_blood_pressure_sbp" int,
"body_weight" float,
"renal_disease" bool,
"allergy_to_aspirin" bool,
"creatinine_clearance_cl" float,
"allergy_to_clopidogrel" bool,
"allergy_to_heparin" bool,
"platelet_count" float,
"thrombocytopenia" flo... | known allergy or contraindication to fibrinolytics or aspirin or heparin or clopidogrel | SELECT * FROM table_dev_60 WHERE allergy_to_fibrinolytics = 1 OR allergy_to_aspirin = 1 OR allergy_to_heparin = 1 OR allergy_to_clopidogrel = 1 |
CREATE TABLE table_44387 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Attendance" real,
"Record" text,
"Points" real
) | Which Record has a Visitor of pittsburgh, and a Score of 4 0? | SELECT "Record" FROM table_44387 WHERE "Visitor" = 'pittsburgh' AND "Score" = '4–0' |
CREATE TABLE table_29067 (
"Date" text,
"Time" text,
"Visiting team" text,
"Home team" text,
"Site" text,
"Broadcast" text,
"Result" text,
"Attendance" real
) | What is the home team where the San Jose state is the visiting team? | SELECT "Home team" FROM table_29067 WHERE "Visiting team" = 'San Jose State' |
CREATE TABLE table_name_24 (
round VARCHAR,
margin VARCHAR
) | which round has a margin of 178? | SELECT round FROM table_name_24 WHERE margin = "178" |
CREATE TABLE table_65195 (
"Rank" text,
"Country" text,
"Jerseys" real,
"Giro wins" real,
"Points" real,
"Young rider" real,
"Most recent cyclist" text,
"Most recent date" text,
"Different holders" real
) | what is the giro wins when jerseys is 2, country is portugal and young rider is more than 0? | SELECT SUM("Giro wins") FROM table_65195 WHERE "Jerseys" = '2' AND "Country" = 'portugal' AND "Young rider" > '0' |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those products with a price between 60 and 120, return a scatter chart about the correlation between price and manufacturer . | SELECT Price, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 |
CREATE TABLE table_name_78 (
lner_class VARCHAR
) | What is the 1914 NER class with a d17/2 LNER class? | SELECT 1914 AS _ner_class FROM table_name_78 WHERE lner_class = "d17/2" |
CREATE TABLE table_10815 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | In the venue Corio Oval, who was the away team? | SELECT "Away team" FROM table_10815 WHERE "Venue" = 'corio oval' |
CREATE TABLE table_37583 (
"Pick" real,
"Player" text,
"Team" text,
"Position" text,
"School" text
) | What is the average Pick for the Pasco, Wa school? | SELECT AVG("Pick") FROM table_37583 WHERE "School" = 'pasco, wa' |
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
) | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of headquarter and the average of price , and group by attribute headquarter, list by the y-axis from high to low please. | SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Price) DESC |
CREATE TABLE table_3826 (
"Season" text,
"Competition" text,
"Stage" text,
"Result" text,
"Opponent" text,
"Scorers" text
) | What is the result of the game where the opponent is Innsbrucker Kilmarnock CSK VVS Samara? | SELECT "Result" FROM table_3826 WHERE "Opponent" = 'Innsbrucker Kilmarnock CSK VVS Samara' |
CREATE TABLE table_15731 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | On what date did they have a record of 12-17? | SELECT "Date" FROM table_15731 WHERE "Record" = '12-17' |
CREATE TABLE table_name_2 (
laps VARCHAR,
time VARCHAR
) | What was the total number of Laps for the rider whose time was +7.951? | SELECT COUNT(laps) FROM table_name_2 WHERE time = "+7.951" |
CREATE TABLE table_41565 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Assists" real
) | Which player has the fewest assists and played 2 games or fewer? | SELECT MIN("Assists") FROM table_41565 WHERE "Games" < '2' |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | what exactly does the periph t cell lym abdom stand for? | SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'periph t cell lym abdom' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'periph t cell lym abdom' |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Top 100 StackOverflow users from Nigeria. | SELECT Id, DisplayName AS "display_name", Reputation, WebsiteUrl AS Website, Location FROM Users WHERE Location LIKE '%Nigeria%' ORDER BY Reputation DESC LIMIT 100 |
CREATE TABLE table_5833 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What was the score of the game that led to a 7-5 record? | SELECT "Score" FROM table_5833 WHERE "Record" = '7-5' |
CREATE TABLE table_name_53 (
chassis VARCHAR,
year VARCHAR,
pts VARCHAR
) | Which chassis is more recent than 1972 and has more than 0 Pts. ? | SELECT chassis FROM table_name_53 WHERE year > 1972 AND pts > 0 |
CREATE TABLE table_name_85 (
venue VARCHAR,
score VARCHAR,
h_a_n VARCHAR,
pos VARCHAR
) | Which venue has a neutral H/A/N, lower than position 3 and a score of 141? | SELECT venue FROM table_name_85 WHERE h_a_n = "neutral" AND pos < 3 AND score = "141" |
CREATE TABLE table_46082 (
"Name" text,
"Born-Died" text,
"Term start" text,
"Term end" text,
"Political Party" text
) | What is Born-Died, when Term End is 19 January 1943? | SELECT "Born-Died" FROM table_46082 WHERE "Term end" = '19 january 1943' |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
... | ANAT 403 is taught when in the week ? | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i... |
CREATE TABLE table_5577 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | What is the total Points for the Opponent of @ New Jersey Devils and a Game bigger than 7? | SELECT SUM("Points") FROM table_5577 WHERE "Opponent" = '@ new jersey devils' AND "Game" > '7' |
CREATE TABLE table_19753079_36 (
result VARCHAR,
district VARCHAR
) | Name the result for north carolina 7 | SELECT result FROM table_19753079_36 WHERE district = "North Carolina 7" |
CREATE TABLE table_41684 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries For" text,
"Tries Against" text,
"Try Bonus" text,
"Losing Bonus" text,
"Points" text
) | What is the number of tries for when the try bonus is 0? | SELECT "Tries For" FROM table_41684 WHERE "Try Bonus" = '0' |
CREATE TABLE list (
classroom VARCHAR,
grade VARCHAR
) | Which classrooms are used by grade 4? | SELECT DISTINCT classroom FROM list WHERE grade = 4 |
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
)
... | what is the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft /sda and year of death is less than or equal to 2115? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.dod_year <= "2115.0" |
CREATE TABLE table_76011 (
"Publication" text,
"Country" text,
"Accolade" text,
"Year" real,
"Rank" text
) | Which year's rank was #4 when the country was the US? | SELECT "Year" FROM table_76011 WHERE "Rank" = '#4' AND "Country" = 'us' |
CREATE TABLE table_43604 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
) | what is the score on 22 february 1993? | SELECT "Score" FROM table_43604 WHERE "Date" = '22 february 1993' |
CREATE TABLE table_70393 (
"Overall place" text,
"Yacht name" text,
"Skipper" text,
"Points" text,
"Combined elapsed time" text
) | Which Overall place has a Yacht name of lg flatron? | SELECT "Overall place" FROM table_70393 WHERE "Yacht name" = 'lg flatron' |
CREATE TABLE table_name_16 (
total INTEGER,
to_par VARCHAR
) | What is the maximum total when the To par is +3? | SELECT MAX(total) FROM table_name_16 WHERE to_par = "+3" |
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
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and price , and group by attribute name, display by the bar in desc. | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC |
CREATE TABLE table_33255 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What team plays at home at Windy Hill? | SELECT "Home team" FROM table_33255 WHERE "Venue" = 'windy hill' |
CREATE TABLE table_1130632_1 (
title VARCHAR,
us_viewers__million_ VARCHAR
) | What are the title that have 19.48 million u.s. viewers? | SELECT title FROM table_1130632_1 WHERE us_viewers__million_ = "19.48" |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | in the last month, was patient 8016's arterial bp [diastolic] greater than 68.0? | SELECT COUNT(*) > 0 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 = 8016)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [diast... |
CREATE TABLE table_75922 (
"Season" text,
"Competition" text,
"Round" text,
"Opponent" text,
"Home" text,
"Away" text
) | What is the home score with marek dupnitsa as opponent? | SELECT "Home" FROM table_75922 WHERE "Opponent" = 'marek dupnitsa' |
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
)
... | count the number of medicaid patients who have unspecified congestive heart failure diagnoses. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicaid" AND diagnoses.long_title = "Congestive heart failure, unspecified" |
CREATE TABLE table_12476 (
"State" text,
"Type" text,
"Name" text,
"Title" text,
"Royal house" text,
"From" text
) | Which state has a royal house of Jiang? | SELECT "State" FROM table_12476 WHERE "Royal house" = 'jiang' |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname va... | Fetch me some papers on Artificial Neural Network | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Artificial Neural Network' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | how many hours have passed since the first time that patient 96833 was prescribed acetazolamide sodium during their current hospital visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96833 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'acetazolamide sodium' ORDER BY prescriptions... |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE comment_instructor (
instructor_id int... | Are there any useful courses to take before taking INSTHUM 212 ? | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'INSTHUM' AND number = 212 |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
... | For those employees who did not have any job in the past, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday, list total number of employee id from high to low order. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(EMPLOYEE_ID) DESC |
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
)
... | provide the number of patients whose death status is 1 and diagnoses icd9 code is 25040? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.icd9_code = "25040" |
CREATE TABLE table_204_813 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | where was the location of the last venue held ? | SELECT "venue" FROM table_204_813 ORDER BY "year" DESC LIMIT 1 |
CREATE TABLE table_6924 (
"Office" text,
"Democratic ticket" text,
"Republican ticket" text,
"Conservative ticket" text,
"Liberal ticket" text,
"Free Libertarian ticket" text,
"Socialist Labor ticket" text
) | Robert S. Flanzer was the Free Libertarian ticket with who listed as the Liberal Ticket? | SELECT "Liberal ticket" FROM table_6924 WHERE "Free Libertarian ticket" = 'robert s. flanzer' |
CREATE TABLE table_67019 (
"Rank" text,
"Games" text,
"Player" text,
"Club" text,
"Career span" text
) | What is the rank that shows 426 games? | SELECT "Rank" FROM table_67019 WHERE "Games" = '426' |
CREATE TABLE table_27776266_1 (
directed_by VARCHAR,
us_viewers__million_ VARCHAR
) | Who directed the episode with an audience of 14.11 million? | SELECT directed_by FROM table_27776266_1 WHERE us_viewers__million_ = "14.11" |
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_Per... | Visualize a bar chart about the distribution of ACC_Road and School_ID , and group by attribute ACC_Home, order by the bars in desc. | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC |
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperfield (
fieldid int,
... | What paper did Michael Armstrong wrote in the 90s ? | SELECT DISTINCT paper.year, writes.paperid FROM author, paper, writes WHERE author.authorname LIKE 'Michael Armstrong' AND paper.year LIKE '199' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid |
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Ra... | Show all the activity names and the number of faculty involved in each activity Show bar chart, and list by the Y in descending. | SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY COUNT(*) DESC |
CREATE TABLE table_name_54 (
Id VARCHAR
) | What is 2007, when 2003 is 1R? | SELECT 2007 FROM table_name_54 WHERE 2003 = "1r" |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | count the number of patients whose admission year is less than 2124 and procedure long title is percutaneous [endoscopic] gastrostomy [peg]? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2124" AND procedures.long_title = "Percutaneous [endoscopic] gastrostomy [PEG]" |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total... | In Spring-Summer 2000 , what courses does Prof. Lauren Sarringhaus teach ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Lauren Sarringhaus%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructo... |
CREATE TABLE table_486 (
"Season #" real,
"Series #" real,
"Title" text,
"Canadian airdate" text,
"U.S. airdate" text,
"Production code" real
) | what is the minimum production code | SELECT MIN("Production code") FROM table_486 |
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,... | provide the number of patients whose procedure icd9 code is 309. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "309" |
CREATE TABLE match (
Round real,
Location text,
Country text,
Date text,
Fastest_Qualifying text,
Winning_Pilot text,
Winning_Aircraft text
)
CREATE TABLE airport (
Airport_ID int,
Airport_Name text,
Total_Passengers real,
%_Change_2007 text,
International_Passengers rea... | List the names of aircrafts and the number of times it won matches Plot them as bar chart, could you list from low to high by the y-axis please? | SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) |
CREATE TABLE table_34390 (
"Game" real,
"April" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | What is the lowest value in April with New York Rangers as opponent for a game less than 82? | SELECT MIN("April") FROM table_34390 WHERE "Opponent" = 'new york rangers' AND "Game" < '82' |
CREATE TABLE table_name_14 (
rank VARCHAR,
total VARCHAR,
gold VARCHAR,
nation VARCHAR
) | How many ranks have 0 golds, a Nation of namibia, and a Total smaller than 1? | SELECT COUNT(rank) FROM table_name_14 WHERE gold = 0 AND nation = "namibia" AND total < 1 |
CREATE TABLE table_27502 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What episode number in the series is 'tough love'? | SELECT MAX("No. in series") FROM table_27502 WHERE "Title" = 'Tough Love' |
CREATE TABLE table_24639086_3 (
viewers__in_millions_ VARCHAR,
series__number VARCHAR
) | What is the amount of viewers if the series number is 14? | SELECT viewers__in_millions_ FROM table_24639086_3 WHERE series__number = 14 |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID 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
)
... | Return a bar chart about the distribution of meter_700 and ID . | SELECT meter_700, ID FROM swimmer |
CREATE TABLE table_59552 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the highest Laps, when Bike is 'Yamaha YZF-R1', when Rider is 'David Checa', and when Grid is greater than 18? | SELECT MAX("Laps") FROM table_59552 WHERE "Bike" = 'yamaha yzf-r1' AND "Rider" = 'david checa' AND "Grid" > '18' |
CREATE TABLE table_24600706_1 (
released INTEGER,
song VARCHAR
) | Name the most released for apologize | SELECT MAX(released) FROM table_24600706_1 WHERE song = "Apologize" |
CREATE TABLE table_45247 (
"Name" text,
"Pinnacle height" text,
"Structure type" text,
"Main use" text,
"Country" text,
"Town" text
) | What country has the SBA Towers Tower Hayneville? | SELECT "Country" FROM table_45247 WHERE "Name" = 'sba towers tower hayneville' |
CREATE TABLE table_name_44 (
score VARCHAR,
away_team VARCHAR
) | Which Score has a Away team of walthamstow avenue? | SELECT score FROM table_name_44 WHERE away_team = "walthamstow avenue" |
CREATE TABLE table_78294 (
"Pick" real,
"Round" text,
"Player" text,
"Position" text,
"School" text
) | Which Round is pick 112 in? | SELECT "Round" FROM table_78294 WHERE "Pick" = '112' |
CREATE TABLE table_1604579_2 (
country VARCHAR
) | How economically free is the country of Armenia? | SELECT 2013 AS _index_of_economic_freedom FROM table_1604579_2 WHERE country = "Armenia" |
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 TA... | what the last height of patient 002-21509. | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-21509') AND NOT patient.admissionheight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 |
CREATE TABLE table_35963 (
"Team" text,
"Copa Libertadores 1993" text,
"Supercopa Sudamericana 1993" text,
"Copa CONMEBOL 1993" text,
"Recopa Sudamericana 1993" text,
"Intercontinental Cup 1993" text
) | What is the Intercontinental Cup 1993 result for a Supercopa Sudamericana 1993 result of round of 16? | SELECT "Intercontinental Cup 1993" FROM table_35963 WHERE "Supercopa Sudamericana 1993" = 'round of 16' |
CREATE TABLE table_21192 (
"Months in Malayalam Era" text,
"In Malayalam" text,
"Gregorian Calendar" text,
"Tamil calendar" text,
"Saka era" text,
"Sign of Zodiac" text
) | Name the saka era for sign of zodiac being pisces | SELECT "Saka era" FROM table_21192 WHERE "Sign of Zodiac" = 'Pisces' |
CREATE TABLE table_19683 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | How many games were played? | SELECT MIN("Played") FROM table_19683 |
CREATE TABLE table_1108394_6 (
staten_island VARCHAR,
brooklyn VARCHAR
) | What was Staten Island when Brooklyn was 940? | SELECT staten_island FROM table_1108394_6 WHERE brooklyn = "940" |
CREATE TABLE table_name_93 (
built VARCHAR,
builder VARCHAR
) | What year was Stephenson the builder? | SELECT built FROM table_name_93 WHERE builder = "stephenson" |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
U... | Sh*tty Minecraft questions that have been left undeleted. | SELECT COUNT(*) FROM Posts WHERE DeletionDate IS NULL AND Score <= -1 AND (Tags LIKE '%minecraft-%%' OR Tags LIKE '%minecraft%') AND (ClosedDate IS NULL OR NOT ClosedDate IS NULL) |
CREATE TABLE table_18406 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what's party with district being tennessee 3 | SELECT "Party" FROM table_18406 WHERE "District" = 'Tennessee 3' |
CREATE TABLE table_name_27 (
country VARCHAR,
rank VARCHAR,
time VARCHAR
) | What country has a time of 7:28.66 and a rank less than 3? | SELECT country FROM table_name_27 WHERE rank < 3 AND time = "7:28.66" |
CREATE TABLE table_22825679_1 (
percentage VARCHAR,
team VARCHAR
) | Name the percentage for ole miss | SELECT percentage FROM table_22825679_1 WHERE team = "Ole Miss" |
CREATE TABLE table_7287 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | At what Location was the match against Opponent of Mostapha Al-Turk lasting less than 2 Rounds? | SELECT "Location" FROM table_7287 WHERE "Round" < '2' AND "Opponent" = 'mostapha al-turk' |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | Post count distribution by users this year. | WITH user_contributions AS (SELECT COUNT(DISTINCT p.Id) AS Posts, OwnerUserId FROM Posts AS p WHERE CreationDate >= '2019-01-01' GROUP BY OwnerUserId HAVING COUNT(DISTINCT p.Id) > 200) SELECT COUNT(*) AS Users, Posts FROM user_contributions GROUP BY Posts ORDER BY Posts |
CREATE TABLE screen_mode (
graphics_mode number,
char_cells text,
pixels text,
hardware_colours number,
used_kb number,
map text,
type text
)
CREATE TABLE chip_model (
model_name text,
launch_year number,
ram_mib number,
rom_mib number,
slots text,
wifi text,
blu... | Find the number of phones for each accreditation type. | SELECT accreditation_type, COUNT(*) FROM phone GROUP BY accreditation_type |
CREATE TABLE table_name_60 (
team_1 VARCHAR,
team_2 VARCHAR
) | What was the team 1 when Red Star (D1) was team 2? | SELECT team_1 FROM table_name_60 WHERE team_2 = "red star (d1)" |
CREATE TABLE table_80280 (
"Year" real,
"Competition" text,
"Wins" real,
"Draws" real,
"Loses" real
) | What average Loses has Draws less than 0? | SELECT AVG("Loses") FROM table_80280 WHERE "Draws" < '0' |
CREATE TABLE table_27707 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | When did they play Dayton? | SELECT "Date" FROM table_27707 WHERE "Team" = 'Dayton' |
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,
airline_fli... | what is ORD | SELECT DISTINCT airport_code FROM airport WHERE airport_code = 'ORD' |
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 diagnosis (
diagn... | during this year what was the four most commonly ordered procedure for patients with 60 or above? | 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 >= 60) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'st... |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what were the three most common specimen tests carried out? | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 3 |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_lo... | show me all flights from BALTIMORE to SAN FRANCISCO | 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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN ... |
CREATE TABLE Student (
StuID VARCHAR,
Sex VARCHAR
) | Show student ids for all male students. | SELECT StuID FROM Student WHERE Sex = 'M' |
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,
... | give me the number of patients whose procedure icd9 code is 12? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "12" |
CREATE TABLE Movie (
name VARCHAR,
title VARCHAR
)
CREATE TABLE Reviewer (
name VARCHAR,
title VARCHAR
) | Return all reviewer names and movie names together in a single list. | SELECT name FROM Reviewer UNION SELECT title FROM Movie |
CREATE TABLE membership_register_branch (
Member_ID int,
Branch_ID text,
Register_Year text
)
CREATE TABLE purchase (
Member_ID int,
Branch_ID text,
Year text,
Total_pounds real
)
CREATE TABLE branch (
Branch_ID int,
Name text,
Open_year text,
Address_road text,
City te... | Count the hometown by hometown, and sort from high to low by the y-axis. | SELECT Hometown, COUNT(Hometown) FROM member GROUP BY Hometown ORDER BY COUNT(Hometown) DESC |
CREATE TABLE table_name_99 (
week INTEGER,
result VARCHAR,
attendance VARCHAR
) | Tell me the week for result of l 31-27, and an Attendance smaller than 85,865 | SELECT AVG(week) FROM table_name_99 WHERE result = "l 31-27" AND attendance < 85 OFFSET 865 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.