In my previous article i have given the answer of the question Is SQL a programming language with examples.In this article i would like to throw light on most asked question in SQL interviews – What is SQL used for? The SQL is structured query language which is used to perform the operations of database. SQL is used for multiple purposes. In this article i would like to give the multiple usages SQL in simple words.
What you will find in this article?
Introduction to SQL and its database management systems.
SQL usages with Examples
The SQL is structured query language which is the database management system or domain specific programming language which is used to perform the multiple operations on the databases. The SQL language is usually dealing with the tables and used to perform the operations on tables. You can perform following operations using SQL :
Every database management system uses the SQL as database programming language. The name of the database programming language is quite different. In following table i would like to give the name of the programming languages.
Database Management Systems | Name of SQL | Full Form of SQL name |
Oracle | SQL | Structured Query Language |
Oracle | PLSQL | Procedural Language Structured Query Language |
IBM DB2 | SQL PL | SQL Procedural Language (implements SQL/PSM) |
IBM Informix | SPL | Stored Procedural Language |
IBM Netezza | NZPLSQL[20] | (based on Postgres PL/pgSQL) |
Invantive | PSQL[21] | Invantive Procedural SQL (implements SQL/PSM and PL/SQL) |
Microsoft / Sybase | T-SQL | Transact-SQL |
Mimer SQL | SQL/PSM | SQL/Persistent Stored Module (implements SQL/PSM) |
MySQL | SQL/PSM | SQL/Persistent Stored Module (implements SQL/PSM) |
MonetDB | SQL/PSM | SQL/Persistent Stored Module (implements SQL/PSM) |
NuoDB | SSP | Starkey Stored Procedures |
Oracle | PL/SQL | Procedural Language/SQL (based on Ada) |
PostgreSQL | PL/pgSQL | PostgreSQL (implements SQL/PSM) |
SAP R/3 | ABAP | Advanced Business Application Programming |
SAP HANA | SQLScript | SQLScript |
Sybase | Watcom-SQL | SQL Anywhere Watcom-SQL Dialect |
Teradata | SPL | Stored Procedural Language |
In this section i would like to give usages of SQL database management system. In most of database management systems we are using the SQL as database programming languages. I would like to give you multiple usages of SQL in real life industry.
We can use the multiple SQL queries in production support and application support. The most of the production support issues are related to database and you need to fire some queries and resolve the issue.
Example :
If you want to fetch all data of customer named “Amit”
select * from Customer where name=”Amit”;
You can use the SQL to create the table and work differently on it. You can use those tables in development and adding the business logic.
The SQL DDL statements are used to fetch the particular data in the reporting format. The most important use for SQL is it is used for reporting purpose.
Example :
If you want to fetch the customer information and products information together for report preparation you need to use the joins in SQL.
Select a.Customer_name,b.product_name from Customer a,Product b where a.customer_id=b.product_id;
The SQL is used for data entries . The back-end query will be the insert statement in SQL.
Example :
Insert into Customer
Values(‘1′,’Amit’);
commit;
5.Bulk data entry :
We can use the SQL to insert the bulk data through the excel or other mediums. It will be easy to insert the data and save the time.
6.Controlling the Access :
You can control the access with using grant and revoke statements. It will control the access of multiple users.
7.Adding Business Logic :
We can use procedures,functions and triggers,packages to add the business logic in the specified application.
Example :
In banking domain we require to add the accounts if and only if the balance is 500. We require to use the trigger over-here.
SQL queries are useful for manual data analysis. We can use that data to build the software.
For any website development the SQL is important as backend. So we are using the multiple databases to host the website.
10.Application Performance :
The SQL indexes,partitions,gathering stats can be used to improve the performance of the application.
I hope you get the idea about usages of SQL for with multiple examples. The SQL is key database management system in mostly every application.If you like this article or if you have any issues with the same kindly comment in comments section.
In my previous articles i have given the hierarchy of production support in real company…
In this article i would like to provide information about production support organization structure or…
In my previous article I have given roles for L1 and L2 support engineer with…
I have started this new series of how to become application support engineer. This article…
In this series we are starting with Roles and responsibilities of L1 support engineer .…
Introduction Cryptocurrencies took the world by storm, setting up a new financial system and breaking…