Good Afternoon,
I am new to OLAP (and dabatases in general). I need to write a query to retrieve the TOP 10 sales for a year by product.
To do so I would have to work with three tables (simplified just to show the main structure):
LOCATION(location_id,country,....,city,....,district_id),
SALES_A(shop_id, product_id,....., unit_sales,....., unit_price),
SALES_B(shop_id, product_id,...., unit_sales, unit_price),
SHOP(shop_id,....,location_id,.....)
The structure of the query I need to write using RANK()
should be clear from the examples I have seen but my main doubt comes from a comment made in this video https://www.youtube.com/watch?v=pmpzsws4xwA&t=12s about the point of using Analytical Functions to avoid using self joins.
Since all the examples I have seen so far use only a single table, and because of the comment made on the linked video, my question is...within the context of a Data Warehouse, is it OK to do joins between the different tables needed, and then apply analytical functions to the resulting table?.
Does this incurr in a performance penalty and should be done in a different way?
Many thanks in advance