foreign keys

Author

Kevin Gilds, MPA

Published

2022-09-23

I have been working on a SQL certification course from Freecode Camp. The most important thing that I learned today was adding a Foreign Key to a table in Postgres.

It drives me batty not to use commas and appreciate the parantheses.

ALTER TABLE <table_name> ADD FOREIGN KEY(<column_name>)

REFERENCES <referenced_table_name>(<referenced_column_name>);


About

Kevin is a nonprofit data professional operating out of Lakeland, Florida.
My expertise is helping nonprofits collect, manage and analyze their program data.