sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the average price of hotels for different pet policy.
SQL: SELECT pets_allowed_yn ,  avg(price_range) FROM HOTELS GROUP BY pets_allowed_yn
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the average prices of hotels grouped by their pet policy.
SQL: SELECT pets_allowed_yn ,  avg(price_range) FROM HOTELS GROUP BY pets_allowed_yn
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the id and star rating of each hotel, ordered by its price from low to high.
SQL: SELECT hotel_id ,  star_rating_code FROM HOTELS ORDER BY price_range ASC
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the id and star rating of each hotel and sort them in increasing order of price.
SQL: SELECT hotel_id ,  star_rating_code FROM HOTELS ORDER BY price_range ASC
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the details of the top 3 most expensive hotels.
SQL: SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the details of the three most expensive hotels?
SQL: SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the details and star ratings of the 3 least expensive hotels.
SQL: SELECT other_hotel_details ,  star_rating_code FROM HOTELS ORDER BY price_range ASC LIMIT 3
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the details and star ratings of the three hotels with the lowest price ranges?
SQL: SELECT other_hotel_details ,  star_rating_code FROM HOTELS ORDER BY price_range ASC LIMIT 3
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the transportation method most people choose to get to tourist attractions.
SQL: SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Which transportation method is used the most often to get to tourist attractions?
SQL: SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the description and code of the attraction type most tourist attractions belong to.
SQL: SELECT T1.Attraction_Type_Description ,  T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code  =  T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Which attraction type does the most tourist attractions belong to? Tell me its  attraction type description and code.
SQL: SELECT T1.Attraction_Type_Description ,  T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code  =  T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show different ways to get to attractions and the number of attractions that can be accessed in the corresponding way.
SQL: SELECT How_to_Get_There ,  COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: List all the possible ways to get to attractions, together with the number of attractions accessible by these methods.
SQL: SELECT How_to_Get_There ,  COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show different tourist attractions' names, ids, and the corresponding number of visits.
SQL: SELECT T1.Name ,  T2.Tourist_Attraction_ID ,   COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the name, id and the corresponding number of visits for each  tourist attraction?
SQL: SELECT T1.Name ,  T2.Tourist_Attraction_ID ,   COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the names and ids of tourist attractions that are visited at least two times.
SQL: SELECT T1.Name ,  T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: ref hotel star ratings 
columns : [['star rating code', 'text'], ['star rating description', 'text']]

 -- Table: locations 
columns : [['location id', 'number'], ['location name', 'text'], ['address', 'text'], ['other details', 'text']]

 -- Table: ref attraction types 
columns : [['attraction type code', 'text'], ['attraction type description', 'text']]

 -- Table: visitors 
columns : [['tourist id', 'number'], ['tourist details', 'text']]

 -- Table: features 
columns : [['feature id', 'number'], ['feature details', 'text']]

 -- Table: hotels 
columns : [['hotel id', 'number'], ['star rating code', 'text'], ['pets allowed yn', 'text'], ['price range', 'number'], ['other hotel details', 'text']]

 -- Table: tourist attractions 
columns : [['tourist attraction id', 'number'], ['attraction type code', 'text'], ['location id', 'number'], ['how to get there', 'text'], ['name', 'text'], ['description', 'text'], ['opening hours', 'text'], ['other details', 'text']]

 -- Table: street markets 
columns : [['market id', 'number'], ['market details', 'text']]

 -- Table: shops 
columns : [['shop id', 'number'], ['shop details', 'text']]

 -- Table: museums 
columns : [['museum id', 'number'], ['museum details', 'text']]

 -- Table: royal family 
columns : [['royal family id', 'number'], ['royal family details', 'text']]

 -- Table: theme parks 
columns : [['theme park id', 'number'], ['theme park details', 'text']]

 -- Table: visits 
columns : [['visit id', 'number'], ['tourist attraction id', 'number'], ['tourist id', 'number'], ['visit date', 'time'], ['visit details', 'text']]

 -- Table: photos 
columns : [['photo id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['description', 'text'], ['filename', 'text'], ['other details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['tourist attraction id', 'number'], ['name', 'text'], ['other details', 'text']]

 -- Table: tourist attraction features 
columns : [['tourist attraction id', 'number'], ['feature id', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Which tourist attractions are visited at least twice? Give me their names and ids.
SQL: SELECT T1.Name ,  T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*)  >=  2