This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Models, Databases, Relationships in Rails | |
#### What is the difference between a primary key and a foreign key? Where would we find a primary key? | |
What would it be called by default? Where would we find a foreign key? What is the naming convention for a foreign key? | |
Primary key is the id in the table you're working in, the foreign key is the connected key from another table you're | |
joining or referencing in the current table. The primary key is generated when the table is created. Primary cannot be | |
repeated in the table. Foreign key is a relationship that is formed, primary key of another table. Name of table_id is | |
convention for the foreign key. | |
#### Write down one example of: |