Type of Triangle in SQL | HackerRank Programming Solutions | HackerRank SQL Solutions

Hello Programmers/Coders, Today we are going to share solutions of Programming problems of HackerRank of Programming Language SQL. At Each Problem with Successful submission with all Test Cases Passed, you will get an score or marks. And after solving maximum problems, you will be getting stars. This will highlight your profile to the recruiters.

In this post, you will find the solution for Type of Triangle in SQL-HackerRank Problem. We are providing the correct and tested solutions of coding problems present on HackerRank. If you are not able to solve any problem, then you can take help from our Blog/website.

Use “Ctrl+F” To Find Any Questions Answer. & For Mobile User, You Just Need To Click On Three dots In Your Browser & You Will Get A “Find” Option There. Use These Option to Get Any Random Questions Answer.

Introduction To SQL

SQL stands for Structured Query Language. SQL is used to create, remove, alter the database and database objects in a database management system and to store, retrieve, update the data in a database. SQL is a standard language for creating, accessing, manipulating database management system. SQL works for all modern relational database management systems, like SQL Server, Oracle, MySQL, etc.

  • It is a standard language for Relational Database System. It enables a user to create, read, update and delete relational databases and tables.
  • All the RDBMS like MySQL, Informix, Oracle, MS Access and SQL Server use SQL as their standard database language.
  • SQL allows users to query the database in a number of ways, using English-like statements.

Link for the ProblemType of Triangle – Hacker Rank Solution

Type of Triangle – Hacker Rank Solution


Write a query identifying the type of each record in the TRIANGLES table using its three side lengths. Output one of the following statements for each record in the table:

  • Equilateral: It’s a triangle with 3 sides of equal length.
  • Isosceles: It’s a triangle with 2 sides of equal length.
  • Scalene: It’s a triangle with 3 sides of differing lengths.
  • Not A Triangle: The given values of AB, and C don’t form a triangle.

Input Format

The TRIANGLES table is described as follows:

Type of Triangle

Each row in the table denotes the lengths of each of a triangle’s three sides.

Sample Input

Type of Triangle

Sample Output

Not A Triangle
Type of Triangle – Hacker Rank Solution
select if(A+B<=C or B+C<=A or A+C<=B,"Not A Triangle",
if(A=B and B=C,"Equilateral",
if(A=B or B=C or A=C,"Isosceles","Scalene")))
from TRIANGLES as T;

4 thoughts on “Type of Triangle in SQL | HackerRank Programming Solutions | HackerRank SQL Solutions”

  1. I carry on listening to the rumor speak about getting free online grant applications so I have been looking around for the top site to get one. Could you tell me please, where could i acquire some?

  2. I have to show my thanks to this writer just for bailing me out of this type of problem. Just after surfing throughout the internet and getting proposals that were not powerful, I believed my entire life was over. Living without the approaches to the problems you’ve fixed as a result of this write-up is a crucial case, as well as ones that could have in a negative way damaged my entire career if I hadn’t discovered your blog post. Your personal ability and kindness in playing with all the stuff was priceless. I don’t know what I would’ve done if I hadn’t come upon such a solution like this. It’s possible to at this moment look ahead to my future. Thanks so much for the high quality and results-oriented help. I will not be reluctant to propose your blog to anyone who needs and wants assistance on this subject matter.


Leave a Comment

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker🙏.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock