Mendix comes standard with a postgres database in the Mendix cloud. But you can not connect from outside to that database directly. You can expose your data easily with web, REST or OData services to other systems.
Within Mendix you have OQL to do stuff. See documentation here: https://docs.mendix.com/refguide/oql/
Mendix does the database maintenance part for you so only in very exceptional cases you might want to use SQL on your Mendix database yourself.
Hope this helps and happy building,