Category: Operators and Clauses

  • Order by Clause

    The SQL ORDER BY Clause The SQL ORDER BY clause is used to sort the data in either ascending or descending order, based on one or more columns. This clause can sort data by a single column or by multiple columns. Sorting by multiple columns can be helpful when you need to sort data hierarchically, such as…

  • Distinct Keyword

    The SQL DISTINCT Keyword The SQL DISTINCT keyword is used in conjunction with the SELECT statement to fetch unique records from a table. We use DISTINCT keyword with the SELECT statetment when there is a need to avoid duplicate values present in any specific columns/tables. When we use DISTINCT keyword, SELECT statement returns only the unique records…

  • Top Clause

    The SQL TOP Clause While we are retrieving data from an SQL table, the SQL TOP clause is used to restrict the number of rows returned by a SELECT query in SQL server. In addition, we can also use it with UPDATE and DELETE statements to limit (restrict) the resultant records. For instance, if you have a…

  • Where Clause

    The SQL Where Clause The SQL WHERE clause is used to filter the results obtained by the DML statements such as SELECT, UPDATE and DELETE etc. We can retrieve the data from a single table or multiple tables(after join operation) using the WHERE clause. For instance, you can use the WHERE clause to retrieve details of employees…