https://github.com/abbywright/celestial-bodies-database
A database of Celestial Bodies using PostgreSQL, created by following a tutorial from FreeCodeCamp.
https://github.com/abbywright/celestial-bodies-database
postgresql txt
Last synced: 11 months ago
JSON representation
A database of Celestial Bodies using PostgreSQL, created by following a tutorial from FreeCodeCamp.
- Host: GitHub
- URL: https://github.com/abbywright/celestial-bodies-database
- Owner: abbywright
- Created: 2024-09-16T21:55:46.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-14T23:52:15.000Z (over 1 year ago)
- Last Synced: 2025-04-04T17:50:16.297Z (about 1 year ago)
- Topics: postgresql, txt
- Homepage: https://github.com/freeCodeCamp/learn-celestial-bodies-database.git
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Celestial Bodies Database
Build a database of celestial bodies using PostgreSQL.
### Subtasks
- Create a database named `universe`
- Connect to the database with `\c universe`. Then, add tables named `galaxy`, `star`, `planet`, and `moon`
- Each table should have a primary key
- Each primary key should automatically increment
- Each table should have a `name` column
- Use the `INT` data type for at least two columns that are not a primary or foreign key
- Use the `NUMERIC` data type at least once
- Use the `TEXT` data type at least once
- Use the `BOOLEAN` data type on at least two columns
- Each "star" should have a foreign key that references one of the rows in `galaxy`
- Each "planet" should have a foreign key that references one of the rows in `star`
- Each "moon" should have a foreign key that references one of the rows in `planet`
- The database should have at least five tables
- Each table should have at least three rows
- The `galaxy` and `star` tables should each have at least six rows
- The `planet` table should have at least 12 rows
- The `moon` table should have at least 20 rows
- Each table should have at least three columns
- The `galaxy`, `star`, `planet`, and `moon` tables should each have at least five columns
- At least two columns per table should not accept `NULL` values
- At least one column from each table should be required to be `UNIQUE`
- All columns named `name` should be of type `VARCHAR`
- Each primary key column should follow the naming convention `table_name_id`. For example, the `moon` table should have a primary key column named `moon_id`
- Each foreign key column should have the same name as the column it is referencing
#### [Tutorial from FreeCodeCamp](https://www.freecodecamp.org/learn/relational-database/build-a-celestial-bodies-database-project/build-a-celestial-bodies-database)