Header add

In this article we will learn difference between of SQL vs Tsql vs Plsql.

SQL stands for Structured Query Language. So, SQL is a language, specifically, it's a language for Relational Databases.



In simple terms a relational database is a collection of tables to store data. The tables are usually related to each other by primary and foreign key constraints, hence the term Relational Database Management System, in short RDBMS.

For example, let's say we want to store our organisation Employees data. We create a database (EmployeesDB - I named it EmployeesDB, but you can give it any meaningful name you want) and in this database we create 3 tables.

Employee Table

Departments - To store the list of all departments

Gender - To store different genders (Male and Female for example)

Employees - To store the list of all employees

To create the database itself, tables, relationships and to insert, update, delete and even select data we use SQL - Structured Query Language. So, in simple terms, SQL is a database language, we use it on a Database to create database objects like tables, views, functions etc. We also use it to insert, update, delete and select data.



Difference of T-SQL, PL/SQL and SQL

SQL as a standard database language. It was initially developed by IBM and later ANSI (American National Standards Institute) made it a standard. So, SQL is an ANSI standard and based on it different database vendors like Microsoft, Oracle and many other organizations developed their own database query language.

Similarly Oracle corporation developed a database management system called Oracle and the language that we use to query oracle database is PL/SQL. By the way, PL stands for Procedural Language.
So, you can think of SQL as a subset of T-SQL and PL/SQL. A word of caution here, both T-SQL and PL/SQL does not implement 100% of the feature set of standard SQL, but majority of the standard features are implemented. You can see that from the diagram below. Although, not entirely true, you can still think SQL is almost a subset of T-SQL and PL/SQL. This means if you know T-SQL or PL/SQL, then you already know the standard SQL.

Remembering Points
  • SQL is the standard database language
  • Based on this standard SQL, database vendors like Microsoft, Oracle and many other organizations developed their own database query languages
  • TSQL is a proprietary procedural language for working with Microsoft SQL Server database
  • Similarly, PL/SQL is a proprietary procedural language for working with Oracle database
  • T-SQL and PL/SQL are an extension to standard SQL. 
  • This means they have more features and functions than the standard SQL. 
  • For example, features such as local variables are added. Similarly many, many built-in functions are added for processing strings, numbers, dates and other types of data.
  • They also added the capability to write stored procedures.


SQL Scripts

Create Database using script and select the database

Create the Database Tables of Employees, Departments and Gender



Insert Data to the Tables using the script

Select the data from these table using SQL Join query



Summary
In this tutorial we discussed Difference of SQL vs Tsql vs Plsql. If have any question related to this topic then give your feedback.

Post a Comment

Previous Post Next Post