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 PostHistoryTypes ( Id number, Name 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, 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 PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description 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 ReviewTaskStates ( 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 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 PostTypes ( Id number, Name text )
TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other )
TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
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 CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId 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 PostTags ( PostId number, TagId number )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
### Question ###
Up vs Down votes by Question or Answer.
### Accurate SQL ###
|
SELECT CASE WHEN PostTypeId = 1 THEN 'Question' ELSE 'Answer' END AS "post_type", COUNT(*) AS Amount, SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS UpVotes, SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS DownVotes, CASE WHEN SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) = 0 THEN NULL ELSE (CAST(SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS FLOAT) / CAST(SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS FLOAT)) END AS UpVoteDownVoteRatio FROM Votes AS v JOIN Posts AS p ON v.PostId = p.Id WHERE PostTypeId IN (1, 2) AND VoteTypeId IN (2, 3) AND p.CreationDate > CURRENT_TIMESTAMP() - 365 GROUP BY PostTypeId
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_23537091_1 (copper_age VARCHAR, ubaid_period_in_mesopotamia VARCHAR)
### Question ###
When hittite old kingdom , minoan eruption is the ubaid period in mesopotamia what is the copper age?
### Accurate SQL ###
|
SELECT copper_age FROM table_23537091_1 WHERE ubaid_period_in_mesopotamia = "Hittite Old Kingdom , Minoan eruption"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text )
TABLE: CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text )
### Question ###
Find All_Road and School_ID , and visualize them by a bar chart, and list by the x axis in descending please.
### Accurate SQL ###
|
SELECT All_Road, School_ID FROM basketball_match ORDER BY All_Road 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 club (clubid VARCHAR, clubname VARCHAR)
TABLE: CREATE TABLE member_of_club (clubid VARCHAR, stuid VARCHAR)
TABLE: CREATE TABLE student (stuid VARCHAR)
### Question ###
Find the number of members of club "Pen and Paper Gaming".
### Accurate SQL ###
|
SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Pen and Paper Gaming"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_43287 ( "Ship" text, "Hull No." text, "Commissioned" text, "Builder" text, "Home Port" text, "NVR Page" text )
### Question ###
What is the NVR Page of the ship with a Home Port of Sasebo, Japan?
### Accurate SQL ###
|
SELECT "NVR Page" FROM table_43287 WHERE "Home Port" = 'sasebo, japan'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE ReviewTaskTypes ( 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )
TABLE: CREATE TABLE PostTags ( PostId number, TagId 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 FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
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 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number )
TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE 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 ReviewTaskResultTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE ReviewTaskStates ( 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 CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
### Question ###
SELECT * FROM posts WHERE Id < 50000 AND Score >= 5 AND Tags IS NOT NULL.
### Accurate SQL ###
|
SELECT * FROM Posts WHERE Id < 50000 AND Score >= 5 AND NOT Tags IS NULL
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_10 ( purse VARCHAR, year VARCHAR )
### Question ###
What is the Purse listed for the Year of 1998?
### Accurate SQL ###
|
SELECT purse FROM table_name_10 WHERE year = "1998"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 (evening_gown INTEGER, average VARCHAR, swimsuit VARCHAR)
### Question ###
What is the highest evening gown with an average of 9.531 and swimsuit smaller than 9.449?
### Accurate SQL ###
|
SELECT MAX(evening_gown) FROM table_name_8 WHERE average = 9.531 AND swimsuit < 9.449
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_24 (position VARCHAR, points VARCHAR, drawn VARCHAR, lost VARCHAR)
### Question ###
What is the total number for the position that has less than 2 draws, less than 9 losses and more than 24?
### Accurate SQL ###
|
SELECT COUNT(position) FROM table_name_24 WHERE drawn < 2 AND lost < 9 AND points > 24
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_88 (label VARCHAR, title VARCHAR, year VARCHAR, details VARCHAR)
### Question ###
Which label has a year older than 2004 and a 2xcd detail as well as the sonic seducer cold hands seduction vol. 69 title?
### Accurate SQL ###
|
SELECT label FROM table_name_88 WHERE year > 2004 AND details = "2xcd" AND title = "sonic seducer cold hands seduction vol. 69"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_7568 ( "Year / Theme" text, "Award name" text, "Team name" text, "Team number" real, "City, State/Country" text )
### Question ###
What's the name of the award given to Team number 23?
### Accurate SQL ###
|
SELECT "Award name" FROM table_7568 WHERE "Team number" = '23'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_13880 ( "Pick" real, "Player" text, "Team" text, "Position" text, "School" text )
### Question ###
What is the lowest pick number for Arturo McDowell, who plays the OF position for the San Francisco Giants?
### Accurate SQL ###
|
SELECT MIN("Pick") FROM table_13880 WHERE "Position" = 'of' AND "Team" = 'san francisco giants' AND "Player" = 'arturo mcdowell'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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, game_site VARCHAR )
### Question ###
Name the result for arrowhead stadium
### Accurate SQL ###
|
SELECT result FROM table_name_45 WHERE game_site = "arrowhead stadium"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER )
TABLE: CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER )
TABLE: CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER )
TABLE: CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End_Date DATE )
TABLE: CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) )
### Question ###
Create a bar chart showing the number of date claim made across date claim made
### Accurate SQL ###
|
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Settlements
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_25042332_22 ( preschool__0_5_years_ VARCHAR, tertiary__18_24_years_ VARCHAR )
### Question ###
What is the enrollment ratio for preschool in the region where enrollment ratio for tertiary is 29.55?
### Accurate SQL ###
|
SELECT preschool__0_5_years_ FROM table_25042332_22 WHERE tertiary__18_24_years_ = "29.55"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_27441210_5 (weeks_at__number1 INTEGER, year VARCHAR)
### Question ###
Name the least weeks at number 1 for 1988
### Accurate SQL ###
|
SELECT MIN(weeks_at__number1) FROM table_27441210_5 WHERE year = 1988
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE company (main_industry VARCHAR)
### Question ###
Show all main industry for all companies.
### Accurate SQL ###
|
SELECT DISTINCT main_industry FROM company
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_49 ( score VARCHAR, location_attendance VARCHAR, date VARCHAR )
### Question ###
what score has a location and attendance of montreal forum and the date of may 10?
### Accurate SQL ###
|
SELECT score FROM table_name_49 WHERE location_attendance = "montreal forum" AND date = "may 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 Street_Markets ( Market_ID INTEGER, Market_Details VARCHAR(255) )
TABLE: CREATE TABLE Ref_Attraction_Types ( Attraction_Type_Code CHAR(15), Attraction_Type_Description VARCHAR(255) )
TABLE: CREATE TABLE Tourist_Attractions ( Tourist_Attraction_ID INTEGER, Attraction_Type_Code CHAR(15), Location_ID INTEGER, How_to_Get_There VARCHAR(255), Name VARCHAR(255), Description VARCHAR(255), Opening_Hours VARCHAR(255), Other_Details VARCHAR(255) )
TABLE: CREATE TABLE Features ( Feature_ID INTEGER, Feature_Details VARCHAR(255) )
TABLE: CREATE TABLE Shops ( Shop_ID INTEGER, Shop_Details VARCHAR(255) )
TABLE: CREATE TABLE Hotels ( hotel_id INTEGER, star_rating_code CHAR(15), pets_allowed_yn CHAR(1), price_range real, other_hotel_details VARCHAR(255) )
TABLE: CREATE TABLE Photos ( Photo_ID INTEGER, Tourist_Attraction_ID INTEGER, Name VARCHAR(255), Description VARCHAR(255), Filename VARCHAR(255), Other_Details VARCHAR(255) )
TABLE: CREATE TABLE Locations ( Location_ID INTEGER, Location_Name VARCHAR(255), Address VARCHAR(255), Other_Details VARCHAR(255) )
TABLE: CREATE TABLE Ref_Hotel_Star_Ratings ( star_rating_code CHAR(15), star_rating_description VARCHAR(80) )
TABLE: CREATE TABLE Museums ( Museum_ID INTEGER, Museum_Details VARCHAR(255) )
TABLE: CREATE TABLE Theme_Parks ( Theme_Park_ID INTEGER, Theme_Park_Details VARCHAR(255) )
TABLE: CREATE TABLE Staff ( Staff_ID INTEGER, Tourist_Attraction_ID INTEGER, Name VARCHAR(40), Other_Details VARCHAR(255) )
TABLE: CREATE TABLE Visits ( Visit_ID INTEGER, Tourist_Attraction_ID INTEGER, Tourist_ID INTEGER, Visit_Date DATETIME, Visit_Details VARCHAR(40) )
TABLE: CREATE TABLE Royal_Family ( Royal_Family_ID INTEGER, Royal_Family_Details VARCHAR(255) )
TABLE: CREATE TABLE Tourist_Attraction_Features ( Tourist_Attraction_ID INTEGER, Feature_ID INTEGER )
TABLE: CREATE TABLE Visitors ( Tourist_ID INTEGER, Tourist_Details VARCHAR(255) )
### Question ###
what is the average price range of hotels for each each star rating code?
### Accurate SQL ###
|
SELECT star_rating_code, AVG(price_range) FROM Hotels GROUP BY star_rating_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_203_356 ( id number, "type" text, "diagonal (mm)" text, "width (mm)" text, "height (mm)" text, "area (mm2)" text, "stops (area)" number, "crop factor" text )
### Question ###
what is the different in area between the 1/10 and the 1/8 ?
### Accurate SQL ###
|
SELECT ABS((SELECT "area (mm2)" FROM table_203_356 WHERE "type" = '1/10"') - (SELECT "area (mm2)" FROM table_203_356 WHERE "type" = '1/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_23 ( date INTEGER, tournament VARCHAR )
### Question ###
Name the date of Tournament of paris indoor , france?
### Accurate SQL ###
|
SELECT SUM(date) FROM table_name_23 WHERE tournament = "paris indoor , france"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_1341453_51 (incumbent VARCHAR, first_elected VARCHAR)
### Question ###
Who's the incumbent in the district that first elected in 1969?
### Accurate SQL ###
|
SELECT incumbent FROM table_1341453_51 WHERE first_elected = 1969
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_46504 ( "Round" text, "Team #1" text, "Agg." text, "Team #2" text, "1st leg" text, "2nd leg" text )
### Question ###
What is the 2nd leg of dinamo minsk team #2?
### Accurate SQL ###
|
SELECT "2nd leg" FROM table_46504 WHERE "Team #2" = 'dinamo minsk'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_204_381 ( id number, "sum" number, "mongolian" number, "population\n(2005)" number, "population\n(2008)" number, "population\n(2009)" number, "area\nkm2" number, "density\n/km2" number, "sum centre\npopulation" number )
### Question ###
what is the largest population of 2009 ?
### Accurate SQL ###
|
SELECT MAX("population\n(2005)") FROM table_204_381
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_62459 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
### Question ###
Which country is Howard Clark from?
### Accurate SQL ###
|
SELECT "Country" FROM table_62459 WHERE "Player" = 'howard clark'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_67540 ( "Week" real, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Set 5" text, "Volume Lbs." real, "Peak Intensity(Last Set)" text, "% of 1 Rep Max(Last Set)" text )
### Question ###
How many lbs does a set 4 of 115lb x 8reps have?
### Accurate SQL ###
|
SELECT "Volume Lbs." FROM table_67540 WHERE "Set 4" = '115lb x 8reps'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_80 ( place_of_action VARCHAR, rank VARCHAR, unit VARCHAR )
### Question ###
Tell me the place of action for sergeant rank and 5th company, 2nd marines unit
### Accurate SQL ###
|
SELECT place_of_action FROM table_name_80 WHERE rank = "sergeant" AND unit = "5th company, 2nd marines"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 ###
Calculate the number of patients treated with drug hydx25 who died in or before the year 2186.
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2186.0" AND prescriptions.formulary_drug_cd = "HYDX25"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_29 (venue VARCHAR, player VARCHAR)
### Question ###
For player Les Ames, what was the venue?
### Accurate SQL ###
|
SELECT venue FROM table_name_29 WHERE player = "les ames"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_2 (flight_day VARCHAR, artist VARCHAR)
### Question ###
On what flight day was U2 played?
### Accurate SQL ###
|
SELECT flight_day FROM table_name_2 WHERE artist = "u2"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_24330803_1 ( podiums INTEGER, series VARCHAR )
### Question ###
what is the least number of podiums for a formula BMW Americas series?
### Accurate SQL ###
|
SELECT MIN(podiums) FROM table_24330803_1 WHERE series = "Formula BMW Americas"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_54 ( entered_service VARCHAR, locomotive VARCHAR )
### Question ###
What is the Entered service date of the H1 Locomotive?
### Accurate SQL ###
|
SELECT entered_service FROM table_name_54 WHERE locomotive = "h1"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_54 (category VARCHAR, for_the_show VARCHAR, year VARCHAR)
### Question ###
For 2006 what category has the Show of kasautii zindagii kay?
### Accurate SQL ###
|
SELECT category FROM table_name_54 WHERE for_the_show = "kasautii zindagii kay" AND year = 2006
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_64 (tournament VARCHAR, date VARCHAR)
### Question ###
What Tournament has a Date of 20 december 2010?
### Accurate SQL ###
|
SELECT tournament FROM table_name_64 WHERE date = "20 december 2010"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number )
TABLE: CREATE TABLE employee ( eid number, name text, salary number )
TABLE: CREATE TABLE aircraft ( aid number, name text, distance number )
TABLE: CREATE TABLE certificate ( eid number, aid number )
### Question ###
What are the numbers of all flights coming from Los Angeles?
### Accurate SQL ###
|
SELECT flno FROM flight WHERE origin = "Los Angeles"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
### Question ###
what is average age of patients whose primary disease is bowel obstruction and who are aged equal or more than 71 years?
### Accurate SQL ###
|
SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.age >= "71"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_28 ( polyunsaturated_fat VARCHAR, monounsaturated_fat VARCHAR, smoke_point VARCHAR, total_fat VARCHAR )
### Question ###
What is the polyunsaturated fat with a smoke point of c (), a total fat of 100g and 63g of monounsaturated fat?
### Accurate SQL ###
|
SELECT polyunsaturated_fat FROM table_name_28 WHERE smoke_point = "°c ()" AND total_fat = "100g" AND monounsaturated_fat = "63g"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE invoices ( invoice_number number, order_id number, invoice_date time )
TABLE: CREATE TABLE product_categories ( production_type_code text, product_type_description text, vat_rating number )
TABLE: CREATE TABLE invoice_line_items ( order_item_id number, invoice_number number, product_id number, product_title text, product_quantity text, product_price number, derived_product_cost number, derived_vat_payable number, derived_total_cost number )
TABLE: CREATE TABLE customers ( customer_id number, customer_first_name text, customer_middle_initial text, customer_last_name text, gender text, email_address text, login_name text, login_password text, phone_number text, town_city text, state_county_province text, country text )
TABLE: CREATE TABLE orders ( order_id number, customer_id number, date_order_placed time, order_details text )
TABLE: CREATE TABLE products ( product_id number, parent_product_id number, production_type_code text, unit_price number, product_name text, product_color text, product_size text )
TABLE: CREATE TABLE accounts ( account_id number, customer_id number, date_account_opened time, account_name text, other_account_details text )
TABLE: CREATE TABLE financial_transactions ( transaction_id number, account_id number, invoice_number number, transaction_type text, transaction_date time, transaction_amount number, transaction_comment text, other_transaction_details text )
TABLE: CREATE TABLE order_items ( order_item_id number, order_id number, product_id number, product_quantity text, other_order_item_details text )
### Question ###
Show order ids and the number of products in each order.
### Accurate SQL ###
|
SELECT order_id, COUNT(DISTINCT product_id) FROM order_items GROUP BY order_id
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_27091128_2 ( replaced_by VARCHAR, team VARCHAR )
### Question ###
Who replaced the previous manager of Altay?
### Accurate SQL ###
|
SELECT replaced_by FROM table_27091128_2 WHERE team = "Altay"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_23944006_4 ( surface VARCHAR, score VARCHAR )
### Question ###
Name the number of surfaces for 4-6, 2-6
### Accurate SQL ###
|
SELECT COUNT(surface) FROM table_23944006_4 WHERE score = "4-6, 2-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 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 instructor ( instructor_id int, name varchar, uniqname varchar )
TABLE: CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text 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 program ( program_id int, name varchar, college varchar, introduction varchar )
TABLE: CREATE TABLE semester ( semester_id int, semester varchar, year int )
TABLE: CREATE TABLE course_prerequisite ( pre_course_id int, course_id int )
TABLE: CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar )
TABLE: CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar )
TABLE: CREATE TABLE course_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 jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int )
TABLE: CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int )
TABLE: CREATE TABLE area ( course_id int, area varchar )
TABLE: CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar )
TABLE: CREATE TABLE gsi ( course_offering_id int, student_id 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 )
TABLE: CREATE TABLE ta ( campus_job_id int, student_id int, location varchar )
### Question ###
Could RCNSCI 104 fulfill something other than a general elective ?
### Accurate SQL ###
|
SELECT DISTINCT program_course.category FROM course, program_course WHERE course.department = 'RCNSCI' AND course.number = 104 AND program_course.course_id = course.course_id
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_56 ( time VARCHAR, country VARCHAR, lane VARCHAR )
### Question ###
For how long did Bolivia have a lane greater than 6?
### Accurate SQL ###
|
SELECT COUNT(time) FROM table_name_56 WHERE country = "bolivia" AND lane > 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_1875157_1 ( winnings VARCHAR, starts VARCHAR )
### Question ###
Did this driver have any winnings the season he had 32 starts
### Accurate SQL ###
|
SELECT COUNT(winnings) FROM table_1875157_1 WHERE starts = 32
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 (original_name VARCHAR, language VARCHAR)
### Question ###
What is the original name of the song performed in Swedish?
### Accurate SQL ###
|
SELECT original_name FROM table_name_70 WHERE language = "swedish"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_37512 ( "Season" text, "Competition" text, "Round" text, "Against" text, "Played" text, "Drew" text, "Lost" text, "Goals for" text, "Goals against" text )
### Question ###
Which season did not qualify for UEFA competitions?
### Accurate SQL ###
|
SELECT "Season" FROM table_37512 WHERE "Against" = 'did not qualify for uefa competitions'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_26 ( january VARCHAR, region VARCHAR )
### Question ###
What is the January climate figure for Eastman?
### Accurate SQL ###
|
SELECT january FROM table_name_26 WHERE region = "eastman"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 (college_junior_club_team__league_ VARCHAR, player VARCHAR)
### Question ###
What college or club team did Dale Mitchell play for?
### Accurate SQL ###
|
SELECT college_junior_club_team__league_ FROM table_name_48 WHERE player = "dale mitchell"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_56 ( driver VARCHAR, part_1 VARCHAR )
### Question ###
Which driver had a Part 1 time of 1:13.306?
### Accurate SQL ###
|
SELECT driver FROM table_name_56 WHERE part_1 = "1:13.306"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_24 (venue VARCHAR, competition VARCHAR, position VARCHAR)
### Question ###
Which venue hosts the Olympic Games for DNQ position?
### Accurate SQL ###
|
SELECT venue FROM table_name_24 WHERE competition = "olympic games" AND position = "dnq"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_65508 ( "Club" text, "League/Division" text, "Home Ground" text, "Location" text, "Position in 2012-13" text )
### Question ###
What is the Home Ground with the Location n/a for the Club kcdrsc?
### Accurate SQL ###
|
SELECT "Home Ground" FROM table_65508 WHERE "Location" = 'n/a' AND "Club" = 'kcdrsc'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 ###
Show sum of budget in each year and bin creation time by year in a line chart.
### Accurate SQL ###
|
SELECT Creation, SUM(Budget_in_Billions) FROM department
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_69 ( elected INTEGER, incumbent VARCHAR, party VARCHAR, district VARCHAR )
### Question ###
What's the elected year of Nydia Velazquez in a district bigger than 2 and a democrat?
### Accurate SQL ###
|
SELECT AVG(elected) FROM table_name_69 WHERE party = "democrat" AND district > 2 AND incumbent = "nydia velazquez"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_18018248_2 ( draws VARCHAR, goals_conceded VARCHAR )
### Question ###
How many draws were there when the conceded goals was numbered at 45?
### Accurate SQL ###
|
SELECT COUNT(draws) FROM table_18018248_2 WHERE goals_conceded = 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 Department ( DNO INTEGER, Division VARCHAR(2), DName VARCHAR(25), Room VARCHAR(5), Building VARCHAR(13), DPhone INTEGER )
TABLE: CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) )
TABLE: CREATE TABLE Course ( CID VARCHAR(7), CName VARCHAR(40), Credits INTEGER, Instructor INTEGER, Days VARCHAR(5), Hours VARCHAR(11), DNO INTEGER )
TABLE: CREATE TABLE Enrolled_in ( StuID INTEGER, CID VARCHAR(7), Grade VARCHAR(2) )
TABLE: CREATE TABLE Minor_in ( StuID INTEGER, DNO INTEGER )
TABLE: CREATE TABLE Gradeconversion ( lettergrade VARCHAR(2), gradepoint FLOAT )
TABLE: CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) )
TABLE: CREATE TABLE Member_of ( FacID INTEGER, DNO INTEGER, Appt_Type VARCHAR(15) )
### Question ###
Show me about the correlation between Credits and DNO in a scatter chart.
### Accurate SQL ###
|
SELECT Credits, DNO FROM Course ORDER BY Credits
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_25548213_1 ( title VARCHAR, directed_by VARCHAR )
### Question ###
What was the name of the episode that bill lawrence directed?
### Accurate SQL ###
|
SELECT title FROM table_25548213_1 WHERE directed_by = "Bill Lawrence"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int )
TABLE: CREATE TABLE 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_prerequisite ( pre_course_id int, course_id int )
TABLE: CREATE TABLE semester ( semester_id int, semester varchar, year int )
TABLE: CREATE TABLE ta ( campus_job_id int, student_id int, location varchar )
TABLE: CREATE TABLE requirement ( requirement_id int, requirement varchar, college 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 offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int )
TABLE: CREATE TABLE gsi ( course_offering_id int, student_id int )
TABLE: CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int )
TABLE: CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar )
TABLE: CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar )
TABLE: CREATE TABLE area ( course_id int, area varchar )
TABLE: CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar )
TABLE: CREATE TABLE program_course ( program_id int, course_id int, workload int, category 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 program ( program_id int, name varchar, college varchar, introduction varchar )
TABLE: CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar )
### Question ###
Tell me which Research-Non Phd courses do not have prerequisites .
### Accurate SQL ###
|
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Research-Non Phd%' OR course.description LIKE '%Research-Non Phd%' OR course.name LIKE '%Research-Non Phd%') AND course.enforced_requirement = 'N / 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_66433 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
### Question ###
What is the average rank of Elise Matthysen in lanes under 8?
### Accurate SQL ###
|
SELECT AVG("Rank") FROM table_66433 WHERE "Name" = 'elise matthysen' AND "Lane" < '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_75246 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
### Question ###
Which Opponent has a Record of 38 20 12 2?
### Accurate SQL ###
|
SELECT "Opponent" FROM table_75246 WHERE "Record" = '38–20–12–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 book ( Title VARCHAR, Writer VARCHAR )
### Question ###
What are the titles of the books whose writer is not 'Elaine Lee'?
### Accurate SQL ###
|
SELECT Title FROM book WHERE Writer <> "Elaine Lee"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int )
TABLE: CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar )
TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )
TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar )
TABLE: CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar )
TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text )
TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_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 time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int )
TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text )
TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int )
TABLE: CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text )
TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar )
TABLE: CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar )
TABLE: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )
TABLE: CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar )
TABLE: CREATE TABLE 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 ground_service ( city_code text, airport_code text, transport_type text, ground_fare int )
TABLE: CREATE TABLE days ( days_code varchar, day_name varchar )
TABLE: CREATE TABLE month ( month_number int, month_name text )
TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time 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 city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code 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 )
### Question ###
flights from LOS ANGELES to PITTSBURGH
### 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LOS ANGELES' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.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_1889233_2 ( period_in_office VARCHAR, parliament VARCHAR )
### Question ###
During what period were parliament 11th?
### Accurate SQL ###
|
SELECT period_in_office FROM table_1889233_2 WHERE parliament = "11th"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_28392 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Joined" text, "Primary Conference" text, "Colors" text )
### Question ###
What is the institution with the nickname engineers?
### Accurate SQL ###
|
SELECT "Institution" FROM table_28392 WHERE "Nickname" = 'Engineers'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_19 (song VARCHAR, artist VARCHAR)
### Question ###
What Song is by the Artist 'mor ve ötesi'?
### Accurate SQL ###
|
SELECT song FROM table_name_19 WHERE artist = "mor ve ötesi"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_test_29 ( "id" int, "bleeding" int, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "trauma" bool, "renal_disease" bool, "creatinine_clearance_cl" float, "hemorrhagic_stroke" bool, "platelet_count" float, "surgery" bool, "thrombocytopenia" float, "liver_disease" bool, "oral_anticoagulant_therapy" bool, "heart_rate" int, "kidney_disease" bool, "inr" float, "hypertension" bool, "NOUSE" float )
### Question ###
systolic blood pressure ( supine ) <= 90 mmhg;
### Accurate SQL ###
|
SELECT * FROM table_test_29 WHERE systolic_blood_pressure_sbp <= 90
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text )
TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number )
TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time )
TABLE: CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time )
TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text )
TABLE: CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time )
TABLE: CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number )
TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )
TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text )
TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
### Question ###
in a year before how many patients were prescribed phenylephrine in the same month after the procedure of venous cath nec.
### Accurate SQL ###
|
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'venous cath nec') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'phenylephrine' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.startdate, 'start of month')
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_21109 ( "Rank" real, "Company" text, "Headquarters" text, "Industry" text, "Sales (billion $)" text, "Profits (billion $)" text, "Assets (billion $)" text, "Market Value (billion $)" text )
### Question ###
What is the ranking of BNP Paribas?
### Accurate SQL ###
|
SELECT MIN("Rank") FROM table_21109 WHERE "Company" = 'BNP Paribas'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 ( home VARCHAR, score VARCHAR )
### Question ###
Which home team has a score of 5 6?
### Accurate SQL ###
|
SELECT home FROM table_name_90 WHERE score = "5 – 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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
### Question ###
give me the number of patients whose admission location is emergency room admit and drug code is prav10?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND prescriptions.formulary_drug_cd = "PRAV10"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_18428016_1 (no_in_series VARCHAR, written_by VARCHAR, directed_by VARCHAR)
### Question ###
Name the total number in the series written by john banas and directed by pino amenta
### Accurate SQL ###
|
SELECT COUNT(no_in_series) FROM table_18428016_1 WHERE written_by = "John Banas" AND directed_by = "Pino Amenta"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE branch ( branch_id number, name text, open_year text, address_road text, city text, membership_amount text )
TABLE: CREATE TABLE member ( member_id number, card_number text, name text, hometown text, level number )
TABLE: CREATE TABLE membership_register_branch ( member_id number, branch_id text, register_year text )
TABLE: CREATE TABLE purchase ( member_id number, branch_id text, year text, total_pounds number )
### Question ###
Show the member name and hometown who registered a branch in 2016.
### Accurate SQL ###
|
SELECT T2.name, T2.hometown FROM membership_register_branch AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T1.register_year = 2016
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_28 ( tie_no VARCHAR, home_team VARCHAR )
### Question ###
Liverpool as a home team as listed what in the Tie no column?
### Accurate SQL ###
|
SELECT tie_no FROM table_name_28 WHERE home_team = "liverpool"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) )
TABLE: CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19,4), derived_product_cost DECIMAL(19,4), derived_vat_payable DECIMAL(19,4), derived_total_cost DECIMAL(19,4) )
TABLE: CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME )
TABLE: CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255) )
TABLE: CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) )
TABLE: CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, production_type_code VARCHAR(15), unit_price DECIMAL(19,4), product_name VARCHAR(80), product_color VARCHAR(20), product_size VARCHAR(20) )
TABLE: CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) )
TABLE: CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) )
TABLE: CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(50), customer_middle_initial VARCHAR(1), customer_last_name VARCHAR(50), gender VARCHAR(1), email_address VARCHAR(255), login_name VARCHAR(80), login_password VARCHAR(20), phone_number VARCHAR(255), town_city VARCHAR(50), state_county_province VARCHAR(50), country VARCHAR(50) )
### Question ###
Show the transaction types and the total amount of transactions with a bar chart, rank by the y-axis in descending.
### Accurate SQL ###
|
SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type ORDER BY SUM(transaction_amount) 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_75489 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
### Question ###
Which Silver has a Gold of 2, and a Nation of puerto rico, and a Total smaller than 12?
### Accurate SQL ###
|
SELECT SUM("Silver") FROM table_75489 WHERE "Gold" = '2' AND "Nation" = 'puerto rico' AND "Total" < '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 club_rank ( Total INTEGER )
### Question ###
How many clubs have total medals less than 10?
### Accurate SQL ###
|
SELECT COUNT(*) FROM club_rank WHERE Total < 10
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_6 (how_ashtagrama_iyers_say_it VARCHAR, pure_tamil VARCHAR)
### Question ###
Name how ashtagrama lyers say it for engal veetil, engal agathil
### Accurate SQL ###
|
SELECT how_ashtagrama_iyers_say_it FROM table_name_6 WHERE pure_tamil = "engal veetil, engal agathil"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 ( szdsz VARCHAR, mszp VARCHAR, date VARCHAR )
### Question ###
What is the SZDSZ percentage with an MSZP of 25% on 25/2/2009?
### Accurate SQL ###
|
SELECT szdsz FROM table_name_8 WHERE mszp = "25%" AND date = "25/2/2009"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE 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 )
### Question ###
what is the number of patients whose admission location is phys referral/normal deli and procedure icd9 code is 9955?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND procedures.icd9_code = "9955"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_49 (owner VARCHAR, time VARCHAR, year VARCHAR)
### Question ###
Which owner has the time 2:03.00 and the year of 1991 kd?
### Accurate SQL ###
|
SELECT owner FROM table_name_49 WHERE time = "2:03.00" AND year = "1991 kd"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 ( växjö VARCHAR, karlstad VARCHAR )
### Question ###
What did Vaxjo score when Karlstad scored 1?
### Accurate SQL ###
|
SELECT växjö FROM table_name_53 WHERE karlstad = "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_2611 ( "#" text, "Spacecraft" text, "Spacewalkers" text, "Start ( UTC )" text, "End (UTC)" text, "Duration" text )
### Question ###
What is the end (UTC) for spacecraft STS-114 Eva 3?
### Accurate SQL ###
|
SELECT "End (UTC)" FROM table_2611 WHERE "Spacecraft" = 'STS-114 EVA 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_1 (week_12 VARCHAR, week_1 VARCHAR, week_2 VARCHAR)
### Question ###
What is the week 12 nomination that had a week 1 nomination of Maria Maxine and a week 2 nomination of Henri Satu?
### Accurate SQL ###
|
SELECT week_12 FROM table_name_1 WHERE week_1 = "maria maxine" AND week_2 = "henri satu"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_1590 ( "Character" text, "Indianapolis Concerts" text, "Sarasota" text, "Broadway" text, "Brighton Cast" text )
### Question ###
Name the indianapolis concerts for les minski
### Accurate SQL ###
|
SELECT "Indianapolis Concerts" FROM table_1590 WHERE "Sarasota" = 'Les Minski'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_76 (tournament VARCHAR, surface VARCHAR, score_in_the_final VARCHAR)
### Question ###
Which tournament had a clay surface and a score of 6–1, 3–6, 6–2?
### Accurate SQL ###
|
SELECT tournament FROM table_name_76 WHERE surface = "clay" AND score_in_the_final = "6–1, 3–6, 6–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_182410_10 ( position VARCHAR, digital_terrestrial_channel VARCHAR )
### Question ###
What is the position of digital channel 5 44 (+1)?
### Accurate SQL ###
|
SELECT position FROM table_182410_10 WHERE digital_terrestrial_channel = "5 44 (+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_16363 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
### Question ###
What was the original air date of the episode 'Quarry'?
### Accurate SQL ###
|
SELECT "Original air date" FROM table_16363 WHERE "Title" = 'Quarry'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_36 (bronze INTEGER, nation VARCHAR, rank VARCHAR, gold VARCHAR, silver VARCHAR)
### Question ###
What is the smallest bronze with a Gold smaller than 3, and a Silver larger than 1, and a Rank of 6, and a Nation of hungary?
### Accurate SQL ###
|
SELECT MIN(bronze) FROM table_name_36 WHERE gold < 3 AND silver > 1 AND rank = 6 AND nation = "hungary"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE ROLES ( role_description VARCHAR, role_code VARCHAR )
### Question ###
What is the description of role code ED?
### Accurate SQL ###
|
SELECT role_description FROM ROLES WHERE role_code = "ED"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_22020724_1 ( year__ceremony_ VARCHAR, title_in_the_original_language VARCHAR )
### Question ###
What year was the ceremony where the film 'Tummien Perhosten Koti' was submitted?
### Accurate SQL ###
|
SELECT year__ceremony_ FROM table_22020724_1 WHERE title_in_the_original_language = "Tummien perhosten koti"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_21001903_2 ( mens_singles VARCHAR, womens_singles VARCHAR, tour VARCHAR )
### Question ###
when womens singles is wang yihan and tour is french super series, what were the men's singles?
### Accurate SQL ###
|
SELECT mens_singles FROM table_21001903_2 WHERE womens_singles = "Wang Yihan" AND tour = "French Super Series"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT )
TABLE: CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT )
TABLE: CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT )
### Question ###
Return a bar chart on how many wines are there for each grape?
### Accurate SQL ###
|
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
### Question ###
what is drug type of drug name nafcillin?
### Accurate SQL ###
|
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Nafcillin"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_77019 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text )
### Question ###
Which Player has Years for Grizzlies of 2002-2003?
### Accurate SQL ###
|
SELECT "Player" FROM table_77019 WHERE "Years for Grizzlies" = '2002-2003'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE station ( id int, network_name text, services text, local_authority text )
TABLE: CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int )
TABLE: CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text )
TABLE: CREATE TABLE route ( train_id int, station_id int )
### Question ###
Draw a bar chart of services versus the number of services, and sort by the names in asc.
### Accurate SQL ###
|
SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 (tries_for INTEGER, team VARCHAR, points_against VARCHAR)
### Question ###
WHich Tries has a Team of pau and Points against larger than 103?
### Accurate SQL ###
|
SELECT MIN(tries_for) FROM table_name_48 WHERE team = "pau" AND points_against > 103
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 (genbank_id VARCHAR)
### Question ###
Which 3’UTR sequence has the GenBank ID at hq021440?
### Accurate SQL ###
|
SELECT 3 AS ’utr_sequence FROM table_name_87 WHERE genbank_id = "hq021440"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_22871316_11 (high_points VARCHAR, series VARCHAR)
### Question ###
Who has the high points when 3-2 is the series?
### Accurate SQL ###
|
SELECT high_points FROM table_22871316_11 WHERE series = "3-2"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_93 (total VARCHAR, player VARCHAR, to_par VARCHAR)
### Question ###
What is the total number that Tom Watson parred larger than 10?
### Accurate SQL ###
|
SELECT COUNT(total) FROM table_name_93 WHERE player = "tom watson" AND to_par > 10
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_30121046_1 ( poor_law_union VARCHAR, townland VARCHAR )
### Question ###
What is the poor law union of the Ardacrow townland?
### Accurate SQL ###
|
SELECT poor_law_union FROM table_30121046_1 WHERE townland = "Ardacrow"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_56 (location VARCHAR, country VARCHAR)
### Question ###
What was the location of the tournament held in Spain?
### Accurate SQL ###
|
SELECT location FROM table_name_56 WHERE country = "spain"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text )
TABLE: CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year int )
TABLE: CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int )
### Question ###
Show the number of countries for all people whose age is smaller than the average, display by the x-axis in ascending.
### Accurate SQL ###
|
SELECT Country, COUNT(Country) FROM people WHERE Age < (SELECT AVG(Age) FROM people) GROUP BY Country ORDER BY Country
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.