SELECT Archive

SQL SELECT Tutorial for Nested Queries ( Sub Queries )

A Subquery or Inner query or Nested query is a query within another SQL query and embedded within the WHERE clause. A subquery is used to return data that will be used in the main query as a condition to further restrict the data to be retrieved. Subqueries can be used with ...Read More

SQL tutorial for using Having with Examples

The HAVING statment¬† is added to SQL because the WHERE keyword could not be used with aggregate functions ( such as count, max …) The syntax for using HAVING is as below:   SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name HAVING aggregate_function(column_name) operator value; Example for Database ...Read More

Advanced SQL SELECT Tutorial using Aggegrate Functions by Examples

The important SQL command is SELECT statement. The SQL SELECT statement is used to query or retrieve data from a table in the database. A query may retrieve information from specified columns or from all of the columns in the table: Syntax of SQL SELECT Statement: SELECT column_list FROM table-name [WHERE Clause] ...Read More

Join : SELECT Tutorial using multiple database tables

The JOIN is used in an SQL statement to query data from two or more tables, based on a relationship between certain columns in these tables. Tables in a database are often related to each other with keys. 1) Let’s suppose we have two database tables for : contacts and countries CREATE ...Read More

SQL SELECT Tutorial : Searching & Querying the database

The most commonly used SQL command is SELECT statement. The SQL SELECT statement is used to query or retrieve data from a table in the database. A query may retrieve information from specified columns or from all of the columns in the table. To create a simple SQL SELECT Statement, you must ...Read More