Skip to content

Instantly share code, notes, and snippets.

@ryanflach
Last active July 12, 2016 16:40
Show Gist options
  • Save ryanflach/55532a850818c64015d00d5082c80a15 to your computer and use it in GitHub Desktop.
Save ryanflach/55532a850818c64015d00d5082c80a15 to your computer and use it in GitHub Desktop.
Checks for understanding of Turing Mod2 week 3 lesson.
  1. What is a primary key?
  • The unique identifier for each row in a table.
  1. What is a foreign key?
  • A reference in one table to the primary key in another table that it shares a relationship with.
  1. Why would one row of data have both primary and foreign keys?
  • When a relationship exists between the tables that requires one table to track a row in another.
  1. What is Rails' convention for the column name of the primary key?
  • id
  1. What is Rails' convention for the column name of a foreign key?
  • tablename_id
  1. What are dev, test, and prod databases all about?
  • For development, testing, and production, respectively. They allow you to separate code from test, development, and production environments.
  1. What is the database.yml and how is it used?
  • Stores details about the database configuration and environment locations for those databases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment