{ "data": { "question": { "questionId": "2829", "questionFrontendId": "2668", "boundTopicId": null, "title": "Find Latest Salaries", "titleSlug": "find-latest-salaries", "content": null, "translatedTitle": null, "translatedContent": null, "isPaidOnly": true, "difficulty": "Easy", "likes": 14, "dislikes": 16, "isLiked": null, "similarQuestions": "[]", "exampleTestcases": "{\"headers\":{\"Salary\":[\"emp_id\",\"firstname\",\"lastname\",\"salary\",\"department_id\"]},\"rows\":{\"Salary\":[[1,\"Todd\",\"Wilson\",110000,\"D1006\"],[1,\"Todd\",\"Wilson\",106119,\"D1006\"],[2,\"Justin\",\"Simon\",128922,\"D1005\"],[2,\"Justin\",\"Simon\",130000,\"D1005\"],[3,\"Kelly\",\"Rosario\",42689,\"D1002\"],[4,\"Patricia\",\"Powell\",162825,\"D1004\"],[4,\"Patricia\",\"Powell\",170000,\"D1004\"],[5,\"Sherry\",\"Golden\",44101,\"D1002\"],[6,\"Natasha\",\"Swanson\",79632,\"D1005\"],[6,\"Natasha\",\"Swanson\",90000,\"D1005\"]]}}", "categoryTitle": "Database", "contributors": [], "topicTags": [ { "name": "Database", "slug": "database", "translatedName": null, "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"1.8K\", \"totalSubmission\": \"2.8K\", \"totalAcceptedRaw\": 1849, \"totalSubmissionRaw\": 2826, \"acRate\": \"65.4%\"}", "hints": [], "solution": { "id": "2040", "canSeeDetail": false, "paidOnly": true, "hasVideoSolution": false, "paidOnlyVideo": true, "__typename": "ArticleNode" }, "status": null, "sampleTestCase": "{\"headers\":{\"Salary\":[\"emp_id\",\"firstname\",\"lastname\",\"salary\",\"department_id\"]},\"rows\":{\"Salary\":[[1,\"Todd\",\"Wilson\",110000,\"D1006\"],[1,\"Todd\",\"Wilson\",106119,\"D1006\"],[2,\"Justin\",\"Simon\",128922,\"D1005\"],[2,\"Justin\",\"Simon\",130000,\"D1005\"],[3,\"Kelly\",\"Rosario\",42689,\"D1002\"],[4,\"Patricia\",\"Powell\",162825,\"D1004\"],[4,\"Patricia\",\"Powell\",170000,\"D1004\"],[5,\"Sherry\",\"Golden\",44101,\"D1002\"],[6,\"Natasha\",\"Swanson\",79632,\"D1005\"],[6,\"Natasha\",\"Swanson\",90000,\"D1005\"]]}}", "metaData": "{\"mysql\": [\"Create table If Not Exists Salary (emp_id int,firstname varchar(100),lastname varchar(100),salary int, department_id varchar(100))\"], \"mssql\": [\"Create table Salary (emp_id int,firstname varchar(100),lastname varchar(100),salary int, department_id varchar(100))\"], \"oraclesql\": [\"Create table Salary (emp_id int,firstname varchar(100),lastname varchar(100),salary int, department_id varchar(100))\"], \"database\": true, \"name\": \"find_latest_salaries\", \"pythondata\": [\"Salary = pd.DataFrame([], columns=['emp_id', 'firstname', 'lastname', 'salary', 'department_id']).astype({'emp_id':'Int64', 'firstname':'object', 'lastname':'object', 'salary':'Int64', 'department_id':'object'})\"], \"postgresql\": [\"Create table If Not Exists Salary (emp_id int,firstname varchar(100),lastname varchar(100),salary int, department_id varchar(100))\"], \"database_schema\": {\"Salary\": {\"emp_id\": \"INT\", \"firstname\": \"VARCHAR(100)\", \"lastname\": \"VARCHAR(100)\", \"salary\": \"INT\", \"department_id\": \"VARCHAR(100)\"}}}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [ "Create table If Not Exists Salary (emp_id int,firstname varchar(100),lastname varchar(100),salary int, department_id varchar(100))", "Truncate table Salary", "insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('1', 'Todd', 'Wilson', '110000', 'D1006')", "insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('1', 'Todd', 'Wilson', '106119', 'D1006')", "insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('2', 'Justin', 'Simon', '128922', 'D1005')", "insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('2', 'Justin', 'Simon', '130000', 'D1005')", "insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('3', 'Kelly', 'Rosario', '42689', 'D1002')", "insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('4', 'Patricia', 'Powell', '162825', 'D1004')", "insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('4', 'Patricia', 'Powell', '170000', 'D1004')", "insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('5', 'Sherry', 'Golden', '44101', 'D1002')", "insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('6', 'Natasha', 'Swanson', '79632', 'D1005')", "insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('6', 'Natasha', 'Swanson', '90000', 'D1005')" ], "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" } } }