Skip to content

Commit ec9807f

Browse files
authored
Update questions.sql
1 parent 3c62146 commit ec9807f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SQL Deep Dive/Null Values/questions.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* DB: https://www.db-fiddle.com/f/PnGNcaPYfGoEDvfexzEUA/0
44
* Question:
55
* Assuming a students minimum age for the class is 15, what is the average age of a student?
6-
*/
6+
*/SELECT avg(coalesce(age, 15)) FROM "Student";
77

88
/*
99
* DB: https://www.db-fiddle.com/f/PnGNcaPYfGoEDvfexzEUA/0
1010
* Question:
1111
* Replace all empty first or last names with a default?
12-
*/
12+
*/SELECT id, coalesce(name,'firstname'),coalesce(lastName,'LastName'), age FROM "Student";

0 commit comments

Comments
 (0)