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.
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.
- PostgreSQL
- SQL (Structured Query Language)
- Command Line (psql)
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
- 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.
- 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
-
Install PostgreSQL on your system
-
Clone this repository:
git clone <your-repo-link>
-
Connect to PostgreSQL:
psql -U postgres
-
Import the database:
\i universe.sql
- Designing relational databases
- Creating and linking tables using foreign keys
- Writing SQL queries for data manipulation
- Structuring real-world data into a database format
This project is for educational purposes as part of FreeCodeCamp.