text
stringlengths
432
6.49k
target
stringlengths
2
4.44k
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_76089 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text ) ### Question ### What is Stephen Thompson's School/Club Team? ### Accurate SQL ###
SELECT "School/Club Team" FROM table_76089 WHERE "Player" = 'stephen thompson'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_52066 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) ### Question ### What is the Away Team Score of the Collingwood Home Team? ### Accurate SQL ###
SELECT "Away team score" FROM table_52066 WHERE "Away team" = 'collingwood'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_74595 ( "Year" real, "Race name" text, "Rider status" text, "Winner" text, "Team/Country" text ) ### Question ### What is the latest year when Phil Anderson won? ### Accurate SQL ###
SELECT MAX("Year") FROM table_74595 WHERE "Winner" = 'phil anderson'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_34854 ( "sSpec number" text, "Frequency" text, "L2 cache" text, "Mult." text, "Voltage" text, "Socket" text, "Release date" text, "Part number(s)" text, "Release price ( USD )" text ) ### Question ### Socket of without quickassist has what release price? ### Accurate SQL ###
SELECT "Release price ( USD )" FROM table_34854 WHERE "Socket" = 'without quickassist'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_44024 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real ) ### Question ### Who was the home team when real juventud was the away team when there were more than 1189 in attendance? ### Accurate SQL ###
SELECT "Home" FROM table_44024 WHERE "Attendance" > '1189' AND "Away" = 'real juventud'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_42 ( frequency VARCHAR, city_of_license VARCHAR ) ### Question ### what is the frequency when the city of license is belleville? ### Accurate SQL ###
SELECT frequency FROM table_name_42 WHERE city_of_license = "belleville"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE classroom ( building text, room_number text, capacity number ) TABLE: CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) TABLE: CREATE TABLE takes ( id text, course_id text, sec_id text, semester text, year number, grade text ) TABLE: CREATE TABLE time_slot ( time_slot_id text, day text, start_hr number, start_min number, end_hr number, end_min number ) TABLE: CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) TABLE: CREATE TABLE instructor ( id text, name text, dept_name text, salary number ) TABLE: CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) TABLE: CREATE TABLE department ( dept_name text, building text, budget number ) TABLE: CREATE TABLE prereq ( course_id text, prereq_id text ) TABLE: CREATE TABLE advisor ( s_id text, i_id text ) TABLE: CREATE TABLE section ( course_id text, sec_id text, semester text, year number, building text, room_number text, time_slot_id text ) ### Question ### What is the name of the department with an instructure who has a name like 'Soisalon'? ### Accurate SQL ###
SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_24197 ( "Chinese industrial designation" text, "Export type designation" text, "NATO reporting name" text, "NATO/U.S DOD code" text, "Remarks" text ) ### Question ### Name the nato/ us dod code for sabbot ### Accurate SQL ###
SELECT "NATO/U.S DOD code" FROM table_24197 WHERE "NATO reporting name" = 'SABBOT'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_20328 ( "Year" real, "Matches" real, "Wins" real, "Losses" real, "No Result" real, "Tied" real, "Success Rate" text, "Position" text, "Summary" text ) ### Question ### Name the least tied ### Accurate SQL ###
SELECT MIN("Tied") FROM table_20328
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_204_781 ( id number, "name(s)" text, "yard no." number, "type (as built)" text, "owner" text, "imo number" number, "laid down" text, "launched" text, "delivered/\ncommissioned" text, "fate/\ndecommissioned" text, "notes" text ) ### Question ### who is the first owner listed in the top portion of the table ? ### Accurate SQL ###
SELECT "owner" FROM table_204_781 WHERE id = 1
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) TABLE: 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 ) TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: 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 ) ### Question ### give the number of female patients who had liver transplant. ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "LIVER TRANSPLANT"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) TABLE: CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) TABLE: CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) TABLE: CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) TABLE: CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) ### Question ### What are average ages for students living in each city? Return a bar chart, and sort in asc by the total number. ### Accurate SQL ###
SELECT city_code, AVG(Age) FROM Student GROUP BY city_code ORDER BY AVG(Age)
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE farm ( farm_id number, year number, total_horses number, working_horses number, total_cattle number, oxen number, bulls number, cows number, pigs number, sheep_and_goats number ) TABLE: CREATE TABLE city ( city_id number, official_name text, status text, area_km_2 number, population number, census_ranking text ) TABLE: CREATE TABLE competition_record ( competition_id number, farm_id number, rank number ) TABLE: CREATE TABLE farm_competition ( competition_id number, year number, theme text, host_city_id number, hosts text ) ### Question ### What are the maximum and minimum number of cows across all farms. ### Accurate SQL ###
SELECT MAX(cows), MIN(cows) FROM farm
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_23520 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) ### Question ### Name the outcome for wimbledon ### Accurate SQL ###
SELECT "Outcome" FROM table_23520 WHERE "Championship" = 'Wimbledon'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE company ( Company_ID real, Name text, Headquarters text, Industry text, Sales_in_Billion real, Profits_in_Billion real, Assets_in_Billion real, Market_Value_in_Billion real ) TABLE: CREATE TABLE employment ( Company_ID int, People_ID int, Year_working int ) TABLE: CREATE TABLE people ( People_ID int, Age int, Name text, Nationality text, Graduation_College text ) ### Question ### How many companies are there in each headquarters? Return a stacked bar chart to group by industry and headquearters, and count by headquarters. ### Accurate SQL ###
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Industry, Headquarters
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) TABLE: 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 ) TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text ) TABLE: 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 ) TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) TABLE: 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 ) TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text ) TABLE: 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 ) TABLE: 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 ) TABLE: CREATE TABLE PostTags ( PostId number, TagId number ) TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) TABLE: CREATE TABLE VoteTypes ( Id number, Name text ) TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) TABLE: CREATE TABLE PostTypes ( Id number, Name text ) ### Question ### select body from Posts where Tags like '%java%'. ### Accurate SQL ###
SELECT Body FROM Posts WHERE Tags LIKE '%java%'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: 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 ) TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) TABLE: 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 ) TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) TABLE: 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 ) TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text ) TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) TABLE: 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 ) TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) ### Question ### in the first hospital encounter what are the insurance names of patient 15135? ### Accurate SQL ###
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 15135 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_44 ( conf VARCHAR, pos VARCHAR ) ### Question ### What conference did the player with the position of rb play in? ### Accurate SQL ###
SELECT conf FROM table_name_44 WHERE pos = "rb"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_3 (goal_difference INTEGER, wins VARCHAR, draws VARCHAR, goals_against VARCHAR) ### Question ### What is the goal difference when there are fewer than 12 wins, 32 goals against and 8 draws? ### Accurate SQL ###
SELECT SUM(goal_difference) FROM table_name_3 WHERE draws = 8 AND goals_against = 32 AND wins < 12
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_24011830_2 ( world_record VARCHAR ) ### Question ### Name the 26 august 2005 asian record ### Accurate SQL ###
SELECT 26 AS _august_2005 FROM table_24011830_2 WHERE world_record = "Asian record"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) TABLE: 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) ) TABLE: CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) TABLE: CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) TABLE: CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) TABLE: CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) TABLE: CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) ### Question ### For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of hire_date and the average of manager_id bin hire_date by weekday in a bar chart, and I want to order in asc by the y axis. ### Accurate SQL ###
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID)
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_43079 ( "District" text, "Con- gress" text, "Date" text, "Predecessor" text, "Winner" text ) ### Question ### Which congress was held in 2010? ### Accurate SQL ###
SELECT "Con- gress" FROM table_43079 WHERE "Date" = '2010'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_51 ( package_option VARCHAR, television_service VARCHAR ) ### Question ### What package/option has sky arte hd as the television service? ### Accurate SQL ###
SELECT package_option FROM table_name_51 WHERE television_service = "sky arte hd"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_10 (year INTEGER, publication VARCHAR) ### Question ### What is the publication the observer music monthly highest year? ### Accurate SQL ###
SELECT MAX(year) FROM table_name_10 WHERE publication = "the observer music monthly"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_93 (school_club_team VARCHAR, pick VARCHAR) ### Question ### Which team had a pick of 63? ### Accurate SQL ###
SELECT school_club_team FROM table_name_93 WHERE pick = 63
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_34 (class VARCHAR, team VARCHAR) ### Question ### Which class has a Team of kouros racing team? ### Accurate SQL ###
SELECT class FROM table_name_34 WHERE team = "kouros racing team"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) TABLE: 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 ) TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text ) TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) TABLE: 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 ) TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: 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 ) TABLE: 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 ) TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) ### Question ### have patient 5142's heart rate been on last month/02 greater than 119.0? ### Accurate SQL ###
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 = 5142)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') AND chartevents.valuenum > 119.0 AND DATETIME(chartevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') AND STRFTIME('%d', chartevents.charttime) = '02'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_27710 ( "Software" text, "Description" text, "Platform" text, "License" text, "Developer" text ) ### Question ### What is the license that is described as a tool for designing and executing workflows? ### Accurate SQL ###
SELECT "License" FROM table_27710 WHERE "Description" = 'Tool for designing and executing workflows'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_87 ( destination VARCHAR, train_name VARCHAR ) ### Question ### What is the destination of the Garib nwaz exp train? ### Accurate SQL ###
SELECT destination FROM table_name_87 WHERE train_name = "garib nwaz exp"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_63975 ( "Race" text, "Dist (f)" real, "Course" text, "Runners" real, "Placing" real, "Margin" real, "Jockey" text, "Trainer" text ) ### Question ### what is the highest runners when the jockey is frankie dettori and the placing is higher than 1? ### Accurate SQL ###
SELECT MAX("Runners") FROM table_63975 WHERE "Jockey" = 'frankie dettori' AND "Placing" > '1'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE pilot ( Name VARCHAR, Age VARCHAR ) ### Question ### List names of all pilot aged 30 or younger in descending alphabetical order. ### Accurate SQL ###
SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_67 ( score VARCHAR, opponent VARCHAR ) ### Question ### What was the score with the opponent being New Zealand Warriors? ### Accurate SQL ###
SELECT score FROM table_name_67 WHERE opponent = "new zealand warriors"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: 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 ) TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: 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 ) TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Question ### what is admission time of subject name kelly gallardo? ### Accurate SQL ###
SELECT demographic.admittime FROM demographic WHERE demographic.name = "Kelly Gallardo"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: 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 ) TABLE: 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 ) TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Question ### what is the number of patients whose ethnicity is white - russian and procedure long title is dorsal and dorsolumbar fusion of the posterior column, posterior technique? ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND procedures.long_title = "Dorsal and dorsolumbar fusion of the posterior column, posterior technique"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) TABLE: CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) TABLE: CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) TABLE: CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) TABLE: CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) TABLE: CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) ### Question ### What is the booking start dates of the apartments with type code 'Duplex'? Bin the year into weekday interval with a bar chart, show by the y-axis in descending. ### Accurate SQL ###
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex" ORDER BY COUNT(booking_start_date) DESC
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_62 ( first VARCHAR, position VARCHAR, bats VARCHAR ) ### Question ### Which First has a Position of c, and Bats of l? ### Accurate SQL ###
SELECT first FROM table_name_62 WHERE position = "c" AND bats = "l"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_80323 ( "Source" text, "Dates Administered" text, "Terry McAuliffe" text, "Brian Moran" text, "Creigh Deeds" text ) ### Question ### Which Source has a Brian Moran of 19%? ### Accurate SQL ###
SELECT "Source" FROM table_80323 WHERE "Brian Moran" = '19%'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_66 (score VARCHAR, opponent VARCHAR) ### Question ### What was the score against fabrice martin? ### Accurate SQL ###
SELECT score FROM table_name_66 WHERE opponent = "fabrice martin"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_49 ( position_in_table VARCHAR, outgoing_manager VARCHAR ) ### Question ### How was Sammy Lee's team doing on the table before being replaced? ### Accurate SQL ###
SELECT position_in_table FROM table_name_49 WHERE outgoing_manager = "sammy lee"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_58652 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text ) ### Question ### What is the score when the set 3 is 26 28? ### Accurate SQL ###
SELECT "Score" FROM table_58652 WHERE "Set 3" = '26–28'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_93 (rank VARCHAR, nation VARCHAR, silver VARCHAR, gold VARCHAR) ### Question ### What rank is Turkmenistan, who had 0 silver's and Less than 2 golds? ### Accurate SQL ###
SELECT rank FROM table_name_93 WHERE silver = 0 AND gold < 2 AND nation = "turkmenistan"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_34 (country VARCHAR, icao VARCHAR) ### Question ### Which country is Lemd the ICAO of? ### Accurate SQL ###
SELECT country FROM table_name_34 WHERE icao = "lemd"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_75981 ( "Position" text, "Jersey #" real, "Name" text, "Height (cm)" real, "Weight (kg)" real, "Birthdate" text, "Birthplace" text, "2007\u20132008 Team" text, "NHL rights, if any" text ) ### Question ### Which Weight (kg) has a NHL rights, if any of phoenix coyotes? ### Accurate SQL ###
SELECT COUNT("Weight (kg)") FROM table_75981 WHERE "NHL rights, if any" = 'phoenix coyotes'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: 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 ) TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) TABLE: 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 ) ### Question ### what is the gender and primary disease of patient name michael witt? ### Accurate SQL ###
SELECT demographic.gender, demographic.diagnosis FROM demographic WHERE demographic.name = "Michael Witt"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_64253 ( "Country" text, "Airport" text, "City" text, "2012" real, "Change (12/11)" text ) ### Question ### When the city is agadir what is the change (12/11)? ### Accurate SQL ###
SELECT "Change (12/11)" FROM table_64253 WHERE "City" = 'agadir'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_46651 ( "Draw" real, "Song" text, "Performer" text, "Televotes" real, "Rank" real ) ### Question ### WHich Televotes has a Performer of biljana dodeva, and a Draw larger than 10? ### Accurate SQL ###
SELECT MIN("Televotes") FROM table_46651 WHERE "Performer" = 'biljana dodeva' AND "Draw" > '10'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_86 ( interview INTEGER, state VARCHAR, average VARCHAR ) ### Question ### What is the lowest interview of Texas, with an average larger than 9.531? ### Accurate SQL ###
SELECT MIN(interview) FROM table_name_86 WHERE state = "texas" AND average > 9.531
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_9257 ( "Season" real, "Conference" text, "Champion" text, "Format" text, "Series" text, "Runner-Up" text ) ### Question ### What format has conference iii as the conference? ### Accurate SQL ###
SELECT "Format" FROM table_9257 WHERE "Conference" = 'conference iii'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: 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 ) TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) TABLE: 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 ) ### Question ### give me the number of patients whose diagnoses long title is carcinoma in situ of lip, oral cavity, and pharynx and lab test abnormal status is delta? ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Carcinoma in situ of lip, oral cavity, and pharynx" AND lab.flag = "delta"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_11023 ( "Country" text, "Alternate title/Translation" text, "TV network(s)" text, "Series premiere" text, "Weekly schedule" text ) ### Question ### What is the alternate title/translation of the series that premiered on December 12, 2006? ### Accurate SQL ###
SELECT "Alternate title/Translation" FROM table_11023 WHERE "Series premiere" = 'december 12, 2006'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_22815568_3 ( status VARCHAR, poverty_rate VARCHAR ) ### Question ### What is the status for all the counties that have a poverty rate of 36.6%? ### Accurate SQL ###
SELECT status FROM table_22815568_3 WHERE poverty_rate = "36.6%"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_35177 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) ### Question ### When was the game before week 15 with the result of bye? ### Accurate SQL ###
SELECT "Date" FROM table_35177 WHERE "Week" < '15' AND "Result" = 'bye'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_47761 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) ### Question ### On what Week was the Result W 34 24? ### Accurate SQL ###
SELECT AVG("Week") FROM table_47761 WHERE "Result" = 'w 34–24'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_12284476_8 (alloy VARCHAR, series VARCHAR) ### Question ### what's the alloy with series being ii series ### Accurate SQL ###
SELECT alloy FROM table_12284476_8 WHERE series = "II series"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_48 ( trailers VARCHAR, year VARCHAR, builder VARCHAR ) ### Question ### I want the trailers for 1931 and builder of mccw ### Accurate SQL ###
SELECT trailers FROM table_name_48 WHERE year = "1931" AND builder = "mccw"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_22 ( name VARCHAR, goals VARCHAR, apps VARCHAR, assists VARCHAR, position VARCHAR ) ### Question ### What is the name of the player with more than 0 assists, a position of forward, 19 goals, and more than 84 apps? ### Accurate SQL ###
SELECT name FROM table_name_22 WHERE assists > 0 AND position = "forward" AND apps > 84 AND goals = 19
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_17115950_2 ( date_of_vacancy VARCHAR, replaced_by VARCHAR ) ### Question ### What was the date of vacancy when Viorel Moldovan replaced a manager? ### Accurate SQL ###
SELECT date_of_vacancy FROM table_17115950_2 WHERE replaced_by = "Viorel Moldovan"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_67246 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" real ) ### Question ### What is the lowest lane with Lorenzo Vismara and a time higher than 49.67? ### Accurate SQL ###
SELECT MIN("Lane") FROM table_67246 WHERE "Name" = 'lorenzo vismara' AND "Time" > '49.67'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_87 ( set_1 VARCHAR, date VARCHAR, set_4 VARCHAR ) ### Question ### What is Set 1, when Date is Jun 26, and when Set 4 is 26-24? ### Accurate SQL ###
SELECT set_1 FROM table_name_87 WHERE date = "jun 26" AND set_4 = "26-24"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_199666_1 (wireless_lan VARCHAR, process_technology VARCHAR, centrino VARCHAR) ### Question ### What Wireless LAN had a process technology of 90nm and a Carmel centrino? ### Accurate SQL ###
SELECT wireless_lan FROM table_199666_1 WHERE process_technology = "90nm" AND centrino = "Carmel"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_59 (attendance INTEGER, date VARCHAR, game VARCHAR) ### Question ### what is the attendance on the date of october 16 and the game is more than 5? ### Accurate SQL ###
SELECT SUM(attendance) FROM table_name_59 WHERE date = "october 16" AND game > 5
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_68 ( year INTEGER, sport VARCHAR, first VARCHAR ) ### Question ### Name the sum of year for swimming and first of mike ### Accurate SQL ###
SELECT SUM(year) FROM table_name_68 WHERE sport = "swimming" AND first = "mike"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) TABLE: CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) ### Question ### What is the number of locations of the wrestlers? Visualize by a bar chart, order in asc by the y axis. ### Accurate SQL ###
SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location ORDER BY COUNT(Location)
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_21 ( torque VARCHAR, power VARCHAR ) ### Question ### What Torque has a Power of HP (KW)? ### Accurate SQL ###
SELECT torque FROM table_name_21 WHERE power = "hp (kw)"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_27611593_5 (year INTEGER) ### Question ### When did the earliest tournament happened? ### Accurate SQL ###
SELECT MIN(year) FROM table_27611593_5
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_dev_56 ( "id" int, "anemia" bool, "gender" string, "white_blood_cell_count_wbc" int, "hemoglobinopathy" bool, "major_hematological_conditions" bool, "laboratory_abnormality" bool, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "hematocrit_hct" float, "platelet_count" float, "hemoglobin_concentration" float, "serum_creatinine" float, "age" float, "NOUSE" float ) ### Question ### patients of either sex 18 _ 85 years of age ### Accurate SQL ###
SELECT * FROM table_dev_56 WHERE age >= 18 AND age <= 85
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_203_734 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) ### Question ### what competition is lorenzo 's top position in ? ### Accurate SQL ###
SELECT "competition" FROM table_203_734 ORDER BY "position" LIMIT 1
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_14 ( Id VARCHAR ) ### Question ### What is the categorization in 2009 when it was 2R in 2008 and 2011? ### Accurate SQL ###
SELECT 2009 FROM table_name_14 WHERE 2008 = "2r" AND 2011 = "2r"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE airport_aircraft ( ID int, Airport_ID int, Aircraft_ID int ) TABLE: CREATE TABLE pilot ( Pilot_Id int(11), Name varchar(50), Age int(11) ) TABLE: CREATE TABLE match ( Round real, Location text, Country text, Date text, Fastest_Qualifying text, Winning_Pilot text, Winning_Aircraft text ) TABLE: CREATE TABLE airport ( Airport_ID int, Airport_Name text, Total_Passengers real, %_Change_2007 text, International_Passengers real, Domestic_Passengers real, Transit_Passengers real, Aircraft_Movements real, Freight_Metric_Tonnes real ) TABLE: CREATE TABLE aircraft ( Aircraft_ID int(11), Aircraft varchar(50), Description varchar(50), Max_Gross_Weight varchar(50), Total_disk_area varchar(50), Max_disk_Loading varchar(50) ) ### Question ### What are the descriptions for the aircrafts, and count them by a bar chart ### Accurate SQL ###
SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_23293785_3 (race_total_pts_ INTEGER, country VARCHAR) ### Question ### How many racing points did England get? ### Accurate SQL ###
SELECT MAX(race_total_pts_) FROM table_23293785_3 WHERE country = "England"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE VoteTypes ( Id number, Name text ) TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) TABLE: CREATE TABLE PostTypes ( Id number, Name text ) TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text ) TABLE: 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 ) TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) TABLE: 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 ) TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) TABLE: 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 ) TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostTags ( PostId number, TagId number ) TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) TABLE: 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 ) TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) TABLE: 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 ) TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) ### Question ### Top VBA/Excel Nerds - all - for the last 30 days. ### Accurate SQL ###
SELECT CAST(a.CreationDate AS DATE) AS PostDate, a.OwnerUserId AS "user_link", COUNT(a.Id) AS aNumPosts, SUM(a.Score) AS aScore, SUM(LEN(Body) - LEN(REPLACE(Body, ' ', '')) + 1) AS Words FROM PostTags AS pt LEFT JOIN Tags AS t ON t.Id = pt.TagId LEFT JOIN Posts AS a ON pt.PostId IN (a.Id, a.ParentId) WHERE pt.TagId IN (522, 1449, 8685, 12898, 13591, 14948, 16957, 39812, 69647, 85546, 114597) AND a.CreationDate >= DATEADD(day, -30, GETDATE()) GROUP BY a.OwnerUserId, CAST(a.CreationDate AS DATE) ORDER BY CAST(a.CreationDate AS DATE)
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: 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 ) TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: 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 ) TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Question ### For patient id 4589, specify the icd9 code along with diagnosis short title. ### Accurate SQL ###
SELECT diagnoses.icd9_code, diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "4589"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_dev_38 ( "id" int, "gender" string, "serum_potassium" float, "systolic_blood_pressure_sbp" int, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "diastolic_blood_pressure_dbp" int, "ace_inhibitors" bool, "serum_creatinine" float, "kidney_disease" bool, "NOUSE" float ) ### Question ### have a serum creatinine greater than or equal to 1.5 milligrams / deciliter ( mg / dl ) ( male ) or greater than or equal to 1.4 mg / dl ( female ) , or a creatinine clearance less than 60 milliliters / minute ( ml / minute ) ### Accurate SQL ###
SELECT * FROM table_dev_38 WHERE (serum_creatinine >= 1.5 AND gender = 'male') OR (serum_creatinine >= 1.4 AND gender = 'female') OR creatinine_clearance_cl < 60
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_2182170_1 (crew_chief VARCHAR, listed_owner_s_ VARCHAR) ### Question ### Who is Wayne Day's crew chief? ### Accurate SQL ###
SELECT crew_chief FROM table_2182170_1 WHERE listed_owner_s_ = "Wayne Day"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_52185 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) ### Question ### I want the greatest attendance when the opponent is the chicago bears ### Accurate SQL ###
SELECT MAX("Attendance") FROM table_52185 WHERE "Opponent" = 'chicago bears'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_39 (result VARCHAR, opponent VARCHAR) ### Question ### what is the result when the opponent is blackburn rovers? ### Accurate SQL ###
SELECT result FROM table_name_39 WHERE opponent = "blackburn rovers"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_42315 ( "Country" text, "Automobile Name" text, "Manufacturer" text, "Engine Make/Capacity" text, "Year" text ) ### Question ### What is the name of the car manufactured by Letecke Zavody N.P., Jinonice? ### Accurate SQL ###
SELECT "Automobile Name" FROM table_42315 WHERE "Manufacturer" = 'letecke zavody n.p., jinonice'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) TABLE: 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 ) TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text ) TABLE: 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 ) TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) TABLE: 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 ) TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: 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 ) TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) ### Question ### when was patient 89202's last procedure time for opn/oth rep mtrl vlv-tis until 3 years ago? ### Accurate SQL ###
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'opn/oth rep mtrl vlv-tis') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 89202) AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY procedures_icd.charttime DESC LIMIT 1
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) TABLE: CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar ) TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int ) TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) TABLE: CREATE TABLE days ( days_code varchar, day_name varchar ) TABLE: CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) TABLE: CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) TABLE: CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) TABLE: CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int ) TABLE: CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) TABLE: CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) TABLE: CREATE TABLE code_description ( code varchar, description text ) TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) TABLE: 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 ) TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) TABLE: CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) TABLE: CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar ) TABLE: CREATE TABLE month ( month_number int, month_name text ) TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text ) TABLE: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) ### Question ### what is the aircraft type with the greatest seating capacity ### Accurate SQL ###
SELECT DISTINCT aircraft_code FROM aircraft WHERE capacity = (SELECT MAX(AIRCRAFTalias1.capacity) FROM aircraft AS AIRCRAFTalias1)
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_94 ( record VARCHAR, time VARCHAR ) ### Question ### Which record has 4:14 as the time? ### Accurate SQL ###
SELECT record FROM table_name_94 WHERE time = "4:14"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_64 ( gfr_2006 INTEGER, whites_as__percentage_of_pop VARCHAR, tfr_2006 VARCHAR ) ### Question ### What is the lowest total GFR that has 95.80% of the population as Whites, and a TFR total larger than 2.14, in 2006? ### Accurate SQL ###
SELECT MIN(gfr_2006) FROM table_name_64 WHERE whites_as__percentage_of_pop = "95.80%" AND tfr_2006 > 2.14
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_78 ( points INTEGER, year VARCHAR, wins VARCHAR ) ### Question ### Which Points have a Year larger than 1966, and Wins larger than 1? ### Accurate SQL ###
SELECT AVG(points) FROM table_name_78 WHERE year > 1966 AND wins > 1
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_96 ( rank INTEGER, country VARCHAR ) ### Question ### What is the rank for China? ### Accurate SQL ###
SELECT SUM(rank) FROM table_name_96 WHERE country = "china"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_2583036_1 ( exposures VARCHAR, total_exposure_time VARCHAR ) ### Question ### how many exposures where there when the total exposure time is 105,000s? ### Accurate SQL ###
SELECT exposures FROM table_2583036_1 WHERE total_exposure_time = "105,000s"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_11404452_1 ( original_air_date VARCHAR, us_viewers__millions_ VARCHAR ) ### Question ### What is the original air date when there were 12.81 million u.s viewers? ### Accurate SQL ###
SELECT original_air_date FROM table_11404452_1 WHERE us_viewers__millions_ = "12.81"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_99 ( record VARCHAR, loss VARCHAR ) ### Question ### Loss of finley (8-7) had what record? ### Accurate SQL ###
SELECT record FROM table_name_99 WHERE loss = "finley (8-7)"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_3623 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) ### Question ### When was someone first elected in the district with incumbent john smith? ### Accurate SQL ###
SELECT "First elected" FROM table_3623 WHERE "Incumbent" = 'John Smith'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_169693_1 ( age_40_49 INTEGER ) ### Question ### Name the least age 40-49 ### Accurate SQL ###
SELECT MIN(age_40_49) FROM table_169693_1
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: 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 ) TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) TABLE: 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 ) TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text ) TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) TABLE: 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 ) TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: 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 ) TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) ### Question ### tell me the birth date of patient 366? ### Accurate SQL ###
SELECT patients.dob FROM patients WHERE patients.subject_id = 366
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_203_195 ( id number, "pump type and source" text, "typical use" text, "35 \u00b0c\n(e.g. heated screed floor)" number, "45 \u00b0c\n(e.g. heated screed floor)" number, "55 \u00b0c\n(e.g. heated timber floor)" number, "65 \u00b0c\n(e.g. radiator or dhw)" number, "75 \u00b0c\n(e.g. radiator and dhw)" number, "85 \u00b0c\n(e.g. radiator and dhw)" number ) ### Question ### how many pump types have no typical use listed ? ### Accurate SQL ###
SELECT COUNT("pump type and source") FROM table_203_195 WHERE "typical use" IS NULL
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_85 ( score VARCHAR, home VARCHAR, record VARCHAR ) ### Question ### Name the score for detroit home and record of 33-18-9 ### Accurate SQL ###
SELECT score FROM table_name_85 WHERE home = "detroit" AND record = "33-18-9"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_42120 ( "City" text, "State" text, "AAM Accredited" text, "AAM Member" text, "ASTC Member" text ) ### Question ### What is ASTC Member, when State is Arkansas, when AAM Member is No, and when AAM Accredited is Yes? ### Accurate SQL ###
SELECT "ASTC Member" FROM table_42120 WHERE "State" = 'arkansas' AND "AAM Member" = 'no' AND "AAM Accredited" = 'yes'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) TABLE: CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) TABLE: CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) TABLE: CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) TABLE: CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) TABLE: CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) ### Question ### Show the number of the facility codes of apartments with more than 4 bedrooms, and could you show by the Y in asc? ### Accurate SQL ###
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code)
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_38711 ( "Task No." real, "Date given" text, "Head of Household" text, "Hand Grenade User" text, "Hand Grenade Recipient" text ) ### Question ### What date was Rica head of household? ### Accurate SQL ###
SELECT "Date given" FROM table_38711 WHERE "Head of Household" = 'rica'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_87 (name__wade_giles_ VARCHAR, characters VARCHAR) ### Question ### What's the name that has the characters 廣亨? ### Accurate SQL ###
SELECT name__wade_giles_ FROM table_name_87 WHERE characters = "廣亨"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_25 ( report VARCHAR, date VARCHAR ) ### Question ### What report happened on 22 september? ### Accurate SQL ###
SELECT report FROM table_name_25 WHERE date = "22 september"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) TABLE: 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 ) TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) TABLE: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) ### Question ### calculate the number of patients who were tested for urine, voided specimen microbiology since 2104. ### Accurate SQL ###
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'urine, voided specimen' AND STRFTIME('%y', microlab.culturetakentime) >= '2104')
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE savings ( custid number, balance number ) TABLE: CREATE TABLE checking ( custid number, balance number ) TABLE: CREATE TABLE accounts ( custid number, name text ) ### Question ### Find the total saving balance for each account name. ### Accurate SQL ###
SELECT SUM(T2.balance), T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_18946749_4 ( elevation__m_ INTEGER, peak VARCHAR ) ### Question ### What is the lowest elevation(m) for the peak Mount Taylor? ### Accurate SQL ###
SELECT MIN(elevation__m_) FROM table_18946749_4 WHERE peak = "Mount Taylor"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_5 (wins INTEGER, draws INTEGER) ### Question ### How many wins were there when draws were more than 0? ### Accurate SQL ###
SELECT MIN(wins) FROM table_name_5 WHERE draws > 0