# Celestial Bodies Database - Build a Celestial Bodies Database

**URL:** <https://forum.freecodecamp.org/t/celestial-bodies-database-build-a-celestial-bodies-database/599690>\
**Category:** Curriculum Help\
**Tags:** backend\
**Created:** [March 21, 2023, 7:26am UTC](https://forum.freecodecamp.org/t/celestial-bodies-database-build-a-celestial-bodies-database/599690 "2023-03-21T07:26:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![abbasshaikhji4](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@abbasshaikhji4](https://forum.freecodecamp.org/u/abbasshaikhji4)\
**Post date:** [March 21, 2023, 7:26am UTC](https://forum.freecodecamp.org/t/celestial-bodies-database-build-a-celestial-bodies-database/599690/1 "2023-03-21T07:26:52Z")

</div>

**Tell us what’s happening:**  
Describe your issue in detail here.  
TERMINAL FOR THE CELESTIAL PROJECT  
Error : syntax error near unexpected token `(', How to comply with the Instructions & Get a Pass from the systwm

**Your code so far**

```auto
codeally@89460b308f8b:~/project$ \d galaxy
bash: d: command not found
codeally@89460b308f8b:~/project$ psql --username=freecodecamp --dbname=postgres
Border style is 2.
Pager usage is off.
psql (12.9 (Ubuntu 12.9-2.pgdg20.04+1))
Type "help" for help.

postgres=> \d galaxy
Did not find any relation named "galaxy".
postgres=> CREATE TABLE galaxy (galaxy_id SERIAL PRIMARY KEY NOT NULL, speed INT, description TEXT);
CREATE TABLE
postgres=> \d galaxy
                                   Table "public.galaxy"
+-------------+---------+-----------+----------+-------------------------------------------+
| Column | Type | Collation | Nullable | Default |
+-------------+---------+-----------+----------+-------------------------------------------+
| galaxy_id | integer | | not null | nextval('galaxy_galaxy_id_seq'::regclass) |
| speed | integer | | | |
| description | text | | | |
+-------------+---------+-----------+----------+-------------------------------------------+
Indexes:
    "galaxy_pkey" PRIMARY KEY, btree (galaxy_id)

postgres=> CREATE TABLE star(star_id PRIMARY SERIAL KEY NOT NULL, radius INT NOT NULL, Color VARCHAR(255) NOT NULL, CONSTRAINT fk_galaxy FOREIGN KEY(galaxy_id) REFERNCES galaxy(galaxy_id));
ERROR: syntax error at or near "PRIMARY"
LINE 1: CREATE TABLE star(star_id PRIMARY SERIAL KEY NOT NULL, radiu...
                                  ^
postgres=> CREATE TAVLE star(star_id SERIAL PRIMARY KEY NOT NULL, radius INT NOT NULL, color VARCHAR(255) NOT NULL, Name VARCHAR(255), Not Null, CONSTAINT fk_galaxy FOREGIN KEY(galaxy_id) REFERNCES galaxy(galaxy_id));
ERROR: syntax error at or near "TAVLE"
LINE 1: CREATE TAVLE star(star_id SERIAL PRIMARY KEY NOT NULL, radiu...
               ^
postgres=> CREATE TAVLE star(star_id SERIAL PRIMARY KEY NOT NULL, radius INT NOT NULL, color VARCHAR(255) NOT NULL, Name VARCHAR(255), Not Null, CONSTAINT^Z[1]+ Stopped psql --username=freecodecamp --dbname=postgres
codeally@89460b308f8b:~/project$ CREATE TABLE star(star_id SERIAL PRIMARY KEY NOT NULL, radius INT NOT NULL, color VARCHAR(255) NOT NULL, Name VARCHAR(255), Not Null, CONSTAINT fk_galaxy FOREGIN KEY(galaxy_id) REFERNCES galaxy(galaxy_id));
bash: syntax error near unexpected token `('
codeally@89460b308f8b:~/project$ /d galaxy
bash: /d: No such file or directory
codeally@89460b308f8b:~/project$ /d 
bash: /d: No such file or directory
codeally@89460b308f8b:~/project$ \d galaxybash: d: command not found
codeally@89460b308f8b:~/project$ \d
bash: d: command not found
codeally@89460b308f8b:~/project$ CREATE TABLE star(star_id SERIAL PRIMARY KEY NOT NULL, color VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, CONSTRAINT fk_galaxy FOREIGN KEY(galaxy_id) REFERNCES galaxy(galaxy_id)); 
bash: syntax error near unexpected token `('
codeally@89460b308f8b:~/project$ 

```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0`

**Challenge:** Celestial Bodies Database - Build a Celestial Bodies Database

**Link to the challenge:**

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/relational-database/build-a-celestial-bodies-database-project/build-a-celestial-bodies-database)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![cmar](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/cmar/32/310466_2.png) [@cmar](https://forum.freecodecamp.org/u/cmar)\
**Post date:** [March 22, 2023, 11:38pm UTC](https://forum.freecodecamp.org/t/celestial-bodies-database-build-a-celestial-bodies-database/599690/2 "2023-03-22T23:38:37Z")

</div>

You need to add the code to the psql prompt not the bash prompt

---

<div class="post-metadata">

**Author:** ![abbasshaikhji4](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@abbasshaikhji4](https://forum.freecodecamp.org/u/abbasshaikhji4)\
**Post date:** [March 23, 2023, 8:08am UTC](https://forum.freecodecamp.org/t/celestial-bodies-database-build-a-celestial-bodies-database/599690/3 "2023-03-23T08:08:56Z")

</div>

Thank u Very much , I Req the moderator to mark this thread as Closed…

---

<div class="post-metadata">

**Author:** ![igorgetmeabrain](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/igorgetmeabrain/32/314517_2.png) [@igorgetmeabrain](https://forum.freecodecamp.org/u/igorgetmeabrain)\
**Post date:** [March 23, 2023, 9:44am UTC](https://forum.freecodecamp.org/t/celestial-bodies-database-build-a-celestial-bodies-database/599690/4 "2023-03-23T09:44:34Z")

</div>

> [@abbasshaikhji4](#):
>
> `FOREGIN KEY(galaxy_id) REFERNCES galaxy(galaxy_id));`

Also, you have typos here and several other places too.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 7, 2025, 3:38pm UTC](https://forum.freecodecamp.org/t/celestial-bodies-database-build-a-celestial-bodies-database/599690/5 "2025-01-07T15:38:28Z")

</div>

Closed on January 7, 2025, 3:38pm UTC


