How to make an existing column NOT NULL in SQL

Hi I’m trying to make an exiting column galaxy_id in the galaxy table NOT NULL so that i can set it as a primary key, but I cant figure out how to do that.

I’ve read somwhere that you cant make an empty column NOT NULL so I’ve populated it with one row but that didn’t help.

Figured it out, its “ALTER TABLE galaxy ALTER COLUMN galaxy_id SET NOT NULL” so you can’t enter data type into that command e.g. “ALTER TABLE galaxy ALTER COLUMN galaxy_id INT SET NOT NULL”