{ "data": { "question": { "questionId": "2501", "questionFrontendId": "2362", "categoryTitle": "Database", "boundTopicId": 1723074, "title": "Generate the Invoice", "titleSlug": "generate-the-invoice", "content": null, "translatedTitle": "生成发票", "translatedContent": null, "isPaidOnly": true, "difficulty": "Hard", "likes": 2, "dislikes": 0, "isLiked": null, "similarQuestions": "[]", "contributors": [], "langToValidPlayground": null, "topicTags": [ { "name": "Database", "slug": "database", "translatedName": "数据库", "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"827\", \"totalSubmission\": \"1.1K\", \"totalAcceptedRaw\": 827, \"totalSubmissionRaw\": 1148, \"acRate\": \"72.0%\"}", "hints": [], "solution": null, "status": null, "sampleTestCase": "{\"headers\":{\"Products\":[\"product_id\",\"price\"],\"Purchases\":[\"invoice_id\",\"product_id\",\"quantity\"]},\"rows\":{\"Products\":[[1,100],[2,200]],\"Purchases\":[[1,1,2],[3,2,1],[2,2,3],[2,1,4],[4,1,10]]}}", "metaData": "{\"mysql\":[\"Create table If Not Exists Products (product_id int, price int)\",\"Create table If Not Exists Purchases (invoice_id int, product_id int, quantity int)\"],\"mssql\":[\"Create table Products (product_id int, price int)\",\"Create table Purchases (invoice_id int, product_id int, quantity int)\"],\"oraclesql\":[\"Create table Products (product_id int, price int)\",\"Create table Purchases (invoice_id int, product_id int, quantity int)\"],\"database\":true,\"name\":\"generate_the_invoice\",\"pythondata\":[\"Products = pd.DataFrame([], columns=['product_id', 'price']).astype({'product_id':'Int64', 'price':'Int64'})\",\"Purchases = pd.DataFrame([], columns=['invoice_id', 'product_id', 'quantity']).astype({'invoice_id':'Int64', 'product_id':'Int64', 'quantity':'Int64'})\"],\"postgresql\":[\"Create table If Not Exists Products (product_id int, price int)\",\"Create table If Not Exists Purchases (invoice_id int, product_id int, quantity int)\"],\"database_schema\":{\"Products\":{\"product_id\":\"INT\",\"price\":\"INT\"},\"Purchases\":{\"invoice_id\":\"INT\",\"product_id\":\"INT\",\"quantity\":\"INT\"}}}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [ "Create table If Not Exists Products (product_id int, price int)", "Create table If Not Exists Purchases (invoice_id int, product_id int, quantity int)", "Truncate table Products", "insert into Products (product_id, price) values ('1', '100')", "insert into Products (product_id, price) values ('2', '200')", "Truncate table Purchases", "insert into Purchases (invoice_id, product_id, quantity) values ('1', '1', '2')", "insert into Purchases (invoice_id, product_id, quantity) values ('3', '2', '1')", "insert into Purchases (invoice_id, product_id, quantity) values ('2', '2', '3')", "insert into Purchases (invoice_id, product_id, quantity) values ('2', '1', '4')", "insert into Purchases (invoice_id, product_id, quantity) values ('4', '1', '10')" ], "enableRunCode": true, "envInfo": "{\"mysql\":[\"MySQL\",\"

\\u7248\\u672c\\uff1aMySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"

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\":{\"Products\":[\"product_id\",\"price\"],\"Purchases\":[\"invoice_id\",\"product_id\",\"quantity\"]},\"rows\":{\"Products\":[[1,100],[2,200]],\"Purchases\":[[1,1,2],[3,2,1],[2,2,3],[2,1,4],[4,1,10]]}}", "__typename": "QuestionNode" } } }