Skip to content

Latest commit

 

History

History
45 lines (23 loc) · 1.22 KB

File metadata and controls

45 lines (23 loc) · 1.22 KB

Analyzing-Product-Demand-In-SQL

🚀 Optimizing Price Using SQL + Revenue Modeling

I recently completed a project where I analyzed a real demand-curve dataset using DuckDB SQL to answer a key business question:

👉 What price maximizes total revenue?

Using regression functions like REGR_SLOPE and REGR_INTERCEPT, I built a revenue model, calculated the optimal price point, and compared it with real transaction data to validate the result.

This project strengthened my skills in:

📌 SQL (DuckDB)

📌 Regression modeling

📌 Demand curve analysis

📌 Revenue optimization

📌 Business-focused analytics

It’s a great example of how technical SQL skills + business thinking help companies set smarter prices and increase revenue.

💡 Key Insights from the Analysis

Built a demand curve using price vs. quantity sold

Applied log-linear regression directly in SQL

Used REGR_SLOPE and REGR_INTERCEPT to model demand

Derived the optimal price using calculus-based SQL expressions

Calculated expected maximum revenue

Validated the model by comparing against real revenue records 📈 Results

Optimal Price: $20,106.44

Expected Max Revenue: $733,106.95

Highest Observed Revenue: $840,703.51 (used for model validation)