CREATE TABLE phone_market (Market_ID INT, Phone_ID TEXT, Num_of_stock INT)
CREATE TABLE market (Market_ID INT, District TEXT, Num_of_employees INT, Num_of_shops FLOAT, Ranking INT)
CREATE TABLE phone (Name TEXT, Phone_ID INT, Memory_in_G INT, Carrier TEXT, Price FLOAT)

For each phone, show its names and total number of stocks Visualize by bar chart, and rank num of stock in descending order.
SELECT Name, SUM(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name ORDER BY SUM(T1.Num_of_stock) DESC
SELECT "Name", SUM("T1"."Num_of_stock") FROM "phone_market" AS "T1" JOIN "phone" AS "T2" ON "T1"."Phone_ID" = "T2"."Phone_ID" GROUP BY "T2"."Name" ORDER BY SUM("T1"."Num_of_stock") DESC NULLS LAST