Baselight
--SELECT d1.name, d1.good_with_children, d1.good_with_other_dogs, d1.good_with_strangers, d2.age, d2.gender, d2.spayneuter
--FROM @kaggle.warcoder_dog_breeds_details.dog_breeds d1
--JOIN @kaggle.stealthtechnologies_predict_new_york_dog_bites.dog_bites_data d2 ON d1.name = d2.breed
--WHERE d1.trainability > 3
--ORDER BY max_life_expectancy asc

SELECT d1.name, d1.good_with_children, d1.good_with_other_dogs, d1.good_with_strangers,
       COUNT(d2.breed) AS breed_occurrences
FROM @kaggle.warcoder_dog_breeds_details.dog_breeds d1
JOIN @kaggle.stealthtechnologies_predict_new_york_dog_bites.dog_bites_data d2 ON d1.name LIKE ('%' || d2.breed || '%')
WHERE d1.trainability > 3
GROUP BY d1.name, d1.good_with_children, d1.good_with_other_dogs, d1.good_with_strangers
ORDER BY breed_occurrences desc
namegood_with_childrengood_with_other_dogsgood_with_strangersbreed_occurrences
Shih Tzu553731
Yorkshire Terrier535480
Rottweiler333316
Labrador Retriever555282
Cocker Spaniel554172
Golden Retriever555133
Boxer534109
Staffordshire Bull Terrier53490
Doberman Pinscher53480
Bichon Frise55572
Cane Corso33371
Australian Shepherd53367
Boston Terrier54564
Havanese55563
Pug54541
Belgian Malinois33332
Rhodesian Ridgeback53332
Dalmatian33422
American Eskimo Dog53520
Italian Greyhound35515
Bernese Mountain Dog55413
Vizsla54410
German Longhaired Pointer5449
Cavalier King Charles Spaniel5548
Samoyed5358
Papillon5355
Shetland Sheepdog5523
Bloodhound3333
Keeshond5551

Share link

Anyone who has the link will be able to view this.