You are tasked with enriching a 'SALES DATA' table in Snowflake with geographic information based on IP addresses. You have access to an external function 'GEO LOOKUP(ip_address)' that returns a JSON object containing geographical details (city, region, country) for a given IP address. The 'SALES DATA' table contains 'SALE D', 'CUSTOMER D', ADDRESS', and 'SALE AMOUNT columns. You need to enrich the table with city and country information derived from the IP address. Which of the following statements will correctly add 'CITY' and 'COUNTRY columns to a new table 'ENRICHED SALES DATA based on the external function 'GEO LOOKUP , correctly handling potential NULL values and ensuring data type consistency?

Correct Answer: D
Option D is the most robust solution. It extracts the city and country values from the JSON object returned by the function using the operator. The cast ensures the data is stored as strings. Critically, it uses to handle cases where the 'GEO_LOOKUP' function might return NULL (e.g., for invalid IP addresses), preventing errors and providing a default value ('Unknown'). Option A does not handle NULL, Option B's 'GET_PATH' is not a standard Snowflake function for JSON parsing, Options C parses the GEO LOOKUP output to json format if its not which can result in the 'CITY' and 'COUNTRY becoming 'NULL'. The option E 'PARSE_JSON' would throw errors on invalid json strings in the ip address.