The Space Management System database is designed to efficiently manage π spacecraft, π°οΈ missions, π space stations, and astronaut assignments.
- π PostgreSQL (Database)
- π SQL Queries (Schema & Data Management)
The database consists of the following tables:
1οΈβ£ π Spaceships β Stores information about spacecraft.
2οΈβ£ π°οΈ Missions β Details of space missions.
3οΈβ£ π¨βπ Astronauts β Information about astronauts.
4οΈβ£ π’ Space Stations β Data about space stations.
5οΈβ£ π Assignments β Links astronauts to missions.
Follow these steps to set up the database:
1οΈβ£ Clone the repository
git clone https://github.com/your-repo/space-management-db.git
cd space-management-db
2οΈβ£ Install PostgreSQL (if not installed)
3οΈβ£ Create the Database
CREATE DATABASE space_management;
4οΈβ£ Run Schema File
psql -d space_management -f schema.sql
5οΈβ£ Insert Sample Data (Optional)
psql -d space_management -f seed.sql
Here are some example queries you can run:
β Get all astronauts assigned to a mission
SELECT a.name FROM Astronauts a
JOIN Assignments asg ON a.id = asg.astronaut_id
WHERE asg.mission_id = 1;
β List all active missions
SELECT * FROM Missions WHERE status = 'Active';
β Find spaceships launched after 2020
SELECT * FROM Spaceships WHERE launch_year > 2020;
Want to contribute? Follow these steps:
πΉ Fork the repository
πΉ Create a new branch (git checkout -b feature-name
)
πΉ Commit your changes (git commit -m "Added a new feature"
)
πΉ Push and create a pull request
For any queries, feel free to reach out:
π© Email:[email protected] π GitHub: Hifza-Khalid