{ "data": { "question": { "questionId": "2501", "questionFrontendId": "2362", "boundTopicId": null, "title": "Generate the Invoice", "titleSlug": "generate-the-invoice", "content": null, "translatedTitle": null, "translatedContent": null, "isPaidOnly": true, "difficulty": "Hard", "likes": 11, "dislikes": 9, "isLiked": null, "similarQuestions": "[]", "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]]}}", "categoryTitle": "Database", "contributors": [], "topicTags": [ { "name": "Database", "slug": "database", "translatedName": null, "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"397\", \"totalSubmission\": \"433\", \"totalAcceptedRaw\": 397, \"totalSubmissionRaw\": 433, \"acRate\": \"91.7%\"}", "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": "{\n \"mysql\": [\n \"Create table If Not Exists Products (product_id int, price int)\",\n \"Create table If Not Exists Purchases (invoice_id int, product_id int, quantity int)\"\n ],\n \"mssql\": [\n \"Create table Products (product_id int, price int)\",\n \"Create table Purchases (invoice_id int, product_id int, quantity int)\"\n ],\n \"oraclesql\": [\n \"Create table Products (product_id int, price int)\",\n \"Create table Purchases (invoice_id int, product_id int, quantity int)\"\n ],\n \"database\": true\n}", "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, "enableTestMode": false, "enableDebugger": false, "envInfo": "{\"mysql\": [\"MySQL\", \"
MySQL 8.0
.
mssql server 2019
.
Oracle Sql 11.2
.