SQL Database automation Using Robot Frame work

You should use Query only when using SELECT commands.
In this case you can use Execute SQL String.

Here is a screen capture of RIDE and the documentation of those keywords.