[SQL][HackerRank] Type of Triangle