top of page

Welcome
to NumpyNinja Blogs

NumpyNinja: Blogs. Demystifying Tech,

One Blog at a Time.
Millions of views. 

Visualize SQL Query Results in pgAdmin with Built-in Charts

May 24, 2025
4 min read

If you’ve been working with PostgreSQL and pgAdmin, you’re probably familiar with running SQL queries. But did you know pgAdmin lets you visualize query results as charts directly within the tool? This feature was introduced in Pgadmin4 V6.12.




Why Use Charts in pgAdmin?

pgAdmin’s charting feature helps you:

  • Quickly visualize trends and relationships in your data

  • Debug queries by spotting outliers or unexpected patterns

  • Perform lightweight data exploration without exporting to BI tools.

Let's see how to create a chart in pgAdmin in a few easy steps. In this post, we’ll walk through how to create charts in pgAdmin using SQL, including supported chart types, formatting options, and use cases. The Graph Visualizer supports 5 types of Charts.


1. Line Chart

2. Stacked Line Chart

3. Bar Chart

4. Stacked Bar Chart

5. Pie-Chart.

Here, we created the Student table and inserted values to generate a line chart.


Create Student Table
Create Student Table



  1. LINE CHART


    What is a Line Chart?


    A Line Chart is a type of data visualization that uses lines to connect individual data points. It is especially useful for showing trends over time or changes across categories.

    When to Use a Line Chart:

    • To show progress or trends over time.

    • To compare multiple data series (e.g., scores of different students).

    • To highlight increases, decreases, or patterns in data

      Now, will create the Line chart in pGAdmin .

      Create a line chart to display all 3 subject marks of all students.

      First run the query to get the output select student_name, English, Math, Science from student;


      Then click "Graph Visualiser ".
      Then click "Graph Visualiser ".

      Then choose Graph Type as Line Chart, X-Axis as student_name and Y-Axis as Select All and click Generate. Line Chart will generate automatically based on the output. See the below screenshot for your reference.

    • Click collapse to expand the chart
      Click collapse to expand the chart
      We can see mouse over the line and see the tool tip
      We can see mouse over the line and see the tool tip

    2.Stacked Line Chart


    What is a Stacked Line Chart?

    A Stacked Line Chart is a variation of the standard line chart where multiple data series are stacked on top of each other instead of overlapping. Each line starts from the point where the previous one ends, showing both the individual contribution and the cumulative total.


    Create a stacked line chart to display marks of students.


    select student_name, English, Math, Science from student;


    Once you get the output then choose Graph Visualiser and choose Graph Type as Stacked Line Chart, X-Axis as student_name and Y-Axis as Select All and click Generate. Stacked Line Chart will generate automatically based on the output. See the below screenshot for your reference. It’s almost looks like an Area Chart.

STACKED BAR CHART
STACKED BAR CHART

3. Bar Chart:

What is a Bar Chart?

A Bar Chart is a visual representation of data using rectangular bars to show the quantity or frequency of different categories. The length or height of each bar reflects the value it represents.


Create a Bar Chart to display marks of all students.


Once you get the output then choose Graph Visualiser and choose Graph Type as Bar Chart, X-Axis as student_name and Y-Axis as Select All and click Generate. Bar Chart will generate automatically based on the output. See the below screenshot for your reference.


Bar Chart
Bar Chart

4. Stacked Bar Chart:


What is a Stacked Bar Chart?

A Stacked Bar Chart is a type of bar chart that breaks each bar into multiple segments to show sub-categories within a main category. It helps visualize both the total value and the individual components that make up that total.


Create a Stacked Bar Chart to display marks of all students.

Once you get the output then choose Graph Visualiser and choose Graph Type as Stacked Bar Chart, X-Axis as student_name and Y-Axis as Select All and click Generate. Stacked Bar Chart will generate automatically based on the output. See the below screenshot for your reference.


STACKED BAR CHART
STACKED BAR CHART

5. Pie-Chart:

What is a Pie Chart?

A Pie Chart is a circular graph that displays data as slices of a pie, where each slice represents a proportion of the whole. It's a popular and simple way to show percentages or relative sizes of categories.


Create a pie Chart to display marks of all students.


Once you get the output then choose Graph Visualiser and choose Graph Type as Pie-Chart, Label as student_name and Value as any subject - Math has been chosen and click Generate. Pie-Chart will generate automatically based on the output. See the below screenshot for your reference.


Pie Chart
Pie Chart

CONCULSION :

pgAdmin's charting feature is a powerful yet often overlooked tool for quickly visualizing SQL query results without needing to switch to a full BI platform. Whether you're analyzing trends with a line chart, comparing performance with a bar chart, or identifying correlations with a scatter plot, these built-in visualizations can save time and offer immediate insights — right where you write your queries.

While it has limitations in interactivity and customization, pgAdmin’s chart tool is perfect for:

  • Quick data validation

  • Spotting outliers or patterns

  • Explaining results during development or debugging.


Thank you for reading. Happy learning!!!




 
 

+1 (302) 200-8320

NumPy_Ninja_Logo (1).png

Numpy Ninja Inc. 8 The Grn Ste A Dover, DE 19901

© Copyright 2025 by Numpy Ninja Inc.

  • Twitter
  • LinkedIn
bottom of page