A regional manager ranks stores by sales in each city: SELECT city, store_id, SUM(sales) AS total_sales, RANK() OVER (PARTITION BY city ORDER BY SUM(sales) DESC) AS store_rank FROM stores GROUP BY city, store_id; If two stores tie for first place in a city, what will the next store’s rank be? OPTIONS:A. 2B. 3C. 1D. It depends on the number of total stores ANSWER:B EXPLANATION:RANK() skips numbers after ties (e.g., 1, 1, 3). To avoid skipped ranks, DENSE_RANK() would be used instead.
Blog
A sales manager wants to see how much each product contribut…
A sales manager wants to see how much each product contributes to total revenue: SELECT product_id, SUM(sales) AS product_sales, SUM(sales) OVER () AS total_sales FROM sales GROUP BY product_id; What does the total_sales column represent? OPTIONS:A. The total sales for each product onlyB. The total sales across all products, repeated for every rowC. The maximum sales of any productD. The running total of product sales in descending order ANSWER:B EXPLANATION:The empty OVER() applies the sum across the entire dataset, repeating the same total for each product.
What is the group of fungi associated with the greatest numb…
What is the group of fungi associated with the greatest number of human diseases?
What does polyphyletic mean? Which group of eukaryotes is po…
What does polyphyletic mean? Which group of eukaryotes is polyphyletic?
What source do microbiologists use to find biochemical chara…
What source do microbiologists use to find biochemical characteristics of bacteria?
What was the treatment for Cora’s Creutzfeldt-Jakob disease…
What was the treatment for Cora’s Creutzfeldt-Jakob disease in Chapter 1’s Clinical Focus?
Name one unique feature of fungi and one unique feature of h…
Name one unique feature of fungi and one unique feature of helminths.
What was the causative agent of Marsha’s illness in Chapter…
What was the causative agent of Marsha’s illness in Chapter 4?
An auditor who accepts an audit engagement and does not poss…
An auditor who accepts an audit engagement and does not possess expertise with respect to the business entity’s industry at that point, should:
Question Set 4 Ensemble Learning
Question Set 4 Ensemble Learning