Skip to content

Instantly share code, notes, and snippets.

@AyeshaIftikhar
Created June 24, 2021 08:21
Show Gist options
  • Save AyeshaIftikhar/8f3b0ae4eb58b5e7f7f94d6277766b9b to your computer and use it in GitHub Desktop.
Save AyeshaIftikhar/8f3b0ae4eb58b5e7f7f94d6277766b9b to your computer and use it in GitHub Desktop.
Basic concepts of SQL (Structured Query Language)

Getting Started with SQL

What is SQL?

  • SQL stands for Structured Query Language
  • It is a database query language designed to retrieve and manage data in relational database.
  • SQL is a language to operate databases; it includes database creation, deletion, fetching rows, modifying rows, etc.
  • SQL is an ANSI (American National Standards Institute) standard language.
  • There are many different versions of the SQL language.

Why SQL

  • Computer Language used for sorting, manipulating and retireving data from relational databases.
  • It is a standard language for Relational Database Systems.
  • All the RDMS(Relational Database Management Systems) use this language to operate, including Oracle, MySQL, MS Access, SQL Server used it as their standard langyage.

Applications of SQL

SQL is the most widely used relational database query language all around the world. Some of the most common uses of SQL are:

  • Access data in the relational database management systems.
  • Allows users to describe the data.
  • Allows users to define the data in a database and manipulate that data.
  • Allows to embed within other languages using SQL modules, libraries & pre-compilers.
  • Allows users to create and drop databases and tables.
  • Allows users to create view, stored procedure, functions in a database.
  • Allows users to set permissions on tables, procedures and views.

Brief History of SQL

  • 1970 − Dr. Edgar F. "Ted" Codd of IBM is known as the father of relational databases. He described a relational model for databases.
  • 1974 − Structured Query Language appeared.
  • 1978 − IBM worked to develop Codd's ideas and released a product named System/R.
  • 1986 − IBM developed the first prototype of relational database and standardized by ANSI. The first relational database was released by Relational Software which later came to be known as Oracle.

SQL Process

While executing a command for any RDBMS, the system carries the best way to carry out your request and SQL engine determines the best way how to interpred that request. Different components of the SQL process are:

  • Query Dispatcher
  • Optimization Engines
  • Classic Query Engine
  • SQL Query Engine, etc.

A classic query engine handles all the non-SQL queries, but a SQL query engine won't handle logical files.

SQL Architecture

SQL Architecture

SQL Commands

The SQL commands grouped into four categories:

  • Data Definition Language (DDL)
  • Data Manipulation Language (DML)
  • Data Control Language (DCL)

Data Definition Language (DDL)

It includes the following commands:

  1. CREATE : Creates a new table, a view of a table, or other object in the database.
  2. ALTER : Modifies an existing database object, such as a table.
  3. DROP : Deletes an entire table, a view of a table or other objects in the database.

Data Definition Language (DDL)

  1. SELECT : Retrieves certain records from one or more tables.
  2. INSERT : Add new records
  3. UPDATE : Update existing records
  4. DELETE : Delete existing records

Data Definition Language (DDL)

  1. GRANT : Assign a priviliage to a user
  2. REVOKE : Take backe the assigned priviliage from a user.

Credits: TutorialsPoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment