table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
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_proje...
Name the upper elective courses that are offered for CS .
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
CREATE TABLE table_20618 ( "#" real, "Series Sorted" text, "Title" text, "Author" text, "Doctor" text, "Featuring" text, "Released" text )
Name the released for pat mills
SELECT "Released" FROM table_20618 WHERE "Author" = 'Pat Mills'
CREATE TABLE table_29066 ( "Date" text, "Time" text, "Visiting team" text, "Home team" text, "Site" text, "Broadcast" text, "Result" text, "Attendance" real )
What were the results of the tennessee tech as a visiting team?
SELECT "Result" FROM table_29066 WHERE "Visiting team" = 'Tennessee Tech'
CREATE TABLE table_26756 ( "Player" text, "Group Legs won" real, "Play-Off Legs won" real, "Winners Group Legs won" real, "Winners Play-Off Legs won" real, "Final position money won*" text, "Total money won" text )
What is the latest amount of won legs in the payoffs when the prize money was 2,350?
SELECT MAX("Winners Play-Off Legs won") FROM table_26756 WHERE "Total money won" = '£2,350'
CREATE TABLE table_name_65 ( date VARCHAR, score VARCHAR )
What is the Date with a Score that is 46-77?
SELECT date FROM table_name_65 WHERE score = "46-77"
CREATE TABLE table_24375 ( "Barangay" text, "Population (2000)" real, "Population (2007)" real, "Population (2010)" real, "Barangay Fiesta" text )
What is the 2010 population when the 2000 population is 5720?
SELECT MAX("Population (2010)") FROM table_24375 WHERE "Population (2000)" = '5720'
CREATE TABLE table_name_53 ( race VARCHAR, winning_driver VARCHAR, fastest_lap VARCHAR )
Which race had Jacky Ickx as the winner and Clay Regazzoni with the fastest lap?
SELECT race FROM table_name_53 WHERE winning_driver = "jacky ickx" AND fastest_lap = "clay regazzoni"
CREATE TABLE table_38032 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What week ended in a result of w 30-3, and had an attendance less than 62,795?
SELECT MIN("Week") FROM table_38032 WHERE "Result" = 'w 30-3' AND "Attendance" < '62,795'
CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction...
Show all card type codes and the number of cards in each type by a bar chart, I want to sort Y in descending order.
SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY COUNT(*) DESC
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, ...
what is the number of patients whose procedure long title is percutaneous aspiration of liver?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Percutaneous aspiration of liver"
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
For those employees who was hired before 2002-06-21, find hire_date and the sum of department_id bin hire_date by weekday, and visualize them by a bar chart.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE editor ( Editor_ID int, Name text, Age real )
Group and count the name attribute for visualizing a bar chart, display in ascending by the Name.
SELECT Name, COUNT(Name) FROM editor GROUP BY Name ORDER BY Name
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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight...
what are the fares for flights between ATLANTA and DFW provided by AA
SELECT DISTINCT fare.fare_id FROM airport, airport_service, city, fare, flight, flight_fare WHERE (airport.airport_code = 'DFW' AND city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code) AND flight_fa...
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 semester ( semester_id int, semester varchar, year int ) CREATE TABLE...
Can I get a list of classes without labs at the 400 level ?
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' AND number < 400 + 100 AND number >= 400
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 demographic (...
provide the number of patients whose marital status is married and lab test name is wbc, pleural?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "WBC, Pleural"
CREATE TABLE table_59900 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What country was Jay Haas representing?
SELECT "Country" FROM table_59900 WHERE "Player" = 'jay haas'
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 t...
how many patients whose ethnicity is black/cape verdean and primary disease is left femur fracture?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "LEFT FEMUR FRACTURE"
CREATE TABLE table_74680 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which venue hosted a home team with a score of 13.15 (93)?
SELECT "Venue" FROM table_74680 WHERE "Home team score" = '13.15 (93)'
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, LastEditorDispl...
select top 20 * from Posts.
SELECT p.Title, crt.Name FROM PendingFlags AS pf JOIN CloseReasonTypes AS crt ON pf.CloseReasonTypeId = crt.Id JOIN Posts AS p ON p.Id = pf.PostId LIMIT 20
CREATE TABLE table_24839 ( "Episode number" real, "Title" text, "Original airing on Channel 4" text, "Time of airing on Channel 4" text, "Original airing on E4" text, "Time of airing on E4" text, "Position in Channel 4s ratings a" text, "Position in E4s ratings b" text, "Total viewer...
How many position in channel 4s ratings a have February 24, 2010 as the original airing on channel 4?
SELECT COUNT("Position in Channel 4s ratings a") FROM table_24839 WHERE "Original airing on Channel 4" = 'February 24, 2010'
CREATE TABLE table_76936 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What is the low score for TO par +2 in japan?
SELECT MIN("Score") FROM table_76936 WHERE "To par" = '+2' AND "Country" = 'japan'
CREATE TABLE table_55195 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What did the away team score at corio oval?
SELECT "Away team score" FROM table_55195 WHERE "Venue" = 'corio oval'
CREATE TABLE list ( lastname text, firstname text, grade number, classroom number ) CREATE TABLE teachers ( lastname text, firstname text, classroom number )
Find the last names of the teachers that teach fifth grade.
SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5
CREATE TABLE table_10233 ( "Date" text, "Venue" text, "Opponent" text, "Result" text, "Competition" text )
Which opponent is friendly and played on 15-08-2012?
SELECT "Opponent" FROM table_10233 WHERE "Competition" = 'friendly' AND "Date" = '15-08-2012'
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId n...
Opinions with low score (VLQ ready).
SELECT Id AS "post_link", CreationDate FROM Posts WHERE ClosedDate IS NULL AND PostTypeId = 1 AND DATEDIFF(month, CreationDate, GETDATE()) <= 3 AND Score < 2 AND (Title LIKE '%what is the best%' COLLATE Latin1_General_CI_AI OR Title LIKE '%what are the best%' COLLATE Latin1_General_CI_AI) ORDER BY LEN(Body)
CREATE TABLE table_44813 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text )
What was the score of the game against montreal canadiens after game 26?
SELECT "Score" FROM table_44813 WHERE "Game" > '26' AND "Opponent" = 'montreal canadiens'
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmenti...
what were the top five most frequent procedures for the patients 20s since 6 years ago?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-6 yea...
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 )
Draw a bar chart of founder versus sum revenue, and show y-axis in descending order.
SELECT Founder, SUM(Revenue) FROM Manufacturers GROUP BY Founder ORDER BY SUM(Revenue) DESC
CREATE TABLE table_37523 ( "Camera" text, "Sensor resolution" text, "Sensor" text, "Output" text, "CPU usage" text, "IR LEDs" text )
What was the output with no IR LEDs?
SELECT "Output" FROM table_37523 WHERE "IR LEDs" = 'no'
CREATE TABLE table_15008 ( "Film" text, "Year" real, "Score composer" text, "U.K. peak position" text, "U.S. peak position" text )
What was the US Peak position of the film that peaked at #21 in the UK?
SELECT "U.S. peak position" FROM table_15008 WHERE "U.K. peak position" = '21'
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 lab ( labid number, pa...
is patient 005-11182's level of heartrate last measured on the first icu visit greater than it was first measured on the first icu visit?
SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-11182') AND NOT patient.unitdischargetime IS ...
CREATE TABLE table_72157 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text )
What is the to par dated may 4, 2003?
SELECT "To par" FROM table_72157 WHERE "Date" = 'May 4, 2003'
CREATE TABLE table_5929 ( "Country" text, "Project Name" text, "Year startup" text, "Operator" text, "Peak" text )
What was the startup year for the Jackpine Mine (ph 2) project with an albian sands operator?
SELECT "Year startup" FROM table_5929 WHERE "Operator" = 'albian sands' AND "Project Name" = 'jackpine mine (ph 2)'
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the average of salary bin hire_date by weekday in a bar chart.
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
CREATE TABLE table_name_39 ( result VARCHAR, date VARCHAR )
What is the result on 29 September 2007?
SELECT result FROM table_name_39 WHERE date = "29 september 2007"
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId n...
My most up voted comments.
SELECT Id, Score, Text, CreationDate FROM Comments WHERE UserId = @UserId ORDER BY Score DESC LIMIT 500
CREATE TABLE table_80129 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
How many positions have 14 wins, goals against of 61 and fewer than 19 losses?
SELECT COUNT("Position") FROM table_80129 WHERE "Wins" = '14' AND "Goals against" = '61' AND "Losses" < '19'
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE ...
Retrieve tags and unanswered questions count, ordered by descending count.
SELECT t.TagName, COUNT(q.Id) AS countofUnAnsweredQuestions FROM Posts AS q INNER JOIN PostTags AS pt ON pt.PostId = q.Id INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE (SELECT COUNT(*) FROM Posts AS a WHERE a.ParentId = q.Id AND a.Score > 0) = 0 AND q.CommunityOwnedDate IS NULL AND q.ClosedDate IS NULL AND q.ParentId I...
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 varcha...
For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, show in ascending by the y-axis please.
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID)
CREATE TABLE table_57803 ( "Annual ridership (2012)" real, "Rider. per mile" real, "Opened" real, "Stations" real, "Lines" real )
What is the number of annual ridership with a station that has more than 13 stations and larger than 4 lines?
SELECT SUM("Annual ridership (2012)") FROM table_57803 WHERE "Stations" = '13' AND "Lines" > '4'
CREATE TABLE table_name_92 ( record VARCHAR, date VARCHAR )
On May 26, what was the team's record?
SELECT record FROM table_name_92 WHERE date = "may 26"
CREATE TABLE table_name_2 ( written_by VARCHAR, episode__number VARCHAR )
Who is the author of Episode 38 (16)?
SELECT written_by FROM table_name_2 WHERE episode__number = "38 (16)"
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Duplicate Questions Count per Month.
SELECT date1, COUNT(Id) AS cnt FROM (SELECT TIME_TO_STR(d.CreationDate, '%y-%m') AS "date1", (d.Id) AS id FROM Posts AS d LEFT JOIN PostHistory AS ph ON ph.PostId = d.Id LEFT JOIN PostLinks AS pl ON pl.PostId = d.Id LEFT JOIN Posts AS o ON o.Id = pl.RelatedPostId WHERE d.PostTypeId = 1 AND pl.LinkTypeId = 3 AND ph.Post...
CREATE TABLE table_name_22 ( goal_difference INTEGER, points VARCHAR, losses VARCHAR, draws VARCHAR )
How much Goal Difference has less than 9 Losses, and 8 Draws, and more than 40 points?
SELECT SUM(goal_difference) FROM table_name_22 WHERE losses < 9 AND draws = 8 AND points > 40
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid numb...
among people with age 20s since 4 years ago, what is the top four most frequent diagnoses?
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 yea...
CREATE TABLE table_27998152_1 ( date_of_birth VARCHAR, no VARCHAR )
for the no. 7 what is the date of birth
SELECT date_of_birth FROM table_27998152_1 WHERE no = 7
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 TABLE prescriptions ( row_id number, subject_id number, hadm_id number, ...
what was the first intake time of promote w/fiber for patient 7698 on last month/04?
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7698)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label ...
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, ...
give me the number of patients whose admission location is clinic referral/premature and admission year is less than 2120?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.admityear < "2120"
CREATE TABLE table_name_20 ( date VARCHAR, field VARCHAR )
What days were games played at Hofstra Stadium?
SELECT date FROM table_name_20 WHERE field = "hofstra stadium"
CREATE TABLE table_39902 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the average number of top-10s for events under 57 and 0 top-5s?
SELECT AVG("Top-10") FROM table_39902 WHERE "Events" < '57' AND "Top-5" < '0'
CREATE TABLE table_name_68 ( year INTEGER, sport VARCHAR, first VARCHAR )
Name the sum of year for swimming and first of mike
SELECT SUM(year) FROM table_name_68 WHERE sport = "swimming" AND first = "mike"
CREATE TABLE table_name_42 ( location_attendance VARCHAR, score VARCHAR )
what is the location attendance when the score is w 86 77 (ot)?
SELECT location_attendance FROM table_name_42 WHERE score = "w 86–77 (ot)"
CREATE TABLE table_22684 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location" text, "Record" text )
When w 73-70 is the score what is the location?
SELECT "Location" FROM table_22684 WHERE "Score" = 'W 73-70'
CREATE TABLE table_name_73 ( series_sorted VARCHAR, released VARCHAR )
what is the series sorted when the released is may 2012?
SELECT series_sorted FROM table_name_73 WHERE released = "may 2012"
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
what was the name of the output, which patient 015-59552 had last on this month/22?
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 = '015-59552')) AND intakeoutput.cellpath LIKE '%output%' AND D...
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 loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3)...
Show a bar chart to show different names and credit scores of customers who have taken a loan, show Y from low to high order please.
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY credit_score
CREATE TABLE table_2417445_4 ( district VARCHAR, reason_for_vacancy VARCHAR )
When the person died May 22, 1895 is the reason for vacancy what is the district?
SELECT district FROM table_2417445_4 WHERE reason_for_vacancy = "Died May 22, 1895"
CREATE TABLE table_4401 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the average number of rounds when fighting against Clay Guida?
SELECT AVG("Round") FROM table_4401 WHERE "Opponent" = 'clay guida'
CREATE TABLE table_25346763_1 ( custody_level_s_ VARCHAR, location VARCHAR )
What is the custody level of the facility in Shelton?
SELECT custody_level_s_ FROM table_25346763_1 WHERE location = "Shelton"
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
give me the number of patients whose admission location is phys referral/normal deli and age is less than 47?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.age < "47"
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_amenity ( dormid...
Find the first name of students who are living in the Smith Hall, and count them by a bar chart, could you list in ascending by the total number please?
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY COUNT(Fname)
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
what did patient 035-2205 have last as the output today?
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 = '035-2205')) AND intakeoutput.cellpath LIKE '%output%' AND DA...
CREATE TABLE table_train_31 ( "id" int, "allergy_to_insulin" bool, "active_infection" bool, "periodic_paralysis" bool, "receiving_continuous_intravenous_inotropic_support" bool, "age" float, "NOUSE" float )
history of periodic paralysis associated with carbohydrate loading;
SELECT * FROM table_train_31 WHERE periodic_paralysis = 1
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
has patient 011-46398 received an hypertension diagnosis in 2105?
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-46398')) AND diagnosis.diagnosisname = 'hypertension' AND STRFTIME('%y',...
CREATE TABLE table_75558 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Height m ( ft )" text, "FCC info" text )
What is the lowest ERP W of w223bp?
SELECT MIN("ERP W") FROM table_75558 WHERE "Call sign" = 'w223bp'
CREATE TABLE table_38493 ( "Number" real, "Station" text, "Japanese" text, "Distance (km)" real, "Stop" text, "Location" text )
What is the station with a number greater than 9 and a distance of 16.4 km?
SELECT "Station" FROM table_38493 WHERE "Number" > '9' AND "Distance (km)" = '16.4'
CREATE TABLE table_name_44 ( record VARCHAR, date VARCHAR )
What was the home team's record on September 30?
SELECT record FROM table_name_44 WHERE date = "september 30"
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 t...
what is diagnoses short title and diagnoses long title of diagnoses icd9 code v4364?
SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "V4364"
CREATE TABLE table_32291 ( "Date" text, "Time" text, "Epicenter" text, "Magnitude" text, "Fatalities" text, "Name" text )
What number of Fatalities did the Epicenter M zandar n have?
SELECT "Fatalities" FROM table_32291 WHERE "Epicenter" = 'māzandarān'
CREATE TABLE table_name_54 ( heat VARCHAR, rank VARCHAR, result VARCHAR )
What is the Heat of the Player with a Rank of 18 or less and Result of 55.15?
SELECT heat FROM table_name_54 WHERE rank < 18 AND result = "55.15"
CREATE TABLE table_24673888_1 ( ch__number VARCHAR, branding VARCHAR )
What is the channel number that has a branding of PTV 4 Laoag?
SELECT ch__number FROM table_24673888_1 WHERE branding = "PTV 4 Laoag"
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number...
was the heart rate value of patient 28443 last measured on the current intensive care unit visit greater than the value second to last measured on the current intensive care unit visit?
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i...
CREATE TABLE table_204_104 ( id number, "title" text, "genre" text, "sub\u00addivisions" text, "libretto" text, "premiere date" text, "place, theatre" text, "notes" text )
what is next after ardelinda ?
SELECT "title" FROM table_204_104 WHERE "premiere date" > (SELECT "premiere date" FROM table_204_104 WHERE "title" = 'ardelinda') ORDER BY "premiere date" LIMIT 1
CREATE TABLE table_74633 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the venue for the event on 12 November 2005?
SELECT "Venue" FROM table_74633 WHERE "Date" = '12 november 2005'
CREATE TABLE table_203_356 ( id number, "type" text, "diagonal (mm)" text, "width (mm)" text, "height (mm)" text, "area (mm2)" text, "stops (area)" number, "crop factor" text )
which is wider ; the blackmagic pocket cinema camera or the 1/2 .7 ?
SELECT "type" FROM table_203_356 WHERE "type" IN ('blackmagic pocket cinema camera', '1/2.7"') ORDER BY "width (mm)" DESC LIMIT 1
CREATE TABLE table_23140 ( "County" text, "Starky #" real, "Starky %" text, "Hancock #" real, "Hancock %" text, "McCain #" real, "McCain %" text, "Total" real )
how many times was total considered when hancock # was 1394
SELECT COUNT("Total") FROM table_23140 WHERE "Hancock #" = '1394'
CREATE TABLE table_1682026_6 ( market_value__billion_$_ VARCHAR, sales__billion_$_ VARCHAR )
What is the market value of a company in billions that has 172.7 billion in sales?
SELECT market_value__billion_$_ FROM table_1682026_6 WHERE sales__billion_$_ = "172.7"
CREATE TABLE table_name_33 ( road_numbers VARCHAR, build_year VARCHAR, railroad__quantity_ VARCHAR )
what is the road numbers when the build year is 1943, the railroad (quantity) is clinchfield railroad (12 new, 6 secondhand)?
SELECT road_numbers FROM table_name_33 WHERE build_year = "1943" AND railroad__quantity_ = "clinchfield railroad (12 new, 6 secondhand)"
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, ...
Of the courses offered this Fall , which of them are upper-level NEUROSCI classes ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'NEUROSCI' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fa...
CREATE TABLE table_22860698_8 ( carpet_w_l VARCHAR, year VARCHAR )
What were the carpet w-l in 1993?
SELECT carpet_w_l FROM table_22860698_8 WHERE year = 1993
CREATE TABLE table_204_880 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
which was the first competition ?
SELECT "competition" FROM table_204_880 ORDER BY "year" LIMIT 1
CREATE TABLE table_3370 ( "Date (YYYY-MM-DD)" text, "Time (UTC)" text, "Latitude" text, "Longitude" text, "Depth" text, "Magnitude" text )
On which date did the shock at latitude 08.909 s occur?
SELECT "Date (YYYY-MM-DD)" FROM table_3370 WHERE "Latitude" = '08.909° S'
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, ha...
when was the first time, patient 62977 was prescribed 1/2 ns until 02/2105?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 62977) AND prescriptions.drug = '1/2 ns' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-02' ORDER BY prescriptions.startdate LIMIT 1
CREATE TABLE batting_postseason ( year INTEGER, round TEXT, player_id TEXT, team_id TEXT, league_id TEXT, g INTEGER, ab INTEGER, r INTEGER, h INTEGER, double INTEGER, triple INTEGER, hr INTEGER, rbi INTEGER, sb INTEGER, cs NUMERIC, bb INTEGER, so INTEG...
Plot year by the average of attendance as a line chart
SELECT year, AVG(attendance) FROM home_game GROUP BY year
CREATE TABLE table_name_10 ( architecture_version VARCHAR, model VARCHAR )
What is the architecture version of Model 1b?
SELECT architecture_version FROM table_name_10 WHERE model = "1b"
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
find the procedure icd9 code for subject name james sloan.
SELECT procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "James Sloan"
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description v...
Does TURKISH 102 have a lab when Prof. Alison Hirschel teaches it ?
SELECT COUNT(*) = 0 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 WHERE course.department = 'TURK...
CREATE TABLE table_60718 ( "Greek Designation" text, "Collegiate Institution" text, "Charter Date" text, "Status" text, "City" text, "U.S. State/District" text )
What's the greek designation of the new york chapter with a charter date of april 23, 2005?
SELECT "Greek Designation" FROM table_60718 WHERE "U.S. State/District" = 'new york' AND "Charter Date" = 'april 23, 2005'
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No...
What is the number of counties for all appellations?, I want to rank bars in asc order.
SELECT County, COUNT(County) FROM appellations GROUP BY County ORDER BY County
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructo...
Which Selected Near and Middle Eastern Studies courses are 14 credits ?
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Selected Near and Middle Eastern Studies%' OR name LIKE '%Selected Near and Middle Eastern Studies%') AND credits = 14
CREATE TABLE table_name_12 ( date VARCHAR, venue VARCHAR )
Which date was corio oval the venue?
SELECT date FROM table_name_12 WHERE venue = "corio oval"
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, ...
what are the FIRST class fares from BOSTON to PITTSBURGH on thursday
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((CITY_1.c...
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid ...
how many patients have undergone bronchodilator - beta-agonist a year before in the same month after the previous enteral feeds - enteral formula procedure?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'enteral feeds - enteral formula' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_T...
CREATE TABLE table_name_56 ( wins INTEGER, team VARCHAR, season VARCHAR )
Which Wins have a Team of winnipeg blue bombers, and a Season larger than 1964?
SELECT AVG(wins) FROM table_name_56 WHERE team = "winnipeg blue bombers" AND season > 1964
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's the number of patients who had a nepro intake until 2103?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'nepro' AND d_items....
CREATE TABLE table_22892217_4 ( nightly_rank INTEGER )
What is the highest numbered nightly rank for any episode?
SELECT MAX(nightly_rank) FROM table_22892217_4
CREATE TABLE table_7379 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
Which Region has a Catalog of magik muzik 806-5?
SELECT "Region" FROM table_7379 WHERE "Catalog" = 'magik muzik 806-5'
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_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row...
the number of patients in ward 14?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 14)
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 records from the products and each product's manufacturer, return a bar chart about the distribution of name and price , and group by attribute headquarter, could you show by the y-axis in descending please?
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Price DESC
CREATE TABLE table_71594 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
When the Surface was Carpet (i), what was the Outcome?
SELECT "Outcome" FROM table_71594 WHERE "Surface" = 'carpet (i)'