Here is my star table information. It looks to me like I have setup a foreign key from star table to galaxy table. However, I can’t pass the test "Each star should have a foreign key that references one row in galaxy table.
Any thoughts?
Gerry
±---------
-----------±----------------------±----------±---------±--------------------------------------+
| Column | Type | Collation | Nullable | Default |
±--------------------±----------------------±----------±---------±--------------------------------------+
| star_id | integer | | not null | nextval(‘star_star_id_seq’::regclass) |
| name | character varying(40) | | | |
| distance_from_earth | integer | | | |
| diameter | integer | | | |
| gravity_pull | numeric | | | |
| is_spherical | boolean | | | |
| has_life | boolean | | | |
| galaxy_id | integer | | | |
±--------------------±----------------------±----------±---------±--------------------------------------+
Indexes:
“star_pkey” PRIMARY KEY, btree (star_id)
“star_galaxy_id_key” UNIQUE CONSTRAINT, btree (galaxy_id)
Foreign-key constraints:
“star_galaxy_id_fkey” FOREIGN KEY (galaxy_id) REFERENCES galaxy(galaxy_id)