Free Source Code and Tutorials

Custom Search

Category: SQL Tutorial


It defines how the records are to be sorted. By default, it is to order in ascending order(ASC). If we want to sort in descending order, we can use DESC after the column name.   Syntax:   < View plain text > sql SELECT column_name, column_name FROM table_name ORDER BY column_name ASC/DESC, column_name ASC/DESC;   […]

Share this

SQL UNIQUE Constraint

This unique constraint identifies each record in a table. A PRIMARY KEY constraint itself defines UNIQUE constraint. The basic difference between UNIQUE and PRIMARY KEY constraint is that we can have many UNIQUE constraints on a table whereas we can have only one PRIMARY KEY.   Example of UNIQUE constraint on CREATE TABLE   < […]

Share this

SQL Clone Table

The SQL clone table may be used in a situation that you need an exact copy of a table and CREATE TABLE … SELECT doesn’t suit your purposes because the copy must include the same indexes, default values, and so forth. You can handle this situation by following steps: You can handle this situation by […]

Share this

SQL Having Clause

Having clause is used to mention condition in Group based SQL functions, just like WHERE clause .It acts as the same way as does where clause is used: Syntax for having will be, < View plain text > sql select column_name, function(column_name) FROM table_name WHERE column_name condition GROUP BY column_name HAVING function(column_name) condition   Example […]

Share this

SQL GROUP BY Statement

The SQL Group by statement is used to group the results of a SELECT query based on one or more columns.   The syntax for using Group by in a statement.   < View plain text > sql SELECT column_name, function(column_name) FROM table_name WHERE condition GROUP BY column_name   Example of Group by in a […]

Share this

SQL Distinct Keyword

The distinct keyword is mainly  used with the Select statement  in order to get  unique values from the desired table. Distinct removes all the redundant records while retrieving from the database.   Syntax for DISTINCT Keyword < View plain text > sql SELECT distinct column-name from table-name;   Example Consider the following consumer table. < View plain text > sql […]

Share this

SQL Temporary Tables

The temporary tables could be exceptionally valuable at times to keep transitory information. An essential thing that ought to be known for impermanent tables is that they will be erased when the present customer session ends.   Brief tables were included MySQL from 3.23. On the off chance that you utilize a more seasoned adaptation […]

Share this

SQL Primary Key Constraint

This constraint is used to uniquely define an identify any entry in the table. There are certain conditions like a primary key value can’t be NULL and it must be UNIQUE. There can be only one primary key in a table.   Example of PRIMARY KEY Constraint on CREATE TABLE   < View plain text […]

Share this

SQL Regular Expressions

Following is the table of pattern, which can be used along with REGEXP operator in a query for a selected table in the database. Pattern What the pattern is used /described for ^ Beginning of a given string $ End of a given string . Any single character you wish to take […] Any character   that has […]

Share this


When SELECT command is used along with WHERE clause  in order to fetch data from MySQL table of a given database, but the condition implied doesn’t have any result which means it’s empty . Like you want to search a person whose age is 21 but when you search through the database there is no person like that so […]

Share this
Page 1 of 3123 © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!