Skip to content
Advertisement

Tag: data-analysis

The Sum of people that have same age in SQL?

I’m taking a SQL class and I need help with a question. I have the following table on a phpmyadmin server with a total of 100 patients I’m told to find the sum of people that have same age using SQL. I wrote this query: but it returns 100 as a result and when I did this query and found

Is it possible to get active sessions per hour in SQL?

start_time end_time HostID gameID 6/14/2021 20:13 6/14/2021 22:22 1 AB1 6/14/2021 20:20 6/14/2021 21:47 2 AB2 6/14/2021 20:22 6/14/2021 22:07 3 AB3 6/14/2021 20:59 6/14/2021 21:15 4 AB4 6/15/2021 21:24 6/15/2021 22:09 1 AB5 6/15/2021 21:24 6/15/2021 21:59 2 AB6 6/15/2021 23:11 6/16/2021 01:22 4 AB7 6/16/2021 20:13 6/16/2021 21:23 3 AB8 I have a table that has a start

Calculate Time spent by users on the platform

I’m trying to calculate the time spent by users on my platform on a weekly basis. I have the following api_request_logs table (*Note: each row is duplicate) I tried this query, however, it doesn’t seems it is outputting correct calculation . Current output: Desired output : What I’m doing wrong or do you have a better idea to do it?

Advertisement