Simple Queries in SQL

Queries are one of a thing that make database powerful. The “Query” refers to action of retrieving data from the database. There are following some common clauses used in SQL.

SELECT :- SELECT clause used to retrieves data from the table. SELECT command also provides the query capability this means that executing SELECT statement, information currently in the table show on the screen. Syntax:

SELECT*FROM DEPARTMENT;

FROM :- FROM clause present in every query. It is following by a space and there the name of the table being used as the source of the information. Syntax:

SELECT <column name> FROM <table name>;

WHERE :- WHERE clause used with the SELECT and FROM command. Suppose we select all rows of STUDENT table, but we see only certain number of rows the contain specifies values. For this, we would need to place WHERE clause along with the SELECT statement. Syntax: