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_87 ( height_in_ft VARCHAR, years_with_spurs VARCHAR )
### Question ###
What is Height in Ft., when Years With Spurs is 1973-74?
### Accurate SQL ###
|
SELECT height_in_ft FROM table_name_87 WHERE years_with_spurs = "1973-74"
|
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_38 (cable_channel VARCHAR, call_sign VARCHAR)
### Question ###
How many cable channels have callsign CBFT-DT?
### Accurate SQL ###
|
SELECT COUNT(cable_channel) FROM table_name_38 WHERE call_sign = "cbft-dt"
|
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_245 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
### Question ###
how many total international races did german silva place in the top 3 spots ?
### Accurate SQL ###
|
SELECT COUNT("competition") FROM table_203_245 WHERE "position" <= 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_58649 ( "Season" real, "Date" text, "Winning Driver" text, "Car #" real, "Sponsor" text, "Make" text, "Distance" text, "Avg Speed" text, "Margin of Victory" text )
### Question ###
How many seasons has UPS sponsored a car with a number larger than 17?
### Accurate SQL ###
|
SELECT COUNT("Season") FROM table_58649 WHERE "Car #" > '17' AND "Sponsor" = 'ups'
|
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_6 (nationality VARCHAR, college_junior_club_team__league_ VARCHAR)
### Question ###
What is the nationality of the player who played for the Peterborough Petes (OHL)?
### Accurate SQL ###
|
SELECT nationality FROM table_name_6 WHERE college_junior_club_team__league_ = "peterborough petes (ohl)"
|
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 ( chng VARCHAR, rank VARCHAR, prev VARCHAR )
### Question ###
What chng has a rank greater than 6, with 12 as a prev?
### Accurate SQL ###
|
SELECT chng FROM table_name_55 WHERE rank > 6 AND prev = 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_1342359_5 ( district VARCHAR, party VARCHAR )
### Question ###
what's the districtwith party being democratic
### Accurate SQL ###
|
SELECT district FROM table_1342359_5 WHERE party = "Democratic"
|
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_69311 ( "Name" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
### Question ###
Which name has an Area of makarewa?
### Accurate SQL ###
|
SELECT "Name" FROM table_69311 WHERE "Area" = 'makarewa'
|
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 head ( head_ID int, name text, born_state text, age real )
TABLE: CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real )
TABLE: CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text )
### Question ###
Compute the total the number of born state across born state as a pie chart.
### Accurate SQL ###
|
SELECT born_state, COUNT(born_state) FROM head GROUP BY born_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 table_name_44 ( year VARCHAR, team VARCHAR )
### Question ###
What are the years that Andretti Autosport is a team?
### Accurate SQL ###
|
SELECT COUNT(year) FROM table_name_44 WHERE team = "andretti autosport"
|
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_202_32 ( id number, "year" text, "cast\n(nabucco, abigaille, zaccaria, ismaele, fenena)" text, "conductor,\nopera house and orchestra" text, "label" text )
### Question ###
when was the recording of nabucco made in the metropolitan opera ?
### Accurate SQL ###
|
SELECT "year" FROM table_202_32 WHERE "conductor,\nopera house and orchestra" = 'metropolitan opera'
|
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 program ( program_id int, name varchar, college varchar, introduction varchar )
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 instructor ( instructor_id int, name varchar, uniqname varchar )
TABLE: CREATE TABLE gsi ( course_offering_id int, student_id int )
TABLE: CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar )
TABLE: CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar )
TABLE: CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar )
TABLE: CREATE TABLE course_prerequisite ( pre_course_id int, course_id int )
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 area ( course_id int, area varchar )
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 semester ( semester_id int, semester varchar, year int )
TABLE: CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int )
TABLE: CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar )
TABLE: CREATE TABLE ta ( campus_job_id int, student_id int, location varchar )
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 ( 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 )
### Question ###
Are there any Other classes in the Winter ?
### Accurate SQL ###
|
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_course.category LIKE '%Other%' AND semester.semester = 'Winter' AND semester.year = 2017
|
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 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 PostTypes ( Id number, Name text )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
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 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 ReviewTaskResultTypes ( 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number )
TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE PostTags ( PostId number, TagId number )
### Question ###
How many upvotes do I have for each tag?. how long before I get tag badges?
### Accurate SQL ###
|
SELECT TagName, COUNT(*) AS UpVotes, COUNT(Posts.Id) FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.OwnerUserId = @UserId GROUP BY TagName ORDER BY UpVotes 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_3 (a_ VARCHAR, year_ INTEGER, position VARCHAR, college VARCHAR)
### Question ###
What is the most recent year georgia tech chose a linebacker?
### Accurate SQL ###
|
SELECT MAX(year_)[a_] FROM table_name_3 WHERE position = "linebacker" AND college = "georgia tech"
|
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_38 (country VARCHAR, builder VARCHAR)
### Question ###
What is Country, when Builder is "Sheerness Dockyard"?
### Accurate SQL ###
|
SELECT country FROM table_name_38 WHERE builder = "sheerness dockyard"
|
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_1964010_2 (surface VARCHAR, year VARCHAR, score VARCHAR)
### Question ###
How many surfaces were played on in 2005 where the score was 6β7 (4β7) , 3β6, 7β6 (7β2) , 3β6?
### Accurate SQL ###
|
SELECT COUNT(surface) FROM table_1964010_2 WHERE year = 2005 AND score = "6β7 (4β7) , 3β6, 7β6 (7β2) , 3β6"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_85 ( week INTEGER, result VARCHAR )
### Question ###
What is the Week number with a Result of W 30-28?
### Accurate SQL ###
|
SELECT AVG(week) FROM table_name_85 WHERE result = "w 30-28"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_88 ( lane VARCHAR, heat VARCHAR, nationality VARCHAR )
### Question ###
What is the Lane of the swimmer from Uzbekistan in Heat 1?
### Accurate SQL ###
|
SELECT COUNT(lane) FROM table_name_88 WHERE heat = 1 AND nationality = "uzbekistan"
|
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_27887723_1 ( winner VARCHAR, location VARCHAR )
### Question ###
who was the winner for souderton, pa?
### Accurate SQL ###
|
SELECT winner FROM table_27887723_1 WHERE location = "Souderton, PA"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_25 (points INTEGER, entrant VARCHAR, year VARCHAR)
### Question ###
What is the most points when the entrant was Jaguar racing earlier than 2001?
### Accurate SQL ###
|
SELECT MAX(points) FROM table_name_25 WHERE entrant = "jaguar racing" AND year < 2001
|
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_21530474_1 ( model_no VARCHAR, chassis_code VARCHAR )
### Question ###
Name the model number for usf46
### Accurate SQL ###
|
SELECT model_no FROM table_21530474_1 WHERE chassis_code = "USF46"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_51 ( round INTEGER, record VARCHAR )
### Question ###
Which round has a record of 5-3 (1)?
### Accurate SQL ###
|
SELECT MIN(round) FROM table_name_51 WHERE record = "5-3 (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_22050544_4 (event VARCHAR, event__number VARCHAR)
### Question ###
What is the event name with the number 8M?
### Accurate SQL ###
|
SELECT event FROM table_22050544_4 WHERE event__number = "8M"
|
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 PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE 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 ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange 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 PostTypes ( Id number, Name text )
TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other )
### Question ###
curl and libcurl over time.
### Accurate SQL ###
|
SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS m, TagName, COUNT(*) FROM PostTags AS pt JOIN Posts AS q ON q.Id = pt.PostId JOIN Tags AS t ON t.Id = pt.TagId WHERE TagName IN ('curl', 'libcurl') AND q.CreationDate < DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0) GROUP BY DATEADD(month, DATEDIFF(month, 0, CreationDate), 0), TagName ORDER BY DATEADD(month, DATEDIFF(month, 0, CreationDate), 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_name_53 ( method VARCHAR, time VARCHAR )
### Question ###
What is the Method of the match with a Time of 4:07?
### Accurate SQL ###
|
SELECT method FROM table_name_53 WHERE time = "4:07"
|
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 journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int )
TABLE: CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int )
TABLE: CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text )
### Question ###
Show the different nationalities and the number of journalists of each nationality. Visualize by bar chart.
### Accurate SQL ###
|
SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality
|
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 (venue VARCHAR, season VARCHAR)
### Question ###
During season 1935, what was the venue?
### Accurate SQL ###
|
SELECT venue FROM table_name_92 WHERE season = "1935"
|
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_8 (report VARCHAR, date VARCHAR)
### Question ###
What Report has the Date September 3, 2005?
### Accurate SQL ###
|
SELECT report FROM table_name_8 WHERE date = "september 3, 2005"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_99 ( goals_for INTEGER, draws VARCHAR, points VARCHAR, losses VARCHAR, wins VARCHAR )
### Question ###
What is the average number of goals for entries with more than 12 losses, more than 10 wins, more than 3 draws, and fewer than 29 points?
### Accurate SQL ###
|
SELECT AVG(goals_for) FROM table_name_99 WHERE losses > 12 AND wins > 10 AND points < 29 AND draws > 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_name_9 ( team__number1 VARCHAR )
### Question ###
Who played against TSV bayer 04 leverkusen when they were team #1?
### Accurate SQL ###
|
SELECT 2 AS nd_leg FROM table_name_9 WHERE team__number1 = "tsv bayer 04 leverkusen"
|
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 (builder VARCHAR, works_number VARCHAR, date VARCHAR)
### Question ###
Name the builder for 4/1906 and works number more than 199
### Accurate SQL ###
|
SELECT builder FROM table_name_90 WHERE works_number > 199 AND date = "4/1906"
|
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 procedures ( 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 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 me the number of patients whose primary disease is femoral artery thrombosis and drug name is sodium chloride 0.9% flush?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS" AND prescriptions.drug = "Sodium Chloride 0.9% Flush"
|
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_21108 ( "Rank" real, "Company" text, "Headquarters" text, "Industry" text, "Sales (billion $)" text, "Profits (billion $)" text, "Assets (billion $)" text, "Market Value (billion $)" text )
### Question ###
What are the profits of Wells Fargo (in billions)?
### Accurate SQL ###
|
SELECT "Profits (billion $)" FROM table_21108 WHERE "Company" = 'Wells Fargo'
|
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 (score VARCHAR, december VARCHAR, opponent VARCHAR)
### Question ###
December smaller than 21, and a Opponent of buffalo sabres had what score?
### Accurate SQL ###
|
SELECT score FROM table_name_68 WHERE december < 21 AND opponent = "buffalo sabres"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_99 (driver VARCHAR, entrant VARCHAR)
### Question ###
Which driver drove the Tourtel Larrousse F1?
### Accurate SQL ###
|
SELECT driver FROM table_name_99 WHERE entrant = "tourtel larrousse f1"
|
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_43682 ( "Rank" real, "Title" text, "Studio" text, "Director" text, "Gross" text )
### Question ###
Who directed Predator that was filmed with Fox Studio?
### Accurate SQL ###
|
SELECT "Director" FROM table_43682 WHERE "Studio" = 'fox' AND "Title" = 'predator'
|
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_40 ( score VARCHAR, date VARCHAR )
### Question ###
what is the score on march 8?
### Accurate SQL ###
|
SELECT score FROM table_name_40 WHERE date = "march 8"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_48 ( score VARCHAR, december VARCHAR )
### Question ###
What's the score for December of 30?
### Accurate SQL ###
|
SELECT score FROM table_name_48 WHERE december = 30
|
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_22481967_1 ( status VARCHAR, operator VARCHAR )
### Question ###
List the status for the operator Toronto transit commission.
### Accurate SQL ###
|
SELECT status FROM table_22481967_1 WHERE operator = "Toronto Transit Commission"
|
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 customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR)
TABLE: CREATE TABLE mailshot_customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR)
### Question ###
Show the name and phone of the customer without any mailshot.
### Accurate SQL ###
|
SELECT customer_name, customer_phone FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM mailshot_customers)
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_21 (rank VARCHAR, constituency VARCHAR, result VARCHAR, winning_party_2003 VARCHAR, swing_to_gain VARCHAR)
### Question ###
Which rank had the Labour party winning in 2003, a swing to gain that was larger than 2.13, a lab hold as a result, and which took place in the Linlithgow constituency?
### Accurate SQL ###
|
SELECT rank FROM table_name_21 WHERE winning_party_2003 = "labour" AND swing_to_gain > 2.13 AND result = "lab hold" AND constituency = "linlithgow"
|
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_8 (league VARCHAR, play_offs VARCHAR, name VARCHAR)
### Question ###
What's the total number of League Cup with a Play-off larger than 2, and a Name of Mitch Cook Category:Articles with hCards?
### Accurate SQL ###
|
SELECT COUNT(league) AS Cup FROM table_name_8 WHERE play_offs > 2 AND name = "mitch cook category:articles with hcards"
|
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_18333678_2 (departure VARCHAR, going_to VARCHAR, arrival VARCHAR)
### Question ###
when does the train arriving at bourne at 11.45 departure
### Accurate SQL ###
|
SELECT departure FROM table_18333678_2 WHERE going_to = "Bourne" AND arrival = "11.45"
|
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 time_interval ( period text, begin_time int, end_time int )
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int )
TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text )
TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int )
TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text )
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 date_day ( month_number int, day_number int, year int, day_name varchar )
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 compartment_class ( compartment varchar, class_type varchar )
TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar )
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 month ( month_number int, month_name text )
TABLE: CREATE TABLE code_description ( code varchar, description text )
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 state ( state_code text, state_name text, country_name text )
TABLE: CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description 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 flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int )
TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int )
TABLE: CREATE TABLE days ( days_code varchar, day_name varchar )
TABLE: CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text )
TABLE: CREATE TABLE 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 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )
### Question ###
all flights leaving WASHINGTON to SAN FRANCISCO that are FIRST class
### Accurate SQL ###
|
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND fare_basis.class_type = 'FIRST' AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int )
TABLE: CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar )
TABLE: CREATE TABLE 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 date_day ( month_number int, day_number int, year int, day_name varchar )
TABLE: CREATE TABLE code_description ( code varchar, description text )
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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant 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 month ( month_number int, month_name text )
TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar )
TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text )
TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int )
TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int )
TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar )
TABLE: CREATE TABLE days ( days_code varchar, day_name varchar )
TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text )
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 food_service ( meal_code text, meal_number int, compartment text, meal_description varchar )
TABLE: CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int )
TABLE: CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar )
TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int )
TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int )
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 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 airline ( airline_code varchar, airline_name text, note text )
### Question ###
what flights are available from DENVER to PHILADELPHIA with stopover in PITTSBURGH
### Accurate SQL ###
|
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'PITTSBURGH' AND flight_stop.stop_airport = AIRPORT_SERVICE_2.airport_code AND flight.flight_id = flight_stop.flight_id AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_20728138_1 (seats_won VARCHAR, seats_contested VARCHAR)
### Question ###
How many seats were won, when the seats contested was 48?
### Accurate SQL ###
|
SELECT seats_won FROM table_20728138_1 WHERE seats_contested = 48
|
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 (date VARCHAR, opponent VARCHAR)
### Question ###
What is the date when Canada played?
### Accurate SQL ###
|
SELECT date FROM table_name_68 WHERE opponent = "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 Maintenance_Engineers ( engineer_id VARCHAR, first_name VARCHAR, last_name VARCHAR )
TABLE: CREATE TABLE Engineer_Visits ( engineer_id VARCHAR )
### Question ###
Among those engineers who have visited, which engineer makes the least number of visits? List the engineer id, first name and last name.
### Accurate SQL ###
|
SELECT T1.engineer_id, T1.first_name, T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 ON T1.engineer_id = T2.engineer_id GROUP BY T1.engineer_id ORDER BY COUNT(*) 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 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 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 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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) )
### Question ###
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of first_name and manager_id , and could you sort by the y-axis from high to low?
### Accurate SQL ###
|
SELECT FIRST_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_12518 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
### Question ###
What is the Country of the Player with a To par of +1 and a Score of 72-71=143?
### Accurate SQL ###
|
SELECT "Country" FROM table_12518 WHERE "To par" = '+1' AND "Score" = '72-71=143'
|
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_1028356_3 ( opponents VARCHAR, partner VARCHAR )
### Question ###
How many matches where played with Jim Pugh?
### Accurate SQL ###
|
SELECT COUNT(opponents) FROM table_1028356_3 WHERE partner = "Jim Pugh"
|
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_8 (label VARCHAR, format VARCHAR, date VARCHAR, region VARCHAR)
### Question ###
What is the Label of the CD released in Germany on June 6, 2005?
### Accurate SQL ###
|
SELECT label FROM table_name_8 WHERE date = "june 6, 2005" AND region = "germany" AND format = "cd"
|
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_1342013_31 (party VARCHAR, result VARCHAR)
### Question ###
What number of party had a candidate resigned when appointed judge democratic hold?
### Accurate SQL ###
|
SELECT COUNT(party) FROM table_1342013_31 WHERE result = "Resigned when appointed judge Democratic hold"
|
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_28068063_3 (match_points VARCHAR, eliminated_from_competition VARCHAR)
### Question ###
How many teams eliminated bΓ©ziers from competition?
### Accurate SQL ###
|
SELECT COUNT(match_points) FROM table_28068063_3 WHERE eliminated_from_competition = "BΓ©ziers"
|
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 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 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 cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime 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 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 lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
### Question ###
what were the top three most common procedures until 4 years ago?
### Accurate SQL ###
|
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.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_name_3 (game VARCHAR, team VARCHAR)
### Question ###
What is the game number against the team Boston?
### Accurate SQL ###
|
SELECT COUNT(game) FROM table_name_3 WHERE team = "boston"
|
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_53613 ( "Year" text, "Driver" text, "Constructor" text, "Location" text, "Report" text )
### Question ###
When was a report not held?
### Accurate SQL ###
|
SELECT "Year" FROM table_53613 WHERE "Report" = 'not held'
|
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_70377 ( "Year" real, "Division" text, "League" text, "Regular Season" text, "Playoffs" text, "U.S. Open Cup" text, "Avg. Attendance" text )
### Question ###
Which regular season was 2013 in?
### Accurate SQL ###
|
SELECT "Regular Season" FROM table_70377 WHERE "Year" = '2013'
|
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_45 ( result VARCHAR, opponent VARCHAR, venue VARCHAR )
### Question ###
What was the result when the opponent was manchester united in venue h?
### Accurate SQL ###
|
SELECT result FROM table_name_45 WHERE opponent = "manchester united" AND venue = "h"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_5 ( method VARCHAR, time VARCHAR )
### Question ###
what is the method when the time is 0:51?
### Accurate SQL ###
|
SELECT method FROM table_name_5 WHERE time = "0:51"
|
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 AssignedTo ( Scientist int, Project char(4) )
TABLE: CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int )
TABLE: CREATE TABLE Scientists ( SSN int, Name Char(30) )
### Question ###
What are the naems of all the projects, and how many scientists were assigned to each of them, rank x axis in descending order.
### Accurate SQL ###
|
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY Name DESC
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_93 ( height_in_ft VARCHAR, position VARCHAR, school_club_team_country VARCHAR )
### Question ###
Name the height for the center position from kansas
### Accurate SQL ###
|
SELECT height_in_ft FROM table_name_93 WHERE position = "center" AND school_club_team_country = "kansas"
|
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_89 ( tamil VARCHAR, hindi VARCHAR )
### Question ###
WHAT IS THE TAMIL WITH A SUKRAVAR ?
### Accurate SQL ###
|
SELECT tamil FROM table_name_89 WHERE hindi = "sukravar"
|
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_961 ( "IN No." real, "County Name" text, "Establishment Date (SW Indiana) (History) (Statehood)" text, "County Seat" text, "Time Zone" text, "Population (2010) (Rank)" text, "Area sq mi (km 2 ) (Rank)" text, "Twps" real, "ZIP code Prefix(es)" text, "% of Boundary by water" text )
### Question ###
When Spencer is the county what is total of the population (2010) (rank)?
### Accurate SQL ###
|
SELECT COUNT("Population (2010) (Rank)") FROM table_961 WHERE "County Name" = 'Spencer'
|
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_51096 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
### Question ###
What finish has +21 as the to par?
### Accurate SQL ###
|
SELECT "Finish" FROM table_51096 WHERE "To par" = '+21'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_dev_8 ( "id" int, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "diastolic_blood_pressure_dbp" int, "coronary_artery_disease_cad" bool, "triglyceride_tg" float, "hypertension" bool, "NOUSE" float )
### Question ###
triglycerides greater than or equal to 500 mg / dl
### Accurate SQL ###
|
SELECT * FROM table_dev_8 WHERE triglyceride_tg >= 500
|
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 students_in_detention ( student_id number, detention_id number, incident_id number )
TABLE: CREATE TABLE addresses ( address_id number, line_1 text, line_2 text, line_3 text, city text, zip_postcode text, state_province_county text, country text, other_address_details text )
TABLE: CREATE TABLE ref_address_types ( address_type_code text, address_type_description text )
TABLE: CREATE TABLE assessment_notes ( notes_id number, student_id number, teacher_id number, date_of_notes time, text_of_notes text, other_details text )
TABLE: CREATE TABLE students ( student_id number, address_id number, first_name text, middle_name text, last_name text, cell_mobile_number text, email_address text, date_first_rental time, date_left_university time, other_student_details text )
TABLE: CREATE TABLE ref_incident_type ( incident_type_code text, incident_type_description text )
TABLE: CREATE TABLE student_addresses ( student_id number, address_id number, date_address_from time, date_address_to time, monthly_rental number, other_details text )
TABLE: CREATE TABLE teachers ( teacher_id number, address_id number, first_name text, middle_name text, last_name text, gender text, cell_mobile_number text, email_address text, other_details text )
TABLE: CREATE TABLE detention ( detention_id number, detention_type_code text, teacher_id number, datetime_detention_start time, datetime_detention_end time, detention_summary text, other_details text )
TABLE: CREATE TABLE ref_detention_type ( detention_type_code text, detention_type_description text )
TABLE: CREATE TABLE behavior_incident ( incident_id number, incident_type_code text, student_id number, date_incident_start time, date_incident_end time, incident_summary text, recommendations text, other_details text )
### Question ###
List all cities of addresses in alphabetical order.
### Accurate SQL ###
|
SELECT city FROM addresses ORDER BY city
|
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_46038 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
### Question ###
What's the silver for rank 1 with less than 2 bronze?
### Accurate SQL ###
|
SELECT MIN("Silver") FROM table_46038 WHERE "Rank" = '1' AND "Bronze" < '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_88 ( time VARCHAR, laps VARCHAR, grid VARCHAR )
### Question ###
what is the time when the laps is less than 21 and the grid is more than 17?
### Accurate SQL ###
|
SELECT time FROM table_name_88 WHERE laps < 21 AND grid > 17
|
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 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 )
### Question ###
provide the number of patients whose primary disease is femoral artery thrombosis and who were admitted to the hospital before year 2182?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS" AND demographic.admityear < "2182"
|
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_27933 ( "meas. num." real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text )
### Question ###
What was the percentage of yes votes for the measure where the no votes number 199174?
### Accurate SQL ###
|
SELECT "% YES" FROM table_27933 WHERE "NO votes" = '199174'
|
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_52562 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
### Question ###
On what date did the United Kingdom have a catalog of FT 507?
### Accurate SQL ###
|
SELECT "Date" FROM table_52562 WHERE "Region" = 'united kingdom' AND "Catalog" = 'ft 507'
|
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_13386 ( "2002/ 03" text, "2003/ 04" text, "2004/ 05" text, "2005/ 06" text, "2006/ 07" text, "2007/ 08" text, "2008/ 09" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text )
### Question ###
what is 2005/06 when 2004/05 is not held and 2010/11 is a?
### Accurate SQL ###
|
SELECT "2005/ 06" FROM table_13386 WHERE "2004/ 05" = 'not held' AND "2010/ 11" = 'a'
|
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_12 (drawn VARCHAR, tries_for VARCHAR)
### Question ###
What is the drawn number when there are 58 tries?
### Accurate SQL ###
|
SELECT drawn FROM table_name_12 WHERE tries_for = "58"
|
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_38346 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
### Question ###
What is the result of the match on 30 July 2004?
### Accurate SQL ###
|
SELECT "Result" FROM table_38346 WHERE "Date" = '30 july 2004'
|
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 Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
TABLE: CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
### Question ###
For those records from the products and each product's manufacturer, return a scatter chart about the correlation between manufacturer and code .
### Accurate SQL ###
|
SELECT T1.Manufacturer, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_39 (drawn VARCHAR, played VARCHAR, club VARCHAR)
### Question ###
Name the Drawn for Ystrad Rhondda RFC and has Played of 22.
### Accurate SQL ###
|
SELECT drawn FROM table_name_39 WHERE played = "22" AND club = "ystrad rhondda rfc"
|
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_23476629_2 (hometown VARCHAR, province VARCHAR)
### Question ###
What is the hometown of contestants who are from the province of Huesca?
### Accurate SQL ###
|
SELECT hometown FROM table_23476629_2 WHERE province = "Huesca"
|
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 (high_assists VARCHAR, date VARCHAR)
### Question ###
What is High Assists, when Date is "March 10"?
### Accurate SQL ###
|
SELECT high_assists FROM table_name_93 WHERE date = "march 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 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 )
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 )
### Question ###
Find Nationality and the sum of meter_100 , and group by attribute Nationality, and visualize them by a bar chart, and could you sort in descending by the total number of meter 100?
### Accurate SQL ###
|
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY SUM(meter_100) 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_79 ( pick__number INTEGER, player VARCHAR )
### Question ###
What was Rich Voltzke's highest pick number?
### Accurate SQL ###
|
SELECT MAX(pick__number) FROM table_name_79 WHERE player = "rich voltzke"
|
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_98 ( year_made VARCHAR, fleet_number_s_ VARCHAR )
### Question ###
What is the Year for fleet number 5000?
### Accurate SQL ###
|
SELECT year_made FROM table_name_98 WHERE fleet_number_s_ = "5000"
|
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_48044 ( "Round" real, "Pick" text, "Player" text, "Position" text, "Nationality" text, "Club Team" text )
### Question ###
Which Pick has a Nationality of canada, and a Round of 5?
### Accurate SQL ###
|
SELECT "Pick" FROM table_48044 WHERE "Nationality" = 'canada' AND "Round" = '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_22825679_1 (percentage VARCHAR, team VARCHAR)
### Question ###
Name the percentage for ole miss
### Accurate SQL ###
|
SELECT percentage FROM table_22825679_1 WHERE team = "Ole Miss"
|
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 (gold INTEGER, silver VARCHAR, total VARCHAR, bronze VARCHAR)
### Question ###
What is the sum of Gold, when Total is greater than 2, when Bronze is greater than 1, and when Silver is less than 1?
### Accurate SQL ###
|
SELECT SUM(gold) FROM table_name_70 WHERE total > 2 AND bronze > 1 AND silver < 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_166 ( "Year" real, "Title" text, "Format" text, "Studio" text, "Release Date" text, "Copyright Information" text, "Catalog Number" text )
### Question ###
Who creates the catalog with the number 'cal03 / 0091037137333'?
### Accurate SQL ###
|
SELECT "Studio" FROM table_166 WHERE "Catalog Number" = 'CAL03 / 0091037137333'
|
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 (event VARCHAR, venue VARCHAR)
### Question ###
Which event was held in Beijing?
### Accurate SQL ###
|
SELECT event FROM table_name_44 WHERE venue = "beijing"
|
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 CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId 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 ReviewTaskResultTypes ( Id number, Name text, Description 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 ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment 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 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 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
### Question ###
Percentage of closed questions by each hour of the day.
### Accurate SQL ###
|
SELECT TIME_TO_STR(q.CreationDate, '%I') AS "Hour", CAST((100.0 * COUNT(q.ClosedDate) / COUNT(*)) AS FLOAT(10, 0)) AS "Closed percent", COUNT(*) AS "question_count" FROM Posts AS q WHERE q.PostTypeId = 1 GROUP BY TIME_TO_STR(q.CreationDate, '%I') ORDER BY 'Hour'
|
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_4576 ( "Commodity" text, "2001-02" text, "2002-03" text, "2003-04" text, "2004-05" text, "2005-06" text, "2006-07" text )
### Question ###
What was the production in 2004-05 for the commodity that produced 1,037 in 2005-06?
### Accurate SQL ###
|
SELECT "2004-05" FROM table_4576 WHERE "2005-06" = '1,037'
|
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_71403 ( "Date" text, "Tournament" text, "Surface" text, "Tier" text, "Partner" text, "Opponents in the final" text, "Score" text )
### Question ###
Which date has the tier of Itf $10k?
### Accurate SQL ###
|
SELECT "Date" FROM table_71403 WHERE "Tier" = 'itf $10k'
|
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 Companies (name VARCHAR, Headquarters VARCHAR)
### Question ###
What are the names of companies whose headquarters are not "USA"?
### Accurate SQL ###
|
SELECT name FROM Companies WHERE Headquarters <> 'USA'
|
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 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 )
TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
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 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 cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
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 ###
when is patient 006-81423's per iv flush: upper arm r 20 gauge intake the first time until 1959 days ago?
### Accurate SQL ###
|
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-81423')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'per iv flush: upper arm r 20 gauge' AND DATETIME(intakeoutput.intakeoutputtime) <= DATETIME(CURRENT_TIME(), '-1959 day') ORDER BY intakeoutput.intakeoutputtime 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_54482 ( "Player" text, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text )
### Question ###
What Utah Jazz player played Center?
### Accurate SQL ###
|
SELECT "Player" FROM table_54482 WHERE "Position" = 'center'
|
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_47222 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
### Question ###
What's the lap number for time/retired of +33.912?
### Accurate SQL ###
|
SELECT COUNT("Laps") FROM table_47222 WHERE "Time/Retired" = '+33.912'
|
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_74 (established VARCHAR, institution VARCHAR)
### Question ###
What is the year established of North Jersey Phoenix?
### Accurate SQL ###
|
SELECT established FROM table_name_74 WHERE institution = "north jersey phoenix"
|
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_34928 ( "Year" real, "Award" text, "Nominated work" text, "Category" text, "Result" text )
### Question ###
What award has breakthrough performance as the category?
### Accurate SQL ###
|
SELECT "Award" FROM table_34928 WHERE "Category" = 'breakthrough performance'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_39 (points VARCHAR, team VARCHAR, grid VARCHAR)
### Question ###
What was Herdez Competition's total points with a grid larger than 1?
### Accurate SQL ###
|
SELECT COUNT(points) FROM table_name_39 WHERE team = "herdez competition" AND grid > 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 (engine VARCHAR, entrant VARCHAR, points VARCHAR)
### Question ###
What engine has the Mercedes AMG Petronas f1 team, and 93 points?
### Accurate SQL ###
|
SELECT engine FROM table_name_1 WHERE entrant = "mercedes amg petronas f1 team" AND points = "93"
|
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_60063 ( "Team 1" text, "Score" text, "Team 2" text, "1st round" text, "2nd round" text )
### Question ###
What are the 2nd round results for the match with Girondins de Bordeaux (d1) as Team 2?
### Accurate SQL ###
|
SELECT "2nd round" FROM table_60063 WHERE "Team 2" = 'girondins de bordeaux (d1)'
|
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_35046 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
### Question ###
What are the average points that have december 27?
### Accurate SQL ###
|
SELECT AVG("Points") FROM table_35046 WHERE "December" = '27'
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.