Skip to content

paulbeduosei/Analyzing-Product-Demand-In-SQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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)

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors