x

SQL Tutorial

NEXT

SQL tutorial – SQL is referred as Structured Query Language, a standard query language certified by ANSI and ISO. SQL is used to access different databases like SQL Server, MySQL, MS Access, Sybase, Oracle, DB2, Informix and Teradata etc.


In this SQL tutorial, you will learn how to use the SQL language to,

  • Store, retrieve and manipulate data in SQL server.
  • Select, insert, update and delete rows in SQL tables.
  • Create database and tables in SQL server and all other SQL concepts.

This SQL tutorial is designed for freshers who are beginners for SQL, students and also for the corporate level developers who want to learn and refresh their SQL skills.

Start with SQL tutorial now

This SQL tutorial covers all below topics:

SQL Basics

SQL language – Introduction:

Structured Query language (SQL) is divided into below major aspects. They are, 1. Data Definition Language – DDL 2. Data Manipulation Language –DML 3. Data control language – DCL….more…

SQL – Data types:

Data storage format of an object is defined by SQL data types. These objects can be a variable or columns or expressions and data can be numeric, character, string, binary, date and time….more…

SQL – Operators & Expressions:

The symbols which are used to perform logical and mathematical operations in SQL are called operators. Types of Operators used in SQL. 1. Arithmetic operators 2. Relational operators 3. Logical operators….more…

SQL – select:

The SELECT statement in SQL is used to select the data from database. Either we can select all columns from a table or can select only particular column using select statement in SQL. All selected data are stored in a result table which is also called as a result set. Syntax for SQL select statement is….more…

SQL – insert into:

INSERT INTO statement in SQL is used to insert new records in a table. Either we can insert a new record for all columns or can insert values only for particular columns using INSERT INTO statement in SQL. Syntax of SQL INSERT INTO statement is….more…

SQL – update:

The UPDATE statement in SQL is used to update/modify existing records/values in a table. Either we can update all existing records for all columns in a table or can update only particular columns and particular records in a table using the UPDATE statement in SQL. Syntax of SQL UPDATE statement is….more…

SQL – delete:

The DELETE statement in SQL is used to delete existing records in a table. Either we can delete all existing records in a table or can delete only particular records in a table using DELETE statement in SQL. Syntax for SQL DELETE statement is….more…

SQL  tutorial – Clauses & Operators

SQL – distinct/unique:

DISTINCT or UNIQUE keyword in SQL is used with SELECT statement/query to select only unique records from a table, i.e. it eliminates all duplicate records from a table….more…

SQL – where:

WHERE clause in SQL is used with SELECT, UPDATE and DELETE statements/queries to select, update and delete only particular records from a table those meet the condition given in WHERE clause. I.e. It filters records from a table as per the where condition….more…

SQL – LIKE & wildcard operators:

LIKE operator in SQL is used with a WHERE clause to search specific patterns in a column. To make searching effective, there are 2 wild card operators available in SQL which are used along with the LIKE operator. They are % (percentage) and _ (underscore). Wildcard operators are used as a substitute for one or more than one characters while searching….more…

SQL – Order by:

ORDER BY clause in SQL is used to sort the data selected from a table. ORDER BY clause sorts the data either in ascending order or descending order using one or more columns. By default, the result set of the query is sorted by ascending order….more…


SQL – AND, OR:

AND, OR operators in SQL are used with SELECT, UPDATE and DELETE statements/queries to select, update and delete only particular records in a table those meet the condition given in WHERE clause and conditions given in AND, OR operators. I.e. it filters records from a table as per the condition….more…

SQL – IN, NOT IN

IN, NOT IN operators in SQL are used with SELECT, UPDATE and DELETE statements/queries to select, update and delete only particular records in a table those meet the condition given in WHERE clause and conditions given in IN, NOT IN operators. I.e. it filters records from a table as per the condition….more…

SQL – IS NULL & IS NOT NULL

Generally, NULL data represents data does not exist or missing data or unknown data.  IS NULL & IS NOT NULL in SQL is used with a WHERE clause in SELECT, UPDATE and DELETE statements/queries to validate whether column has some value or data does not exist for that column. Please note that NULL and 0 are not same. A column with NULL value has no value, it’s empty….more…

SQL – BETWEEN…AND & NOT BETWEEN…AND:

BETWEEN…AND operators in SQL are used to select in-between values from the given range/ values. It is used in a WHERE clause in SELECT, UPDATE and DELETE statements/queries….more…

SQL – Select…into:

SELECT INTO statement in SQL is used to select the data from a table and insert the selected data in another table. I.e. it copies the data from one table to another table.  Either we can copy all data or partial data from one table to another….more…

SQL – Top:

SELECT…TOP clause in SQL is used to specify the number of rows or percentage of rows to be selected from a table by SELECT query. This TOP clause is very useful in larger tables where there is a chance for performance issue while selecting thousands of records. So, we can select only a few records from the larger tables as per our need….more…

SQL – Alias:

ALIAS in SQL is used to rename a column or table temporarily by giving some other name. This will not impact the actual name of a column or table….more…

SQL tutorial – JOINS

SQL – Inner Join:

INNER JOIN in SQL is used to combine two or more tables together using the matching columns from both tables. All matching column records are selected…

SQL – Left Join:

QL LEFT JOIN is used to combine the two tables together. LEFT JOIN selects all records from left table and also selects all matching records from the right table…

SQL – Right Join:

SQL RIGHT JOIN is used to combine the two tables together. RIGHT JOIN selects all records from Right table and also selects all matching records from the left table…

SQL – Full Join, Self Join, Cartesian or Cross join:

SQL FULL JOIN is used to combine the two tables together. FULL JOIN selects and returns all records from both left and right table and displays in the output…

SQL – UNION & UNION ALL:

SQL UNION clause is used to combine the two tables together. There will be 2 separate SELECT SQL’s those are combined using UNION clause…

SQL – INTERSECT & EXCEPT:

The SQL UNION ALL is also same as SQL UNION clause. But, UNION ALL returns all records from both tables including duplicates…

SQL tutorial – Functions:

SQL function is a group of instructions combined together to perform a task. There are so many inbuilt functions in SQL to perform many arithmetic tasks. They are,

  1. Aggregate functions
  2. Scalar functions
  3. Group by function
  4. Having function

SQL tutorial – Database & tables:

This SQL tutorial covers how to create database, tables and index and how to modify and delete them when required. Also, all below concepts are also explained in detail in this tutorial.

  1. SQL – Create DB, table & index
  2. SQL – Modify DB, table & index
  3. SQL – Drop DB, table & index
  4. SQL – Truncate
  5. SQL – Constraints
  6. SQL – Not null
  7. SQL – Unique
  8. SQL – Primary & composite key
  9. SQL – Foreign key
  10. SQL – Auto Increment
  11. SQL – Default
  12. SQL – Check
  13. SQL – Views

REFERENCE E-BOOKS & RESEARCH PAPERS:

  • SQL language –  Don Chamberlin, IBM Almaden Research Center, San Jose, CA

NEXT



Like it? Please Spread the word!