Database Administrators
Q&A for database professionals who wish to improve their database skills
Latest Questions
0
votes
1
answers
155
views
creating a Pie Chart in SSRS
how can I create the pie chart that displays the Count of columns with filters like ( Active Paths / Courses / Sections /----- this is my column name )from 4 different tables and combined them in one query?
how can I create the pie chart that displays the Count of columns with filters like ( Active Paths / Courses / Sections /----- this is my column name )from 4 different tables and combined them in one query?
mitu habtay
(1 rep)
Dec 17, 2020, 05:34 AM
• Last activity: Jul 18, 2025, 02:03 AM
4
votes
3
answers
24879
views
Grouping data into 5 minute intervals within a time range
I am trying to prepare data for a candle stick chart. I have some records on MySQL database as shown below: | Rate | Date | |----------|---------------------| | 0.001111 | 2017-11-12 19:13:05 | | 0.001214 | 2017-11-12 19:14:11 | | 0.001612 | 2017-11-12 19:15:42 | | 0.001231 | 2017-11-12 19:16:23 | |...
I am trying to prepare data for a candle stick chart. I have some records on MySQL database as shown below:
| Rate | Date |
|----------|---------------------|
| 0.001111 | 2017-11-12 19:13:05 |
| 0.001214 | 2017-11-12 19:14:11 |
| 0.001612 | 2017-11-12 19:15:42 |
| 0.001231 | 2017-11-12 19:16:23 |
| 0.001514 | 2017-11-12 19:17:23 |
| 0.001611 | 2017-11-12 19:26:33 |
| 0.001421 | 2017-11-12 19:27:25 |
| 0.001214 | 2017-11-12 19:28:27 |
| 0.001611 | 2017-11-12 19:29:55 |
|----------|---------------------|
I want to group below data as shown below:
| Rate | Date |
|----------|---------------------|
| 0.002325 | 2017-11-12 19:10:00 |
| 0.004357 | 2017-11-12 19:15:00 |
| 0.004357 | 2017-11-12 19:20:00 | # Auto generated record of missing record.
| 0.005857 | 2017-11-12 19:25:00 |
|----------|---------------------|
I was trying to understand calendar table, but I wasn't able to do with that.
I also followed this link https://stackoverflow.com/questions/4342370/grouping-into-interval-of-5-minutes-within-a-time-range but still failed.
UPDATE:
This is my sample query that I am using currently to get data with date sorting and grouping.
SELECT
SUM(exchange_rat) AS totalAmount,
DATE_FORMAT(from_unixtime(unix_timestamp(created_at) - unix_timestamp(created_at) mod 300), '%Y-%m-%d %H:%i:00') as createdAt
from payments group by createdAt
Uttam Rabadiya
(41 rep)
Jan 14, 2018, 11:05 AM
• Last activity: Jun 29, 2021, 04:06 AM
0
votes
1
answers
264
views
What is the advantage of setting a character column as VARCHAR(32) over VARCHAR(255)
What is the advantage of setting a database column `VARCHAR(32)` over `VARCHAR(255)` even though the two of them consume 2-byte memory?
What is the advantage of setting a database column
VARCHAR(32)
over VARCHAR(255)
even though the two of them consume 2-byte memory?
Navaneet Raman Bhaskar
(11 rep)
Aug 10, 2019, 02:49 PM
• Last activity: Dec 9, 2020, 07:11 AM
1
votes
2
answers
6071
views
Open Source tools to visualise MySQL/MariaDB performance metrics (show global status with interval)
I'm searching for an Open Source tool to visualise MySQL/MariaDB performance metrics (output of show global status in nice graphs). In MongoDB world there is the Closed Source Ops Manager and the Open Source [`mtools`][1]. I'm searching for something similar. In official Oracle training for MySQL 5....
I'm searching for an Open Source tool to visualise MySQL/MariaDB performance metrics (output of show global status in nice graphs).
In MongoDB world there is the Closed Source Ops Manager and the Open Source
While searching the internet I also found some RRDtool based graphs.
So my question is how to generate ad hoc nice visualisations from MariaDB performance metrics? Is there some Open Source project which helps in this task? How do other DBAs do this?
mtools
. I'm searching for something similar.
In official Oracle training for MySQL 5.6 there are diagrams like


