Home » SQL

What are the clause, Keywords and statement in SQL?

Here, we will learn: what are the clauses, keywords and statements in SQL, in a query there are many words used and we have to know which is clause, keyword or statement? So let’s understand in this article.

Throughout the learning of SQL (structured query language), the following terminology (words) will be used:

  1. Keyword
  2. Clause
  3. Statement

Consider this Query - based on this Query we will understand these words:

SELECT std_id, std_name, std_age,...
FROM student;

1) Keyword

The individual tokens (elements) which are predefined, and we cannot change its meaning are known as SQL keyboard.

In the given example: The keyword are "SELECT" and "FROM"

2) Clause

Clause is a part of an SQL statement.

In the given example: The clause is "SELECT std_id, std_name, std_age,..."

3) Statement

A complete query may refer as "statement" and we can say that set of two or more clause are known as a "statement" in SQL.

Some of the rules to write an SQL statement

  1. SQL statement is not case sensitive you may write the statement in any case (even keywords like SELECT, FROM, DROP etc.) are not case sensitive.
  2. You can write a complete SQL statement in a single line (but, you should separate them in multiple lines, each clause should be written in separate line).
  3. You may use to enhance the SQL Query readability.

Note: keywords should be written in UPPERCASE (for better readability) and other words should be written in lowercase.



Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.