

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
This lesson's interactive features are locked, please to keep using them
In SQL, a cell with a NULL value indicates that the value is missing. A NULL value is very different from a zero value.
When creating a table, we can define whether or not a field can or cannot be NULL, and that's a kind of constraint.
We will cover constraints in more detail soon; for now, let's focus on NULL values.
We didn't force any constraints on our tables when we created them, and it has allowed for NULL entries to make their way into our table! Let's take a look at our transactions table to see what those NULL values look like.
Write a query to SELECT all fields on all records in the transactions table.
Notice that both the transaction_type and was_successful fields have NULL values in all 3 records in the table (nulls are represented by blank cells in our system). That's because we ran our migration in the previous exercise after the 3 records were created!
Use the * (wildcard) syntax to select all fields.