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_name_96 ( home_team VARCHAR, away_team VARCHAR ) ### Question ### Who is the home team of the game against Essendon? ### Accurate SQL ###
SELECT home_team FROM table_name_96 WHERE away_team = "essendon"
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_64053 ( "Rank\u2003" real, "Largest U.S. City\u2003" text, "Total" real, "Partners\u2003" real, "Other" real ) ### Question ### What is the smallest rank for the city having partners of 342, other under 147, and largest city of Cleveland? ### Accurate SQL ###
SELECT MIN("Rank\u2003") FROM table_64053 WHERE "Partners\u2003" = '342' AND "Largest U.S. City\u2003" = 'cleveland' AND "Other" < '147'
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) TABLE: CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 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 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 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) ) ### Question ### For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about manager_id over the last_name , show Y in descending order. ### Accurate SQL ###
SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID 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_70 (opponent VARCHAR, date VARCHAR) ### Question ### Which Opponent is on 29 september 1997? ### Accurate SQL ###
SELECT opponent FROM table_name_70 WHERE date = "29 september 1997"
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_59655 ( "Year recorded" text, "Title" text, "Genre" text, "Label" text, "Year inducted" text ) ### Question ### What label is 'weather bird' under? ### Accurate SQL ###
SELECT "Label" FROM table_59655 WHERE "Title" = 'weather bird'
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 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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Question ### what is the number of patients whose primary disease is complete heart block and year of death is less than or equal to 2138? ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND demographic.dod_year <= "2138.0"
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_41061 ( "Date" text, "Title" text, "Director" text, "Production Cost" text, "Singapore Gross" text ) ### Question ### When was the film directed by Pen-Ek Ratanaruang released? ### Accurate SQL ###
SELECT "Date" FROM table_41061 WHERE "Director" = 'pen-ek ratanaruang'
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 comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) TABLE: CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) TABLE: CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) TABLE: CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) TABLE: CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) TABLE: CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) TABLE: CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) TABLE: CREATE TABLE gsi ( course_offering_id int, student_id int ) TABLE: CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) TABLE: CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) TABLE: CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) TABLE: CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) TABLE: CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) TABLE: CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) TABLE: CREATE TABLE semester ( semester_id int, semester varchar, year int ) TABLE: CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) TABLE: CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) TABLE: CREATE TABLE area ( course_id int, area varchar ) ### Question ### When was the last SURVMETH 745 course offered ? ### Accurate SQL ###
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'SURVMETH' AND course.number = 745 AND semester.semester_id = course_offering.semester ORDER BY semester.year 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 table_name_63 (points VARCHAR, chassis VARCHAR, year VARCHAR) ### Question ### What is the number of points when there was a BMW 269 F2 chassis earlier than 1969? ### Accurate SQL ###
SELECT COUNT(points) FROM table_name_63 WHERE chassis = "bmw 269 f2" AND year < 1969
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_1341672_14 ( first_elected VARCHAR, incumbent VARCHAR ) ### Question ### Name the number of first elected for phil crane ### Accurate SQL ###
SELECT COUNT(first_elected) FROM table_1341672_14 WHERE incumbent = "Phil Crane"
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_3526 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text ) ### Question ### What was the results for top 12? ### Accurate SQL ###
SELECT "Result" FROM table_3526 WHERE "Week #" = 'Top 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_name_92 ( date VARCHAR, jurisdiction VARCHAR ) ### Question ### Name the date for oregon jurisdiction ### Accurate SQL ###
SELECT date FROM table_name_92 WHERE jurisdiction = "oregon"
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 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 ) TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Question ### Find the number of patients who died and had a drug code of zosy4fpb. ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.formulary_drug_cd = "ZOSY4FPB"
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_27 (route VARCHAR, winner VARCHAR) ### Question ### Name the route with winner of sébastien rosseler ### Accurate SQL ###
SELECT route FROM table_name_27 WHERE winner = "sébastien rosseler"
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_36 ( frequency_mhz INTEGER, erp_w VARCHAR ) ### Question ### Which Frequency MHz has a ERP W of 250? ### Accurate SQL ###
SELECT MAX(frequency_mhz) FROM table_name_36 WHERE erp_w = 250
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_70 ( date VARCHAR, sport VARCHAR ) ### Question ### Which date had a sport of Academics? ### Accurate SQL ###
SELECT date FROM table_name_70 WHERE sport = "academics"
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 (to_par VARCHAR, player VARCHAR) ### Question ### what is the to par for retief goosen? ### Accurate SQL ###
SELECT to_par FROM table_name_93 WHERE player = "retief goosen"
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_1166259_1 ( points VARCHAR, lost VARCHAR ) ### Question ### How many points are there when the lost is 26? ### Accurate SQL ###
SELECT points FROM table_1166259_1 WHERE lost = 26
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 furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real ) TABLE: CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) TABLE: CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) ### Question ### Visualize names and market shares of furnitures which no any company is producing in our records by a pie chart. ### Accurate SQL ###
SELECT Name, Market_Rate FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte)
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 ( margin_of_victory VARCHAR, winning_score VARCHAR ) ### Question ### What was the margin of victory when the winning score was 14 (70-68-67=205)? ### Accurate SQL ###
SELECT margin_of_victory FROM table_name_59 WHERE winning_score = –14(70 - 68 - 67 = 205)
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 ( division_record VARCHAR, school VARCHAR ) ### Question ### What is the division record for Woodbridge? ### Accurate SQL ###
SELECT division_record FROM table_name_78 WHERE school = "woodbridge"
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_55 ( team VARCHAR, winner VARCHAR ) ### Question ### What is the team of winner Dick Johnson? ### Accurate SQL ###
SELECT team FROM table_name_55 WHERE winner = "dick johnson"
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 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 ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment 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 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId 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 PostTags ( PostId number, TagId number ) TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description 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 ReviewTaskTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostTypes ( Id number, Name text ) 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 PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text ) TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) 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 ) TABLE: CREATE TABLE VoteTypes ( Id number, Name text ) TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) ### Question ### Top 100 Reputation in Iran. ### Accurate SQL ###
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Iran%' ORDER BY Reputation DESC LIMIT 1000
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 journal ( Journal_ID int, Date text, Theme text, Sales int ) TABLE: CREATE TABLE editor ( Editor_ID int, Name text, Age real ) TABLE: CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) ### Question ### Display a bar chart for the names and the ages of editors, list by the bar from low to high. ### Accurate SQL ###
SELECT Name, Age FROM editor ORDER BY 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_name_49 (result VARCHAR, opponent VARCHAR) ### Question ### What was the result of the game against the Los Angeles Dons? ### Accurate SQL ###
SELECT result FROM table_name_49 WHERE opponent = "los angeles dons"
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_13156 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text ) ### Question ### What's the status for an against below 22 with an opposing team of Australia? ### Accurate SQL ###
SELECT "Status" FROM table_13156 WHERE "Against" < '22' AND "Opposing Teams" = 'australia'
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_1756284_1 (bush_number INTEGER) ### Question ### What was the highest vote number for Bush? ### Accurate SQL ###
SELECT MAX(bush_number) FROM table_1756284_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 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 flight_leg ( flight_id int, leg_number int, leg_flight int ) TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int ) 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 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 code_description ( code varchar, description text ) TABLE: CREATE TABLE days ( days_code varchar, day_name varchar ) 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 city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) TABLE: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int ) TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) TABLE: CREATE TABLE month ( month_number int, month_name text ) TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) TABLE: CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text ) 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 ( 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 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 food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) ### Question ### list the total number of flights to all airports by DL ### Accurate SQL ###
SELECT COUNT(DISTINCT flight_id) FROM flight WHERE airline_code = 'DL'
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_11153 ( "State" text, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real ) ### Question ### What is the total number of interview scores that have an evening gown score of 9.543 and an average that is bigger than 9.521? ### Accurate SQL ###
SELECT SUM("Interview") FROM table_11153 WHERE "Evening Gown" = '9.543' AND "Average" > '9.521'
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 happy_hour ( MONTH VARCHAR ) ### Question ### Which month has the most happy hours? ### Accurate SQL ###
SELECT MONTH FROM happy_hour GROUP BY MONTH ORDER BY COUNT(*) 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 table_name_1 (points INTEGER, games VARCHAR, pts_game VARCHAR, nation VARCHAR) ### Question ### Can you tell me the average Points that has a Pts/game larger than 4, and the Nation of england, and the Games smaller than 5? ### Accurate SQL ###
SELECT AVG(points) FROM table_name_1 WHERE pts_game > 4 AND nation = "england" AND games < 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_29436238_1 (original_air_date VARCHAR, no_in_season VARCHAR) ### Question ### What date did episode 4 in the season originally air? ### Accurate SQL ###
SELECT original_air_date FROM table_29436238_1 WHERE no_in_season = 4
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 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) 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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) ### Question ### in 2105, what are the top three most frequent treatments that patients were given in the same month after the diagnosis of post spinal surgery - thoracic? ### Accurate SQL ###
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'post spinal surgery - thoracic' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmentname, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', treatment.treatmenttime) = '2105') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.treatmenttime AND DATETIME(t1.diagnosistime, 'start of month') = DATETIME(t2.treatmenttime, 'start of month') GROUP BY t2.treatmentname) AS t3 WHERE t3.c1 <= 3
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_65275 ( "Manufacturer" text, "Model" text, "Transmission" text, "Engine Capacity" real, "Fuel Type" text, "L/100km Urban (Cold)" real, "L/100km Extra-Urban" real, "L/100km Combined" real, "mpg-UK Urban (Cold)" real, "mpg-UK Extra-Urban" real, "mpg-UK Combined" real, "mpg-US Urban" real, "mpg-US Extra-Urban" real, "mpg-US Combined" real, "CO 2 g/km" real, "Green Rating" text ) ### Question ### What is the total engine capacity of the a4 transmission, which has an urban mpg-US greater than 19, an mpg-us extra-urban greater than 38.6, and an aveo model? ### Accurate SQL ###
SELECT COUNT("Engine Capacity") FROM table_65275 WHERE "Transmission" = 'a4' AND "mpg-US Urban" > '19' AND "mpg-US Extra-Urban" > '38.6' AND "Model" = 'aveo'
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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime 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 ) ### Question ### in 03/2105, what was the last lab test time for patient 011-53628? ### Accurate SQL ###
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-53628')) AND STRFTIME('%y-%m', lab.labresulttime) = '2105-03' ORDER BY lab.labresulttime 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 Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) TABLE: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) ### Question ### For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of headquarter and the amount of headquarter , and group by attribute headquarter, display by the X from low to high please. ### Accurate SQL ###
SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
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 actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) TABLE: CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) ### Question ### Give me a histogram for how many musicals has each nominee been nominated for?, and display from low to high by the x axis. ### Accurate SQL ###
SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY Nominee
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_train_168 ( "id" int, "cholesterol" float, "hemoglobin_a1c_hba1c" float, "triglyceride_tg" float, "fasting_glucose" int, "NOUSE" float ) ### Question ### documented hemoglobin a1c ( hba1c ) < 7.5 % at time of entry ### Accurate SQL ###
SELECT * FROM table_train_168 WHERE hemoglobin_a1c_hba1c < 7.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_62 (position VARCHAR, round VARCHAR, team VARCHAR) ### Question ### What was the position of the team Minneapolis Lakers during round T? ### Accurate SQL ###
SELECT position FROM table_name_62 WHERE round = "t" AND team = "minneapolis lakers"
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_80 ( diameter VARCHAR, €_equiv VARCHAR ) ### Question ### What is the diameter of the coin with a equivalence of 0.60? ### Accurate SQL ###
SELECT diameter FROM table_name_80 WHERE €_equiv = "0.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_name_59 ( wins INTEGER, club VARCHAR, goals_for VARCHAR ) ### Question ### Which average wins have a Club of barcelona atl tic, and Goals for larger than 56? ### Accurate SQL ###
SELECT AVG(wins) FROM table_name_59 WHERE club = "barcelona atlètic" AND goals_for > 56
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 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 ) TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Question ### how many patients whose lab test name is magnesium? ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Magnesium"
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_11677100_12 ( school VARCHAR, position VARCHAR ) ### Question ### What school did the catcher attend? ### Accurate SQL ###
SELECT school FROM table_11677100_12 WHERE position = "Catcher"
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_52726 ( "Finished" text, "Post" real, "Horse" text, "Jockey" text, "Trainer" text, "Odds" real ) ### Question ### What horse for jara? ### Accurate SQL ###
SELECT "Horse" FROM table_52726 WHERE "Jockey" = 'jara'
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_12995531_3 ( episode_number INTEGER, total_viewers VARCHAR ) ### Question ### what is the episode number where the total viewers is 614000? ### Accurate SQL ###
SELECT MIN(episode_number) FROM table_12995531_3 WHERE total_viewers = 614000
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_510 ( id number, "township" text, "fips" number, "population\ncenter" text, "population" number, "population\ndensity\n(/mi2)" number, "population\ndensity\n(/km2)" number, "land area\n(mi2)" number, "land area\n(km2)" number, "water area\n(mi2)" number, "water area\n(km2)" number, "geographic coordinates" text ) ### Question ### how many townships in pope county , arkansas have populations of more than 1000 ? ### Accurate SQL ###
SELECT COUNT("township") FROM table_203_510 WHERE "population" > 1000
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_53139 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Driver" text, "Rounds" text ) ### Question ### kenneth mcalpine drove from which entrant? ### Accurate SQL ###
SELECT "Entrant" FROM table_53139 WHERE "Driver" = 'kenneth mcalpine'
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_19474 ( "Date Released" text, "Polling institute" text, "Socialist" text, "Social Democratic" text, "Peoples Party" text, "Green-Communist" text, "Left Bloc" text, "Lead" text ) ### Question ### What percentages of social democratic correspond to a 5.5% left bloc? ### Accurate SQL ###
SELECT "Social Democratic" FROM table_19474 WHERE "Left Bloc" = '5.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 gas_station ( station_id number, open_year number, location text, manager_name text, vice_manager_name text, representative_name text ) TABLE: CREATE TABLE station_company ( station_id number, company_id number, rank_of_the_year number ) TABLE: CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, sales_billion number, profits_billion number, assets_billion number, market_value number ) ### Question ### Show headquarters with at least two companies in the banking industry. ### Accurate SQL ###
SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING COUNT(*) >= 2
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 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 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) ) ### Question ### Plot salary by grouped by email as a bar graph, and order in desc by the X please. ### Accurate SQL ###
SELECT EMAIL, SALARY FROM employees ORDER BY EMAIL 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_12181 ( "Draft" text, "Round" text, "Pick" text, "Nationality" text, "Position" text, "College/High School/Club" text ) ### Question ### What is the nationality of the person drafted to Position F from Kentucky State? ### Accurate SQL ###
SELECT "Nationality" FROM table_12181 WHERE "Position" = 'f' AND "College/High School/Club" = 'kentucky state'
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 Player ( pName VARCHAR, HS INTEGER ) ### Question ### What are the names of players whose training hours is between 500 and 1500? ### Accurate SQL ###
SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500
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_81 (attribute VARCHAR, category VARCHAR, type VARCHAR) ### Question ### Name the attribute for mutation and domcharacterdatamodified ### Accurate SQL ###
SELECT attribute FROM table_name_81 WHERE category = "mutation" AND type = "domcharacterdatamodified"
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 ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) TABLE: CREATE TABLE documents_to_be_destroyed ( document_id number, destruction_authorised_by_employee_id number, destroyed_by_employee_id number, planned_destruction_date time, actual_destruction_date time, other_details text ) TABLE: CREATE TABLE roles ( role_code text, role_name text, role_description text ) TABLE: CREATE TABLE all_documents ( document_id number, date_stored time, document_type_code text, document_name text, document_description text, other_details text ) TABLE: CREATE TABLE ref_calendar ( calendar_date time, day_number number ) TABLE: CREATE TABLE employees ( employee_id number, role_code text, employee_name text, gender_mfu text, date_of_birth time, other_details text ) TABLE: CREATE TABLE document_locations ( document_id number, location_code text, date_in_location_from time, date_in_locaton_to time ) TABLE: CREATE TABLE ref_locations ( location_code text, location_name text, location_description text ) ### Question ### What is the location code for the country 'Canada'? ### Accurate SQL ###
SELECT location_code FROM ref_locations WHERE location_name = "Canada"
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 (tournament VARCHAR, score VARCHAR, date VARCHAR) ### Question ### What is the tournament with a w/o score on November 5, 2007? ### Accurate SQL ###
SELECT tournament FROM table_name_62 WHERE score = "w/o" AND date = "november 5, 2007"
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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense 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 PostTags ( PostId number, TagId 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 PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) TABLE: CREATE TABLE VoteTypes ( Id number, Name text ) TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment 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 ReviewTaskStates ( 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) 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 ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) 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 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostTypes ( Id number, Name text ) 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 PostHistoryTypes ( Id number, Name text ) ### Question ### SELECT * FROM posts LIMIT 10. ### Accurate SQL ###
SELECT * FROM Posts LIMIT 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_12165135_1 ( overall_pick__number INTEGER, afl_team VARCHAR ) ### Question ### What is the largest pick number of the new york jets? ### Accurate SQL ###
SELECT MAX(overall_pick__number) FROM table_12165135_1 WHERE afl_team = "New York Jets"
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_57472 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) ### Question ### Where did South Melbourne play? ### Accurate SQL ###
SELECT "Venue" FROM table_57472 WHERE "Away team" = 'south melbourne'
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_36085 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text ) ### Question ### What is the 1st leg for Instituto? ### Accurate SQL ###
SELECT "1st Leg" FROM table_36085 WHERE "Home (2nd leg)" = 'instituto'
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_25818630_2 ( loss_gain VARCHAR, affiliation VARCHAR ) ### Question ### What was the loss/gain when the affiliation was solidarity? ### Accurate SQL ###
SELECT loss_gain FROM table_25818630_2 WHERE affiliation = "Solidarity"
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_47 (tournament VARCHAR, finalist VARCHAR) ### Question ### WHich Tournament has a Finalist of marat safin (12)? ### Accurate SQL ###
SELECT tournament FROM table_name_47 WHERE finalist = "marat safin (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_4703 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) ### Question ### Which Home team scored 6.11 (47)? ### Accurate SQL ###
SELECT "Away team" FROM table_4703 WHERE "Home team score" = '6.11 (47)'
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_373 ( id number, "wager" text, "winner" text, "loser" text, "location" text, "date" text ) ### Question ### other wrestler to win a match in cuernavaca besides mocho cota ### Accurate SQL ###
SELECT "winner" FROM table_204_373 WHERE "location" = 'cuernavaca' AND "winner" <> 'mocho cota'
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 ( record VARCHAR, date VARCHAR ) ### Question ### WHAT IS THE RECORD FOR DATE NOVEMBER 14? ### Accurate SQL ###
SELECT record FROM table_name_44 WHERE date = "november 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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) 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 cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime 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 lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) ### Question ### count the number of times patient 028-40370 had been prescribed dext 5% in water 1000 ml lvp since 2105. ### Accurate SQL ###
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-40370')) AND medication.drugname = 'dext 5% in water 1000 ml lvp' AND STRFTIME('%y', medication.drugstarttime) >= '2105'
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_90 (provider VARCHAR, transmission VARCHAR, free_or_pay VARCHAR, years VARCHAR) ### Question ### Name the Provider that has a pay in 2006–, and a Transmission of iptv and digital terrestrial? ### Accurate SQL ###
SELECT provider FROM table_name_90 WHERE free_or_pay = "pay" AND years = "2006–" AND transmission = "iptv and digital terrestrial"
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 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 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 ) ### Question ### give the number of patients whose insurance is private and procedure icd9 code is 4105. ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "4105"
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_13431 ( "Non-dictatorship" text, "Pareto efficiency" text, "Majority" text, "Monotone" text, "Consistency & Participation" text, "Condorcet" text, "Condorcet loser" text, "Clone independence" text, "Reversal symmetry" text ) ### Question ### what is the reversal symmetry when non-dictatorship is yes, consistency & participation is no, and clone independence is yes? ### Accurate SQL ###
SELECT "Reversal symmetry" FROM table_13431 WHERE "Non-dictatorship" = 'yes' AND "Consistency & Participation" = 'no' AND "Clone independence" = '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 table_64002 ( "Wimmera FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) ### Question ### What's the total draws when the losses are less than 10, less than 2 byes, and 13 wins? ### Accurate SQL ###
SELECT COUNT("Draws") FROM table_64002 WHERE "Losses" < '10' AND "Wins" = '13' AND "Byes" < '2'
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 INTEGER, director VARCHAR) ### Question ### WHAT IS THE RANK OF MARTIN BREST? ### Accurate SQL ###
SELECT SUM(rank) FROM table_name_93 WHERE director = "martin brest"
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 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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) TABLE: CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) ### Question ### For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the phone_number by a bar chart, list y-axis in desc order. ### Accurate SQL ###
SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT 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 d_labitems ( row_id number, itemid number, label 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 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) 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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod 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 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_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto 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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) ### Question ### does lr have been prescribed to patient 88254 in this year? ### Accurate SQL ###
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88254) AND prescriptions.drug = 'lr' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
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_548 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) ### Question ### what was the total number of medals received by the nations ranked # 11 ? ### Accurate SQL ###
SELECT SUM("total") FROM table_203_548 WHERE "rank" = 11
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_1998037_9 ( television_commentator VARCHAR, radio_commentator VARCHAR ) ### Question ### Who is the television commentator when the radio commentator is Galyna Babiy? ### Accurate SQL ###
SELECT television_commentator FROM table_1998037_9 WHERE radio_commentator = "Galyna Babiy"
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_23 (location VARCHAR, name_of_mill VARCHAR) ### Question ### What is the Location of the Moulin Bertrand Mill? ### Accurate SQL ###
SELECT location FROM table_name_23 WHERE name_of_mill = "moulin bertrand"
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 Projects ( Code Char(4), Name Char(50), Hours int ) TABLE: CREATE TABLE Scientists ( SSN int, Name Char(30) ) TABLE: CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) ### Question ### A bar chart for finding the number of the name of the project for which a scientist whose name contains Smith is assigned to, could you rank by the Y-axis from high to low? ### Accurate SQL ###
SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name ORDER BY COUNT(T2.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_68 ( week INTEGER, date VARCHAR ) ### Question ### In what week was the December 21, 1969 game? ### Accurate SQL ###
SELECT AVG(week) FROM table_name_68 WHERE date = "december 21, 1969"
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_676 ( id number, "pick #" number, "cfl team" text, "player" text, "position" text, "college" text ) ### Question ### how many players are an ol ? ### Accurate SQL ###
SELECT COUNT("cfl team") FROM table_203_676 WHERE "position" = 'ol'
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_32212 ( "Rank" real, "All-time Rank" text, "Name" text, "Debut Year" real, "Current Club" text, "Goals" real, "Apps" real ) ### Question ### How many goals were achieved when Chievo was the club and the debut year was before 2002? ### Accurate SQL ###
SELECT COUNT("Goals") FROM table_32212 WHERE "Current Club" = 'chievo' AND "Debut Year" < '2002'
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 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 ) 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 ### count the number of patients whose admission year is less than 2150 and lab test category is blood gas? ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2150" AND lab."CATEGORY" = "Blood Gas"
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_47 (total INTEGER, nation VARCHAR, bronze VARCHAR) ### Question ### What is the total for Austria when there is less than 1 bronze? ### Accurate SQL ###
SELECT AVG(total) FROM table_name_47 WHERE nation = "austria" AND bronze < 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_15364 ( "D 48" text, "D 47" text, "D 46" text, "D 45" text, "D 44" text, "D 43" text, "D 42" text, "D 41" text ) ### Question ### Name the D 46 which has D 42 of r 14 ### Accurate SQL ###
SELECT "D 46" FROM table_15364 WHERE "D 42" = 'r 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 EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) TABLE: CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) TABLE: CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) TABLE: CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) TABLE: CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) TABLE: CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) TABLE: CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) ### Question ### Find the average gpa of all students in each department with a bar chart, could you list by the y axis from low to high? ### Accurate SQL ###
SELECT DEPT_CODE, AVG(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY AVG(STU_GPA)
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 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 student ( id text, name text, dept_name text, tot_cred number ) TABLE: CREATE TABLE classroom ( building text, room_number text, capacity number ) TABLE: CREATE TABLE prereq ( course_id text, prereq_id text ) TABLE: CREATE TABLE department ( dept_name text, building text, budget number ) TABLE: CREATE TABLE section ( course_id text, sec_id text, semester text, year number, building text, room_number text, time_slot_id text ) TABLE: CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) TABLE: CREATE TABLE advisor ( s_id text, i_id text ) TABLE: CREATE TABLE instructor ( id text, name text, dept_name text, salary number ) TABLE: CREATE TABLE time_slot ( time_slot_id text, day text, start_hr number, start_min number, end_hr number, end_min number ) ### Question ### What are the names of students who have taken Statistics courses? ### Accurate SQL ###
SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id = T2.course_id JOIN student AS T3 ON T2.id = T3.id WHERE T1.dept_name = 'Statistics'
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_1965650_4 (position VARCHAR, nhl_team VARCHAR) ### Question ### What's the number of positions of the player playing in Minnesota North Stars? ### Accurate SQL ###
SELECT COUNT(position) FROM table_1965650_4 WHERE nhl_team = "Minnesota North Stars"
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_22111 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text ) ### Question ### How many districts have the incumbent, Charles Rangel? ### Accurate SQL ###
SELECT COUNT("District") FROM table_22111 WHERE "Incumbent" = 'Charles Rangel'
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 election ( election_id number, representative_id number, date text, votes number, vote_percent number, seats number, place number ) TABLE: CREATE TABLE representative ( representative_id number, name text, state text, party text, lifespan text ) ### Question ### What are the names of representatives in descending order of votes? ### Accurate SQL ###
SELECT T2.name FROM election AS T1 JOIN representative AS T2 ON T1.representative_id = T2.representative_id ORDER BY votes 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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) 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 lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ### Question ### has patient 006-122712 been admitted to a hospital er during the current hospital encounter? ### Accurate SQL ###
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '006-122712' AND patient.hospitaladmitsource = 'emergency department' AND patient.hospitaldischargetime 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_25438110_5 (casinos VARCHAR, fy09_$millions VARCHAR) ### Question ### How many casinos are associated with a FY2009 $mil value of exactly $279? ### Accurate SQL ###
SELECT COUNT(casinos) FROM table_25438110_5 WHERE fy09_$millions = "$279"
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 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime 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 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 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_labitems ( row_id number, itemid number, label 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 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 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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) ### Question ### what is the average hospital cost in which are involved rt heart cardiac cath? ### Accurate SQL ###
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'rt heart cardiac cath')) GROUP BY cost.hadm_id) AS t1
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 ( visitor VARCHAR, time VARCHAR ) ### Question ### Who was the visitor at 5:00 pm? ### Accurate SQL ###
SELECT visitor FROM table_name_42 WHERE time = "5:00 pm"
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 Institution ( Institution_id text, Institution text, Location text, Founded real, Type text, Enrollment int, Team text, Primary_Conference text, building_id text ) TABLE: CREATE TABLE building ( building_id text, Name text, Street_address text, Years_as_tallest text, Height_feet int, Floors int ) TABLE: CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real, accession_number text, sequence_length real, sequence_identity_to_human_protein text, Institution_id text ) ### Question ### Show the names and heights of buildings with at least two institutions founded after 1880 by a bar chart, and could you order by the total number from low to high please? ### Accurate SQL ###
SELECT Name, Height_feet FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id WHERE T2.Founded > 1880 ORDER BY Height_feet
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 diagnoses ( 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 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 ### provide the number of married patients who belong to latino or hispanic ethnic background. ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.ethnicity = "HISPANIC OR LATINO"
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_67646 ( "Year" real, "Winner" text, "Winning Hand" text, "Prize Money" text, "Entrants" real, "Runner-Up" text, "Losing Hand" text ) ### Question ### What was the first year Fabrice Soulier was a runner-up? ### Accurate SQL ###
SELECT MIN("Year") FROM table_67646 WHERE "Runner-Up" = 'fabrice soulier'
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_17 (colors VARCHAR, school VARCHAR) ### Question ### What Colors has a School of zeigler high school? ### Accurate SQL ###
SELECT colors FROM table_name_17 WHERE school = "zeigler high school"
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_53509 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text, "Record" text ) ### Question ### What was the result of the game with the attendance of 45,320? ### Accurate SQL ###
SELECT "Result" FROM table_53509 WHERE "Attendance" = '45,320'
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_11959669_3 ( high_rebounds VARCHAR, date VARCHAR ) ### Question ### Who had the highest rebounds on November 4 ### Accurate SQL ###
SELECT high_rebounds FROM table_11959669_3 WHERE date = "November 4"
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 swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) TABLE: CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) TABLE: CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) TABLE: CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) ### Question ### Give me the comparison about ID over the meter_300 , and I want to list by the bar from low to high. ### Accurate SQL ###
SELECT meter_300, ID FROM swimmer ORDER BY meter_300
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_75 (surface VARCHAR, score VARCHAR) ### Question ### What is the Surface when the score was 4–6, 6–3, 6–7 (5–7)? ### Accurate SQL ###
SELECT surface FROM table_name_75 WHERE score = "4–6, 6–3, 6–7 (5–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_name_92 (player VARCHAR, position VARCHAR, club_province VARCHAR) ### Question ### Which Player has a Position of number 8, and a Club/province of scarlets? ### Accurate SQL ###
SELECT player FROM table_name_92 WHERE position = "number 8" AND club_province = "scarlets"