{ "data": { "question": { "questionId": "1821", "questionFrontendId": "1677", "categoryTitle": "Database", "boundTopicId": 510843, "title": "Product's Worth Over Invoices", "titleSlug": "products-worth-over-invoices", "content": null, "translatedTitle": "发票中的产品金额", "translatedContent": null, "isPaidOnly": true, "difficulty": "Easy", "likes": 9, "dislikes": 0, "isLiked": null, "similarQuestions": "[]", "contributors": [], "langToValidPlayground": null, "topicTags": [ { "name": "Database", "slug": "database", "translatedName": "数据库", "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"4.9K\", \"totalSubmission\": \"14K\", \"totalAcceptedRaw\": 4905, \"totalSubmissionRaw\": 13984, \"acRate\": \"35.1%\"}", "hints": [], "solution": null, "status": null, "sampleTestCase": "{\"headers\":{\"Product\":[\"product_id\",\"name\"],\"Invoice\":[\"invoice_id\",\"product_id\",\"rest\",\"paid\",\"canceled\",\"refunded\"]},\"rows\":{\"Product\":[[0,\"ham\"],[1,\"bacon\"]],\"Invoice\":[[23,0,2,0,5,0],[12,0,0,4,0,3],[1,1,1,1,0,1],[2,1,1,0,1,1],[3,1,0,1,1,1],[4,1,1,1,1,0]]}}", "metaData": "{\"mysql\":[\"Create table If Not Exists Product(product_id int, name varchar(15))\",\"Create table If Not Exists Invoice(invoice_id int,product_id int,rest int, paid int, canceled int, refunded int)\"],\"mssql\":[\"Create table Product(product_id int, name varchar(15))\",\"Create table Invoice(invoice_id int,product_id int,rest int, paid int, canceled int, refunded int)\"],\"oraclesql\":[\"Create table Product(product_id int, name varchar(15))\",\"Create table Invoice(invoice_id int,product_id int,rest int, paid int, canceled int, refunded int)\"],\"database\":true,\"name\":\"analyze_products\",\"pythondata\":[\"Product = pd.DataFrame([], columns=['product_id', 'name']).astype({'product_id':'Int64', 'name':'object'})\",\"Invoice = pd.DataFrame([], columns=['invoice_id', 'product_id', 'rest', 'paid', 'canceled', 'refunded']).astype({'invoice_id':'Int64', 'product_id':'Int64', 'rest':'Int64', 'paid':'Int64', 'canceled':'Int64', 'refunded':'Int64'})\"],\"postgresql\":[\"Create table If Not Exists Product(product_id int, name varchar(15))\",\"Create table If Not Exists Invoice(invoice_id int,product_id int,rest int, paid int, canceled int, refunded int)\"],\"database_schema\":{\"Product\":{\"product_id\":\"INT\",\"name\":\"VARCHAR(15)\"},\"Invoice\":{\"invoice_id\":\"INT\",\"product_id\":\"INT\",\"rest\":\"INT\",\"paid\":\"INT\",\"canceled\":\"INT\",\"refunded\":\"INT\"}}}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [ "Create table If Not Exists Product(product_id int, name varchar(15))", "Create table If Not Exists Invoice(invoice_id int,product_id int,rest int, paid int, canceled int, refunded int)", "Truncate table Product", "insert into Product (product_id, name) values ('0', 'ham')", "insert into Product (product_id, name) values ('1', 'bacon')", "Truncate table Invoice", "insert into Invoice (invoice_id, product_id, rest, paid, canceled, refunded) values ('23', '0', '2', '0', '5', '0')", "insert into Invoice (invoice_id, product_id, rest, paid, canceled, refunded) values ('12', '0', '0', '4', '0', '3')", "insert into Invoice (invoice_id, product_id, rest, paid, canceled, refunded) values ('1', '1', '1', '1', '0', '1')", "insert into Invoice (invoice_id, product_id, rest, paid, canceled, refunded) values ('2', '1', '1', '0', '1', '1')", "insert into Invoice (invoice_id, product_id, rest, paid, canceled, refunded) values ('3', '1', '0', '1', '1', '1')", "insert into Invoice (invoice_id, product_id, rest, paid, canceled, refunded) values ('4', '1', '1', '1', '1', '0')" ], "enableRunCode": true, "envInfo": "{\"mysql\":[\"MySQL\",\"
\\u7248\\u672c\\uff1a mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\" Oracle Sql 11.2.<\\/p>\"],\"pythondata\":[\"Pandas\",\" Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\" PostgreSQL 16<\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,
"dailyRecordStatus": null,
"editorType": "CKEDITOR",
"ugcQuestionId": null,
"style": "LEETCODE",
"exampleTestcases": "{\"headers\":{\"Product\":[\"product_id\",\"name\"],\"Invoice\":[\"invoice_id\",\"product_id\",\"rest\",\"paid\",\"canceled\",\"refunded\"]},\"rows\":{\"Product\":[[0,\"ham\"],[1,\"bacon\"]],\"Invoice\":[[23,0,2,0,5,0],[12,0,0,4,0,3],[1,1,1,1,0,1],[2,1,1,0,1,1],[3,1,0,1,1,1],[4,1,1,1,1,0]]}}",
"__typename": "QuestionNode"
}
}
}MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"