in this table I have to Write a query to fetch the most active user on each day from May 6th, 21 to May 10th, 21. Print user name as null if there are no user sessions on a given date. I have tried everything I could but not able to find any solution , My output basically showed result for one date not for every day , and I searched web I found solutions for Daily active users but I failed to convert this for most daily active user
code for creation of table:
DROP TABLE IF EXISTS Sessions;
CREATE TABLE Sessions(
NAME CHAR (20),
CITY CHAR(20),
DATE datetime,
ACTION CHAR(30)
);
INSERT INTO Sessions
VALUES
('Mahi','Delhi','06/05/21 0:00','Session_Started'),
('Mahi','Delhi','07/05/21 7:00','Session_Started'),
('Mahi','Delhi','07/05/21 8:00','Session_Started'),
('Mahi','Delhi','08/05/21 9:00','Session_Started'),
('Rajesh','Bangalore','06/05/21 9:00','Session_Started'),
('Rajesh','Bangalore','07/05/21 8:00','Session_Started'),
('Rajesh','Bangalore','07/05/21 8:30','Session_Started'),
('Rajesh','Bangalore','08/05/21 60','Session_Started'),
('Sam','Pune','06/05/21 5:00','Session_Started'),
('Sam','Pune','08/05/21 6:00','Session_Started'),
('Sam','Pune','07/05/21 0:00','Session_Started'),
('Sam','Pune','08/05/21 0:00','Session_Started'),
('Sam','Pune','09/05/21 0:00','Session_Started'),
('Vishal','Mumbai','06/05/21 0:00','Session_Started'),
('Vishal','Mumbai','07/05/21 0:00','Session_Started'),
('Vishal','Mumbai','08/05/21 0:00','Session_Started');