answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT MIN(points) FROM table_23308178_5
What's the minimal number of points scored in any game?
CREATE TABLE table_23308178_5 (points INTEGER)
SELECT america FROM table_22860_1 WHERE atlantic_europe = "Hoxniense"
What is every entry for America when Atlantic Europe is Hoxniense?
CREATE TABLE table_22860_1 (america VARCHAR, atlantic_europe VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Hemodialysis"
what is the number of patients whose admission type is emergency and procedure long title is hemodialysis?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE 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 text, admittime text, dischtime text, admityear text )
SELECT COUNT(game) FROM table_23308178_5 WHERE opponent = "Florida Panthers" AND location = "Verizon Center"
How many different games against Florida Panthers were played in Verizon Center?
CREATE TABLE table_23308178_5 (game VARCHAR, opponent VARCHAR, location VARCHAR)
SELECT age__before_ FROM table_22860_1 WHERE maghreb = "Maarifiense"
What are all ages for Maghreb is Maarifiense?
CREATE TABLE table_22860_1 (age__before_ VARCHAR, maghreb VARCHAR)
SELECT MAX("Year") FROM table_12557 WHERE "Position" = '1st' AND "Venue" = 'maputo, mozambique'
What was the latest year with a position of 1st at Maputo, Mozambique?
CREATE TABLE table_12557 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
SELECT record FROM table_23308178_5 WHERE date = "November 7"
What was the record in the November 7 game?
CREATE TABLE table_23308178_5 (record VARCHAR, date VARCHAR)
SELECT MIN(opp_points) FROM table_22860990_3 WHERE record = "6-2"
How many points did the opponents with a 6-2 record against the Spartans score?
CREATE TABLE table_22860990_3 (opp_points INTEGER, record VARCHAR)
SELECT "implied probability" FROM table_200_41 WHERE "number" = '8 = 23 + 0'
what is the implied probability of 8 = 23 + 0 ?
CREATE TABLE table_200_41 ( id number, "number" text, "encoding" text, "implied probability" number )
SELECT COUNT(attendance) FROM table_23308178_9 WHERE record = "49-15-11"
How many times was there a record of 49-15-11?
CREATE TABLE table_23308178_9 (attendance VARCHAR, record VARCHAR)
SELECT opponent FROM table_22860990_3 WHERE spartans_points = 73
Against whom did the Spartans score 73 points?
CREATE TABLE table_22860990_3 (opponent VARCHAR, spartans_points VARCHAR)
SELECT "Winning applicant" FROM table_74569 WHERE "Block" = '10d' AND "Ensemble name" = 'muxco lincolnshire'
Who is the Winning Applicant of Ensemble Name Muxco Lincolnshire in Block 10D?
CREATE TABLE table_74569 ( "Area" text, "Advertisement date" text, "Block" text, "Winning applicant" text, "Ensemble name" text )
SELECT COUNT(score) FROM table_23308178_9 WHERE date = "March 6"
How many scores had a date of March 6?
CREATE TABLE table_23308178_9 (score VARCHAR, date VARCHAR)
SELECT high_points FROM table_22883210_5 WHERE game = 5
Who had highest points in game 5?
CREATE TABLE table_22883210_5 (high_points VARCHAR, game VARCHAR)
SELECT procedures.short_title FROM procedures WHERE procedures.icd9_code = "3613"
Find out the short title of the procedure for procedure icd9 code 3613.
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 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 text, admittime text, dischtime text, admityear 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 text, route text, drug_dose text )
SELECT opponent FROM table_23314951_4 WHERE date = "7-21-2006"
If the date is 7-21-2006, who was the opponent?
CREATE TABLE table_23314951_4 (opponent VARCHAR, date VARCHAR)
SELECT score FROM table_22883210_8 WHERE date = "February 24"
What was the final score of the game held on February 24?
CREATE TABLE table_22883210_8 (score VARCHAR, date VARCHAR)
SELECT DISTINCT advisory_requirement FROM course WHERE name LIKE '%Ibsen and Strindberg%'
For Ibsen and Strindberg , are there any classes I need to have taken ?
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) 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_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year 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, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) 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_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) 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 jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int )
SELECT against FROM table_23314951_4 WHERE opponent = "Kristian Pless"
If the opponent is Kristian Pless, who was it against?
CREATE TABLE table_23314951_4 (against VARCHAR, opponent VARCHAR)
SELECT team FROM table_22883210_8 WHERE date = "February 4"
Who was the opponent in the game held on February 4?
CREATE TABLE table_22883210_8 (team VARCHAR, date VARCHAR)
SELECT finish FROM table_name_59 WHERE player = "billy casper"
What was the finish for Billy Casper?
CREATE TABLE table_name_59 ( finish VARCHAR, player VARCHAR )
SELECT winning_team FROM table_23315271_2 WHERE winning_driver = "Max Busnelli"
Who is the winning team when max busnelli is the winning driver?
CREATE TABLE table_23315271_2 (winning_team VARCHAR, winning_driver VARCHAR)
SELECT citation FROM table_22901612_2 WHERE region = "Southern District of Texas"
If the region is the Southern district of Texas, what is the citation?
CREATE TABLE table_22901612_2 (citation VARCHAR, region VARCHAR)
SELECT LAST_DATE_OF_MONTH(p.CreationDate), ROUND((COUNT(p.ClosedDate)) * 100.0 / (COUNT(p.Id)), 2) AS percentage FROM Posts AS p WHERE (p.PostTypeId = 1) AND (p.CreationDate >= '##Date1?2010-01-01##') AND (p.CreationDate <= '##Date2?2021-01-01##') GROUP BY LAST_DATE_OF_MONTH(p.CreationDate) ORDER BY LAST_DATE_OF_MONTH(p.CreationDate)
Percentage of closed question per month.
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId 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, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) 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 ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
SELECT location FROM table_23315271_2 WHERE circuit = "ACI Vallelunga circuit"
In which location is aci vallelunga circuit?
CREATE TABLE table_23315271_2 (location VARCHAR, circuit VARCHAR)
SELECT region FROM table_22901612_2 WHERE chief_judge = "Jeffrey L. Viken"
If the chief judge is Jeffrey L. Viken, what is the region?
CREATE TABLE table_22901612_2 (region VARCHAR, chief_judge VARCHAR)
SELECT T1.city FROM addresses AS T1 JOIN staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
In what city does Janessa Sawayn live?
CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, date_joined_staff time, date_left_staff time ) CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_code text, date_became_customer time, date_of_birth time, first_name text, last_name text, amount_outstanding number, email_address text, phone_number text, cell_mobile_phone_number text ) CREATE TABLE customer_payments ( customer_id number, datetime_payment time, payment_method_code text, amount_payment number ) CREATE TABLE vehicles ( vehicle_id number, vehicle_details text ) CREATE TABLE lessons ( lesson_id number, customer_id number, lesson_status_code text, staff_id number, vehicle_id number, lesson_date time, lesson_time text, price number ) CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text )
SELECT pole_position FROM table_23315271_2 WHERE circuit = "Misano World circuit"
Who held the pole position in misano world circuit?
CREATE TABLE table_23315271_2 (pole_position VARCHAR, circuit VARCHAR)
SELECT region FROM table_22901612_2 WHERE chief_judge = "Glen E. Conrad"
If the chief judge is Glen E. Conrad, what is the region?
CREATE TABLE table_22901612_2 (region VARCHAR, chief_judge VARCHAR)
SELECT player FROM table_name_24 WHERE nationality = "spain"
Which player has a nationality of spain?
CREATE TABLE table_name_24 ( player VARCHAR, nationality VARCHAR )
SELECT score FROM table_23308178_7 WHERE opponent = "Detroit Red Wings"
List the results for all games which involved the detroit red wings.
CREATE TABLE table_23308178_7 (score VARCHAR, opponent VARCHAR)
SELECT title FROM table_22904707_1 WHERE us_viewers__million_ = "14.52"
What was the name of the episode that had 14.52 viewers?
CREATE TABLE table_22904707_1 (title VARCHAR, us_viewers__million_ VARCHAR)
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 43959) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY procedures_icd.charttime LIMIT 1)
what was the name of procedure, that patient 43959 was first received in this year?
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE 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 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 ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text )
SELECT MAX(points) FROM table_23308178_7 WHERE record = "28-12-6"
Calculate the highest points where the win,loss, tie ratio is 28-12-6
CREATE TABLE table_23308178_7 (points INTEGER, record VARCHAR)
SELECT us_viewers__million_ FROM table_22904707_1 WHERE no = 63
How many million viewers did episode number 63 have?
CREATE TABLE table_22904707_1 (us_viewers__million_ VARCHAR, no VARCHAR)
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 = 99647 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'sodium polystyrene sulfonate' ORDER BY prescriptions.startdate DESC LIMIT 1
how many hours has passed since the last sodium polystyrene sulfonate prescription of patient 99647 in this hospital visit?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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_procedures ( row_id number, icd9_code text, short_title text, long_title text ) 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, cost number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
SELECT record FROM table_23308178_7 WHERE opponent = "Montreal Canadiens"
what are the previous performance details for games involving the montreal canadiens?
CREATE TABLE table_23308178_7 (record VARCHAR, opponent VARCHAR)
SELECT MIN(_number) FROM table_22904707_1 WHERE no = 52
What number in the season was episode 52 in the series?
CREATE TABLE table_22904707_1 (_number INTEGER, no VARCHAR)
SELECT "species" FROM table_203_700 ORDER BY "height" DESC LIMIT 1
what species of tree was the tallest one used ?
CREATE TABLE table_203_700 ( id number, "year" number, "species" text, "height" text, "location grown" text, "state" text, "notes" text )
SELECT year FROM table_2331549_1 WHERE third_place = "Michigan State University"
Which years did Michigan state university come in third place?
CREATE TABLE table_2331549_1 (year VARCHAR, third_place VARCHAR)
SELECT metropolitan_area FROM table_22916979_2 WHERE rank = 60
which area has a rank of 60?
CREATE TABLE table_22916979_2 (metropolitan_area VARCHAR, rank VARCHAR)
SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type
What is the average account balance of customers with credit score below 50 for the different account types. Visualize by bar chart.
CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state varchar(20) ) CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int )
SELECT champion FROM table_2331549_1 WHERE third_place = "Michigan Technological University"
Who were the champions in years where michigan technological university was in third place?
CREATE TABLE table_2331549_1 (champion VARCHAR, third_place VARCHAR)
SELECT COUNT(population__2000_census_) FROM table_22916979_2 WHERE census_designated_place = "Westmont"
what is the total number of population where census designated place is westmont?
CREATE TABLE table_22916979_2 (population__2000_census_ VARCHAR, census_designated_place VARCHAR)
SELECT COUNT(podium) FROM table_name_42 WHERE race = 14 AND flap > 1
On Race 14 when the FLap is larger than 1, what is the podium number?
CREATE TABLE table_name_42 ( podium VARCHAR, race VARCHAR, flap VARCHAR )
SELECT host_city FROM table_2331549_1 WHERE host_school = "École de technologie supérieure"
What was the host city in years where the host school was école de technologie supérieure?
CREATE TABLE table_2331549_1 (host_city VARCHAR, host_school VARCHAR)
SELECT COUNT(census_designated_place) FROM table_22916979_2 WHERE population__2000_census_ = 10581
what is the total number of census designated places with a population of 10581?
CREATE TABLE table_22916979_2 (census_designated_place VARCHAR, population__2000_census_ VARCHAR)
SELECT "Recopa Sudamericana 1996" FROM table_35609 WHERE "Team" = 'corinthians'
What is the recoupa sudamericana 1996 result of team corinthians?
CREATE TABLE table_35609 ( "Team" text, "Copa Libertadores 1996" text, "Supercopa Sudamericana 1996" text, "Copa CONMEBOL 1996" text, "Recopa Sudamericana 1996" text )
SELECT second_place FROM table_2331549_1 WHERE champion = "South Dakota School of Mines & Technology"
Who came in second place when the champion was south dakota school of mines & technology?
CREATE TABLE table_2331549_1 (second_place VARCHAR, champion VARCHAR)
SELECT MAX(number_of_contestants) FROM table_22951646_1
Name the most number of contestants
CREATE TABLE table_22951646_1 (number_of_contestants INTEGER)
SELECT MAX("Extra points 1 point") FROM table_36579 WHERE "Total Points" < '8'
Which Extra points 1 point is the highest one that has a Total Points smaller than 8?
CREATE TABLE table_36579 ( "Player" text, "Touchdowns (5 points)" real, "Extra points 1 point" real, "Field goals (5 points)" real, "Total Points" real )
SELECT COUNT(innings) FROM table_23316034_16 WHERE average = "45.65"
If the average is 45.65, what is the total number of innings?
CREATE TABLE table_23316034_16 (innings VARCHAR, average VARCHAR)
SELECT premiere FROM table_22951646_1 WHERE number_of_episodes = 8
Name the premiere for 8 episodes
CREATE TABLE table_22951646_1 (premiere VARCHAR, number_of_episodes VARCHAR)
SELECT SUM("Drawn") FROM table_54845 WHERE "From" = '30 october 2006' AND "Win %" > '43.2'
Name the sum of drawn for 30 october 2006 and win % more than 43.2
CREATE TABLE table_54845 ( "Team" text, "Nation" text, "From" text, "Matches" real, "Drawn" real, "Lost" real, "Win %" real )
SELECT player FROM table_23316034_16 WHERE innings = 82
What is the name of the player if the innings is 82?
CREATE TABLE table_23316034_16 (player VARCHAR, innings VARCHAR)
SELECT league_finish FROM table_22962745_12 WHERE w = 11
Name the league finish for w being 11
CREATE TABLE table_22962745_12 (league_finish VARCHAR, w VARCHAR)
SELECT date_s__administered FROM table_name_49 WHERE joe_sestak__d_ = "46%" AND margin_of_error = "± 3.0%"
WHAT DATE DID JOE SESTAK HAVE 46% WITH 3.0% MARGIN OF ERROR?
CREATE TABLE table_name_49 ( date_s__administered VARCHAR, joe_sestak__d_ VARCHAR, margin_of_error VARCHAR )
SELECT average FROM table_23316034_16 WHERE innings = 68
If the innings is 68, what is the average?
CREATE TABLE table_23316034_16 (average VARCHAR, innings VARCHAR)
SELECT overall_record FROM table_22993636_2 WHERE team = "LSU"
What's LSU's overall record/
CREATE TABLE table_22993636_2 (overall_record VARCHAR, team VARCHAR)
SELECT 2013 FROM table_name_5 WHERE 2009 = "virgin"
What is the 2013 with virgin in 2009?
CREATE TABLE table_name_5 ( Id VARCHAR )
SELECT MAX(matches) FROM table_23316034_16 WHERE runs = 5028
If the runs is 5028, what is the matches maximum?
CREATE TABLE table_23316034_16 (matches INTEGER, runs VARCHAR)
SELECT COUNT(sec_wins) FROM table_22993636_2 WHERE overall_record = "30-4"
How many different SEC Win counts does the team with an overall record of 30-4 have?
CREATE TABLE table_22993636_2 (sec_wins VARCHAR, overall_record VARCHAR)
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '027-41381' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104' ORDER BY patient.hospitaladmittime LIMIT 1
when did patient 027-41381 get admitted to the hospital for the first time until 2104 via emergency department?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) 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 time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
SELECT MIN(dismissals) FROM table_23316034_23 WHERE player = "Sammy Carter"
Name the least dismissals for sammy carter
CREATE TABLE table_23316034_23 (dismissals INTEGER, player VARCHAR)
SELECT percentage FROM table_22993636_2 WHERE team = "Auburn"
What's Auburn's percentage?
CREATE TABLE table_22993636_2 (percentage VARCHAR, team VARCHAR)
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'stress ulcer prophylaxis - esomeprazole' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-6 year')) GROUP BY patient.uniquepid) AS t1 WHERE t1.c1 = 2
since 6 years ago, how many patients were given the stress ulcer prophylaxis - esomeprazole two times?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) 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 time, hospitaldischargetime time, hospitaldischargestatus text )
SELECT COUNT(dismissals) FROM table_23316034_23 WHERE player = "Adam Gilchrist"
Name the number of dismissals for adam gilchrist
CREATE TABLE table_23316034_23 (dismissals VARCHAR, player VARCHAR)
SELECT overall_record FROM table_22993636_2 WHERE road_record = "4-3"
What's the overall record of the team with 4-3 road record?
CREATE TABLE table_22993636_2 (overall_record VARCHAR, road_record VARCHAR)
SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE
Return a bar chart on what is the number of professors for different school?
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) 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 EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) )
SELECT MAX(dismissals) FROM table_23316034_23 WHERE rank = 4
Name the least dismissals for 4 rank
CREATE TABLE table_23316034_23 (dismissals INTEGER, rank VARCHAR)
SELECT home_record FROM table_22993636_2 WHERE percentage = ".168"
What's the home record of the team with percentage of .168?
CREATE TABLE table_22993636_2 (home_record VARCHAR, percentage VARCHAR)
SELECT country FROM table_name_84 WHERE player = "arron oberholser"
where did arron oberholser play?
CREATE TABLE table_name_84 ( country VARCHAR, player VARCHAR )
SELECT top_10 FROM table_2333416_2 WHERE winnings = "$17,695"
How many top 10 finishes did Ken Bouchard get in the year he won $17,695?
CREATE TABLE table_2333416_2 (top_10 VARCHAR, winnings VARCHAR)
SELECT avg_speed FROM table_23018775_3 WHERE lap_four = "22.9049"
What was the average speed where lap four's time was 22.9049?
CREATE TABLE table_23018775_3 (avg_speed VARCHAR, lap_four VARCHAR)
SELECT MIN(number_of_electorates__2009_) FROM table_name_40 WHERE reserved_for___sc___st__none_ = "none" AND name = "jahanabad"
Name the Number of electorates (2009 which has a Reserved for ( SC / ST /None) of none, and a Name of jahanabad?
CREATE TABLE table_name_40 ( number_of_electorates__2009_ INTEGER, reserved_for___sc___st__none_ VARCHAR, name VARCHAR )
SELECT year FROM table_2333416_2 WHERE position = "78th"
What year did Ken Bouchard finish in 78th place?
CREATE TABLE table_2333416_2 (year VARCHAR, position VARCHAR)
SELECT COUNT(lap_two) FROM table_23018775_3 WHERE name = "Marco Andretti"
How many lap two's did marco andretti do?
CREATE TABLE table_23018775_3 (lap_two VARCHAR, name VARCHAR)
SELECT DISTINCT hometown FROM people EXCEPT SELECT DISTINCT T2.hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id
List the distinct hometowns that are not associated with any gymnast.
CREATE TABLE gymnast ( gymnast_id number, floor_exercise_points number, pommel_horse_points number, rings_points number, vault_points number, parallel_bars_points number, horizontal_bar_points number, total_points number ) CREATE TABLE people ( people_id number, name text, age number, height number, hometown text )
SELECT COUNT(year) FROM table_2333416_2 WHERE position = "38th"
How many seasons did Ken Bouchard finish in 38th place?
CREATE TABLE table_2333416_2 (year VARCHAR, position VARCHAR)
SELECT MIN(_number_number) FROM table_23018775_3 WHERE team = "team 3G"
What is tthe lowest number on team 3g?
CREATE TABLE table_23018775_3 (_number_number INTEGER, team VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Depress psychosis-unspec"
what is the number of patients whose gender is f and diagnoses short title is depress psychosis-unspec?
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 text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid 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 )
SELECT MIN(wins) FROM table_2333416_2
What is the greatest number of wins Ken Bouchard had in a season?
CREATE TABLE table_2333416_2 (wins INTEGER)
SELECT COUNT(pos) FROM table_23018775_3 WHERE total_time = "1:30.4135"
How many positions have a total time of 1:30.4135?
CREATE TABLE table_23018775_3 (pos VARCHAR, total_time VARCHAR)
SELECT SUM(losses) FROM table_name_35 WHERE ballarat_fl = "melton" AND draws < 0
What is the total number of Losses that Melton had when they had fewer Draws than 0?
CREATE TABLE table_name_35 ( losses INTEGER, ballarat_fl VARCHAR, draws VARCHAR )
SELECT COUNT(races) FROM table_23338693_1 WHERE season = 2012 AND podiums = 0
How many races in 2012 season have 0 podiums?
CREATE TABLE table_23338693_1 (races VARCHAR, season VARCHAR, podiums VARCHAR)
SELECT pos FROM table_23018775_3 WHERE lap_two = "22.7290"
Which positions have a lap two time of 22.7290?
CREATE TABLE table_23018775_3 (pos VARCHAR, lap_two VARCHAR)
SELECT T1.name, COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 5
List the top 5 genres by number of tracks. List genres name and total tracks.
CREATE TABLE media_types ( id number, name text ) CREATE TABLE employees ( id number, last_name text, first_name text, title text, reports_to number, birth_date time, hire_date time, address text, city text, state text, country text, postal_code text, phone text, fax text, email text ) CREATE TABLE albums ( id number, title text, artist_id number ) CREATE TABLE playlist_tracks ( playlist_id number, track_id number ) CREATE TABLE tracks ( id number, name text, album_id number, media_type_id number, genre_id number, composer text, milliseconds number, bytes number, unit_price number ) CREATE TABLE invoice_lines ( id number, invoice_id number, track_id number, unit_price number, quantity number ) CREATE TABLE sqlite_sequence ( name text, seq text ) CREATE TABLE genres ( id number, name text ) CREATE TABLE invoices ( id number, customer_id number, invoice_date time, billing_address text, billing_city text, billing_state text, billing_country text, billing_postal_code text, total number ) CREATE TABLE artists ( id number, name text ) CREATE TABLE playlists ( id number, name text ) CREATE TABLE customers ( id number, first_name text, last_name text, company text, address text, city text, state text, country text, postal_code text, phone text, fax text, email text, support_rep_id number )
SELECT COUNT(season) FROM table_23338693_1 WHERE team = "Motopark"
How many seasons have motopark team?
CREATE TABLE table_23338693_1 (season VARCHAR, team VARCHAR)
SELECT avg_speed FROM table_23018775_3 WHERE total_time = "1:30.4842"
What was the average speed where the total time was 1:30.4842?
CREATE TABLE table_23018775_3 (avg_speed VARCHAR, total_time VARCHAR)
SELECT "Score" FROM table_36317 WHERE "Opponent" = 'buffalo sabres'
What was the Score in the game against the Buffalo Sabres?
CREATE TABLE table_36317 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
SELECT team FROM table_23338693_1 WHERE position = "NC" AND season = 2010
Which team has nc position for 2010 season?
CREATE TABLE table_23338693_1 (team VARCHAR, position VARCHAR, season VARCHAR)
SELECT poles FROM table_2308381_2 WHERE avg_start = "4.7"
Name the poles for avg start being 4.7
CREATE TABLE table_2308381_2 (poles VARCHAR, avg_start VARCHAR)
SELECT "Player" FROM table_59606 WHERE "Position" = 'offensive tackle' AND "AFL Team" = 'new york jets'
Which player is an offensive tackle for the New York Jets?
CREATE TABLE table_59606 ( "Pick" real, "AFL Team" text, "Player" text, "Position" text, "College" text )
SELECT points FROM table_23338693_1 WHERE series = "British Formula Renault 2.0 Winter Cup" AND f_laps = 0
How many points have a series of british formula renault 2.0 winter cup and f/laps of 0?
CREATE TABLE table_23338693_1 (points VARCHAR, series VARCHAR, f_laps VARCHAR)
SELECT avg_finish FROM table_2308381_2 WHERE position = "70th"
Name the avg finish for position of 70th
CREATE TABLE table_2308381_2 (avg_finish VARCHAR, position VARCHAR)
SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.id DESC
Give me a histogram for what are the ids and names of the architects who built at least 3 bridges ?, and I want to display by the Y in desc.
CREATE TABLE mill ( architect_id int, id int, location text, name text, type text, built_year int, notes text ) CREATE TABLE architect ( id text, name text, nationality text, gender text ) CREATE TABLE bridge ( architect_id int, id int, name text, location text, length_meters real, length_feet real )
SELECT MAX(minutes) FROM table_23346303_5 WHERE rebounds = 0
If the amount of rebounds is 0, what is the maximum minutes?
CREATE TABLE table_23346303_5 (minutes INTEGER, rebounds VARCHAR)
SELECT year FROM table_2308381_2 WHERE starts = 15
Name the year for 15 starts
CREATE TABLE table_2308381_2 (year VARCHAR, starts VARCHAR)
SELECT "title" FROM table_203_325 ORDER BY "year" LIMIT 1
which is david d'or 's oldest album ?
CREATE TABLE table_203_325 ( id number, "year" number, "title" text, "(english)" text, "ifpi israel certification" text, "label" text )
SELECT COUNT(points) FROM table_23346303_5 WHERE assists = 7
What is the points total number if the assists is 7?
CREATE TABLE table_23346303_5 (points VARCHAR, assists VARCHAR)