Ultimate access to all questions.
You are working on a data analysis project where you need to transform a DataFrame named 'df_products' from a long format to a wide format for better readability and analysis. The DataFrame contains the following columns: 'product_id', 'product_name', 'category', and 'price'. Your task is to use the Spark SQL 'PIVOT' clause to achieve this transformation, creating separate columns for each category ('Electronics', 'Clothing', 'Food') and calculating the total price for each category. Consider the following constraints: the solution must be scalable to accommodate additional categories without manual updates, and it should efficiently handle large datasets. Which of the following queries meets these requirements? (Choose two correct options if option E is available, otherwise choose one.)