{ "data": { "question": { "questionId": "1214", "questionFrontendId": "1112", "boundTopicId": null, "title": "Highest Grade For Each Student", "titleSlug": "highest-grade-for-each-student", "content": null, "translatedTitle": null, "translatedContent": null, "isPaidOnly": true, "difficulty": "Medium", "likes": 285, "dislikes": 14, "isLiked": null, "similarQuestions": "[{\"title\": \"Department Highest Salary\", \"titleSlug\": \"department-highest-salary\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]", "exampleTestcases": "{\"headers\":{\"Enrollments\":[\"student_id\",\"course_id\",\"grade\"]},\"rows\":{\"Enrollments\":[[2,2,95],[2,3,95],[1,1,90],[1,2,99],[3,1,80],[3,2,75],[3,3,82]]}}", "categoryTitle": "Database", "contributors": [], "topicTags": [ { "name": "Database", "slug": "database", "translatedName": null, "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"55.3K\", \"totalSubmission\": \"77.8K\", \"totalAcceptedRaw\": 55257, \"totalSubmissionRaw\": 77848, \"acRate\": \"71.0%\"}", "hints": [], "solution": { "id": "2051", "canSeeDetail": false, "paidOnly": true, "hasVideoSolution": false, "paidOnlyVideo": true, "__typename": "ArticleNode" }, "status": null, "sampleTestCase": "{\"headers\":{\"Enrollments\":[\"student_id\",\"course_id\",\"grade\"]},\"rows\":{\"Enrollments\":[[2,2,95],[2,3,95],[1,1,90],[1,2,99],[3,1,80],[3,2,75],[3,3,82]]}}", "metaData": "{\"mysql\": [\"Create table If Not Exists Enrollments (student_id int, course_id int, grade int)\"], \"mssql\": [\"Create table Enrollments (student_id int, course_id int, grade int)\"], \"oraclesql\": [\"Create table Enrollments (student_id int, course_id int, grade int)\"], \"database\": true, \"name\": \"highest_grade\", \"pythondata\": [\"Enrollments = pd.DataFrame([], columns=['student_id', 'course_id', 'grade']).astype({'student_id':'Int64', 'course_id':'Int64', 'grade':'Int64'})\"], \"postgresql\": [\"\\nCreate table If Not Exists Enrollments (student_id int, course_id int, grade int)\"], \"database_schema\": {\"Enrollments\": {\"student_id\": \"INT\", \"course_id\": \"INT\", \"grade\": \"INT\"}}}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [ "Create table If Not Exists Enrollments (student_id int, course_id int, grade int)", "Truncate table Enrollments", "insert into Enrollments (student_id, course_id, grade) values ('2', '2', '95')", "insert into Enrollments (student_id, course_id, grade) values ('2', '3', '95')", "insert into Enrollments (student_id, course_id, grade) values ('1', '1', '90')", "insert into Enrollments (student_id, course_id, grade) values ('1', '2', '99')", "insert into Enrollments (student_id, course_id, grade) values ('3', '1', '80')", "insert into Enrollments (student_id, course_id, grade) values ('3', '2', '75')", "insert into Enrollments (student_id, course_id, grade) values ('3', '3', '82')" ], "enableRunCode": true, "enableTestMode": false, "enableDebugger": false, "envInfo": "{\"mysql\": [\"MySQL\", \"

MySQL 8.0.

\"], \"mssql\": [\"MS SQL Server\", \"

mssql server 2019.

\"], \"oraclesql\": [\"Oracle\", \"

Oracle Sql 11.2.

\"], \"pythondata\": [\"Pandas\", \"

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" } } }