Hello, I'm new in node-red and javascript.
I have created a flow able to make a connection to a SQL database and select the first row of a specific table.
If you haven't already done so then I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot in about 1 hour. A small investment for a lot of gain.
Also then study in particular the node red docs Working with Messages
Take a look at the examples that are provided by the node.
1 - select the hamburger menu upper right of the editor
2 - select the 'Import' option
3 - select "Examples' and scroll to the 'node-red-node-ui-table'
and import the examples so you can see how to cofigure your table.