Hello and welcome all to a new series to understand the SQL statements in simpler ways. In this series we will try to learn about Data, Database and SQL statements along with their syntax, execution and examples. Before understanding commands of SQL, we have to learn some basics about SQL. And before we learn about a SQL, let us understand what SQL is used for.
What is Data?
In simple words, data can be a piece or collection of information or we can also say that data is facts related to any object in consideration. For example, your name, age, height, weight, etc. are some data related to you. A picture, image, file, pdf, etc. can also be considered data.
What is a Database?
A database is a systematic collection of data. They support electronic storage and manipulation of data. Databases make data management easy.
Let us discuss a database example: An online telephone directory uses a database to store data of people, phone numbers, and other contact details. Your electricity service provider uses a database to manage billing, client-related issues, handle fault data, etc.
Let us also consider Facebook. It needs to store, manipulate, and present data related to members, their friends, member activities, messages, advertisements, and a lot more. We can provide a countless number of examples for the usage of databases.
Now, to access, manage or modify the data in the database, we need a medium or a language to make database understand our requirement, that medium or language is SQL.
What is SQL?
SQL stands for Structured Query Language. SQL is used to create, remove, alter the database and database objects in a database management system and to store, retrieve, update the data in a database. SQL is a standard language for creating, accessing, manipulating database management system. SQL works for all modern relational database management systems, like SQL Server, Oracle, MySQL, etc.Data is stored in the form of tables in sql. And table is divided into several columns according to requirement.So now that we have understand the SQL and its use, let’s move ahead to know about types of SQL statements.
Types of SQL Commands
SQL commands can be categorized into five categories based on their functionality and uses.
1. Data Definition Language (DDL)
DDL commands are used for creating and altering the database and database object in the relational database management system, like CREATE DATABASE, CREATE TABLE, ALTER TABLE, etc. The most used DDL commands are CREATE, DROP, ALTER, and TRUNCATE.
2. Data Manipulation Language (DML)
DML commands are used for manipulating data in a relational database management system. DML commands are used for adding, removing, updating data in the database system, like INSERT INTO TableName, DELETE FROM TableName, UPDATE tableName set data, etc. The most used DML commands are INSERT INTO, DELETE FROM, UPDATE.
3. Data Query Language(DQL)
DQL command is used for fetching the data. DQL command is used for selecting data from the table, view, temp table, table variable, etc. There is only one command under DQL which is the SELECT command.
4.Data Control Language(DCL)
DCL stands for data control language. DCL commands are used for providing and taking back the access rights on the database and database objects. DCL command used for controlling user’s access on the data. Most used DCL commands are GRANT and REVOKE.
5.Transaction Control Language(TCL)
TCL commands are used for handling transactions in the database. Transactions ensure data integrity in the multi-user environment. TCL commands can rollback and commit data modification in the database. The most used TCL commands are COMMIT, ROLLBACK, SAVEPOINT, and SET TRANSACTION.
So, here we come to the end of the first part of the SQL series blog in which we understood what is Data, Database, SQL, why SQL is required and what are different types of SQL commands. I hope you liked it and stay tuned for another series where in we will explore more about the different types of SQL commands.
Please feel free to comment or share your views and thoughts. You can always reach out to us by sending an email at info@amlgolabs.com or filling a contact form at the end of the page.
What is Data?
In simple words, data can be a piece or collection of information or we can also say that data is facts related to any object in consideration. For example, your name, age, height, weight, etc. are some data related to you. A picture, image, file, pdf, etc. can also be considered data.
What is a Database?
A database is a systematic collection of data. They support electronic storage and manipulation of data. Databases make data management easy.
Let us discuss a database example: An online telephone directory uses a database to store data of people, phone numbers, and other contact details. Your electricity service provider uses a database to manage billing, client-related issues, handle fault data, etc.
Let us also consider Facebook. It needs to store, manipulate, and present data related to members, their friends, member activities, messages, advertisements, and a lot more. We can provide a countless number of examples for the usage of databases.
Now, to access, manage or modify the data in the database, we need a medium or a language to make database understand our requirement, that medium or language is SQL.
What is SQL?
SQL stands for Structured Query Language. SQL is used to create, remove, alter the database and database objects in a database management system and to store, retrieve, update the data in a database. SQL is a standard language for creating, accessing, manipulating database management system. SQL works for all modern relational database management systems, like SQL Server, Oracle, MySQL, etc.Data is stored in the form of tables in sql. And table is divided into several columns according to requirement.So now that we have understand the SQL and its use, let’s move ahead to know about types of SQL statements.
Types of SQL Commands
SQL commands can be categorized into five categories based on their functionality and uses.
1. Data Definition Language (DDL)
DDL commands are used for creating and altering the database and database object in the relational database management system, like CREATE DATABASE, CREATE TABLE, ALTER TABLE, etc. The most used DDL commands are CREATE, DROP, ALTER, and TRUNCATE.
2. Data Manipulation Language (DML)
DML commands are used for manipulating data in a relational database management system. DML commands are used for adding, removing, updating data in the database system, like INSERT INTO TableName, DELETE FROM TableName, UPDATE tableName set data, etc. The most used DML commands are INSERT INTO, DELETE FROM, UPDATE.
3. Data Query Language(DQL)
DQL command is used for fetching the data. DQL command is used for selecting data from the table, view, temp table, table variable, etc. There is only one command under DQL which is the SELECT command.
4.Data Control Language(DCL)
DCL stands for data control language. DCL commands are used for providing and taking back the access rights on the database and database objects. DCL command used for controlling user’s access on the data. Most used DCL commands are GRANT and REVOKE.
5.Transaction Control Language(TCL)
TCL commands are used for handling transactions in the database. Transactions ensure data integrity in the multi-user environment. TCL commands can rollback and commit data modification in the database. The most used TCL commands are COMMIT, ROLLBACK, SAVEPOINT, and SET TRANSACTION.
So, here we come to the end of the first part of the SQL series blog in which we understood what is Data, Database, SQL, why SQL is required and what are different types of SQL commands. I hope you liked it and stay tuned for another series where in we will explore more about the different types of SQL commands.
About Amlgo
Labs : Amlgo Labs is an
advanced data analytics and decision sciences company based out in Gurgaon and
Bangalore, India. We help our clients in different areas of data
solutions includes design/development of end to end
solutions (Cloud, Big Data, UI/UX, Data Engineering, Advanced Analytics
and Data Sciences) with a focus on improving businesses and providing
insights to make intelligent data-driven decisions across verticals. We have
another vertical of business that we call - Financial Regulatory Reporting for
(MAS, APRA, HKMA, EBA, FED, RBI etc) all major regulators in the world
and our team is specialized in commonly used regulatory tools across the
globe (AxiomSL
Controller View, OneSumX Development, Moody’s
Risk, IBM Open Pages etc).We build
innovative concepts and then solutions to give an extra edge to the business
outcomes and help to visualize and execute effective decision strategies. We are among top 10 Data Analytics Start-ups in India, 2019 and 2020.
Please feel free to comment or share your views and thoughts. You can always reach out to us by sending an email at info@amlgolabs.com or filling a contact form at the end of the page.
Comments
Post a Comment