Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions SQL Deep Dive/3 Valued Logic Exercises/questions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
* Table: customers
* Question: adjust the following query to display the null values as "No Address"
*/
SELECT address2
FROM customers

SELECT coalesce(address2, 'No Address')
FROM customers;
/*
* DB: Store
* Table: customers
Expand All @@ -15,7 +14,7 @@ FROM customers

SELECT *
FROM customers
WHERE COALESCE(address2, null) IS NOT null;
WHERE address2 IS NOT null;

/*
* DB: Store
Expand All @@ -24,4 +23,4 @@ WHERE COALESCE(address2, null) IS NOT null;
*/

SELECT coalesce(lastName, 'Empty'), * from customers
where (age = null);
where (age is null);