How can the key and foreign key constraints be enforced

How can the key and foreign key constraints be enforced by the DBMS? Is the enforcement technique you suggest difficult to implement? Can the constraint checks be executed in an efficient manner when updates are applied to the database? 

Instructions:  250-300 words .There must be at least one APA formatted reference (and APA in-text citation) to support the thoughts in the post as needed.  Do not use direct quotes, rather rephrase the author’s words and continue to use in-text citations.