{ "data": { "question": { "questionId": "610", "questionFrontendId": "610", "boundTopicId": null, "title": "Triangle Judgement", "titleSlug": "triangle-judgement", "content": "
Table: Triangle
\n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| x | int |\n| y | int |\n| z | int |\n+-------------+------+\nIn SQL, (x, y, z) is the primary key column for this table.\nEach row of this table contains the lengths of three line segments.\n\n\n
\n\n
Report for every three line segments whether they can form a triangle.
\n\nReturn the result table in any order.
\n\nThe result format is in the following example.
\n\n\n
Example 1:
\n\n\nInput: \nTriangle table:\n+----+----+----+\n| x | y | z |\n+----+----+----+\n| 13 | 15 | 30 |\n| 10 | 20 | 15 |\n+----+----+----+\nOutput: \n+----+----+----+----------+\n| x | y | z | triangle |\n+----+----+----+----------+\n| 13 | 15 | 30 | No |\n| 10 | 20 | 15 | Yes |\n+----+----+----+----------+\n\n", "translatedTitle": null, "translatedContent": null, "isPaidOnly": false, "difficulty": "Easy", "likes": 498, "dislikes": 129, "isLiked": null, "similarQuestions": "[]", "exampleTestcases": "{\"headers\":{\"Triangle\":[\"x\",\"y\",\"z\"]},\"rows\":{\"Triangle\":[[13,15,30],[10,20,15]]}}", "categoryTitle": "Database", "contributors": [], "topicTags": [ { "name": "Database", "slug": "database", "translatedName": null, "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": [ { "lang": "MySQL", "langSlug": "mysql", "code": "# Write your MySQL query statement below\n", "__typename": "CodeSnippetNode" }, { "lang": "MS SQL Server", "langSlug": "mssql", "code": "/* Write your T-SQL query statement below */\n", "__typename": "CodeSnippetNode" }, { "lang": "Oracle", "langSlug": "oraclesql", "code": "/* Write your PL/SQL query statement below */\n", "__typename": "CodeSnippetNode" }, { "lang": "Pandas", "langSlug": "pythondata", "code": "import pandas as pd\n\ndef triangle_judgement(triangle: pd.DataFrame) -> pd.DataFrame:\n ", "__typename": "CodeSnippetNode" }, { "lang": "PostgreSQL", "langSlug": "postgresql", "code": "-- Write your PostgreSQL query statement below\n", "__typename": "CodeSnippetNode" } ], "stats": "{\"totalAccepted\": \"119.7K\", \"totalSubmission\": \"169.5K\", \"totalAcceptedRaw\": 119657, \"totalSubmissionRaw\": 169525, \"acRate\": \"70.6%\"}", "hints": [], "solution": { "id": "180", "canSeeDetail": false, "paidOnly": true, "hasVideoSolution": false, "paidOnlyVideo": true, "__typename": "ArticleNode" }, "status": null, "sampleTestCase": "{\"headers\":{\"Triangle\":[\"x\",\"y\",\"z\"]},\"rows\":{\"Triangle\":[[13,15,30],[10,20,15]]}}", "metaData": "{\"mysql\": [\"Create table If Not Exists Triangle (x int, y int, z int)\"], \"mssql\": [\"Create table Triangle (x int, y int, z int)\"], \"oraclesql\": [\"Create table Triangle (x int, y int, z int)\"], \"database\": true, \"name\": \"triangle_judgement\", \"pythondata\": [\"Triangle = pd.DataFrame([], columns=['x', 'y', 'z']).astype({'x':'Int64', 'y':'Int64', 'z':'Int64'})\"], \"postgresql\": [\"Create table If Not Exists Triangle (x int, y int, z int)\"], \"database_schema\": {\"Triangle\": {\"x\": \"INT\", \"y\": \"INT\", \"z\": \"INT\"}}}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [ "Create table If Not Exists Triangle (x int, y int, z int)", "Truncate table Triangle", "insert into Triangle (x, y, z) values ('13', '15', '30')", "insert into Triangle (x, y, z) values ('10', '20', '15')" ], "enableRunCode": true, "enableTestMode": false, "enableDebugger": false, "envInfo": "{\"mysql\": [\"MySQL\", \"
MySQL 8.0
.
mssql server 2019
.
Oracle Sql 11.2
.
Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0
\"], \"postgresql\": [\"PostgreSQL\", \"PostgreSQL 16
\"]}", "libraryUrl": null, "adminUrl": null, "challengeQuestion": null, "__typename": "QuestionNode" } } }