So I got a table called pet_size which represents... pet sizes!
The sizes can be:
SELECT pet_breed.id, pet_breed.breed_name, pet_type.type_name, pet_size.size_name
WHERE pet_breed.petTypeId = pet_type.id
AND pet_breed.sizeId = pet_size.id
ORDER BY pet_breed.id
You're using the old style joins, update to use correct
LEFT JOIN and you'll get the result you're expecting
SELECT pb.id ,pb.breed_name ,pt.type_name ,ISNULL(ps.size_name,'Unknown') size_name FROM pet_breed pb LEFT JOIN pet_type pt ON pb.petTypeId = pt.id LEFT JOIN pet_size ps ON pb.sizeId = ps.id ORDER BY pb.id
I've updated this with table aliases which will make your code more readable too.
Your old joins were acting as
INNER JOINS which will only return rows with matching values in all tables.
Edit: Re-read the question and put an
ISNULL in to catch where data doesn't match.