Sql Query
I am a developer that have more experience on flutter but at that time company need assign me to backend team so I just start learning .net core, sql server
I come out with best practice so other junior can get on it more faster
Avoid using SELECT *
Instead of selecting all columns in a table, only select the columns that you need. This can reduce the amount of data that needs to be processed and improve query performance.
Security retrieve unnecessary column and can expose sensitive data in user query
Get Bonchayouk’s stories in your inbox
Join Medium for free to get updates from this writer.
Minimize subqueries:
Subqueries can significantly reduce query performance, so try to minimize their use. Consider using JOINs or temporary tables instead.
Avoid using functions in WHERE clauses:
Ensure that your WHERE clauses are optimized and use efficient operators (e.g., IN, BETWEEN, etc.) where possible.
Stored procedures can be pre-compiled and cached, which can improve query performance.
Using Index
Indexes can significantly improve query performance by allowing the database engine to quickly locate the rows that match the query criteria





