Skip to content

Latest commit

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Banner

🗄️ Car Dealership Database System

Relational Database Design & Implementation — MySQL, Normalized to 3NF

MySQLSQLDatabaseERD

TypeEntitiesNormalizationLanguage


📌 Project at a Glance

🎯 GoalDesign & implement a relational database to run car-dealership operations
🧠 ApproachERD → 3NF normalization → SQL schema → analytical queries
📊 Scope9 interconnected entities covering the full sales-to-service lifecycle
⚙️ DeliveryMySQL schema, ER diagram, sample queries + report & presentation

🧩 Business Problem

A multi-location car dealership tracks customers, vehicles, staff, inventory, sales, service, payments, and warranties — often in disconnected spreadsheets. That causes duplicated data, broken links between a sale and its payment, and no reliable way to report performance.

🚗 Core question:How do we model dealership operations as one integrated, normalized database so that sales, service, payments, and warranties stay consistent and are easy to query for decisions?

A well-designed schema removes redundancy, protects data integrity, and unlocks reporting like total sales by dealership or service cost by customer.


🗂️ Schema & Entities

Nine tables in Third Normal Form (3NF), linked by primary and foreign keys.

EntityKey ColumnsRelationships
👤 CustomersCustomerID (PK), FirstName, LastName, Email, Phone, AddressID→ Sales, Services, Warranty
🚗 CarsCarID (PK), Make, Model, Year, Price, VIN→ Inventory, Sales, Services, Warranty
🏢 DealershipsDealershipID (PK), Name, AddressID, Phone→ Employees, Inventory
🧑‍💼 EmployeesEmployeeID (PK), Name, Position, Department, DealershipID (FK)← Dealerships
📦 InventoryInventoryID (PK), CarID (FK), DealershipID (FK), StockQuantity← Cars, Dealerships
💰 SalesSaleID (PK), CustomerID, EmployeeID, CarID (FK), SaleDate, SalePrice→ Payments
🔧 ServicesServiceID (PK), CarID, CustomerID (FK), ServiceDate, Description, Cost← Cars, Customers
💳 PaymentsPaymentID (PK), SaleID (FK), PaymentMethod, Date, Amount← Sales
🛡️ WarrantyWarrantyID (PK), CarID, CustomerID (FK), StartDate, EndDate, Coverage← Cars, Customers

🔬 Methodology

DESIGN NORMALIZE IMPLEMENT & QUERY
──────────────── ──────────────── ────────────────
1. Identify entities 1. Apply 1NF → 2NF → 3NF 1. Write DDL: CREATE
& business domains 2. Remove redundancy TABLE + constraints
2. Draw ERD with 3. Enforce integrity via 2. DML: INSERT sample
relationships PK / FK constraints records
3. Define attributes 4. Validate dependencies 3. DQL: analytical
& candidate keys are on the key only SELECT / JOIN / GROUP

📊 Database Schema Dashboard

Dashboard

Entity-relationship map of the 9-table dealership schema and the analytical queries it powers, built from the project's ERD and MySQL implementation. Row counts are illustrative sample volumes.


📈 Key Insights

  • One integrated model links a sale to its customer, car, employee, payment, and warranty with no duplicated data
  • 3NF normalization removes redundancy so every fact is stored once and updates stay consistent
  • Foreign-key constraints guarantee referential integrity — no orphan sales, payments, or services
  • Multi-dealership support lets the same schema scale to additional locations without redesign
  • Analytical queries answer real questions: total sales by dealership, service cost by customer, inventory by location

💼 Business Impact

AreaValue
🧹 Data qualityRedundancy removed and integrity enforced through 3NF + FK constraints
📊 ReportingAggregate sales, service, and payment analysis via SQL JOINs and GROUP BY
🏢 ScalabilityAdd dealerships, staff, and inventory without changing the core design
🔗 TraceabilityEvery payment ties back to a sale; every warranty to a car and customer
🔮 Next stepClean relational base ready for ML on sales forecasting & customer trends

🛠️ Technologies Used

CategoryTools
DatabaseMySQL (relational)
DesignEntity-Relationship Diagram, 3NF normalization
SQLDDL (schema), DML (data), DQL (queries)
DeliverablesERD image, normalized schema diagram, query outputs

📁 Repository Contents

Car Dealership Database System/
├── 📁 assets/
│ ├── 🎨 banner.svg # Repository banner
│ ├── 📊 dashboard.svg # Database schema dashboard
│ ├── 🖼️ ERD.png # Entity-Relationship Diagram
│ ├── 🖼️ schema_3nf.jpg # Normalized (3NF) schema
│ ├── 🖼️ sql_query.png # Example analytical query
│ └── 🖼️ sql_output.png # Query result set
├── 📁 docs/
│ ├── 📄 Final Report.docx # Design rationale & documentation
│ └── 📄 Project Presentation.pptx # Summary slides
├── 📁 outputs/ # Additional query outputs
└── 📝 README.md # Project overview

Heta Chavda — Data Analytics | Database Design | SQL

GitHubLinkedIn

Found this useful? Give it a star!

About

A SQL-based relational database system for managing car dealership operations, including customers, inventory, sales, services, and payments.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors