{ "data": { "question": { "questionId": "1942", "questionFrontendId": "1789", "boundTopicId": null, "title": "Primary Department for Each Employee", "titleSlug": "primary-department-for-each-employee", "content": null, "translatedTitle": null, "translatedContent": null, "isPaidOnly": true, "difficulty": "Easy", "likes": 59, "dislikes": 28, "isLiked": null, "similarQuestions": "[]", "exampleTestcases": "{\"headers\":{\"Employee\":[\"employee_id\",\"department_id\",\"primary_flag\"]},\"rows\":{\"Employee\":[[\"1\",\"1\",\"N\"],[\"2\",\"1\",\"Y\"],[\"2\",\"2\",\"N\"],[\"3\",\"3\",\"N\"],[\"4\",\"2\",\"N\"],[\"4\",\"3\",\"Y\"],[\"4\",\"4\",\"N\"]]}}", "categoryTitle": "Database", "contributors": [], "topicTags": [ { "name": "Database", "slug": "database", "translatedName": null, "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"9.6K\", \"totalSubmission\": \"12.1K\", \"totalAcceptedRaw\": 9610, \"totalSubmissionRaw\": 12122, \"acRate\": \"79.3%\"}", "hints": [], "solution": null, "status": null, "sampleTestCase": "{\"headers\":{\"Employee\":[\"employee_id\",\"department_id\",\"primary_flag\"]},\"rows\":{\"Employee\":[[\"1\",\"1\",\"N\"],[\"2\",\"1\",\"Y\"],[\"2\",\"2\",\"N\"],[\"3\",\"3\",\"N\"],[\"4\",\"2\",\"N\"],[\"4\",\"3\",\"Y\"],[\"4\",\"4\",\"N\"]]}}", "metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Employee (employee_id int, department_id int, primary_flag ENUM('Y','N'))\"\n ],\n \"mssql\": [\n \"Create table Employee (employee_id int, department_id int, primary_flag varchar(1) not null check(primary_flag in ('Y', 'N')))\"\n ],\n \"oraclesql\": [\n \"Create table Employee (employee_id int, department_id int, primary_flag varchar(1) not null check(primary_flag in ('Y', 'N')))\"\n ],\n \"database\": true\n}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [ "Create table If Not Exists Employee (employee_id int, department_id int, primary_flag ENUM('Y','N'))", "Truncate table Employee", "insert into Employee (employee_id, department_id, primary_flag) values ('1', '1', 'N')", "insert into Employee (employee_id, department_id, primary_flag) values ('2', '1', 'Y')", "insert into Employee (employee_id, department_id, primary_flag) values ('2', '2', 'N')", "insert into Employee (employee_id, department_id, primary_flag) values ('3', '3', 'N')", "insert into Employee (employee_id, department_id, primary_flag) values ('4', '2', 'N')", "insert into Employee (employee_id, department_id, primary_flag) values ('4', '3', 'Y')", "insert into Employee (employee_id, department_id, primary_flag) values ('4', '4', 'N')" ], "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.

\"]}", "libraryUrl": null, "adminUrl": null, "challengeQuestion": null, "__typename": "QuestionNode" } } }