Stacked Bar Chart with SQL Query

Good afternoon

I want to design a bar chart that is of type: Stacked Bars, but the data you are going to visualize is from a database.

For this I am preparing an SQL Query but it does not show me the data.

How can I make the bar chart stacked?