Skip to content

Latest commit

 

History

History
68 lines (46 loc) · 1.91 KB

File metadata and controls

68 lines (46 loc) · 1.91 KB

🌌 Universe Database Project

This project is part of the FreeCodeCamp Relational Database Certification. It demonstrates the creation and management of a PostgreSQL database that models a simplified universe including galaxies, stars, planets, and moons.

📌 Project Overview

The Universe Database is designed to store structured information about celestial objects and their relationships. It uses relational database concepts such as tables, primary keys, foreign keys, and constraints.

🛠️ Technologies Used

  • PostgreSQL
  • SQL (Structured Query Language)
  • Command Line (psql)

🗂️ Database Structure

The database consists of the following main tables:

  • Galaxy – Stores information about galaxies
  • Star – Contains details about stars within galaxies
  • Planet – Holds data about planets orbiting stars
  • Moon – Includes information about moons orbiting planets
  • Additional Tables (if any) – Custom tables added for extended functionality

🔗 Relationships

  • A galaxy can have multiple stars
  • A star can have multiple planets
  • A planet can have multiple moons

These relationships are enforced using foreign keys.

✨ Features

  • Well-structured relational schema
  • Use of primary and foreign key constraints
  • Data integrity through NOT NULL and UNIQUE constraints
  • Sample data inserted for testing and demonstration

🚀 How to Run

  1. Install PostgreSQL on your system

  2. Clone this repository:

    git clone <your-repo-link>
  3. Connect to PostgreSQL:

    psql -U postgres
  4. Import the database:

    \i universe.sql

📚 What I Learned

  • Designing relational databases
  • Creating and linking tables using foreign keys
  • Writing SQL queries for data manipulation
  • Structuring real-world data into a database format

📄 License

This project is for educational purposes as part of FreeCodeCamp.