The custom SQL query is written after connecting to data for pulling the data in a structured view. For example, suppose, one has 50 columns in a table, but they only need 10 columns. So, instead of taking 50 columns, one can write an SQL query. This will increase the performance.