sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: investors 
columns : [['investor id', 'number'], ['investor details', 'text']]

 -- Table: lots 
columns : [['lot id', 'number'], ['investor id', 'number'], ['lot details', 'text']]

 -- Table: reference transaction types 
columns : [['transaction type code', 'text'], ['transaction type description', 'text']]

 -- Table: transactions 
columns : [['transaction id', 'number'], ['investor id', 'number'], ['transaction type code', 'text'], ['date of transaction', 'time'], ['amount of transaction', 'number'], ['share count', 'text'], ['other details', 'text']]

 -- Table: sales 
columns : [['sales transaction id', 'number'], ['sales details', 'text']]

 -- Table: purchases 
columns : [['purchase transaction id', 'number'], ['purchase details', 'text']]

 -- Table: transactions lots 
columns : [['transaction id', 'number'], ['lot 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 ids of the investors who have at least two transactions.
SQL: SELECT T2.investor_id FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id  =  T2.investor_id GROUP BY T2.investor_id HAVING COUNT(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: investors 
columns : [['investor id', 'number'], ['investor details', 'text']]

 -- Table: lots 
columns : [['lot id', 'number'], ['investor id', 'number'], ['lot details', 'text']]

 -- Table: reference transaction types 
columns : [['transaction type code', 'text'], ['transaction type description', 'text']]

 -- Table: transactions 
columns : [['transaction id', 'number'], ['investor id', 'number'], ['transaction type code', 'text'], ['date of transaction', 'time'], ['amount of transaction', 'number'], ['share count', 'text'], ['other details', 'text']]

 -- Table: sales 
columns : [['sales transaction id', 'number'], ['sales details', 'text']]

 -- Table: purchases 
columns : [['purchase transaction id', 'number'], ['purchase details', 'text']]

 -- Table: transactions lots 
columns : [['transaction id', 'number'], ['lot 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 ids and details of the investors who have at least two transactions with type code "SALE".
SQL: SELECT T2.investor_id ,  T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id  =  T2.investor_id WHERE T2.transaction_type_code  =  "SALE" GROUP BY T2.investor_id HAVING COUNT(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: investors 
columns : [['investor id', 'number'], ['investor details', 'text']]

 -- Table: lots 
columns : [['lot id', 'number'], ['investor id', 'number'], ['lot details', 'text']]

 -- Table: reference transaction types 
columns : [['transaction type code', 'text'], ['transaction type description', 'text']]

 -- Table: transactions 
columns : [['transaction id', 'number'], ['investor id', 'number'], ['transaction type code', 'text'], ['date of transaction', 'time'], ['amount of transaction', 'number'], ['share count', 'text'], ['other details', 'text']]

 -- Table: sales 
columns : [['sales transaction id', 'number'], ['sales details', 'text']]

 -- Table: purchases 
columns : [['purchase transaction id', 'number'], ['purchase details', 'text']]

 -- Table: transactions lots 
columns : [['transaction id', 'number'], ['lot 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 dates of transactions with at least 100 share count or amount bigger than 100?
SQL: SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count  >=  100 OR amount_of_transaction  >=  100
-- Language PostgreSQL
        -- Tables: 
             -- Table: investors 
columns : [['investor id', 'number'], ['investor details', 'text']]

 -- Table: lots 
columns : [['lot id', 'number'], ['investor id', 'number'], ['lot details', 'text']]

 -- Table: reference transaction types 
columns : [['transaction type code', 'text'], ['transaction type description', 'text']]

 -- Table: transactions 
columns : [['transaction id', 'number'], ['investor id', 'number'], ['transaction type code', 'text'], ['date of transaction', 'time'], ['amount of transaction', 'number'], ['share count', 'text'], ['other details', 'text']]

 -- Table: sales 
columns : [['sales transaction id', 'number'], ['sales details', 'text']]

 -- Table: purchases 
columns : [['purchase transaction id', 'number'], ['purchase details', 'text']]

 -- Table: transactions lots 
columns : [['transaction id', 'number'], ['lot 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 all sales and purchases?
SQL: SELECT sales_details FROM sales UNION SELECT purchase_details FROM purchases
-- Language PostgreSQL
        -- Tables: 
             -- Table: investors 
columns : [['investor id', 'number'], ['investor details', 'text']]

 -- Table: lots 
columns : [['lot id', 'number'], ['investor id', 'number'], ['lot details', 'text']]

 -- Table: reference transaction types 
columns : [['transaction type code', 'text'], ['transaction type description', 'text']]

 -- Table: transactions 
columns : [['transaction id', 'number'], ['investor id', 'number'], ['transaction type code', 'text'], ['date of transaction', 'time'], ['amount of transaction', 'number'], ['share count', 'text'], ['other details', 'text']]

 -- Table: sales 
columns : [['sales transaction id', 'number'], ['sales details', 'text']]

 -- Table: purchases 
columns : [['purchase transaction id', 'number'], ['purchase details', 'text']]

 -- Table: transactions lots 
columns : [['transaction id', 'number'], ['lot 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 lots which are not used in any transactions?
SQL: SELECT lot_details FROM Lots EXCEPT SELECT T1.lot_details FROM Lots AS T1 JOIN transactions_lots AS T2 ON T1.lot_id  =  T2.lot_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: How many available hotels are there in total?
SQL: SELECT count(*) FROM HOTELS
-- 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 total number of available hotels.
SQL: SELECT count(*) FROM HOTELS
-- 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 price ranges of hotels?
SQL: SELECT price_range FROM HOTELS
-- 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: Tell me the price ranges for all the hotels.
SQL: SELECT price_range FROM HOTELS
-- 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 all distinct location names.
SQL: SELECT DISTINCT Location_Name FROM LOCATIONS
-- 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 distinct location names?
SQL: SELECT DISTINCT Location_Name FROM LOCATIONS
-- 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 details of all the staff members.
SQL: SELECT Name ,  Other_Details FROM Staff
-- 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 is the name and detail of each staff member?
SQL: SELECT Name ,  Other_Details FROM Staff
-- 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 details of all visitors.
SQL: SELECT Tourist_Details FROM VISITORS
-- 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 is the detail of each visitor?
SQL: SELECT Tourist_Details FROM VISITORS
-- 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 price ranges of hotels with 5 star ratings.
SQL: SELECT price_range FROM HOTELS WHERE star_rating_code  =  "5"
-- 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 price ranges of five star hotels?
SQL: SELECT price_range FROM HOTELS WHERE star_rating_code  =  "5"
-- 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 range of hotels that have 5 star ratings and allow pets.
SQL: SELECT avg(price_range) FROM HOTELS WHERE star_rating_code  =  "5" AND pets_allowed_yn  =  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: What is the average price range of five star hotels that allow pets?
SQL: SELECT avg(price_range) FROM HOTELS WHERE star_rating_code  =  "5" AND pets_allowed_yn  =  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: What is the address of the location "UK Gallery"?
SQL: SELECT Address FROM LOCATIONS WHERE Location_Name  =  "UK Gallery"
-- 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 address of the location named "UK Gallery".
SQL: SELECT Address FROM LOCATIONS WHERE Location_Name  =  "UK Gallery"