Syntax of SQL

As you all know, every programming language has its own syntax. Similarly, SQL has its own way to write a query. It has its built-in commands, keywords, statements and functions which makes SQL more powerful.

You can write a query using these things to perform on the database to get the desired result.

The SQL language is NOT a case sensitive language. That means, you can write your query in a small as well as capital letters.

The only thing you should remember is, your table name and column name which you mentioned in the query should be the same as what is there in a database.

I would always suggest you to follow the best practices while writing any programming code.

In SQL, the commands should be in capital and the expression and predicates should be in small letters. Now don’t be confused what is expression and predicate? You will get to know when you keep reading this. 😊

The SQL statement or query is a combination of 3 things i.e. clause, expression, and predicate. See the below screenshot it will help you to understand better.

The next important thing in SQL is the semicolon (;). You have to give the semicolon at the end of the query.

It is a standard way to separate each SQL query in the database system. You can execute multiple queries at the same call, just specifying the semicolon at the end of each.

In SQL, there are many commands used to perform various operations on database. Have a look in detail SQL Commands & Keywords.

Previous Post Next Post

Contact Form