Company: ZomatoPA_IITK
Difficulty: medium
Total Drug Sales by Manufacturer The table pharmacy_sales records the sales of each drug together with the company that makes it. Write an SQL query that computes the total sales of each manufacturer in millions of dollars, rounded to the nearest whole number . Return one row per manufacturer, sorted by this rounded total from highest to lowest; manufacturers with the same rounded total are sorted alphabetically by name. Table: pharmacy_sales Column Type Description manufacturer VARCHAR(40) Name of the drug manufacturer drug_name VARCHAR(40) Name of the drug sales DECIMAL(14,2) Total sales of this drug, in dollars Expected Output Return exactly these 2 columns, in this order: Column Description manufacturer Name of the manufacturer total_sales_millions The manufacturer's total sales divided by 1,000,000 and rounded to the nearest integer Rules A manufacturer's total is the sum of sales over all of its rows. Several rows of the same manufacturer, even with the same sales value, are all