Finding the Daily Users Registered
Consider the below table for example:
Query to create the table:
-- create a table
CREATE TABLE students (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
gender TEXT NOT NULL,
date TEXT not null
);
-- insert some values
INSERT INTO students VALUES (1, 'Ryan', 'M', '28/10/2022');
INSERT INTO students VALUES (2, 'Joanna', 'F', '29/10/2022');
INSERT INTO students VALUES (3, 'Mick', 'M', '30/10/2022');
INSERT INTO students VALUES (4, 'Jonas', 'M', '30/10/2022');
-- fetch some values
SELECT * FROM students;
Output:
As you can see in the above table we are having four columns Id, Name, Gender and Date Registered.
Below is the simple query to find the Daily Users Registered:
SELECT date AS num, COUNT(*) AS date FROM students GROUP BY date;
Output:
0 Comments