It would be difficult to write the best queries for reference and reuse. It will always vary based on the nature of your application, architecture, design, table structure, and so on. However, precautions can be taken while writing MySQL queries for better performance, scalability, and integrity.
Let's go through a few of the best practices that we should keep in mind while designing or writing MySQL queries.