How does De Morgan's Law work in conditional SQL querying?

498 Views Asked by At

Context: I was practicing some SQL questions on stratascratch.com when I came across this one:

De Morgan's laws in SQL

https://platform.stratascratch.com/coding-question?id=9648&python=

The hint says that "Drafted means pickround value (int64 type) is not NULL or 0. According to my understanding, this means pickround value must be NOT NULL OR NOT 0, which is the standard solution to the question. Hence, by De Morgan's Law, this means the equivalent expression is NOT (NULL AND 0). However, the code I wrote there reads pickround is NULL OR 0, which is the opposite of what the question specified and still my code turned out to be correct, as indicated by the green "Solved" tick mark.

My question is: am I misunderstanding the SQL syntax or am I misunderstanding the logic?

0

There are 0 best solutions below