API and queries mess

Hi, I used influxdb to store my data and i am using python with influxdb-client library to work out but to make a query like show databases it’s just simply don’t work. I am confused here is python only takes flux query or queries like sql can also be written in.
result = query_api.query(“SELECT * FROM measurement”)

Here, I am trying to get the last updated record from the measurement. as per time new columns (segments) are adding so can’t specify the column name(segment) to get the last updated record.