SQL, databases and ORMs Flashcards
1NF (First Normal Form) Rules
1NF (First Normal Form) Rules
- Each table cell should contain a single value.
- Each record needs to be unique.
2NF (Second Normal Form) Rules
2NF (Second Normal Form) Rules
- Rule 1- Be in 1NF
- Rule 2- Single Column Primary Key that does not functionally depend on any subset of candidate key relation
3NF (Third Normal Form) Rules
3NF (Third Normal Form) Rules
- Rule 1- Be in 2NF
- Rule 2- Has no transitive functional dependencies
(when changing a non-key column, might cause any of the other non-key columns to change)
2 types of databases
Relational - SQL
Non Relational - NoSQL
Design of all the tables and the relationships is called…
a schema
Main unique id is called…
primary key
Link to a unique id in another table is called…
foreign key
Relationship types:
one to one
one to many
many to many
What is a migration?
It’s a record keeping track of a series of changes to a database (that can be ‘played back’ to reproduce changes on the database)
What is an ORM?
Object Relational Mapper - maps javascript object to database table