SQL is the most widely used syntax today to express operations on databases. There are different database servers, which are mostly identical, but contain some individual differences and optimizations, which are not part of the SQL standard. I myself mainly use MySQL or MariaDB as the server component. The table type Aria, which can be used in MariaDB, has turned out to be the most efficient solution. In MySQL, the most commonly used table type is InnoDB, and in direct comparison, accesses to Aria tables reliably only need about one tenth of the time that would be required for InnoDB tables.
The only important thing is to optimize database tables by using appropriate indexes, which are tables of contents that allow the database server to execute many queries much faster. Without such indexes, the entire table would have to be searched for each query, which means that the more data there is, the longer each search takes. With indexes, those searches are scalable, so they don't necessarily take more time when there is more data.
Many optimizations are also possible with so-called JOINs - in this case, any number of tables are set in relation to each other and merged into a single table for the respective query. This way you can reduce the number of queries, which is otherwise one of the main points for poor performance. As a rule of thumb: the more details you can get from a single query, the better.
The only important thing is to optimize database tables by using appropriate indexes, which are tables of contents that allow the database server to execute many queries much faster. Without such indexes, the entire table would have to be searched for each query, which means that the more data there is, the longer each search takes. With indexes, those searches are scalable, so they don't necessarily take more time when there is more data.
Many optimizations are also possible with so-called JOINs - in this case, any number of tables are set in relation to each other and merged into a single table for the respective query. This way you can reduce the number of queries, which is otherwise one of the main points for poor performance. As a rule of thumb: the more details you can get from a single query, the better.