Search

Friday, 14 June 2019

SQL Guide - Introduction to SQL


 Introduction to SQL

This tutorial focuses on studying structured query language (Structured Query Language - SQL) and is supplemented with a large number of examples that clearly demonstrate the capabilities of SQL.


SQL is an ANSI standard, but there are a large number of versions of this query language.



What is SQL?

SQL is designed to save, manipulate and retrieve data stored in a relational database (hereinafter - DB). It is the standard language for Relational Database Management Systems (RDBMS), such as MySQL, Oracle, Postgres, etc.


These systems use different SQL dialects:

Oracle - PL / SQL

MS SQL - T-SQL

SQL Benefits


Among the advantages of SQL, we can highlight the following:
  • Allows users to access data in the RDBMS.
  • Allows users to describe data.
  • Allows users to define and manipulate data in the database.
  • Allows users to embed other languages ​​using   SQL modules, libraries, and precompiles.
  • Allows users to create and delete databases and tables.
  • Allows the user to create embedded views, procedures, and functions in the database.
  • Allows you to restrict access to tables, procedures and views.

SQL operation principle

When we execute a SQL command for any RDBMS, the system determines the best way to process our request and the control module (“engine”) SQL calculates how to interpret the task.

This process includes the following components: 
    Query

    Dispatcher

    Optimization Engines

    Classic Query Engine

    SQL Query Engine, etc.


The Classic Query Engine handles all non-SQL requests, and the SQL Query Engine does not process logical files.



Below is a simple diagram showing the SQL architecture:
 Simple SQL Architect                                                              


Data Definition Language 


Command
Description
CREATE
Creates a new table, table view, or other object in the database.

ALTER
Modifies an existing database object (for example, a table).
DROP
Deletes the specified table, table view, or other database object.



DML - Data Manipulation Language


Command
Description
SELECT
Pull certain data from one or more tables.
INSERT
creates a record
UPDATE
Changes records
DELETE
Deletes records.



DCL - Data Control Language


Command
Description
GRANT
Gives all user privileges
REVOKE
Cancels user privileges.



We conclude with this introduction to the Structured Query Language (SQL).

In the next article we will discuss the basic concepts of RDBMS.
Below is a list of my favorite SQL books which I would recommend for you if you looking to enhance your knowledge on the topic.

SQL in 10 Minutes, Sams Teach Yourself
SQL: The Ultimate Beginner's Guide to Learn SQL Programming Step by Step 
Learning SQL
SQL Cookbook (Cookbooks (O'Reilly))
SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL
T-SQL Fundamentals
Data Analysis Using SQL and Excel, 2nd Edition 


Below is my favourite Forums for SQL   
SQL Authority with Pinal Dave 
SQL Server Central Articles








2 comments:

  1. Nice introduction. Looking forward to more content.

    ReplyDelete
  2. Thanks very much. Appreciate you feedback. Definitely more quality content on the way.

    ReplyDelete