SQL: An Executive Summary

This article is for everyone who wants to understand the basic concepts of SQL or need a refresher of some basic keys and functionalities on SQL databases.

By the end of this article you should be able to understand:

  • What is a database?
  • What is a relational database?
  • What is SQL?
  • What are SQL processes?
  • What are SQL commands?

Let's get started.

  1. What is a database?

A database is a structured set of data held in a computer, especially one that is accessible in various ways. Small databases can be stored on a file system, while large databases are hosted on cloud storage. for example, a business database may include tables for products, employees, and financial records. Each of these tables would have different fields that are relevant to the information stored in the table. The advanced version of the database management system is a Relational database.

2.What is a Relational database?

A relational database is a type of database that stores and provides access to data points that are related to one another. For example, the columns of the table held attributes of the data and each record usually has a value for each attribute, making it easy to establish the relationships among data points.

3.What is SQL?

SQL is structured Query Language, which is a computer language for strong, manipulating and retrieving data stored in a relational database. SQL is the standard language for relational database systems. All the relational database management systems(RDMS) like MySQL, Ms Access, Oracle and SQL Server use SQL as their standard database language. You may ask yourself, Why SQL? why one should consider learning and using SQL? The solution to this question is that SQL is widely popular because it offers the following advantages:

  • Allows users to create the view, stored procedures and functions in a database
  • Allows management sytems in a database
  • Allows users to describe the data in a database
  • Allows users to define the data in a database
  • Allows users to manipulate the data in a database
  • Allows users to create and drop databases

4. What are SQL processes?

When you are executing an SQL command for any relational database management system, the system determines the best way to carry out your request and the SQL engine figure out how to interpret the task. There are various components included in this process. these components are:

  • Query Dispatcher
  • Optimization Engines
  • Classic Query Engine
  • SQL Query Engine
  • showing SQL Architecture

5. What are SQL commands? These SQL commands are basically categorised into 5 categories:

  • DDL
  • DQL
  • DML
  • DCL
  • TCI

1.DDL

DDL stands for Data Definition Language. DDL commands in SQL are used to create database schema and to define the type and structure of the data that will be stored in a database. they basically create, modify and delete database structures but not data.

List of DDL commands

  • Truncate: This is used to remove all records from a table, including all spaces allocated for the records.
  • Rename: This is used to rename an object already existing in the database.
  • Comment:This is used to add comments to the dictionary.
  • Create: This command is used to create the database.
  • Drop:This command is used to delete objects from the database.
  • Alter:This command is used to alter the structure of the database.

2.DML

DML stands for Data Manipulation Language.DML commands are used to manipulate the data present in the database.

List of DML commands

  • Call:It is used to call a PL/SQL code.
  • Unlock:It is used to release any table locks held by the current session.
  • Lock:It is used to control the concurrency on a table.
  • Delete: It is used to delete records from a database table.
  • Insert:It is used to insert data into a table.
  • Update:It is used to update existing data within a table.

3.DQL

DQL stands for Data Query Language.DQL commands are used for performing queries on data within schema objects.

There is one Command which is

  • Select:It is used to retrieve data from the database

4.DCL

DCL stands for Data Control Language. DCL commands are used to deal with permissions, rights, and other controls of the database system.

List of DCL Commands

  • Revoke:It withdraws the user's access privileges.

  • Grant:It gives users access privileges to the database.

5.TCL

TCL stands for Transaction Control Language. TCL commands deal with the transaction within the database.

List of TCL Commands

  • Save POint: It is used to set a savepoint within a transaction.

  • RollBack: It is used to roll back a transaction in case of any errors occurs.

  • Set Transaction: It is used to specify characteristics for the transaction.

  • Commit: It is used to commit a transaction.

Next step

Now that you’ve completed this article, you've got the basic knowledge of databases and SQL commands, all you've to do is to practise more and more to get better. Happy Coding!!