You should maintain your sql statement identical

January 3, 2019 | By

I am starting this new section called SQL tutorial. This section doesn’t contain only basic SQL statement written learning but it also contains some guidance and advice from my experience. SQL is called as sequel sometimes. Don’t bother!

Always use SQL writing pattern identical. It means you need to use your writing style pattern unique or same type repeatedly.

Take an example:

select * from emp;

SELECT * from emp;

select * from EMP;

select * FROM emp;


SELECT * from EMP;


Select * from Emp;



All are the same kind of statements. Looking wise all are same. The result of above all statement is also same but System Global Area of Oracle memory treats all statements are different. Thus, above all statements will be parsed separately and occupy memory separately.  The problem starts with those SQL statements which are written in a different manner. 

This is the only example. In real time if you check your long SQL statements and guess how it will be stored in Oracle SGA memory region? Those long and big SQL statements will consume so much memory in Oracle SQL engine. Resulting memory is wastage and unnecessary parsing. Hard parsing always consumes high CPU and SQL statement will consume memory. It means so many performance issues can be occurring due to this bad practice.

I have seen lots of developers and programmer who has own pattern of SQL statement writing. But when you are changing the company and joining the new company then you should need to observe this thing first for keeping your mind that which writing pattern is being followed by your company’s old employee. Or as project manager, IT manager you need to develop your own skill and fix pattern of Structured Query Language writing method. An example you can keep all table name in uppercase and rest of all in lower case. You can keep all in lower case.

Therefore, avoid this kind of silly mistake before you are starting to write a new SQL statement in your company.

Tags: ,

Category: sql tutorial

Comments are closed.