FOREIGN KEY in SQL
A FOREIGN KEY in SQL is a constraint that establishes a relationship between two tables in a relational database. It defines a column (or a set of columns) in one table (child table) that refers to a PRIMARY KEY or UNIQUE KEY column in another table (parent table). This constraint ensures referential integrity by enforcing that values in the foreign key column must exist as values in the referenced column of the parent table. Foreign keys help maintain data consistency and enable the creation of relationships (such as one-to-many or many-to-many) between related tables, facilitating effective data modeling and database management.