mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
95 lines
6.5 KiB
JSON
95 lines
6.5 KiB
JSON
{
|
|
"data": {
|
|
"question": {
|
|
"questionId": "181",
|
|
"questionFrontendId": "181",
|
|
"boundTopicId": null,
|
|
"title": "Employees Earning More Than Their Managers",
|
|
"titleSlug": "employees-earning-more-than-their-managers",
|
|
"content": "<p>Table: <code>Employee</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| id | int |\n| name | varchar |\n| salary | int |\n| managerId | int |\n+-------------+---------+\nid is the primary key (column with unique values) for this table.\nEach row of this table indicates the ID of an employee, their name, salary, and the ID of their manager.\n</pre>\n\n<p> </p>\n\n<p>Write a solution to find the employees who earn more than their managers.</p>\n\n<p>Return the result table in <strong>any order</strong>.</p>\n\n<p>The result format is in the following example.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nEmployee table:\n+----+-------+--------+-----------+\n| id | name | salary | managerId |\n+----+-------+--------+-----------+\n| 1 | Joe | 70000 | 3 |\n| 2 | Henry | 80000 | 4 |\n| 3 | Sam | 60000 | Null |\n| 4 | Max | 90000 | Null |\n+----+-------+--------+-----------+\n<strong>Output:</strong> \n+----------+\n| Employee |\n+----------+\n| Joe |\n+----------+\n<strong>Explanation:</strong> Joe is the only employee who earns more than his manager.\n</pre>\n",
|
|
"translatedTitle": null,
|
|
"translatedContent": null,
|
|
"isPaidOnly": false,
|
|
"difficulty": "Easy",
|
|
"likes": 2469,
|
|
"dislikes": 238,
|
|
"isLiked": null,
|
|
"similarQuestions": "[]",
|
|
"exampleTestcases": "{\"headers\": {\"Employee\": [\"id\", \"name\", \"salary\", \"managerId\"]}, \"rows\": {\"Employee\": [[1, \"Joe\", 70000, 3], [2, \"Henry\", 80000, 4], [3, \"Sam\", 60000, null], [4, \"Max\", 90000, null]]}}",
|
|
"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 find_employees(employee: pd.DataFrame) -> pd.DataFrame:\n ",
|
|
"__typename": "CodeSnippetNode"
|
|
},
|
|
{
|
|
"lang": "PostgreSQL",
|
|
"langSlug": "postgresql",
|
|
"code": "-- Write your PostgreSQL query statement below\n",
|
|
"__typename": "CodeSnippetNode"
|
|
}
|
|
],
|
|
"stats": "{\"totalAccepted\": \"579K\", \"totalSubmission\": \"840.8K\", \"totalAcceptedRaw\": 579007, \"totalSubmissionRaw\": 840838, \"acRate\": \"68.9%\"}",
|
|
"hints": [],
|
|
"solution": {
|
|
"id": "215",
|
|
"canSeeDetail": false,
|
|
"paidOnly": true,
|
|
"hasVideoSolution": false,
|
|
"paidOnlyVideo": true,
|
|
"__typename": "ArticleNode"
|
|
},
|
|
"status": null,
|
|
"sampleTestCase": "{\"headers\": {\"Employee\": [\"id\", \"name\", \"salary\", \"managerId\"]}, \"rows\": {\"Employee\": [[1, \"Joe\", 70000, 3], [2, \"Henry\", 80000, 4], [3, \"Sam\", 60000, null], [4, \"Max\", 90000, null]]}}",
|
|
"metaData": "{\"mysql\": [\"Create table If Not Exists Employee (id int, name varchar(255), salary int, managerId int)\"], \"mssql\": [\"Create table Employee (id int, name varchar(255), salary int, managerId int)\"], \"oraclesql\": [\"Create table Employee (id int, name varchar(255), salary int, managerId int)\"], \"database\": true, \"name\": \"find_employees\", \"pythondata\": [\"Employee = pd.DataFrame([], columns=['id', 'name', 'salary', 'managerId']).astype({'id':'Int64', 'name':'object', 'salary':'Int64', 'managerId':'Int64'})\\n\"], \"postgresql\": [\"Create table If Not Exists Employee (id int, name varchar(255), salary int, managerId int)\"], \"database_schema\": {\"Employee\": {\"id\": \"INT\", \"name\": \"VARCHAR(255)\", \"salary\": \"INT\", \"managerId\": \"INT\"}}}",
|
|
"judgerAvailable": true,
|
|
"judgeType": "large",
|
|
"mysqlSchemas": [
|
|
"Create table If Not Exists Employee (id int, name varchar(255), salary int, managerId int)",
|
|
"Truncate table Employee",
|
|
"insert into Employee (id, name, salary, managerId) values ('1', 'Joe', '70000', '3')",
|
|
"insert into Employee (id, name, salary, managerId) values ('2', 'Henry', '80000', '4')",
|
|
"insert into Employee (id, name, salary, managerId) values ('3', 'Sam', '60000', 'None')",
|
|
"insert into Employee (id, name, salary, managerId) values ('4', 'Max', '90000', 'None')"
|
|
],
|
|
"enableRunCode": true,
|
|
"enableTestMode": false,
|
|
"enableDebugger": false,
|
|
"envInfo": "{\"mysql\": [\"MySQL\", \"<p><code>MySQL 8.0</code>.</p>\"], \"mssql\": [\"MS SQL Server\", \"<p><code>mssql server 2019</code>.</p>\"], \"oraclesql\": [\"Oracle\", \"<p><code>Oracle Sql 11.2</code>.</p>\"], \"pythondata\": [\"Pandas\", \"<p>Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0</p>\"], \"postgresql\": [\"PostgreSQL\", \"<p>PostgreSQL 16</p>\"]}",
|
|
"libraryUrl": null,
|
|
"adminUrl": null,
|
|
"challengeQuestion": null,
|
|
"__typename": "QuestionNode"
|
|
}
|
|
}
|
|
} |