Category Archives: SQL

SQL Having Clause

Like the WHERE clause HAVING clause is used to put a condition on a statement, in SQL we can not use the WHERE statement with aggregated statements such as GROUP BY, so there we use the HAVING clause to set a condition. SQL Having Clause In sort HAVING is a replace of WHERE clause for the GROUP BY… Read More »

SQL Views

A VIEW is an SQL statement which is used to create virtual tables, although it is just a SQL statement like SELECT, UPDATE, etc. but it holds the data like an actual table. VIEWS provide an alternative way to write a complex query, for instance, if there is a complex query you need to use often when you… Read More »

SQL Indexes

SQL query works fast on a small data sets or table with less number of rows, but in the real world database table contains millions of rows and hundreds of tables and we if try to apply a search query on a table which contains millions of rows then the SQL engine would take a lot of time… Read More »

SQL Alias Syntax

The SQL alias is used to change the table or column name temporary, during a query. To use the Alias in SQL we use the AS clause followed by the temporary name. The main use of Aliases clauses to make a column and table name more readable. SQL Alias Syntax The life of the Alias temporary name change… Read More »

SQL NULL Values

The NULL value represents no value or black value. For instance, suppose there is a table which stores students first name and last name, if any student does not have any last name then the last name column for that student will remain blank and that blank cell in the SQL table will be represented by a NULL… Read More »

SQL UNIONS CLAUSE

The SQL UNION clause is used to combine the result table of two or more than two select statements by eliminating the duplicate data records or rows. SQL UNIONS CLAUSE We can only use the UNION operator between two SELECT statements if they follow the following criteria: Both the SELECT statements have the same number of Columns. The… Read More »

SQL JOINS

JOIN is one of the most powerful and used commands in SQL, JOINS are used to combine rows from two or more tables from the same database and while we join the tables there should be a relation between both the tables. We use JOIN when we want to fetch data from two tables and wants to see… Read More »

SQL Constraints

Constrains are the special rules which restrict the limits of the column data values, constrains often used when we want a column data values to follow a specific set of rule. It’s always a good practice to mention the column constrain if necessary because it increases the data reliability and accuracy. SQL Constraints As we know that constraints… Read More »