

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Null Values
incomplete
2: Constraints
incomplete
3: Primary Keys
incomplete
4: Foreign Keys
incomplete
5: Schema
incomplete
6: Relational Databases
incomplete
7: Relational vs. Non-Relational DBs
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
We have been using the term relational quite a bit. It's time we actually go over what that means!
A relational database is a type of database that stores data so that it can be easily related to other data. For example, a user can have many tweets. There's a relationship between a user and their tweet.
In a relational database:
Data is typically represented in "tables."
Each table has "columns" or "fields" that hold attributes related to the record.
Each row or entry in the table is called a record.
Typically, each record has a unique Id called the primary key.
Here is an example of a small relational database. This database has 3 tables, Students, Courses, and StudentCourses. The StudentCourses table manages the relationship between the Students and Courses tables.
Curly has an Id of 2.
We can find Curly's courses by looking in the StudentCourses table for the records that match his StudentId.
"Haskell Monads" has an Id of 3.
We can find all the students enrolled in the Haskell Monads course by checking the CourseId column in the StudentCourses table.