use pubs
go

-- Attempt 1
SELECT au_lname, au_fname, city, state FROM authors
WHERE 
city <> 'OAKLAND' AND state <> 'CA' 
OR     
city <> 'Salt Lake City' AND state <> 'UT'

-- Attempt 2
SELECT au_lname, au_fname, city, state FROM authors
WHERE 
(city <> 'OAKLAND' AND state <> 'CA')
OR 	
(city <> 'Salt Lake City' AND state <> 'UT')

-- Attempt 3
SELECT au_lname, au_fname, city, state FROM authors
WHERE 
(city <> 'OAKLAND' AND state <> 'CA')
AND
(city <> 'Salt Lake City' AND state <> 'UT')

-- Attempt 4
SELECT au_lname, au_fname, city, state FROM authors
WHERE 
NOT
(
(city = 'OAKLAND' AND state = 'CA')
OR
(city = 'Salt Lake City' AND state = 'UT')
)

Published in: SQL
Download

Related snippets