Two Easy Approaches using UNION and UNPIVOT Explained
There can be two approaches to the problem :\n1. Using UNION \n\nSELECT product_id, \'store1\' AS store, store1 AS price FROM Products WHERE store1 IS NOT NULL\
There can be two approaches to the problem :\n1. Using UNION \n```\nSELECT product_id, \'store1\' AS store, store1 AS price FROM Products WHERE store1 IS NOT NULL\nUNION \nSELECT product_id, \'store2\' AS store, store2 AS price FROM Products WHERE store2 IS NOT NULL\nUNION \nSELECT product_id, \'store3\' AS store, store3 AS price FROM Products WHERE store3 IS NOT NULL\n```\n\n2. Using UNPIVOT : \n\n\tUNPIVOT is a relational operator that accepts two columns, along with  a list of columns, and generates a row for each column specified in the list.\n\n```\nSELECT \n    product_id,\n    store,\n    price\nFROM Products\nUNPIVOT\n(\n\tprice\n\tFOR store in (store1,store2,store3)\n) AS T\n```
['Union Find', 'MySQL']