{ "data": { "question": { "questionId": "1654", "questionFrontendId": "1511", "boundTopicId": null, "title": "Customer Order Frequency", "titleSlug": "customer-order-frequency", "content": null, "translatedTitle": null, "translatedContent": null, "isPaidOnly": true, "difficulty": "Easy", "likes": 225, "dislikes": 45, "isLiked": null, "similarQuestions": "[]", "exampleTestcases": "{\"headers\": {\"Customers\": [\"customer_id\", \"name\", \"country\"], \"Product\": [\"product_id\", \"description\", \"price\"], \"Orders\": [\"order_id\", \"customer_id\", \"product_id\", \"order_date\", \"quantity\"]}, \"rows\": {\"Customers\": [[1, \"Winston\", \"USA\"], [2, \"Jonathan\", \"Peru\"], [3, \"Moustafa\", \"Egypt\"]], \"Product\": [[10, \"LC Phone\", 300], [20, \"LC T-Shirt\", 10], [30, \"LC Book\", 45], [40, \"LC Keychain\", 2]], \"Orders\": [[1, 1, 10, \"2020-06-10\", 1], [2, 1, 20, \"2020-07-01\", 1], [3, 1, 30, \"2020-07-08\", 2], [4, 2, 10, \"2020-06-15\", 2], [5, 2, 40, \"2020-07-01\", 10], [6, 3, 20, \"2020-06-24\", 2], [7, 3, 30, \"2020-06-25\", 2], [9, 3, 30, \"2020-05-08\", 3]]}}", "categoryTitle": "Database", "contributors": [], "topicTags": [ { "name": "Database", "slug": "database", "translatedName": null, "__typename": "TopicTagNode" } ], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"27.5K\", \"totalSubmission\": \"37.4K\", \"totalAcceptedRaw\": 27538, \"totalSubmissionRaw\": 37438, \"acRate\": \"73.6%\"}", "hints": [], "solution": null, "status": null, "sampleTestCase": "{\"headers\": {\"Customers\": [\"customer_id\", \"name\", \"country\"], \"Product\": [\"product_id\", \"description\", \"price\"], \"Orders\": [\"order_id\", \"customer_id\", \"product_id\", \"order_date\", \"quantity\"]}, \"rows\": {\"Customers\": [[1, \"Winston\", \"USA\"], [2, \"Jonathan\", \"Peru\"], [3, \"Moustafa\", \"Egypt\"]], \"Product\": [[10, \"LC Phone\", 300], [20, \"LC T-Shirt\", 10], [30, \"LC Book\", 45], [40, \"LC Keychain\", 2]], \"Orders\": [[1, 1, 10, \"2020-06-10\", 1], [2, 1, 20, \"2020-07-01\", 1], [3, 1, 30, \"2020-07-08\", 2], [4, 2, 10, \"2020-06-15\", 2], [5, 2, 40, \"2020-07-01\", 10], [6, 3, 20, \"2020-06-24\", 2], [7, 3, 30, \"2020-06-25\", 2], [9, 3, 30, \"2020-05-08\", 3]]}}", "metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Customers (customer_id int, name varchar(30), country varchar(30))\",\n \"Create table If Not Exists Product (product_id int, description varchar(30), price int)\\n\",\n \"Create table If Not Exists Orders (order_id int, customer_id int, product_id int, order_date date, quantity int)\\n\"\n ],\n \"mssql\": [\n \"Create table Customers (customer_id int, name varchar(30), country varchar(30))\\n\",\n \"Create table Product (product_id int, description varchar(30), price int)\",\n \"Create table Orders (order_id int, customer_id int, product_id int, order_date date, quantity int)\"\n ],\n \"oraclesql\": [\n \"Create table Customers (customer_id int, name varchar(30), country varchar(30))\",\n \"Create table Product (product_id int, description varchar(30), price int)\",\n \"Create table Orders (order_id int, customer_id int, product_id int, order_date date, quantity int)\",\n \"ALTER SESSION SET nls_date_format='YYYY-MM-DD'\"\n ],\n \"database\": true\n}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [ "Create table If Not Exists Customers (customer_id int, name varchar(30), country varchar(30))", "Create table If Not Exists Product (product_id int, description varchar(30), price int)\n", "Create table If Not Exists Orders (order_id int, customer_id int, product_id int, order_date date, quantity int)\n", "Truncate table Customers", "insert into Customers (customer_id, name, country) values ('1', 'Winston', 'USA')", "insert into Customers (customer_id, name, country) values ('2', 'Jonathan', 'Peru')", "insert into Customers (customer_id, name, country) values ('3', 'Moustafa', 'Egypt')", "Truncate table Product", "insert into Product (product_id, description, price) values ('10', 'LC Phone', '300')", "insert into Product (product_id, description, price) values ('20', 'LC T-Shirt', '10')", "insert into Product (product_id, description, price) values ('30', 'LC Book', '45')", "insert into Product (product_id, description, price) values ('40', 'LC Keychain', '2')", "Truncate table Orders", "insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('1', '1', '10', '2020-06-10', '1')", "insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('2', '1', '20', '2020-07-01', '1')", "insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('3', '1', '30', '2020-07-08', '2')", "insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('4', '2', '10', '2020-06-15', '2')", "insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('5', '2', '40', '2020-07-01', '10')", "insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('6', '3', '20', '2020-06-24', '2')", "insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('7', '3', '30', '2020-06-25', '2')", "insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('9', '3', '30', '2020-05-08', '3')" ], "enableRunCode": true, "enableTestMode": false, "enableDebugger": false, "envInfo": "{\"mysql\": [\"MySQL\", \"

MySQL 8.0.

\"], \"mssql\": [\"MS SQL Server\", \"

mssql server 2019.

\"], \"oraclesql\": [\"Oracle\", \"

Oracle Sql 11.2.

\"]}", "libraryUrl": null, "adminUrl": null, "challengeQuestion": null, "__typename": "QuestionNode" } } }