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
Introduction to SQL and its database management systems :
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 :
- User can create a database and tables.
- User can manipulate the data in the table
- User can update or delete data from the table
- User can control the database transactions
- User can control the access of multiple users who needs to utilize the data.
- SQL can be used in relational as well as multidimensional databases.
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||(based on Postgres PL/pgSQL)|
|Invantive||PSQL||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|
|Sybase||Watcom-SQL||SQL Anywhere Watcom-SQL Dialect|
|Teradata||SPL||Stored Procedural Language|
What is SQL used for?
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.
- Production Support and Application support :
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.
If you want to fetch all data of customer named “Amit”
select * from Customer where name=”Amit”;
- Creation of the table and work on its controls
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.
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;
- Data Entry
The SQL is used for data entries . The back-end query will be the insert statement in SQL.
Insert into Customer
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.
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.
- Data Analysis :
SQL queries are useful for manual data analysis. We can use that data to build the software.
- Website Hosting :
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.