

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 6
click for more info
Not enough gems
Cost: 6 gems
1: CRUD
incomplete
2: Insert Statement
incomplete
3: Auto Increment
incomplete
4: Manual Entry
incomplete
5: Count
incomplete
6: WHERE Clause
incomplete
7: Finding NULL Values
incomplete
8: DELETE
incomplete
9: Danger of Deleting Data
incomplete
10: Update Query in SQL
incomplete
11: Object-Relational Mapping (ORMs)
incomplete
12: Query Practice – User Count
incomplete
13: Query Practice – Country Codes
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
You can use a WHERE clause to filter values by whether or not they're NULL.
SELECT name FROM users WHERE first_name IS NULL;
SELECT name FROM users WHERE first_name IS NOT NULL;
The way we store transactions at CashPal is interesting. We store a user_id field on the transactions table. That user is the "owner" of the transaction, and a user_id is never null.
Whenever the owner of the transaction receives money, the sender_id will not be null – it will be the user ID of the sender. The recipient_id will be null.
Whenever the owner of the transaction sends money, the recipient_id will not be null – it will be the user ID of the recipient. The sender_id will be null.
Select all the rows and their columns from the transactions table where the owner of the transactions is receiving money.