What is SQL
The SQL stands for Structured Query Language, is a computer language designed to retrieve and manage data in the relational databases. The SQL is an ANSI standard which stands for American National Standards Institute.
SQL is pronounced as the sequel, as well.
There are many relational databases in the market. A few popular includes MySQL, MS SQL server, MS Access, Oracle and IBM’s DB2.
Where Relational Database Management System is a DBMS which is based on the relational model introduced by E.F.Codd.
SQL is the standard for performing operations including create, update, delete data in RDBMS, however, different providers use dialects such as:
- MS SQL Server uses Transact-SQL (T-SQL)
- Oracle uses PL/SQL
As a database student, you should learn SQL generally, as this SQL tutorial will take you through. With that, you can work on any RDBMS for standard operations. Certain SQL commands or statements are common to each database like the Select statement to query data from the DB tables. Similarly, Update data, to modify data in the tables, Delete data, Where clause etc. are kept compliant to the ANSI standards by different providers.
However, there are different things in different RDBMS like syntax, data types, doing programming at the database level etc. For that, please follow the related documentation of that specific database.
Purpose of this tutorial
This tutorial will explain standard SQL commands in its respective chapters. The SQL commands can be categorized into the following:
- Data Definition language (DDL) that includes Create, Alter Drop commands.
- Data Manipulation Language (DML) that includes Insert, Update and Delete.
- Data Control Language (DCL) that includes Grant, Revoke.
- Data Query Language (DQL) that includes the Select statement
The tutorial will address each of the above statements in general and wherever required references of the particular database is given. Generally, we will use the MySQL and MS SQL server to execute different commands for this tutorial examples. The MySQL is freely available while the standard version of MS SQL server can also be found free.
This is the SQL tutorial for beginners who are just started learning what database and SQL is. Also, it covers advanced level SQL topics for advanced learners.
Examples in this SQL tutorial
Almost each of the chapter in this tutorial contains examples that you can run in the database. A screenshot of each example is linked that shows the output of the SQL command. You can click on “See the graphic of this table with data” link with each tutorial to see the demonstration of the respective SQL commands.
Applying SQL skills
Learning SQL and being experienced in SQL is quite necessary these days in order to work and apply skills as a programmer.
High-level experience may lead you as a database administrator, however, equipping yourself at beginners or mediocre level will help you developing small to medium sized web applications or desktop software or even mobile applications. As such, the modern application at any level uses the database to store different kind of data.
Table of content
Chapters in this tutorial:
- SQL Tutorial
- SQL create database
- How to create table
- Primary key in SQL
- How to drop table
- Insert statement
- Insert with values
- Insert with select
- The Update statement
- SQL Delete
- SQL Truncate
- The Select statement
- SQL Alter statement
- SQL Where clause
- SQL Between clause
- SQL IN
- SQL Like operator
- The Order by
- The Group by
- SQL Having
- SQL Functions
- SQL Distinct clause
- SQL Joins