How to show result of sql query in a page?

Solved! I follow this tutorial:

https://wordpress.org/gutenberg/handbook/designers-developers/developers/tutorials/block-tutorial/writing-your-first-block-type/

https://wordpress.org/gutenberg/handbook/designers-developers/developers/tutorials/block-tutorial/creating-dynamic-blocks/

And complimented with this:
https://gist.github.com/mattheu/7cf235b4f932de891bc21cb5f3ff3de6

tech