Created
January 9, 2020 01:55
-
-
Save LIQRGV/ab934071f6567bd20bd179f5be7ca4aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--App usage data are kept in the following table: | |
--TABLE sessions | |
-- id INTEGER PRIMARY KEY, | |
-- userId INTEGER NOT NULL, | |
-- duration DECIMAL NOT NULL | |
--Write a query that selects userId and average session duration for each user who has more than one session. | |
--https://www.testdome.com/questions/sql/sessions/14245?visibility=1&skillId=17 | |
select userId, avg(duration) from sessions group by userId having count(1) > 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment