What is SQL?
Structured Query Language is also known as SQL is the database language and is one of the most famous and in-demand technology. This language was specially developed for database management i.e. creating a database, inserting and updating records in them, managing accesses and retrieving data from it. SQL is mostly used for Relational Database Management Systems.
Its demand is increasing every single day. As there is an increase in data, demand and need for SQL increases. It is been used by web developers, data analysts, data engineers, and in every other field where we need to store and retrieve data.
One of the main reasons why SQL is gaining popularity is that it is simple, easy, quick, and powerful. Another reason is that the most commonly used version of SQL(MySQL) is open-source(FREE)
Another great feature of SQL is Non Procedural language(explained in the next section).
Why SQL?
Now, we may ask why do we need SQL? Why should we learn it..!!!
It is so because:-
- It is the most widely used language ie. from Web Development to Data Analytics
- It has been on the list of most famous programming languages for the last 5 years.
- It is a highly in-demand language.
The key feature that makes it different from the other languages is that it is a non-procedural language and it is Quick and Easy to learn.
Procedural..!!! What's that...!!!
Procedural is a type of programming language that focuses on doing a task in a well-defined manner with proper steps and structure. Eg:- Java, C etc.
These languages have a well-defined structure and need to be very specific while doing a task. So here the focus is more on the steps and procedure "How to do" rather than the task itself "What to do".
On the other Non-Procedural is just the opposite of the above, it focuses on the task itself "What to do" rather than "How to do". In this we do not need to focus on the steps and structure rather we simply ask the system to do a particular task. Eg:- SQL, LISP etc.
I would like to explain this with a quick example: "Ask a Dog to fetch the ball".
Procedural Vs Non-Procedural |
Hope that makes it clear the difference between Procedural and Non-procedural language.
It's time to move ahead with the SQL and look into the different components of SQL.
Components of SQL
The SQL commands are grouped into 4 major components as per their usage, these components are:-
- Data Definition Language --- DDL
- Data Manipulation Language --- DML
- Data Control Language --- DCL
- Transaction Control Language --- TCL
Let's dive deeper into these components and learn about them.
Data Definition Language:- DDL is also referred to as Data Description Language by some of the experts as the language/syntax is used for creating and modifying databases including the tables. Its purpose is to create a database, describe a database, modify it and provide a structure for storing the data. The main commands used for this are:-
- CREATE
- RENAME
- DROP
- TRUNCATE
- ALTER
- SELECT
- UPDATE
- DELETE
- INSERT
- EXPLAIN
- GRANT
- REVOKE
We also had a look at different programming methods i.e Procedural and Non-Procedural there are differences with an EASY example.
Comments
Post a Comment