+ 2

Why to write all sql statements in upper case

26th May 2017, 5:56 AM
Ubaidullah Anwar 🇵🇰
Ubaidullah Anwar 🇵🇰 - avatar
4 Respostas
+ 13
It was meant for readability. Before, SQL was written in plain-text editors (no syntax/code highlighting) and keywords needed to be differentiated for better readability and maintenance. SELECT column_name FROM table_name WHERE column_name = column_value vs select column_name from table_name where column_name = column_value See the difference? The first word in each line told the reader exactly what was going on (selecting something from somewhere where something). But now with syntax-highlighting, there's really no point. But it IS a best practice and allows SQL developers to be on the same page/style while developing. -Stackoverflow
26th May 2017, 6:18 AM
Kailash Loncha
Kailash Loncha - avatar
+ 5
Each language is different. To print a line C++ cout<<endl; Java System.out.println(); C# Console.WriteLine(); Ruby puts. I dunno any more. Also SQL is case insensitive.
26th May 2017, 8:42 AM
Dragon Slayer Xavier
Dragon Slayer Xavier - avatar
+ 1
Every language has their own style for the syntax. Thus, we can understand that this language is different then others. It doesn't make us confused.
26th May 2017, 6:50 AM
jamilxt
jamilxt - avatar
+ 1
I think as long as your coding is concise, readable, reproducable and can be understood by others case of text is a personal choice. i prefer to use upper case for my SELECT FROM etc and a new line to separate at each clause.
27th Jul 2017, 9:32 PM
Amy
Amy - avatar