SQL Interview Questions and answers Part 49 | Amazon SQL Interview Question And Answer Part-9
This question has been asked in Amazon interview and is based on Number of Calls between two Persons.
Problem Statement : Calls Table has three columns namely From_Id, To_Id and Duration . It contains duration of calls between From_Id and To_Id. Write a SQL query to report the number of calls and the total call duration between each pair of distinct persons (Person1,Person2) where Person1 is less than Person2. Return the result as shown in Output Table.
-------------------------------------------------------------------------
𝗝𝗼𝗶𝗻 𝗺𝗲 𝗼𝗻 𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:🔥
-------------------------------------------------------------------------
*Instagram :
/ itjunction4all
*Twitter:
/ sunilkr5672
-------------------------------------------------------------------------
Table and Insert SQL Script :
-------------------------------------------------------------------------
Create Table Calls
(
From_Id int,
To_Id int,
Duration int
)
INSERT INTO Calls Values(1,2,59);
INSERT INTO Calls Values(2,1,11);
INSERT INTO Calls Values(1,3,20);
INSERT INTO Calls Values(3,4,100);
INSERT INTO Calls Values(3,4,200);
INSERT INTO Calls Values(3,4,200);
INSERT INTO Calls Values(4,3,499);
#AmazonDataEngineer #AmazonInterview #AmazonSQLInterview #FAANG #SQLInterviewQuestionsandanswers #sqlInterviewQuestions #sqlInterviewQuestionsForTesting
Смотрите видео SQL Interview Questions Part 49 | Amazon SQL Question Part-9 | Number of Calls between two Persons онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь ItJunction4all 04 Июнь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 2,64 раз и оно понравилось 6 людям.