Time Spent over Weekend | SQL Interview question

 DML Script:

DROP TABLE IF EXISTS Timings


CREATE TABLE Timings

(

    [timestamp] DATETIME2,

    [Employee] INT

);


INSERT INTO Timings ([timestamp], [Employee])

VALUES ('2024-01-13 09:25:00', 10),

       ('2024-01-13 19:35:00', 10),

       ('2024-01-16 09:10:00', 10),

       ('2024-01-16 18:10:00', 10),

       ('2024-02-11 09:07:00', 10),

       ('2024-02-11 19:20:00', 10),

       ('2024-02-17 08:40:00', 17),

       ('2024-02-17 18:04:00', 17),

       ('2024-03-23 09:20:00', 10),

       ('2024-03-23 18:30:00', 10),

   ('2024-03-31 18:20:00', 15),

       ('2024-04-01 06:30:00', 15),

   ('2024-04-26 21:25:00', 19),

       ('2024-04-27 06:30:00', 19) 


   select * from Timings


Detailed Explanation: https://youtu.be/QzWsibF651s

Comments

Popular posts from this blog

50 Essential SQL Questions to Land Your Dream Job

How to find all the customers who placed orders on three consecutive days | SQL Scenario questions

ACCENTURE SQL INTERVIEW QUESTION | Change the ProductIDs