Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

One-to-Many SQL Practice (PostgreSQL)

📌 Overview

This project demonstrates SQL queries based on a one-to-many relationship using PostgreSQL.

  • One Product → Many Orders
  • Focus: JOINs, GROUP BY, HAVING, Aggregations

🗂️ Database Schema

  • products: stores product details
  • orders: stores customer orders linked via product_id

🔥 Concepts Covered

  • INNER JOIN
  • LEFT JOIN
  • GROUP BY
  • HAVING
  • COUNT(), SUM()
  • DISTINCT

📊 Queries Implemented

  1. Show each order with product details
  2. Show all products (even without orders)
  3. Filter orders by category
  4. Sort orders by price
  5. Count orders per product
  6. Calculate revenue per product
  7. Filter products by revenue > 2000
  8. Find unique customers by category

🛠️ Tech Stack

  • PostgreSQL
  • pgAdmin

📸 Sample Outputs

🚀 Author

Chinki Raj

About

PostgreSQL queries for one-to-many relationship (products & orders).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages