#SQL

Published: 15 September 2024
on channel: The Code Samples
155
10

#SQL Leetcode SQL 50 #22: 550:

Write a solution to report the fraction of players that logged in again on the day after the day they first logged in, rounded to 2 decimal places. In other words, you need to count the number of players that logged in for at least two consecutive days starting from their first login date, then divide that number by the total number of players.

We will be solving all the questions from LeetCode SQL 50 one by one. These questions range from easy to hard.

**SQL scripts you can use to create and populate the table:
-- Create the Activity table
CREATE TABLE Activity (
player_id INT,
device_id INT,
event_date DATE,
games_played INT
);

-- Insert data into the Activity table (add more rows to it)
INSERT INTO Activity (player_id, device_id, event_date, games_played) VALUES
(1, 2, '2016-03-01', 5),
(1, 2, '2016-03-02', 6);

#datascience #coding #programming #mssql #databasemanagement #leetcode #leetcode550 #leetcodesolution

👉SQL Tutorials Playlist:
   • SQL Tutorials  

👉SQL Shorts Playlist:
   • SQL Shorts  

👉Python Shorts Playlist:
   • Python Shorts  

👉Python Tutorials Playlist:
   • Python Tutorials  

👉Excel Shorts Playlist:
   • Excel Shorts  


Watch video #SQL online without registration, duration hours minute second in high quality. This video was added by user The Code Samples 15 September 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 155 once and liked it 10 people.