You might think that the phrase dept=NULL would work here. It doesn't. This is because NULL "propogates". Any normal expression that includes NULL is itself NULL, thus the value of the expressions 2+NULL and party || NULL and NULL=NULL for example are all NULL.

+

You might think that the phrase dept=NULL would work here. It doesn't. This is because NULL propagates. Any normal expression that includes NULL is itself NULL, thus the value of the expressions 2+NULL and party || NULL and NULL=NULL for example are all NULL.

<div title="That's not a proper explanation." class='hint'>

<div title="That's not a proper explanation." class='hint'>

Line 238:

Line 238:

<div class="lsclear">Clear your results</div>

<div class="lsclear">Clear your results</div>

−

[[Using Null Quiz]]

+

<p><div class="quizlink">[[Using Null Quiz]]</div></p>

Revision as of 06:52, 8 September 2012

teacher

id

dept

name

phone

mobile

101

1

Shrivell

2753

07986 555 1234

102

1

Throd

2754

07122 555 1920

103

1

Splint

2293

104

Spiregrain

3287

105

2

Cutflower

3212

07996 555 6574

106

Deadyawn

3345

...

dept

id

name

1

Computing

2

Design

3

Engineering

...

Teachers and Departments

The school includes many departments. Most teachers work exclusively for a single department.
Some teachers have no department.

NULL, INNER JOIN, LEFT JOIN, RIGHT JOIN

List the teachers who have NULL for their department.

You might think that the phrase dept=NULL would work here. It doesn't. This is because NULL propagates. Any normal expression that includes NULL is itself NULL, thus the value of the expressions 2+NULL and party || NULL and NULL=NULL for example are all NULL.