{ "data": { "question": { "questionId": "1942", "questionFrontendId": "1789", "categoryTitle": "Database", "boundTopicId": 654757, "title": "Primary Department for Each Employee", "titleSlug": "primary-department-for-each-employee", "content": null, "translatedTitle": "员工的直属部门", "translatedContent": null, "isPaidOnly": true, "difficulty": "Easy", "likes": 6, "dislikes": 0, "isLiked": null, "similarQuestions": "[]", "contributors": [], "langToValidPlayground": null, "topicTags": [ { "name": "Database", "slug": "database", "translatedName": "数据库", "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"2.8K\", \"totalSubmission\": \"3.9K\", \"totalAcceptedRaw\": 2750, \"totalSubmissionRaw\": 3865, \"acRate\": \"71.2%\"}", "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, "envInfo": "{\"mysql\":[\"MySQL\",\"
\\u7248\\u672c\\uff1a mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\" Oracle Sql 11.2.<\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,
"dailyRecordStatus": null,
"editorType": "CKEDITOR",
"ugcQuestionId": null,
"style": "LEETCODE",
"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\"]]}}",
"__typename": "QuestionNode"
}
}
}MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"