2022-03-27 18:35:17 +08:00
{
"data" : {
"question" : {
"questionId" : "197" ,
"questionFrontendId" : "197" ,
"boundTopicId" : null ,
"title" : "Rising Temperature" ,
"titleSlug" : "rising-temperature" ,
2023-12-09 18:42:21 +08:00
"content" : "<p>Table: <code>Weather</code></p>\n\n<pre>\n+---------------+---------+\n| Column Name | Type |\n+---------------+---------+\n| id | int |\n| recordDate | date |\n| temperature | int |\n+---------------+---------+\nid is the column with unique values for this table.\nThis table contains information about the temperature on a certain day.\n</pre>\n\n<p> </p>\n\n<p>Write a solution to find all dates' <code>Id</code> with higher temperatures compared to its previous dates (yesterday).</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> \nWeather table:\n+----+------------+-------------+\n| id | recordDate | temperature |\n+----+------------+-------------+\n| 1 | 2015-01-01 | 10 |\n| 2 | 2015-01-02 | 25 |\n| 3 | 2015-01-03 | 20 |\n| 4 | 2015-01-04 | 30 |\n+----+------------+-------------+\n<strong>Output:</strong> \n+----+\n| id |\n+----+\n| 2 |\n| 4 |\n+----+\n<strong>Explanation:</strong> \nIn 2015-01-02, the temperature was higher than the previous day (10 -> 25).\nIn 2015-01-04, the temperature was higher than the previous day (20 -> 30).\n</pre>\n" ,
2022-03-27 18:35:17 +08:00
"translatedTitle" : null ,
"translatedContent" : null ,
"isPaidOnly" : false ,
"difficulty" : "Easy" ,
2023-12-09 18:42:21 +08:00
"likes" : 2480 ,
"dislikes" : 560 ,
2022-03-27 18:35:17 +08:00
"isLiked" : null ,
"similarQuestions" : "[]" ,
"exampleTestcases" : "{\"headers\": {\"Weather\": [\"id\", \"recordDate\", \"temperature\"]}, \"rows\": {\"Weather\": [[1, \"2015-01-01\", 10], [2, \"2015-01-02\", 25], [3, \"2015-01-03\", 20], [4, \"2015-01-04\", 30]]}}" ,
"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"
2023-12-09 18:42:21 +08:00
} ,
{
"lang" : "Pandas" ,
"langSlug" : "pythondata" ,
"code" : "import pandas as pd\n\ndef rising_temperature(weather: pd.DataFrame) -> pd.DataFrame:\n " ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "PostgreSQL" ,
"langSlug" : "postgresql" ,
"code" : "-- Write your PostgreSQL query statement below\n" ,
"__typename" : "CodeSnippetNode"
2022-03-27 18:35:17 +08:00
}
] ,
2023-12-09 19:57:46 +08:00
"stats" : "{\"totalAccepted\": \"483.4K\", \"totalSubmission\": \"1M\", \"totalAcceptedRaw\": 483363, \"totalSubmissionRaw\": 1048718, \"acRate\": \"46.1%\"}" ,
2022-03-27 18:35:17 +08:00
"hints" : [ ] ,
"solution" : {
2023-12-09 18:42:21 +08:00
"id" : "2209" ,
2022-03-27 18:35:17 +08:00
"canSeeDetail" : true ,
"paidOnly" : false ,
"hasVideoSolution" : false ,
"paidOnlyVideo" : true ,
"__typename" : "ArticleNode"
} ,
"status" : null ,
"sampleTestCase" : "{\"headers\": {\"Weather\": [\"id\", \"recordDate\", \"temperature\"]}, \"rows\": {\"Weather\": [[1, \"2015-01-01\", 10], [2, \"2015-01-02\", 25], [3, \"2015-01-03\", 20], [4, \"2015-01-04\", 30]]}}" ,
2023-12-09 18:42:21 +08:00
"metaData" : "{\"mysql\": [\"Create table If Not Exists Weather (id int, recordDate date, temperature int)\"], \"mssql\": [\"Create table Weather (id int, recordDate date, temperature int)\"], \"oraclesql\": [\"Create table Weather (id int, recordDate date, temperature int)\", \"ALTER SESSION SET nls_date_format='YYYY-MM-DD'\"], \"database\": true, \"name\": \"rising_temperature\", \"pythondata\": [\"Weather = pd.DataFrame([], columns=['id', 'recordDate', 'temperature']).astype({'id':'Int64', 'recordDate':'datetime64[ns]', 'temperature':'Int64'})\"], \"postgresql\": [\"Create table If Not Exists Weather (id int, recordDate date, temperature int)\"], \"database_schema\": {\"Weather\": {\"id\": \"INT\", \"recordDate\": \"DATE\", \"temperature\": \"INT\"}}}" ,
2022-03-27 18:35:17 +08:00
"judgerAvailable" : true ,
"judgeType" : "large" ,
"mysqlSchemas" : [
"Create table If Not Exists Weather (id int, recordDate date, temperature int)" ,
"Truncate table Weather" ,
"insert into Weather (id, recordDate, temperature) values ('1', '2015-01-01', '10')" ,
"insert into Weather (id, recordDate, temperature) values ('2', '2015-01-02', '25')" ,
"insert into Weather (id, recordDate, temperature) values ('3', '2015-01-03', '20')" ,
"insert into Weather (id, recordDate, temperature) values ('4', '2015-01-04', '30')"
] ,
"enableRunCode" : true ,
"enableTestMode" : false ,
"enableDebugger" : false ,
2023-12-09 18:42:21 +08:00
"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>\"]}" ,
2022-03-27 18:35:17 +08:00
"libraryUrl" : null ,
"adminUrl" : null ,
"challengeQuestion" : null ,
"__typename" : "QuestionNode"
}
}
}