"content":"<p>Table: <code>Employee</code></p>\n\n<pre>\n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| id | int |\n| salary | int |\n+-------------+------+\nid is the primary key (column with unique values) for this table.\nEach row of this table contains information about the salary of an employee.\n</pre>\n\n<p> </p>\n\n<p>Write a solution to find the <code>n<sup>th</sup></code> highest salary from the <code>Employee</code> table. If there is no <code>n<sup>th</sup></code> highest salary, return <code>null</code>.</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 | salary |\n+----+--------+\n| 1 | 100 |\n| 2 | 200 |\n| 3 | 300 |\n+----+--------+\nn = 2\n<strong>Output:</strong> \n+------------------------+\n| getNthHighestSalary(2) |\n+------------------------+\n| 200 |\n+------------------------+\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nEmployee table:\n+----+--------+\n| id | salary |\n+----+--------+\n| 1 | 100 |\n+----+--------+\nn = 2\n<strong>Output:</strong> \n+------------------------+\n| getNthHighestSalary(2) |\n+------------------------+\n| null |\n+------------------------+\n</pre>\n",
"similarQuestions":"[{\"title\": \"The Number of Users That Are Eligible for Discount\", \"titleSlug\": \"the-number-of-users-that-are-eligible-for-discount\", \"difficulty\": \"Easy\", \"translatedTitle\": null}]",
"code":"-CREATE FUNCTION getNthHighestSalary(N IN NUMBER) RETURN NUMBER IS\n-result NUMBER;\n-BEGIN\n- /* Write your PL/SQL query statement below */\n-\n- RETURN result;\n-END;",
"__typename":"CodeSnippetNode"
},
{
"lang":"Pandas",
"langSlug":"pythondata",
"code":"import pandas as pd\n\ndef nth_highest_salary(employee: pd.DataFrame, N: int) -> pd.DataFrame:",
"__typename":"CodeSnippetNode"
},
{
"lang":"PostgreSQL",
"langSlug":"postgresql",
"code":"CREATE OR REPLACE FUNCTION NthHighestSalary(N INT) RETURNS TABLE (Salary INT) AS $$\nBEGIN\n RETURN QUERY (\n -- Write your PostgreSQL query statement below.\n \n \n );\nEND;\n$$ LANGUAGE plpgsql;",