1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/originData/[no content]customer-purchasing-behavior-analysis.json
2024-08-06 08:46:50 +08:00

66 lines
6.5 KiB
JSON

{
"data": {
"question": {
"questionId": "3539",
"questionFrontendId": "3230",
"categoryTitle": "Database",
"boundTopicId": 2852426,
"title": "Customer Purchasing Behavior Analysis",
"titleSlug": "customer-purchasing-behavior-analysis",
"content": null,
"translatedTitle": "客户购买行为分析",
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 0,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
"contributors": [],
"langToValidPlayground": null,
"topicTags": [
{
"name": "Database",
"slug": "database",
"translatedName": "数据库",
"__typename": "TopicTagNode"
}
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"55\", \"totalSubmission\": \"162\", \"totalAcceptedRaw\": 55, \"totalSubmissionRaw\": 162, \"acRate\": \"34.0%\"}",
"hints": [],
"solution": null,
"status": null,
"sampleTestCase": "{\"headers\":{\"Transactions\":[\"transaction_id\",\"customer_id\",\"product_id\",\"transaction_date\",\"amount\"],\"Products\":[\"product_id\",\"category\",\"price\"]},\"rows\":{\"Transactions\":[[1,101,1,\"2023-01-01\",100.00],[2,101,2,\"2023-01-15\",150.00],[3,102,1,\"2023-01-01\",100.00],[4,102,3,\"2023-01-22\",200.00],[5,101,3,\"2023-02-10\",200.00]],\"Products\":[[1,\"A\",100.00],[2,\"B\",150.00],[3,\"C\",200.00]]}}",
"metaData": "{\"mysql\":[\"CREATE TABLE if not exists Transactions (\\n transaction_id INT,\\n customer_id INT,\\n product_id INT,\\n transaction_date DATE,\\n amount DECIMAL(10, 2)\\n)\",\"CREATE TABLE if not exists Products (\\n product_id INT ,\\n category VARCHAR(255),\\n price DECIMAL(10, 2)\\n)\\n\"],\"mssql\":[\"CREATE TABLE Transactions (\\n transaction_id INT ,\\n customer_id INT,\\n product_id INT,\\n transaction_date DATE,\\n amount DECIMAL(10, 2)\\n)\\n\",\"\\nCREATE TABLE Products (\\n product_id INT ,\\n category VARCHAR(255),\\n price DECIMAL(10, 2)\\n)\"],\"oraclesql\":[\"CREATE TABLE Transactions (\\n transaction_id NUMBER ,\\n customer_id NUMBER,\\n product_id NUMBER,\\n transaction_date DATE,\\n amount NUMBER(10, 2)\\n)\",\"CREATE TABLE Products (\\n product_id NUMBER ,\\n category VARCHAR2(255),\\n price NUMBER(10, 2)\\n)\",\"ALTER SESSION SET nls_date_format='YYYY-MM-DD'\"],\"database\":true,\"name\":\"analyze_customer_behavior\",\"postgresql\":[\"CREATE TABLE IF NOT EXISTS Transactions (\\n transaction_id INTEGER,\\n customer_id INTEGER,\\n product_id INTEGER,\\n transaction_date DATE,\\n amount NUMERIC(10, 2)\\n);\\n\",\"CREATE TABLE IF NOT EXISTS Products (\\n product_id INTEGER,\\n category VARCHAR(255),\\n price NUMERIC(10, 2)\\n);\\n\"],\"pythondata\":[\"Transactions = pd.DataFrame(columns=['transaction_id', 'customer_id', 'product_id', 'transaction_date', 'amount']).astype({'transaction_id': 'int', 'customer_id': 'int', 'product_id': 'int', 'transaction_date': 'datetime64[ns]', 'amount': 'float'})\",\"Products = pd.DataFrame(columns=['product_id', 'category', 'price']).astype({'product_id': 'int', 'category': 'str', 'price': 'float'})\"],\"database_schema\":{\"Transactions\":{\"transaction_id\":\"INT\",\"customer_id\":\"INT\",\"product_id\":\"INT\",\"transaction_date\":\"DATE\",\"amount\":\"DECIMAL(10, 2)\"},\"Products\":{\"product_id\":\"INT\",\"category\":\"VARCHAR(255)\",\"price\":\"DECIMAL(10, 2)\"}}}",
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [
"CREATE TABLE if not exists Transactions (\n transaction_id INT,\n customer_id INT,\n product_id INT,\n transaction_date DATE,\n amount DECIMAL(10, 2)\n)",
"CREATE TABLE if not exists Products (\n product_id INT ,\n category VARCHAR(255),\n price DECIMAL(10, 2)\n)\n",
"Truncate table Transactions",
"insert into Transactions (transaction_id, customer_id, product_id, transaction_date, amount) values ('1', '101', '1', '2023-01-01', '100.0')",
"insert into Transactions (transaction_id, customer_id, product_id, transaction_date, amount) values ('2', '101', '2', '2023-01-15', '150.0')",
"insert into Transactions (transaction_id, customer_id, product_id, transaction_date, amount) values ('3', '102', '1', '2023-01-01', '100.0')",
"insert into Transactions (transaction_id, customer_id, product_id, transaction_date, amount) values ('4', '102', '3', '2023-01-22', '200.0')",
"insert into Transactions (transaction_id, customer_id, product_id, transaction_date, amount) values ('5', '101', '3', '2023-02-10', '200.0')",
"Truncate table Products",
"insert into Products (product_id, category, price) values ('1', 'A', '100.0')",
"insert into Products (product_id, category, price) values ('2', 'B', '150.0')",
"insert into Products (product_id, category, price) values ('3', 'C', '200.0')"
],
"enableRunCode": true,
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"],\"pythondata\":[\"Pandas\",\"<p>Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\"<p>PostgreSQL 16<\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,
"dailyRecordStatus": null,
"editorType": "CKEDITOR",
"ugcQuestionId": null,
"style": "LEETCODE",
"exampleTestcases": "{\"headers\":{\"Transactions\":[\"transaction_id\",\"customer_id\",\"product_id\",\"transaction_date\",\"amount\"],\"Products\":[\"product_id\",\"category\",\"price\"]},\"rows\":{\"Transactions\":[[1,101,1,\"2023-01-01\",100.00],[2,101,2,\"2023-01-15\",150.00],[3,102,1,\"2023-01-01\",100.00],[4,102,3,\"2023-01-22\",200.00],[5,101,3,\"2023-02-10\",200.00]],\"Products\":[[1,\"A\",100.00],[2,\"B\",150.00],[3,\"C\",200.00]]}}",
"__typename": "QuestionNode"
}
}
}