ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

Category: SQL Tutorial

SQL ORDER BY Keyword

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;   […]

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   < […]

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 […]

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 […]

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 […]

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 […]

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 […]

SQL NULL Values

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 […]

Page 1 of 3123
ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

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