Sybil
(2578 rep)
Jul 17, 2016, 02:41 PM
• Last activity: Aug 21, 2019, 10:35 AM
0
votes
1
answers
1788
views
How does one create a data base for a survey/questionnaire?
I need to create a database for a wordy questionnaire. At the end I want to be able to graph my information. Where can I do this?
I need to create a database for a wordy questionnaire. At the end I want to be able to graph my information. Where can I do this?
user75873
(1 rep)
Sep 13, 2015, 09:14 AM
• Last activity: Aug 21, 2019, 02:08 AM
2
votes
1
answers
375
views
Plotting graphs for MYSQL
I was executing following command mysqladmin ext -i1 -c3600 It produces valuable output but I want to use the output to plot graphs so that I can visualize inserts, updates, buffer and other stuff. Anyone has any idea on how to use the output to plot graphs ?
I was executing following command
mysqladmin ext -i1 -c3600
It produces valuable output but I want to use the output to plot graphs so that I can visualize inserts, updates, buffer and other stuff.
Anyone has any idea on how to use the output to plot graphs ?
roger moore
(367 rep)
Jul 30, 2015, 07:36 PM
• Last activity: Mar 27, 2017, 11:34 PM
1
votes
1
answers
413
views
SSRS - Graph Line Value for Parameter
For the purpose of reporting database growth, I am created everything except one and most important thing. In SSDT I'm created report, which contains graph line which need to be show in depend of parameters. I have drop-down list of databases, graph where are in sections: VALUES (Fields!dataSize.Val...
For the purpose of reporting database growth, I am created everything except one and most important thing. In SSDT I'm created report, which contains graph line which need to be show in depend of parameters. I have drop-down list of databases, graph where are in sections: VALUES (Fields!dataSize.Value), Category Groups(date), Series Groups (databaseName).
I have parameter databases_id (dataset1, value field: id, label field: databaseName).
When I start report and select some database and click on VIEW REPORT, I get lines for every parameters(databases) on list. How to get only lines for selected parameters(databases)?
Darko Milic
(464 rep)
Sep 16, 2015, 08:49 AM
• Last activity: Mar 27, 2017, 11:33 PM
1
votes
1
answers
2528
views
How to fill gaps with calendar table, count and group by
I'm building a bar chart. I would like a query which counts the entries from a particular day and groups them together as one row with a count. I have the following query working and I have a working date dimension table which I would like to try to join with to fill in the gaps. It would also be ni...
I'm building a bar chart. I would like a query which counts the entries from a particular day and groups them together as one row with a count. I have the following query working and I have a working date dimension table which I would like to try to join with to fill in the gaps. It would also be nice to have min and max variables to easily alter the span (1 week, 1 month, 1 year, or from start of this year etc).
I got a variant working with a CTE query but it was painfully slow (1min+). I can't seem to figure this out, help!
The Date Dimension table was created following this guide: https://www.mssqltips.com/sqlservertip/4054/creating-a-date-dimension-or-calendar-table-in-sql-server/
CREATE TABLE dbo.DateDimension
(
DateKey INT NOT NULL PRIMARY KEY,
[Date] DATE NOT NULL,
[Day] TINYINT NOT NULL,
DaySuffix CHAR(2) NOT NULL,
[Weekday] TINYINT NOT NULL,
WeekDayName VARCHAR(10) NOT NULL,
IsWeekend BIT NOT NULL,
IsHoliday BIT NOT NULL,
HolidayText VARCHAR(64) SPARSE,
DOWInMonth TINYINT NOT NULL,
[DayOfYear] SMALLINT NOT NULL,
WeekOfMonth TINYINT NOT NULL,
WeekOfYear TINYINT NOT NULL,
ISOWeekOfYear TINYINT NOT NULL,
[Month] TINYINT NOT NULL,
[MonthName] VARCHAR(10) NOT NULL,
[Quarter] TINYINT NOT NULL,
QuarterName VARCHAR(6) NOT NULL,
[Year] INT NOT NULL,
MMYYYY CHAR(6) NOT NULL,
MonthYear CHAR(7) NOT NULL,
FirstDayOfMonth DATE NOT NULL,
LastDayOfMonth DATE NOT NULL,
FirstDayOfQuarter DATE NOT NULL,
LastDayOfQuarter DATE NOT NULL,
FirstDayOfYear DATE NOT NULL,
LastDayOfYear DATE NOT NULL,
FirstDayOfNextMonth DATE NOT NULL,
FirstDayOfNextYear DATE NOT NULL
);
Current query:
select count(*) as total, dateadd(DAY,0, datediff(day,0, CreatedAt)) as created
from Table1
group by dateadd(DAY,0, datediff(day,0, CreatedAt))
order by dateadd(DAY,0, datediff(day,0, CreatedAt)) desc
total created
1 01/11/2017 00:00:00
16 01/03/2017 00:00:00
1 12/27/2016 00:00:00
1 12/20/2016 00:00:00
1 11/30/2016 00:00:00
1 11/29/2016 00:00:00
11 11/28/2016 00:00:00
13 11/25/2016 00:00:00
4 11/24/2016 00:00:00
2 11/22/2016 00:00:00
I want something like this
total created
1 01/11/2017 00:00:00
0 01/10/2017 00:00:00
0 01/09/2017 00:00:00
0 01/08/2017 00:00:00
0 01/07/2017 00:00:00
0 01/06/2017 00:00:00
0 01/05/2017 00:00:00
0 01/04/2017 00:00:00
16 01/03/2017 00:00:00
etc
Sauceman
(13 rep)
Jan 16, 2017, 11:16 AM
• Last activity: Mar 27, 2017, 11:27 PM
Showing page 1 of 8 total questions