What products, pharmacies, and promotions are truly driving profitability Additionally, which hidden trends might be putting future revenue at risk?
These questions drove my latest project where I analysed a pharmacy sales dataset using SQL on Postgres.
The goal was not merely to store sales data but to transform fragmented transactional records into a structured analytical system.
This system helps decision-makers understand performance, identify growth opportunities, and proactively manage risks to profitability across a pharmacy network.
I began by designing a dimensional data model built around a central sales fact table connected to key business dimensions: Date, Pharmacy, and Product. This foundation allowed business activity to be viewed from multiple perspectives instead of relying on isolated reports.
Once the structure was in place, the real exploration began where I posed the questions that business leaders ask daily:
β’ How has revenue evolved over time?
β’ Which pharmacies are generating the strongest financial performance?
β’ Which product categories and brands contribute the most to growth?
β’ Are promotional campaigns actually increasing revenue?
β’ Which countries and regions demonstrate the strongest demand?
β’ Which products are experiencing margin declines that could threaten future profitability?
As I explored each question, new layers of insight emerged.
Some pharmacies generated impressive revenue but revealed lower profitability than expected. Certain product categories consistently outperformed others, highlighting areas for potential expansion. Promotion analysis showed the impact of marketing activities on sales, while product-level margin analysis helped identify areas where profitability was quietly eroding.
One of my favorite aspects of the project was analyzing declining product margins.
Instead of solely celebrating top-performing products, I focused on identifying those whose profitability was trending downward, and by comparing current margin performance with prior-year results i was able to highlight products that could become future risks if left unaddressed.
These insights helped the business shift from reactive reporting to proactive decision-making.
Beyond the technical implementation, this project reinforced an important lesson: Data becomes valuable when it helps answer business questions.
While building tables, writing queries, and creating views are important skills, the real impact comes from translating data into decisions that improve performance, reduce risk, and create strategic clarity.
This project not only strengthened my SQL development skills but also enhanced my ability to think like a business analyst, connecting data structures to real-world business outcomes.
Read project documentation on GitHub:
github.com/M1deTheAnalyst/Phβ¦
#SQL #DataAnalytics #BusinessIntelligence #DataWarehouse #AnalyticsEngineering #DataAnalysis #PostgreSQL #BusinessAnalytics #DataProjects #PortfolioProject