Why are the queries in SQL mostly written in Capital Letters?

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.

Leave a Comment