Time series a day

i have the following database:


This is filled with other data too, but this are the important ones.

SELECT DATE(Date) AS "time", ID AS "value" FROM database WHERE Date >= Date(Now()) - INTERVAL 30 DAY ORDER BY ID DESC

With this query I get this result:

I want to have a graph, where are the created db entries per day are shown. So not the ID.

For example:
ID Date
1 2023-01-01
2 2023-01-01
3 2023-01-03
4 2023-01-04

The result should show a graph, where at 2023-01-01 the value is 2 (because two data at this day), 2023-01-02 is 0, 2023-01-03 is 1, 2023-01-04 is 1 and so on.

I hope you can help me



This is more of a sql question than a grafana question


count(1) as value, date(date) as time

From x
Group by 1

Type of approach for your specific db query language