Sql Introduction in Database Management Systems

By | February 20, 2016

Introduction to SQL

            Structure Query Language(SQL) is a programming language used for storing and managing data in RDBMS. SQL was the first commercial language introduced for E.F Codd’s Relational model. Today almost all RDBMS(MySql, Oracle, Infomix, Sybase, MS Access) uses SQL as the standard database language. SQL is used to perform all type of data operations in RDBMS.

Advantages of Mysql Database

  1. MYSQL is released under an open-source license. So you have nothing to pay to use it.
  2. MYSQL is a very powerful program in its own right. It handles a large subset of the functionality of the most expensive and powerful database packages.
  3. MYSQL uses a standard form of the well-known SQL data language.
  4. MYSQL works on many operating systems and with many languages including PHP, PERL, C, C++, JAVA etc.
  5. MYSQL works very quickly and works well even with large data sets.
  6. MYSQL is very friendly to PHP, the most appreciated language for web development.
  7. MYSQL supports large databases, up to 50 million rows or more in a table. The default file size limit for a table is 4GB, but you can increase this (if your operating system can handle it) to a theoretical limit of 8 million terabytes (TB).
  8. MYSQL is customizable. The open source GPL license allows programmers to modify the MYSQL software to fit their own specific environments.mary of the current situation

Overview :

SQL tutorial gives unique learning on Structured Query Language and it helps to make practice on SQL commands which provide immediate results. SQL is a language of the database, it includes database creation, deletion, fetching rows and modifying rows etc.
SQL is an ANSI (American National Standards Institute) standard but there are many different versions of the SQL language.

What is SQL?

SQL is Structured Query Language, which is a computer language for storing, manipulating and retrieving data stored in relational database.
SQL is the standard language for Relation Database System. All relational database management systems like MySQL, MS Access, Oracle, Sybase, Informix, postgres and SQL Server use SQL as standard database language.
Also, they are using different dialects, such as:
  • MS SQL Server using T-SQL,
  • Oracle using PL/SQL,
  • MS Access version of SQL is called JET SQL (native format) etc.

Why SQL?

  • Allows users to access data in relational database management systems.
  • Allows users to describe the data.
  • Allows users to define the data in 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

SQL Process:

  When you are executing an SQL command for any RDBMS, the system determines the best way to carry out your request and SQL engine figures out how to interpret the task.
         There are various components included in the process. These components are Query Dispatcher, Optimization Engines, Classic Query Engine and SQL Query Engine, etc. Classic query engine handles all non-SQL queries but SQL query engine won’t handle logical files.
 
Following is a simple diagram showing SQL Architecture

databasse-sql-architecture-overview


Read

SQL Command

SQL defines following data languages to manipulate data of RDBMS.
 
DDL: Data Definition Language
 
     Data Definition Language deals with database schemas and descriptions of how the data should reside in the database, therefore language statements like CREATE TABLE or ALTER TABLE belong to DDL.
Data Definition Language (DDL) statements are used to define the database structure or schema.
  1. CREATE – to create objects in the database
  2. ALTER – alters the structure of the database
  3. DROP – delete objects from the database
  4. TRUNCATE – remove all records from a table, including all spaces allocated for the records are removed
  5. RENAME – rename an object
DML: Data Manipulation Language
 
    DML deals with data manipulation and therefore includes most common SQL statements such SELECT, INSERT, etc
Data Manipulation Language (DML) statements are used for managing data within schema objects.
  1. SELECT – retrieve data from the database
  2. INSERT – insert data into a table
  3. UPDATE – updates existing data within a table
  4. DELETE – deletes all records from a table, the space for the records remain
DCL: Data Control Language
 
     Data Control Language includes commands such as GRANT and mostly concerns with rights, permissions and other controls of the database system.
   Data Control Language (DCL) statements.
  1. GRANT – gives user’s access privileges to database
  2. REVOKE – withdraw access privileges given with the GRANT command
TCL: Transaction Control Language
 
    These commands are to keep a check on other commands and their affect on the database. These commands can annul changes made by other commands by rolling back to original state. It can also make changes permanent
  1. commit – to permanently save 
  2. rollback – to undo change 
  3. savepoint – to save temporarily

If you like the article, please do like or comment. Any Suggestions or changes Comment below.Thank You..!!

Leave a Reply

Your email address will not be published. Required fields are marked *