Back to questions

SQL SUM Practice Exercise SQL Interview Question

SQL SUM Practice Exercise

SQL Interview Question

Imagine you are a Data Analyst working at CVS Pharmacy, and you had access to pharmacy sales data.

Output the total number of drugs manufactured by Pfizer, and output the total sales for all the Pfizer drugs.

Table:

Column NameType
product_idinteger
units_soldinteger
total_salesdecimal
cogsdecimal
manufacturervarchar
drugvarchar

Sample Input:

product_idunits_soldtotal_salescogsmanufacturerdrug
937410293452.54208876.01Eli LillyZyprexa
3494698600997.19521182.16AstraZenecaSurmontil
6177023500101.61419174.97BiogenVaricose Relief
13614481410842581006447.73BiogenBurkhart
...................

Example Output:

countsum
1327502472.25

Difficulty

Easy

Input

Output