{ "data": { "question": { "questionId": "3432", "questionFrontendId": "3124", "categoryTitle": "Database", "boundTopicId": 2750525, "title": "Find Longest Calls", "titleSlug": "find-longest-calls", "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\": \"50\", \"totalSubmission\": \"83\", \"totalAcceptedRaw\": 50, \"totalSubmissionRaw\": 83, \"acRate\": \"60.2%\"}", "hints": [], "solution": null, "status": null, "sampleTestCase": "{\"headers\":{\"Contacts\":[\"id\",\"first_name\",\"last_name\"],\"Calls\":[\"contact_id\",\"type\",\"duration\"]},\"rows\":{\"Contacts\":[[1,\"John\",\"Doe\"],[2,\"Jane\",\"Smith\"],[3,\"Alice\",\"Johnson\"],[4,\"Michael\",\"Brown\"],[5,\"Emily\",\"Davis\"]],\"Calls\":[[1,\"incoming\",120],[1,\"outgoing\",180],[2,\"incoming\",300],[2,\"outgoing\",240],[3,\"incoming\",150],[3,\"outgoing\",360],[4,\"incoming\",420],[4,\"outgoing\",200],[5,\"incoming\",180],[5,\"outgoing\",280]]}}", "metaData": "{\"mysql\":[\"Create table if Not Exists Contacts(id int, first_name varchar(20), last_name varchar(20))\",\"Create table if Not Exists Calls(contact_id int, type ENUM('incoming', 'outgoing'), duration int)\"],\"mssql\":[\"Create table Contacts(id int, first_name varchar(20), last_name varchar(20))\",\"Create table Calls(contact_id int, type varchar(20) NOT NULL CHECK (type in ('incoming' , 'outgoing')), duration int)\"],\"oraclesql\":[\"Create table Contacts(id int, first_name varchar(20), last_name varchar(20))\",\"Create table Calls(contact_id int, type varchar(20) NOT NULL CHECK (type in ('incoming' , 'outgoing')), duration int)\"],\"database\":true,\"name\":\"find_longest_calls\",\"pythondata\":[\"Contacts = pd.DataFrame([], columns=['id', 'first_name', 'last_name']).astype({'id':'Int64', 'first_name':'object', 'last_name':'object'})\\n\",\"Calls = pd.DataFrame([], columns=['contact_id', 'type', 'duration']).astype({'contact_id': 'Int64', 'type': 'category', 'duration': 'Int64'})\\n\"],\"postgresql\":[\"CREATE TABLE Contacts (\\n id SERIAL PRIMARY KEY,\\n first_name VARCHAR(20),\\n last_name VARCHAR(20)\\n);\\n\",\"CREATE TABLE Calls (\\n contact_id INT,\\n type VARCHAR(20) NOT NULL CHECK (type IN ('incoming', 'outgoing')),\\n duration INT\\n);\\n\"],\"manual\":true,\"database_schema\":{\"Contacts\":{\"id\":\"INT\",\"first_name\":\"VARCHAR(20)\",\"last_name\":\"VARCHAR(20)\"},\"Calls\":{\"contact_id\":\"INT\",\"type\":\"ENUM('incoming', 'outgoing')\",\"duration\":\"INT\"}}}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [ "Create table if Not Exists Contacts(id int, first_name varchar(20), last_name varchar(20))", "Create table if Not Exists Calls(contact_id int, type ENUM('incoming', 'outgoing'), duration int)", "Truncate table Contacts", "insert into Contacts (id, first_name, last_name) values ('1', 'John', 'Doe')", "insert into Contacts (id, first_name, last_name) values ('2', 'Jane', 'Smith')", "insert into Contacts (id, first_name, last_name) values ('3', 'Alice', 'Johnson')", "insert into Contacts (id, first_name, last_name) values ('4', 'Michael', 'Brown')", "insert into Contacts (id, first_name, last_name) values ('5', 'Emily', 'Davis')", "Truncate table Calls", "insert into Calls (contact_id, type, duration) values ('1', 'incoming', '120')", "insert into Calls (contact_id, type, duration) values ('1', 'outgoing', '180')", "insert into Calls (contact_id, type, duration) values ('2', 'incoming', '300')", "insert into Calls (contact_id, type, duration) values ('2', 'outgoing', '240')", "insert into Calls (contact_id, type, duration) values ('3', 'incoming', '150')", "insert into Calls (contact_id, type, duration) values ('3', 'outgoing', '360')", "insert into Calls (contact_id, type, duration) values ('4', 'incoming', '420')", "insert into Calls (contact_id, type, duration) values ('4', 'outgoing', '200')", "insert into Calls (contact_id, type, duration) values ('5', 'incoming', '180')", "insert into Calls (contact_id, type, duration) values ('5', 'outgoing', '280')" ], "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\":{\"Contacts\":[\"id\",\"first_name\",\"last_name\"],\"Calls\":[\"contact_id\",\"type\",\"duration\"]},\"rows\":{\"Contacts\":[[1,\"John\",\"Doe\"],[2,\"Jane\",\"Smith\"],[3,\"Alice\",\"Johnson\"],[4,\"Michael\",\"Brown\"],[5,\"Emily\",\"Davis\"]],\"Calls\":[[1,\"incoming\",120],[1,\"outgoing\",180],[2,\"incoming\",300],[2,\"outgoing\",240],[3,\"incoming\",150],[3,\"outgoing\",360],[4,\"incoming\",420],[4,\"outgoing\",200],[5,\"incoming\",180],[5,\"outgoing\",280]]}}",
"__typename": "QuestionNode"
}
}
}MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"